Error while parsing POM - java

I am trying to integrate Browserstack with jenkins, using maven to build java code for testing.
However when I run the Job I got this errors and pretty much crashes the build and next steps.
[WARNING] The POM for org.codehaus.mojo:aspectj-maven-plugin:jar:1.8 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
that leads to the next errors what I think are related:
[ERROR] Failed to execute goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) on project NewTest: Execution default of goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile failed: A required class was missing while executing com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile: org/apache/commons/lang/StringUtils
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/com/browserstack/automate-maven-plugin/0.7.2-SNAPSHOT/automate-maven-plugin-0.7.2-SNAPSHOT.jar
[ERROR] urls[1] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[2] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[3] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[4] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[5] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[6] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[7] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[8] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[ERROR] urls[9] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/codehaus/mojo/aspectj-maven-plugin/1.8/aspectj-maven-plugin-1.8.jar
[ERROR] urls[10] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/org/aspectj/aspectjtools/1.8.7/aspectjtools-1.8.7.jar
[ERROR] urls[11] = file:/var/lib/jenkins/workspace/testbrowserstack/.repository/com/browserstack/automate-testassist/0.7.2-SNAPSHOT/automate-testassist-0.7.2-SNAPSHOT.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.commons.lang.StringUtils
[ERROR] -> [Help 1]
Here is my pom file which also uses the right version of the openjdk:
<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>NewTest</groupId>
<artifactId>NewTest</artifactId>
<version>0.1-Unittest</version>
<dependencies>
<!--
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.45.0</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>
-->
<dependency>
<groupId>com.browserstack</groupId>
<artifactId>automate-testassist</artifactId>
<version>0.7.2-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>com.browserstack</groupId>
<artifactId>automate-maven-plugin</artifactId>
<version>0.7.2-SNAPSHOT</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<complianceLevel>1.8</complianceLevel>
</configuration>
<executions>
<execution>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
No sure what would be the issue.

The culprit here is automate-maven-plugin used by you. The error message as well clearly reads this
[ERROR] Failed to execute goal
com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile
(default) on project NewTest: Execution default of goal
com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile
failed: A required class was missing while executing
com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile:
org/apache/commons/lang/StringUtils
Also trying to use the 0.7.2-SNAPSHOT of automate-maven-plugin along with specifying the same pluginRepositories wouldn't work in general. Seems like you are locally building and using this. So probably you can go ahead and update the plugin possibly.

Related

Build failing after adding a test, eventhough there are no errors in the script.Using selenium,testng with maven in eclipse

