I am trying to follow these instructions to get started with Selenium. I downloaded and installed Maven on my mac but when trying to use mvn clean install with the suggested pom.xml file I get the following errors:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM /Users/JB/Documents/Maven/Selenium-Build/pom.xml: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... #1:1) # line 1, column 1
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (/Users/JB/Documents/Maven/Selenium-Build/pom.xml) has 1 error
[ERROR] Non-parseable POM /Users/JB/Documents/Maven/Selenium-Build/pom.xml: only whitespace content allowed before start tag and not { (position: START_DOCUMENT seen {... #1:1) # line 1, column 1 -> [Help 2]
Here is the pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MySel20Proj</groupId>
<artifactId>MySel20Proj</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.13.0</version>
</dependency>
</dependencies>
What am I missing here? I've tried the POM looks like it is structured the same as many of the examples I found when researching this issue. I don't see the whitespace it is complaing about at the start of the document. I am not familiar with Maven, and am really in need of some help.
I've seen this kind of thing happen when copy-and-paste ends up putting a non-printing character at the very beginning of the file, before that initial <. You don't see it - but Maven complains. If you are in Linux, try "cat -v pom.xml" to see if there are any such characters in there...
Related
I'm having an issue in Spring Project which i'm trying to use mvn sonar:sonar, but it's not working it's displaying this error:
Could not find artifact com.test:1.1.3 in repository.jboss.org-public (https://repository.jboss.org/nexus/content/groups/public) and
'parent.relativePath' points at wrong local POM # line 10, column 10
But i have already installed the dependency:
<parent>
<groupId>com.test</groupId>
<artifactId>jenkinspom</artifactId>
<version>1.1.3</version>
</parent>
What's could be the problem?
Youre artifact has the name com.test.jenkinsPom.
But you error message says just prints out the groupId com.test and the version.
I'm trying to deploy my Discord bot using Heroku but everytime I deploy it, it gives me an error. The code works on local using IntelliJ Idea. Can anyone help me correct this error please?
Build log:
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 21 source files to /tmp/build_8fdb6208/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.237 s
[INFO] Finished at: 2021-03-21T23:52:06Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project CalciteDiscordBot: Fatal error compiling: invalid target release: 15 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
! ERROR: Failed to build app with Maven
We're sorry this build is failing! If you can't find the issue in application code,
please submit a ticket so we can help: https://help.heroku.com/
! Push rejected, failed to compile Java app.
! Push failed
Here's my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>CalciteDiscordBot</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.target>15</maven.compiler.target>
<maven.compiler.source>15</maven.compiler.source>
</properties>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.2.0_168</version>
</dependency>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</project>
Someone just helped me with this issue yesterday your Maven POM specifies that you want Java 15, but the Java version installed cannot handle compilation for 15. So, add a system.properties file to your application root with the following contents and build again:
java.runtime.version=15
You application requires Java 15 (<maven.compiler.source>15</maven.compiler.source>) so you need tell Heroku you want that specific Java version (instead of the default one)
In the root folder place a file system.properties:
java.runtime.version=15
I am using Eclipse Mars to run my Java project. I am making use of Maven in it. But while trying to compile my package I am getting the following error.
Failed to execute goal on project apex-check: Could not resolve dependencies for project org.fundacionjala.enforce.sonarqube:apex-check:jar:1.0: Failed to collect dependencies at org.fundacionjala.enforce.sonarqube:apex-squid:jar:1.0: Failed to read artifact descriptor for org.fundacionjala.enforce.sonarqube:apex-squid:jar:1.0: Could not transfer artifact org.fundacionjala.enforce.sonarqube:apex-squid:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): Failed to authenticate with proxy -> [Help 1].
I am able to find that my pom.xml has a bug in its dependency. But don't know how to resolve it. I have given below my pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!-- ~ Copyright (c) Fundacion Jala. All rights reserved. ~ Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.fundacionjala.enforce.sonarqube</groupId>
<artifactId>apex</artifactId>
<version>1.0b${build.number}</version>
</parent>
<artifactId>apex-check</artifactId>
<name>Apex :: Checks</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>apex-squid</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
I have written 'apex-check' and 'apex-squid' as two separate projects.
Can anyone explain how to correct my pom.xml?
You need to have:
org.fundacionjala.enforce.sonarqube:apex-check:jar:1.0
org.fundacionjala.enforce.sonarqube:apex-squid:jar:1.0
jar files available in your local .m2/repository folder. If they are not present maven will try to download from central repository and as an expected result it will fail on firewall or it will not find the artifact. i.e. if:
apex-check requires apex-squid project as dependency first you need to install squid project files by using mvn install on squid project folder.
But it seems more like you want to create a multi module maven project, take a look at this question. Create a parent project similar to this project, add check and squid as module and run mvn clean install on parent.
**edit: I just see you already have parent, so make sure parent has your projects as modules, which helps reactive build order and eclipse imports
I have source code for a framework, let's call it my-framework. It provides various packages, including com.not_telling.framework.db.
I have a pom.xml file for this framework:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.not_telling</groupId>
<artifactId>my-famework</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>my-framework Maven Library</name>
<url>http://maven.apache.org</url>
<!-- more things here... -->
</project>
I can compile this and install it to my local repository cache, using this command:
mvn install
End of the install log:
[INFO] Installing C:\Users\MyUserName\my-framework\backend\target\my-framework.jar to C:\Users\MyUserName\.m2\repository\com\not_telling\my-famework\0.0.1-SNAPSHOT\my-famework-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\Users\MyUserName\my-framework\backend\pom.xml to C:\Users\MyUserName\.m2\repository\com\not_telling\my-famework\0.0.1-SNAPSHOT\my-famework-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Then I have another project, that tries to use this as a dependency:
<dependency>
<groupId>com.not_telling</groupId>
<artifactId>my-famework</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
The compilation phase of this project fails with this message:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project my-project: Compilation failure: Compilation failure:
[ERROR] /C:/Users/MyUserName/workspace/my-project/backend/src/main/java/com/not_telling/some_example.java:[13,17] package com.not_telling.framework.db does not exist
Why is that? Maybe because the jar is in the repository cache, but not in a local repository?
This question is a follow up of absolute maven pomderived entry added to classpath - I realized that instead of doing magic with relative source directory references, I need to make a separate module, but I'm facing this problem.
It was bleeding from numerous wounds. These needed to be fixed:
move source files from under src/ to under src/main/java, in both the framework and the application project
change the group and the artifact id to match the package name E.g. for a package that is named "com.not_telling.framework" I had to use groupId=com.not_telling and name=framework.
The dependency scope was wrong in the application's pom file. I had to remove test
Now it works from command line I can do "mvn install" for the framework, and then "mvn package" for the applications.
The only problem left is that the application cannot be compiled from eclipse, I had to remove all linked source folders / build paths in the application project to the framework.
I tried to generate maven project in Windows XP.
I created folder with pom.xml:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>selenium.web.driver</groupId>
<artifactId>OMS_selenium_Test</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>selenium_tests</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.0</version>
<scope></scope>
</dependency>
</dependencies>
</project>
Opened cmd and going into this folder.
Run the next command:
C:\Documents and Settings\Admintemp\maven_test>mvn archetype:generate -DgroupId=
selenium.web.driver -DartifactId=OMS_selenium_Test -Dversion=1.0-SNAPSHOT -Dinte
ractiveMode=false
Instead of generating project with this data I caught next errror:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.2:generate (default-cli) on project OMS_selenium_Test: Unable to add module to
the current project as it is not of packaging type 'pom' -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
Why this exactly happen?
Maybe I miss smt, but I can't figure out what exactly...
How to solve this trouble and generate project with maven?
Your mistake has been to create a POM file by hand. Maven will do this automatically when you run the command you attempted. Delete your POM file and try running the command again.
Maven assumed you wanted to add a sub-module to an existing Maven project. This failed because your existing POM file was "jar" project (e.g. normal Java code) when it was expecting a "pom" project.
This happens when you run the generate command from within the same folder where you ran the mvn archetype:create-from-project from (or in this case, the POM you generated made maven think this was an existing project).
Ernestas answer worked because they switched to a different folder and ran the same command.
Well, I tried the following commands and it worked for me:
> cd C:\Temp
> mvn archetype:generate -DgroupId=selenium.web.driver -DartifactId=OMS_selenium_Test -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
EDIT
Now I have my project in: C:\Temp\OMS_selenium_Test