sonarqube analyzing on java 9 - sonarqube

docker sonarqube latest version 6.7.1 broke my maven build on java 9:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project request-work: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar: javax/xml/bind/ValidationEventHandler
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jenkins/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.4.0.905/sonar-maven-plugin-3.4.0.905.jar
[ERROR] urls[1] = file:/home/jenkins/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/home/jenkins/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[4] = file:/home/jenkins/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.10.0.1189/sonar-scanner-api-2.10.0.1189.jar
[ERROR] urls[5] = file:/home/jenkins/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : javax.xml.bind.ValidationEventHandler
[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]
The same configuration on java 8 work perfect.
How to fix it?

On the SonarQube requirements page you can read that SonarQube
only supports Open JDK 8 and Oracle JRE 8. So you need that runtime to run a SonarQube analysis and the SonarQube Website.
The main problem is the current ElasticSearch engine included in the product (support for Java 9 is added in ElasticSearch 6.2,
see also JIRA item SONAR-10574).
You can read for example in this blog that JDK 9 is obselete so
developers need to migrate the code to JDK 10, JDK 11 (later this year) or fallback to JDK 8. See also
this SO question asking for the plans
for the SonarQube 7.x versions, still without an answer. There is a big chance that support for the next Java runtime will be build into
the 7.x version and not in the 6.x versions. You can analyse Java 9 code. See this
SO question for the details.

Related

Quarkus project failed to build

I follow this quarkus guide : https://quarkus.io/guides/getting-started and everything works fine on my local machine. However when I push my code and launch a jenkins build I got the following error :
11:19:24 [INFO] [jenkins-event-spy] Generated /home/jenkins/workspace/middleware_snapshot_develop-EKIMU4RSDFMZGBZA3XCVKQY7EEXFYGGT2UK5R5N3NP636H36IDJQ#tmp/withMavenc261dc7b/maven-spy-20200505-091643-8556196817679207068499.log
11:19:24 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project mytraindata-quarkus-test: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy: java.lang.NoSuchMethodError: org.eclipse.aether.spi.connector.ArtifactUpload.getFileTransformer()Lorg/eclipse/aether/transform/FileTransformer;
11:19:24 [ERROR] -----------------------------------------------------
11:19:24 [ERROR] realm = plugin>org.apache.maven.plugins:maven-deploy-plugin:2.8.2
11:19:24 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
11:19:24 [ERROR] urls[0] = file:/root/.m2/repository/org/apache/maven/plugins/maven-deploy-plugin/2.8.2/maven-deploy-plugin-2.8.2.jar
11:19:24 [ERROR] urls[1] = file:/root/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
11:19:24 [ERROR] urls[2] = file:/root/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
11:19:24 [ERROR] urls[3] = file:/root/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
11:19:24 [ERROR] urls[4] = file:/root/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.jar
11:19:24 [ERROR] Number of foreign imports: 1
11:19:24 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
11:19:24 [ERROR]
11:19:24 [ERROR] -----------------------------------------------------
11:19:24 [ERROR] -> [Help 1]
11:19:24 [ERROR]
11:19:24 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
11:19:24 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
11:19:24 [ERROR]
11:19:24 [ERROR] For more information about the errors and possible solutions, please read the following articles:
11:19:24 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
11:19:24 [ERROR]
11:19:24 [ERROR] After correcting the problems, you can resume the build with the command
11:19:24 [ERROR] mvn <goals> -rf :mytraindata-quarkus-test
Note that I have another quarkus project with the old bom which build fine:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>1.1.1.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
as opposite of the new one which fails:
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-universe-bom</artifactId>
<version>1.4.1.Final</version>
<type>pom</type>
<scope>import</scope>
</dependency>
I suspect that the error comes from the new bom.
Here is the configuration :
10:22:57 Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T19:49:05Z)
10:22:57 Maven home: /usr/share/maven
10:22:57 Java version: 1.8.0_171, vendor: Oracle Corporation
10:22:57 Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
10:22:57 Default locale: en, platform encoding: UTF-8
10:22:57 OS name: "linux", version: "3.10.0-957.21.2.el7.x86_64", arch: "amd64", family: "unix"
I ve installed maven 3.5.3 on my local machine and I can successfully build the project.
So I don't know what causes this failure...
Any help ?
Thank you !
The minimum Maven version for newest Quarkus version is 3.6.2. Can you try upgrading to the latest Maven release?
It really looks like Maven failing due to incompatible versions.

Sonar scanner with Maven and JDK 11