I have a maven module which has an a.b.c package and there is a test AssetUploadTest.java and one more test NavigateToPage.java. I am getting a build error only when I am adding the AssetUploadTest. I don't want the tests to run but just be compiled, because I have a properties file which has a username and pwd to my website. But due to compliance, we should not upload the username and pwd into our git. So I gave replace-with-username and replace-with-pwd.
My problem is why the build is successful when here is the second test, and why it is failing with the other test.
This is the error trace
INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 34.047 s
[INFO] Finished at: 2019-11-20T17:34:43-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project aem-microsoft-martech.it.tests: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\v-sruga\git\AxeCore\CSM-CASM-CoMgmt-Nabu-AEM\it.tests\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR]
[ERROR] Cannot find class in classpath: com.micrososft.mcb.tests.ui.AssetUploadTest
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR]
[ERROR] Cannot find class in classpath: com.micrososft.mcb.tests.ui.AssetUploadTest
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:665)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:279)
[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:243)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1077)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)
[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[ERROR]
[ERROR] -> [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
Please help me. I tried to change the surefire version,failsafe version, but no luck.
My pom looks like this
<properties>
<junit.version>4.8.2</junit.version>
</properties>
<build>
<!-- <sourceDirectory>${basedir}/src</sourceDirectory> -->
<!-- <testSourceDirectory>${basedir}/test</testSourceDirectory> -->
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<inherited>true</inherited>
<configuration>
<instructions>
<Sling-Test-Regexp>.*Test</Sling-Test-Regexp>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>run-all-tests.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<!-- TODO create separate API package, this is just to get the special
Sling test runner -->
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
</dependency>
<dependency>
<groupId>uk.org.lidalia</groupId>
<artifactId>slf4j-test</artifactId>
</dependency>
<dependency>
<groupId>{project.groupId}</groupId>
<artifactId>aem-microsoft-martech.core</artifactId>
<version>${project.version}</version>
<type>bundle</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
</dependencies>
</project>
No sufficient Code ,So i guess :
The class in your code is a.b.c. AssetUploadTest!
But from StackTrace we can see this line ,Cannot find class in classpath: com.micrososft.mcb.tests.ui.AssetUploadTest,which indicates that you import com.micrososft.mcb.tests.ui.AssetUploadTest in fact!
The maven can't find the class in classpath and Build failing.

Maven: package com.sun.istack.internal does not exist

I have little maven project that uses com.sun.istack.internal.Nullable.
I tried both JDK 9 and 1.8, and still get error about package does not exists.
I search for the package and find some: https://mvnrepository.com/search?q=+com.sun.istack but they still not supply necessary one.
The JAVA_HOME:
apshenichnikov#IAS-WS-UX02:~/NetBeansProjects/newlps$ echo $JAVA_HOME
/usr/local/java/jdk1.8.0_121/
And JDK:
apshenichnikov#IAS-WS-UX02:~/NetBeansProjects/newlps$ sudo update-alternatives --config java
There are 4 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-9-oracle/bin/java 1091 auto mode
1 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode
2 /usr/lib/jvm/java-9-oracle/bin/java 1091 manual mode
* 3 /usr/local/java/jdk1.8.0_121/ 1 manual mode
4 /usr/local/java/jdk1.8.0_121/bin/java 1 manual mode
Press <enter> to keep the current choice[*], or type selection number:
And the POM.xml:
<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>ru.beinteractive</groupId>
<artifactId>newlps</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>newlps</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.google.code.externalsortinginjava</groupId>
<artifactId>externalsortinginjava</artifactId>
<version>0.1.9</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/libs
</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>
I injected:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
</plugin>
Inside the POM.xml
And I still have compilation exception
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.286 s
[INFO] Finished at: 2017-12-13T15:28:45+03:00
[INFO] Final Memory: 20M/261M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.0:compile (default-compile) on project newlps: Compilation failure: Compilation failure:
[ERROR] /home/apshenichnikov/NetBeansProjects/newlps/src/main/java/su/ias/utils/ParamUtils.java:[3,31] package com.sun.istack.internal does not exist
[ERROR] /home/apshenichnikov/NetBeansProjects/newlps/src/main/java/su/ias/utils/StringUtils.java:[3,31] package com.sun.istack.internal does not exist
[ERROR] /home/apshenichnikov/NetBeansProjects/newlps/src/main/java/su/ias/utils/ParamUtils.java:[36,74] cannot find symbol
[ERROR] symbol: class Nullable
[ERROR] location: class su.ias.utils.ParamUtils
[ERROR] /home/apshenichnikov/NetBeansProjects/newlps/src/main/java/su/ias/utils/ParamUtils.java:[46,68] cannot find symbol
[ERROR] symbol: class Nullable
[ERROR] location: class su.ias.utils.ParamUtils
[ERROR] /home/apshenichnikov/NetBeansProjects/newlps/src/main/java/su/ias/utils/StringUtils.java:[19,36] cannot find symbol
[ERROR] symbol: class Nullable
[ERROR] location: class su.ias.utils.StringUtils
[ERROR] /home/apshenichnikov/NetBeansProjects/newlps/src/main/java/su/ias/utils/StringUtils.java:[45,6] cannot find symbol
[ERROR] symbol: class Nullable
[ERROR] location: class su.ias.utils.StringUtils
[ERROR] -> [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/MojoFailureException
Try import import org.jetbrains.annotations.Nullable instead. It has the same you need for #Nullable annotation.
Then add this dependency:
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>13.0</version>
</dependency>

Can't run java tutorial of vaadin - missing class

I tried to get into Vaadin by going through the tutorial.
I did everything described there but I can't even run it without having a build failure. I created a new Maven Project and selected Vaadin as the Archetype. After that, I made a Maven install on my project that was completed successfully. From there on, I followed the tutorial and configured the debug settings and run the program in debug mode but unfortunately I got the following error and I don't know what went wrong(Figure 5-7 in the tutorial).
[ERROR] Failed to execute goal org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run (default-cli) on project app: Execution default-cli of goal org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run failed: A required class was missing while executing org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run: javax/servlet/http/HttpServletResponse
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-maven-plugin/9.3.9.v20160517/jetty-maven-plugin-9.3.9.v20160517.jar
[ERROR] urls[1] = file:/C:/Users/User1/.m2/repository/org/sonatype/sisu/sisu-inject-bean/2.1.1/sisu-inject-bean-2.1.1.jar
[ERROR] urls[2] = file:/C:/Users/User1/.m2/repository/org/sonatype/sisu/sisu-guice/2.9.4/sisu-guice-2.9.4-no_aop.jar
[ERROR] urls[3] = file:/C:/Users/User1/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar
[ERROR] urls[4] = file:/C:/Users/User1/.m2/repository/org/sonatype/aether/aether-util/1.11/aether-util-1.11.jar
[ERROR] urls[5] = file:/C:/Users/User1/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[6] = file:/C:/Users/User1/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[7] = file:/C:/Users/User1/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[8] = file:/C:/Users/User1/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[9] = file:/C:/Users/User1/.m2/repository/org/apache/maven/plugin-tools/maven-plugin-tools-api/3.4/maven-plugin-tools-api-3.4.jar
[ERROR] urls[10] = file:/C:/Users/User1/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
[ERROR] urls[11] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-util/9.3.9.v20160517/jetty-util-9.3.9.v20160517.jar
[ERROR] urls[12] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-webapp/9.3.9.v20160517/jetty-webapp-9.3.9.v20160517.jar
[ERROR] urls[13] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-xml/9.3.9.v20160517/jetty-xml-9.3.9.v20160517.jar
[ERROR] urls[14] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-servlet/9.3.9.v20160517/jetty-servlet-9.3.9.v20160517.jar
[ERROR] urls[15] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-quickstart/9.3.9.v20160517/jetty-quickstart-9.3.9.v20160517.jar
[ERROR] urls[16] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-jaas/9.3.9.v20160517/jetty-jaas-9.3.9.v20160517.jar
[ERROR] urls[17] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-security/9.3.9.v20160517/jetty-security-9.3.9.v20160517.jar
[ERROR] urls[18] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-plus/9.3.9.v20160517/jetty-plus-9.3.9.v20160517.jar
[ERROR] urls[19] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-jndi/9.3.9.v20160517/jetty-jndi-9.3.9.v20160517.jar
[ERROR] urls[20] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-server/9.3.9.v20160517/jetty-server-9.3.9.v20160517.jar
[ERROR] urls[21] = file:/C:/Users/User1/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar
[ERROR] urls[22] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-http/9.3.9.v20160517/jetty-http-9.3.9.v20160517.jar
[ERROR] urls[23] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-io/9.3.9.v20160517/jetty-io-9.3.9.v20160517.jar
[ERROR] urls[24] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-jmx/9.3.9.v20160517/jetty-jmx-9.3.9.v20160517.jar
[ERROR] urls[25] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/jetty-annotations/9.3.9.v20160517/jetty-annotations-9.3.9.v20160517.jar
[ERROR] urls[26] = file:/C:/Users/User1/.m2/repository/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar
[ERROR] urls[27] = file:/C:/Users/User1/.m2/repository/org/ow2/asm/asm/5.0.1/asm-5.0.1.jar
[ERROR] urls[28] = file:/C:/Users/User1/.m2/repository/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.jar
[ERROR] urls[29] = file:/C:/Users/User1/.m2/repository/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.jar
[ERROR] urls[30] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-server-impl/9.3.9.v20160517/javax-websocket-server-impl-9.3.9.v20160517.jar
[ERROR] urls[31] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/javax-websocket-client-impl/9.3.9.v20160517/javax-websocket-client-impl-9.3.9.v20160517.jar
[ERROR] urls[32] = file:/C:/Users/User1/.m2/repository/javax/websocket/javax.websocket-api/1.0/javax.websocket-api-1.0.jar
[ERROR] urls[33] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-server/9.3.9.v20160517/websocket-server-9.3.9.v20160517.jar
[ERROR] urls[34] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-common/9.3.9.v20160517/websocket-common-9.3.9.v20160517.jar
[ERROR] urls[35] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-api/9.3.9.v20160517/websocket-api-9.3.9.v20160517.jar
[ERROR] urls[36] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-client/9.3.9.v20160517/websocket-client-9.3.9.v20160517.jar
[ERROR] urls[37] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/websocket/websocket-servlet/9.3.9.v20160517/websocket-servlet-9.3.9.v20160517.jar
[ERROR] urls[38] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/apache-jsp/9.3.9.v20160517/apache-jsp-9.3.9.v20160517.jar
[ERROR] urls[39] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/toolchain/jetty-schemas/3.1/jetty-schemas-3.1.jar
[ERROR] urls[40] = file:/C:/Users/User1/.m2/repository/org/mortbay/jasper/apache-jsp/8.0.33/apache-jsp-8.0.33.jar
[ERROR] urls[41] = file:/C:/Users/User1/.m2/repository/org/mortbay/jasper/apache-el/8.0.33/apache-el-8.0.33.jar
[ERROR] urls[42] = file:/C:/Users/User1/.m2/repository/org/eclipse/jdt/core/compiler/ecj/4.4.2/ecj-4.4.2.jar
[ERROR] urls[43] = file:/C:/Users/User1/.m2/repository/org/eclipse/jetty/apache-jstl/9.3.9.v20160517/apache-jstl-9.3.9.v20160517.jar
[ERROR] urls[44] = file:/C:/Users/User1/.m2/repository/org/apache/taglibs /taglibs-standard-spec/1.2.5/taglibs-standard-spec-1.2.5.jar
[ERROR] urls[45] = file:/C:/Users/User1/.m2/repository/org/apache/taglibs/taglibs-standard-impl/1.2.5/taglibs-standard-impl-1.2.5.jar
[ERROR] urls[46] = file:/C:/Users/User1/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: javax.servlet.http.HttpServletResponse
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>my.vaadin</groupId>
<artifactId>app</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>app</name>
<prerequisites>
<maven>3</maven>
</prerequisites>
<properties>
<vaadin.version>8.0.0</vaadin.version>
<vaadin.plugin.version>8.0.0</vaadin.plugin.version>
<jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- If there are no local customisations, this can also be "fetch" or "cdn" -->
<vaadin.widgetset.mode>local</vaadin.widgetset.mode>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-bom</artifactId>
<version>${vaadin.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Exclude an unnecessary file generated by the GWT compiler. -->
<packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<!-- Clean up also any pre-compiled themes -->
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/themes</directory>
<includes>
<include>**/styles.css</include>
<include>**/styles.scss.cache</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- The Jetty plugin allows us to easily test the development build by
running jetty:run on the command line. -->
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.plugin.version}</version>
<configuration>
<scanIntervalSeconds>2</scanIntervalSeconds>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<!-- Vaadin pre-release repositories -->
<id>vaadin-prerelease</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-prereleases</id>
<url>http://maven.vaadin.com/vaadin-prereleases</url>
</pluginRepository>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
Looks like the same error
Check your version of java and maven and make sure they are compatible.
Make sure
For the Maven compilation to work you need a JDK(not JRE,by default it may point to JRE) to be configured in your Eclipse in
Window ▸ Preferences ▸ Java ▸ Installed JREs ▸ Add…​.
This step is necessary at least on Windows, if you are using a fresh installation of Eclipse or for some other reason haven’t configured a JDK to your Eclipse. The JDK by default installs to \Program Files\Java on Windows. You can make JDK the default JRE for your Eclipse.

Maven: Cannot Find Symbol

I am attempting to run Maven builds of a Java project, however tests are failing stating that the Player symbol cannot be founded, despite being imported.
Maven builds are failing as follows:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[4,31] error: cannot find symbol
[ERROR] package com.ffxivcensus.gatherer
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,8] error: cannot find symbol
[ERROR] class PlayerTest
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,27] error: cannot find symbol
[ERROR] class PlayerTest
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,12] error: cannot find symbol
[ERROR] class PlayerTest
/var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,28] error: cannot find symbol
[INFO] 5 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.415 s
[INFO] Finished at: 2016-01-18T15:35:38+01:00
[INFO] Final Memory: 18M/206M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (default-testCompile) on project XIVStats-Gatherer-Java: Compilation failure: Compilation failure:
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[4,31] error: cannot find symbol
[ERROR] package com.ffxivcensus.gatherer
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,8] error: cannot find symbol
[ERROR] class PlayerTest
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[22,27] error: cannot find symbol
[ERROR] class PlayerTest
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,12] error: cannot find symbol
[ERROR] class PlayerTest
[ERROR] /var/lib/jenkins/workspace/XIVStats-Gatherer-Java/src/test/com/ffxivcensus/gatherer/PlayerTest.java:[116,28] error: cannot find symbol
[ERROR] -> [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/MojoFailureException
My config is as follows:
<?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>com.ffxivcensus.gatherer</groupId>
<artifactId>XIVStats-Gatherer-Java</artifactId>
<version>1.0pre</version>
<name>XIVStats Lodestone Gatherer</name>
<url>https://github.com/xivstats</url>
<licenses>
<license>
<name>BSD 2-Clause License</name>
<url>https://opensource.org/licenses/BSD-2-Clause</url>
<distribution>repo</distribution>
</license>
</licenses>
<issueManagement>
<url>https://github.com/XIVStats/XIVStats-Gatherer-Java/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<developers>
<developer>
<email>me#example.com</email>
<name>Peter Reid</name>
<url>https://github.com/reidweb</url>
<id>reidweb</id>
</developer>
<developer>
<email>me#example.com</email>
<name>Jonathan Price</name>
<url>https://github.com/pricetx</url>
<id>pricetx</id>
</developer>
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>mvnrepository.com</id>
<name>mvnrepository.com</name>
<url>http://mvnrepository.com/</url>
</repository>
</repositories>
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<finalName>${project.artifactId}-${project.version}</finalName>
<testOutputDirectory>target/test</testOutputDirectory>
<sourceDirectory>src/main</sourceDirectory>
<testSourceDirectory>src/test/</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<includes>
<include>src</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>com.ffxivcensus.gatherer.GathererController</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1207</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
See this github project
In your Maven-compiler-plugin definition:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<includes>
<include>src</include>
</includes>
</configuration>
</plugin>
Do not include the src folder directly. It will mess up the compilation order, Maven ends up building the test folder first, then fails on missing the main classes. Change it to this to make it work:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
</plugin>

Releasing a java based git project using maven release command

I have a Git project on Bitbucket and I am trying to release it using mvn release:prepare command but I am getting following exception.
I understand that it is asking for my password but not sure where and how to specify it.
Error Log:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.355 s
[INFO] Finished at: 2015-10-20T12:17:04-04:00
[INFO] Final Memory: 13M/166M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project git-cicd-demo: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] bash: /dev/tty: No such device or address
[ERROR] error: failed to execute prompt script (exit code 1)
[ERROR] fatal: could not read Password for 'https://nitalchandel#bitbucket.org': Invalid argument
[ERROR] -> [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/MojoFailureException
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>com.study.git.cicd</groupId>
<artifactId>git-cicd-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<!-- VCS integration -->
<scm>
<connection>scm:git:https://nitalchandel#bitbucket.org/nitalchandel/git-cicd-demo.git</connection>
<url>https://nitalchandel#bitbucket.org/nitalchandel/git-cicd-demo</url>
<developerConnection>scm:git:https://nitalchandel#bitbucket.org/nitalchandel/git-cicd-demo.git</developerConnection>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
You should be able to specify your password on the command line:
mvn release:prepare -Dpassword=qwerty ...
See here for the full set of options for release:prepare.

Categories