Maven Sonar Failing on Jenkins

2,466 views
Skip to first unread message

Bangar Milind

unread,
Jun 9, 2016, 7:46:47 AM6/9/16
to SonarQube
Hi,

Trying out SonarQube 5.6 on my old Java Projects (Spring). 

While executing the Maven SONAR Goal (JDK 7 build 25) , I am getting following exception, which is primarily to do with JRE. 


[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project gw-cc-claim: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation : Unsupported major.minor version 52.0


Can you please help in sharing the compatibility matrix across different versions of SonarQube.

Regards
Milind


Julien Lancelot

unread,
Jun 9, 2016, 7:53:55 AM6/9/16
to Bangar Milind, SonarQube
Hi,

SonarQube 5.6 is only compatible with Java 8.

Regards,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/5e518d64-cc69-4a5d-a2f1-3c799f93195d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Julien LANCELOT | SonarSource

Bangar Milind

unread,
Jun 9, 2016, 9:22:53 AM6/9/16
to SonarQube
Hi Julien,

I used JDK8 as well, but getting below issue while running the Test suite.

[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default) on project gw-cc-claim-jaxws: Compiler errors:
[ERROR] error at factory.registerObjectFactory(new ClaimProxyFactory(), TypeFactory.valueOf(Claim.class));
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] E:\JPDSlave\workspace\GW-Int-CC-Claim-Sonar\gw-cc-claim\gw-cc-claim-jaxws\src\main\java\com\aviva\ukgi\gw\cc\claim\mapper\SearchClaimResponseMapper.java:74:0::0 The type java.lang.reflect.AnnotatedElement cannot be resolved. It is indirectly referenced from required .class files
[ERROR] error at (no source information available)
[ERROR] E:\JPDSlave\workspace\GW-Int-CC-Claim-Sonar\gw-cc-claim\gw-cc-claim-jaxws\target\generated-sources\wsimport\aviva\uk\gi\dis\claim\v03\AddressMasterType.java:1:0::0 The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
[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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :gw-cc-claim-jaxws
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

The same runs fine in JDK7, but not on JDK8.

Spring projects were compiled in JDK6.

Thanks in advance.

Regards
Milind

Julien Lancelot

unread,
Jun 9, 2016, 9:56:23 AM6/9/16
to Bangar Milind, SonarQube
It seems that you need to update your pom to make aspectj work with Java 8 : http://stackoverflow.com/questions/25155905/running-jdk8-for-aspectj

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

simon.b...@grg.com

unread,
Jun 21, 2016, 4:53:09 AM6/21/16
to SonarQube, milindb...@gmail.com
I don't understand.
What has the version of Java SonarQube server is running under got to do with the version of Java the project being analysed is using?
I thought that the (in my case) Gradle plugin analysed the project locally and uploaded the results to the server?
Reply all
Reply to author
Forward
0 new messages