I can make Sonar scanner work with OpenJDK 8 but not with OpenJDK 11.
The Maven command used is:
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.report.export.path=sonar-report.json -P ci
The build fails with:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project framework-bio: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar: javax/xml/bind/ValidationEventHandler
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:3.4.0.905
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/var/lib/jenkins/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.4.0.905/sonar-maven-plugin-3.4.0.905.jar
[ERROR] urls[1] = file:/var/lib/jenkins/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/var/lib/jenkins/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/var/lib/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[4] = file:/var/lib/jenkins/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.10.0.1189/sonar-scanner-api-2.10.0.1189.jar
[ERROR] urls[5] = file:/var/lib/jenkins/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: javax.xml.bind.ValidationEventHandler
[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/PluginContainerException
Is Sonar Scanner expected to work with JDK 11?
I finally found https://github.com/sonargraph/sonar-sonargraph-integration/issues/14
The issue is coming from SonarQube plugin named sonar-sonargraph-integration.
I uninstalled the plugin from SonarQube server and the issue went away.

Sonar 3.5.1 not working for Java 8 and maven 3.3.9 with war file

We are upgrading and existing project to java 8 and maven 3.3.9 we have sonar 3.5.1, though latest versions of sonar are available we don't want to update sonar since we have done some customization in sonar 3.5.1.
Main thing is that we deploy sonar war in the same tomcat where we
have deployed our project but in new sonar versions war folder is
deleted and they have provided separate sonar server which we don't
want.
So please help me to run sonar 3.5.1 or tell me how can I make war of latest sonar version and deploy it in my own tomcat. I am trying this from last two days and tested with different versions but no success. When using sonar 3.5.1 we are getting below error
[INFO] Sonar version: 3.5.1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.007 s
[INFO] Finished at: 2017-04-26T23:47:34+05:30
[INFO] Final Memory: 24M/218M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project app25apr1: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar failed: A required class was missing while executing org.codehaus.mojo:sonar-maven-plugin:2.0:sonar: org/sonatype/aether/graph/DependencyFilter
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/ist/innoeye/headStart8Repository/org/codehaus/mojo/sonar-maven-plugin/2.0/sonar-maven-plugin-2.0.jar
[ERROR] urls[1] = file:/home/ist/innoeye/headStart8Repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[2] = file:/home/ist/innoeye/headStart8Repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[3] = file:/home/ist/innoeye/headStart8Repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[4] = file:/home/ist/innoeye/headStart8Repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[5] = file:/home/ist/innoeye/headStart8Repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[6] = file:/home/ist/innoeye/headStart8Repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[7] = file:/home/ist/innoeye/headStart8Repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[8] = file:/home/ist/innoeye/headStart8Repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.sonatype.aether.graph.DependencyFilter
Sonar 3.5.1 is 4 years old. I highly suggest to use latest LTS (5.6.6) which is working with Java 8 and maven 3.3.9.
If you don't want to upgrade due to your customizations, I don't know if you will be able to analyse your projects.

org/sonar/api/utils/SonarException : Unsupported major.minor version 51.0

after upgrading from 3.3.2 to Sonarqube 5.1.2, my maven build for a project that needs to be built with jdk 1.6 is failing with:
build 03-Dec-2015 19:33:10 [INFO] ------------------------------------------------------------------------
build 03-Dec-2015 19:33:10 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project my_project: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar failed: An API incompatibility was encountered while executing org.codehaus.mojo:sonar-maven-plugin:2.6:sonar: java.lang.UnsupportedClassVersionError: org/sonar/api/utils/SonarException : Unsupported major.minor version 51.0
build 03-Dec-2015 19:33:10 [ERROR] -----------------------------------------------------
build 03-Dec-2015 19:33:10 [ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:2.6
build 03-Dec-2015 19:33:10 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
build 03-Dec-2015 19:33:10 [ERROR] urls[0] = file:/tmp/org/codehaus/mojo/sonar-maven-plugin/2.6/sonar-maven-plugin-2.6.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[1] = file:/tmp/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[2] = file:/tmp/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[3] = file:/tmp/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[4] = file:/tmp/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[5] = file:/tmp/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[6] = file:/tmp/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[7] = file:/tmp/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[8] = file:/tmp/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[9] = file:/tmp/org/codehaus/sonar/runner/sonar-runner-api/2.4/sonar-runner-api-2.4.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[10] = file:/tmp/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[11] = file:/tmp/com/google/guava/guava/10.0.1/guava-10.0.1.jar
build 03-Dec-2015 19:33:10 [ERROR] urls[12] = file:/tmp/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar
build 03-Dec-2015 19:33:10 [ERROR] Number of foreign imports: 1
build 03-Dec-2015 19:33:10 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
build 03-Dec-2015 19:33:10 [ERROR]
build 03-Dec-2015 19:33:10 [ERROR] -----------------------------------------------------
build 03-Dec-2015 19:33:10 [ERROR] -> [Help 1]
seems like a compatibility issue, any ideas?
Pointing to the old sonar it still works fine, pointing to the new one, I get this.
Thanks,
Roberto
As you can read in the "Requirements" page or the "SonarQube 5.0 Upgrade Guide", you need at least Java 7 to run a SonarQube analysis.
You can always build (compile, test, ...etc) your project with Java 6, but then you need to configure your SonarQube analysis to use Java 7 or greater.
SonarQube 5.x requires java 7 to run the server and to run analysis.
It will still analyze projects build with java 6 but you should run the analysis with java 7.
I fell into almost the same problem running my Sonar analysis on Jenkins via maven. At some point a project analysis that worked started to fail while:
SonarQube Server had not changed (version 4.5.6)
Jenkins Job config had not changed (Maven Job configured with JDK 1.7.0.45)
Maven config had not changed
And this is what I got:
org.codehaus.plexus.component.repository.exception.ComponentLookupException: org/sonarsource/scanner/maven/SonarQubeMojo : Unsupported major.minor version 52.0
17:27:29 [ERROR] -----------------------------------------------------
17:27:29 [ERROR] realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.1.1
17:27:29 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
17:27:29 [ERROR] urls[0] = file:/c:/tools/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.1.1/sonar-maven-plugin-3.1.1.jar
17:27:29 [ERROR] urls[1] = file:/c:/tools/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.2/maven-dependency-tree-2.2.jar
17:27:29 [ERROR] urls[2] = file:/c:/tools/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
17:27:29 [ERROR] urls[3] = file:/c:/tools/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
17:27:29 [ERROR] urls[4] = file:/c:/tools/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
17:27:29 [ERROR] urls[5] = file:/c:/tools/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
17:27:29 [ERROR] urls[6] = file:/c:/tools/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
17:27:29 [ERROR] urls[7] = file:/c:/tools/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.7/sonar-scanner-api-2.7.jar
17:27:29 [ERROR] urls[8] = file:/c:/tools/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
17:27:29 [ERROR] urls[9] = file:/c:/tools/.m2/repository/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar
17:27:29 [ERROR] Number of foreign imports: 1
17:27:29 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
The issue is caused here by a mismatch of java version between:
Jenkins Job executing with JDK 1.7.x
sonar-maven-plugin version 3.1.1 being compiled with JDK 1.8.x
The version of the plugin was not set explicitly in the pom.xml, so the analysis started to fail when the job took this version of the plugin.
For many reasons, the job JDK could not be upgraded to 1.8, so the version of the sonar-maven-plugin was fixed to 3.0.2.
This is correct, you need java 1.7 version. Make sure you have updated jdk version not the jre.
First verify which env variable to used to pick up jdk version.
javac -version
output:
Picked up _JAVA_OPTIONS: -Xmx512M
javac 1.7.0_80
Go to the command line and follow the below change.
Set JAVA_OPTIONS=C:\Program Files\Java\jdk1.7.0_80
or
Set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_80
set PATH=%JAVA_HOME%\bin;%PATH%

Error while running through command line in springs

I have a test class that uses #Autowired annotation and #ContextConfiguration and #Category annotations.
The test tuns fine when its run through eclipse.
But when i try running it through Command line, it is throwing the following error.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.690s
[INFO] Finished at: Wed Jun 12 09:56:48 GMT+05:30 2013
[INFO] Final Memory: 31M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.14.1:integration-test (default) on project OmnitureSeleniumTests: Execution default of goal org.apache.maven.plugins:maven-failsafe-plugin:2.14.1:integration-test failed: There was an error in the forked process
[ERROR] java.lang.NoSuchMethodError: org.junit.runner.Request.classes(Lorg/junit/runner/Computer;[Ljava/lang/Class;)Lorg/junit/runner/Request;
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createReqestAndRun(JUnitCoreWrapper.java:128)
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:111)
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:84)
[ERROR] at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:138)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:597)
[ERROR] at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159)
[ERROR] at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
[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/PluginExecutionException
I am using junit 4.8.2 and
maven-failsafe-plugin:2.14.1
There could be many configuration / environmental differences when running maven from Eclipse vs command line:
The maven version / path. In Eclipse the actual maven binary can be default / explicitly set via preferences, whereas in command line your OS will pick the first one available on your PATH env var. Check maven version using mvn -version
Maven user / global settings.xml. When running through command line typically ~/.m2/settings.xml is used but this can be explicitly overridden on Eclipse preferences
Maven local repository cache. If you have discrepancy on 1 and/or 2, you could end up with different local repository cache. Incorrect artifact distribution could cause build to fail if performed against different local repository cache.
Eclipse maven could use different version of JVM than your command line.
i have changed the version of maven-failsafe-plugin to 2.6 and it is running fine thru command line now :)

Resources