Search code examples
sonarqubesonar-runnersonarqube-scan

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

Solution

  • 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.