Issue with SonarQube 5.6.5 and Maven - maven

For the last few days, I try to have SonarQube working on my local with a very simple Maven project. I didn't want to start with one of my project, but I wanted to start from a tutorial. So, I re-used the following Github project:
https://github.com/mechero/code-quality-game
And I downloaded and installed SonarQube 5.6.5 on my local. The first message that I received was this one:
objc[57607]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java (0x10adf04c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10aeb84e0). One of the two will be used. Which one is undefined.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building code-quality-game 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.2:sonar (default-cli) # code-quality-game ---
[INFO] User cache: /Users/benjamin.chevallerea/.sonar/cache
[INFO] Load global repositories
[INFO] Load global repositories (done) | time=322ms
[INFO] User cache: /Users/benjamin.chevallerea/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=5ms
[INFO] SonarQube version: 5.6.5
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=29ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=169ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=717ms
[INFO] Publish mode
[INFO] ------------- Scan code-quality-game
[INFO] Load server rules
[INFO] Load server rules (done) | time=156ms
[INFO] Base dir: /Users/benjamin.chevallerea/Downloads/code-quality-game/sonar-connector
[INFO] Working dir: /Users/benjamin.chevallerea/Downloads/code-quality-game/sonar-connector/target/sonar
[INFO] Source paths: pom.xml, src/main/java
[INFO] Test paths: src/test/java
[INFO] Binary dirs: target/classes
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[INFO] Excluded sources:
[INFO] **/resultbeans/*.java
[INFO] 36 files indexed
[INFO] 5 files ignored because of inclusion/exclusion patterns
[INFO] Quality profile for java: Sonar way
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.979 s
[INFO] Finished at: 2017-02-16T11:21:42+00:00
[INFO] Final Memory: 68M/1963M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project code-quality-game: Unable to load component class org.sonar.java.SonarComponents: org/springsource/loaded/ri/ReflectiveInterceptor: org.springsource.loaded.ri.ReflectiveInterceptor -> [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
By logging to the UI, I noticed that there was a new version for the Java plugin. So, I updated it and I deleted my local cache and restarted. Then, I got this error:
objc[57893]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java (0x10ebdc4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10eca44e0). One of the two will be used. Which one is undefined.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building code-quality-game 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.2:sonar (default-cli) # code-quality-game ---
[INFO] User cache: /Users/benjamin.chevallerea/.sonar/cache
[INFO] Load global repositories
[INFO] Load global repositories (done) | time=312ms
[INFO] User cache: /Users/benjamin.chevallerea/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=6ms
[INFO] SonarQube version: 5.6.5
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=36ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=130ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=719ms
[INFO] Publish mode
[INFO] ------------- Scan code-quality-game
[INFO] Load server rules
[INFO] Load server rules (done) | time=174ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.843 s
[INFO] Finished at: 2017-02-16T11:27:11+00:00
[INFO] Final Memory: 64M/1963M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project code-quality-game: Unable to load component class org.sonar.batch.sensor.DefaultSensorStorage: Unable to load component class org.sonar.batch.issue.ModuleIssues: Unable to load component class org.sonar.batch.issue.IssueFilters: Unable to load component class org.sonar.java.filters.PostAnalysisIssueFilter: org/springsource/loaded/ri/ReflectiveInterceptor: org.springsource.loaded.ri.ReflectiveInterceptor -> [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
So I uploaded all plugins in SonarQube, but same issues. Because the problem is with the sensor, I decided to force the language to Java by adding the following property:
<sonar.language>java</sonar.language>
And now, I have the following error:
objc[58166]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java (0x1090c54c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10918d4e0). One of the two will be used. Which one is undefined.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building code-quality-game 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.2:sonar (default-cli) # code-quality-game ---
[INFO] User cache: /Users/benjamin.chevallerea/.sonar/cache
[INFO] Load global repositories
[INFO] Load global repositories (done) | time=191ms
[INFO] User cache: /Users/benjamin.chevallerea/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=4ms
[INFO] SonarQube version: 5.6.5
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=26ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=50ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=431ms
[INFO] Publish mode
[INFO] ------------- Scan code-quality-game
[INFO] Language is forced to java
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.123 s
[INFO] Finished at: 2017-02-16T11:32:37+00:00
[INFO] Final Memory: 67M/1963M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project code-quality-game: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar failed: A required class was missing while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar: org/springsource/loaded/TypeRegistry
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/benjamin.chevallerea/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.2/sonar-maven-plugin-3.2.jar
[ERROR] urls[1] = file:/Users/benjamin.chevallerea/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.2/maven-dependency-tree-2.2.jar
[ERROR] urls[2] = file:/Users/benjamin.chevallerea/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[3] = file:/Users/benjamin.chevallerea/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[4] = file:/Users/benjamin.chevallerea/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[5] = file:/Users/benjamin.chevallerea/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[6] = file:/Users/benjamin.chevallerea/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[7] = file:/Users/benjamin.chevallerea/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.8/sonar-scanner-api-2.8.jar
[ERROR] urls[8] = file:/Users/benjamin.chevallerea/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] urls[9] = file:/Users/benjamin.chevallerea/.m2/repository/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.springsource.loaded.TypeRegistry
[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
And I'm stuck on this error for few days now. I even tried to do exactly the same on a fresh new SpringBoot app and same issue.
Thanks in advance if you can help me.
Ben

The problem has been solved. Nothing related to SonarQube or Java. I realized that the variable MAVEN_HOME was not configured properly. Thanks for your help.

Related

Cannot run "mvn jetty:run" in my fhir project

Im new at fhir server.
My code mainly from repo https://github.com/hapifhir/hapi-fhir-jpaserver-starter
I tried to install fhir server on my ubuntu 20.04(lts) and stuck with this problem.
my mvn version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 17.0.5, vendor: Private Build, runtime: /usr/lib/jvm/java-17-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-50-generic", arch: "amd64", family: "unix"
ERROR
[INFO] Scanning for projects...
[WARNING] The project ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter:war:6.2.1 uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO]
[INFO] ------------< ca.uhn.hapi.fhir:hapi-fhir-jpaserver-starter >------------
[INFO] Building HAPI FHIR JPA Server - Starter Project 6.2.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.4.48.v20220622:run (default-cli) > test-compile # hapi-fhir-jpaserver-starter >>>
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0:enforce (enforce-maven) # hapi-fhir-jpaserver-starter ---
[INFO]
[INFO] --- jacoco-maven-plugin:0.8.8:prepare-agent (default-prepare-agent) #
hapi-fhir-jpaserver-starter ---
[INFO] argLine set to -javaagent:/root/.m2/repository/org/jacoco/org.jacoco.agent/0.8.8/org.jacoco.agent-0.8.8-runtime.jar=destfile=/root/hapi-fhir-jpaserver-starter/target/jacoco.exec,excludes=ca/uhn/fhir/model/dstu2/**/*.class:ca/uhn/fhir/jpa/rp/r5/*.class:ca/uhn/fhir/jpa/rp/r4/*.class:ca/uhn/fhir/jpa/rp/r4b/*.class:ca/uhn/fhir/jpa/rp/dstu3/*.class:ca/uhn/fhir/jpa/rp/dstu2/*.class,dumponexit=true
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # hapi-fhir-jpaserver-starter ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # hapi-fhir-jpaserver-starter ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 31 source files to /root/hapi-fhir-jpaserver-starter/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.158 s
[INFO] Finished at: 2022-11-21T15:39:38Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project hapi-fhir-jpaserver-starter: Compilation failure -> [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

CodeHaus Maven JAXB2 plugin error MojoExecutionException: NoSchemasException

I am trying to build my project ,in that i got error called [ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (One) on project tg-tg-tems-ota-common-service: : MojoExecutionException: NoSchemasException -> [Help 1]
we are using java8 ,apache maven 3.6.3 ,jaxb2 plugin 2.4
Please find below error
INFO] Building TravelGrid-Tems-Ota-Service 3.0.0-SNAPSHOT [2/3]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # tg-tg-tems-ota-common-service ---
[INFO]
[INFO] --- jaxb2-maven-plugin:2.4:xjc (One) # tg-tg-tems-ota-common-service ---
[INFO] Created EpisodePath [D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer\tg-tems-ota-common-service\target\generated-sources\jaxb\emt\hotelSearchRequest\META-INF\JAXB]: true
[INFO] Ignored given or default xjbSources [D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer\tg-tems-ota-common-service\src\main\xjb], since it is not an existent file or directory.
[INFO] Ignored given or default sources [D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer\tg-tems-ota-common-service\src\main\xsd], since it is not an existent file or directory.
[WARNING] No XSD files found. Please check your plugin configuration.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for tg-servicelayer 3.0.0-SNAPSHOT:
[INFO]
[INFO] tg-servicelayer .................................... SUCCESS [ 0.697 s]
[INFO] TravelGrid-Tems-Ota-Service ........................ FAILURE [ 0.909 s]
[INFO] TravelGrid-Subsystems .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.941 s
[INFO] Finished at: 2020-06-30T15:50:30+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:jaxb2-maven-plugin:2.4:xjc (One) on project tg-tg-tems-ota-common-service: : MojoExecutionException: NoSchemasException -> [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 <args> -rf :tg-tg-tems-ota-common-service
D:\Sushma_Project\TG_UPGRADATION\Project\branches\3.0.0-SNAPSHOT\tems\tg-tems-servicelayer>
I am new to jaxb plugin ,can anyone help me
Please user "mvn clean install" it will clean the target folder and regenerate everything from scratch.

SonarQube 6.3 fails on trying to scan a binary file

after successfully upgrading from sonarqube 6.2 to 6.3 the analyzation process of one project fails. The error message is Unable to read the source file : '.../ajax.gif' with the charset : 'UTF-8'. Input length = 1. When I run file .../ajax.gif then I get GIF image data, version 89a, 220 x 19 as expected. Before upgrading to 6.3 everything was working fine.
Here is the complete output:
CLI command: mvn clean sonar:sonar
Outcome:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pp-scratch 1.1.17-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.2:sonar (default-cli) # pp-scratch ---
[INFO] User cache: /home/thomas/.sonar/cache
[INFO] Load global settings
[INFO] Load global settings (done) | time=235ms
[INFO] User cache: /home/thomas/.sonar/cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=9ms
[INFO] Plugin [l10nde] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
[INFO] SonarQube version: 6.3.0
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=124ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=85ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=539ms
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=103ms
[INFO] Publish mode
[INFO] Project key: de.tln:pp-scratch
[INFO] ------------- Scan pp-scratch
[INFO] Excluded sources for coverage:
[INFO] **/*DTO.java
[INFO] Load server rules
[INFO] Load server rules (done) | time=97ms
[INFO] Initializer GenericCoverageSensor
[INFO] Initializer GenericCoverageSensor (done) | time=0ms
[INFO] Base dir: /home/thomas/workspace/aexit/pp-scratch
[INFO] Working dir: /home/thomas/workspace/aexit/pp-scratch/target/sonar
[INFO] Source paths: src/main/webapp, pom.xml, src/main/java
[INFO] Test paths: src/test/java
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[INFO] Excluded sources:
[INFO] **/*.min.css
[INFO] **/*.min.js
[INFO] src/main/webapp/resources/bootstrap/**
[INFO] **/entity/*.java
[INFO] 210 files indexed
[INFO] 7 files ignored because of inclusion/exclusion patterns
[INFO] Quality profile for css: Sonar way
[INFO] Quality profile for java: TLN
[INFO] Quality profile for js: Sonar way
[INFO] Quality profile for web: Sonar way
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.309 s
[INFO] Finished at: 2017-03-24T08:18:22+01:00
[INFO] Final Memory: 61M/514M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project pp-scratch: Unable to read the source file : '/home/thomas/workspace/aexit/pp-scratch/src/main/webapp/resources/app/ajaxloadingbar.gif' with the charset : 'UTF-8'. Input length = 1 -> [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
You are facing the following bug: SONAR-8995
It will be fixed in SonarQube 6.3.1.

Issues in exceution while run the test script through Maven

While i am executing my test script through maven test, it shows error. below are the errors at runtime.
[INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building Talentrack V1 [INFO]
------------------------------------------------------------------------ [INFO] Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom
[INFO] Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/2.12.4/maven-surefire-plugin-2.12.4.pom
(11 KB at 4.5 KB/sec) [INFO] Downloading:
https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom
[INFO] Downloaded:
https://repo.maven.apache.org/maven2/org/apache/maven/surefire/surefire/2.12.4/surefire-2.12.4.pom
(14 KB at 21.1 KB/sec) [INFO] [INFO] ---
maven-resources-plugin:2.6:resources (default-resources) # Talentrack
--- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non
existing resourceDirectory
D:\Talentrack_talent\Talentrack\src\main\resources [INFO] [INFO] ---
maven-compiler-plugin:3.3:compile (default-compile) # Talentrack ---
[INFO] Changes detected - recompiling the module! [WARNING] File
encoding has not been set, using platform encoding Cp1252, i.e. build
is platform dependent! [INFO] Compiling 10 source files to
D:\Talentrack_talent\Talentrack\target\classes [INFO]
------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO]
------------------------------------------------------------- [ERROR] No compiler is provided in this environment. Perhaps you are running
on a JRE rather than a JDK? [INFO] 1 error [INFO]
------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 4.087 s [INFO] Finished at:
2016-05-17T16:35:05+05:30 [INFO] Final Memory: 9M/121M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.3:compile
(default-compile) on project Talentrack: Compilation failure [ERROR]
No compiler is provided in this environment. Perhaps you are running
on a JRE rather than a JDK? [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
Compilation failure [ERROR] No compiler is provided in this
environment. Perhaps you are running on a JRE rather than a JDK?
You need to specify the JDK path into your system variables / bash profile which can be done by adding a JAVA_HOME variable to it.

java project not getting analysed in sonar 3.3.5

When I give mvn sonar:sonar for sample java project in sonar I get this error.The sample project is from link
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Simple Java Maven Project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:2.0:sonar (default-cli) # example-java-maven ---
[INFO] Sonar version: 3.5.1
[INFO] [12:29:59.781] Load batch settings
[INFO] [12:30:00.000] User cache: C:\Documents and Settings\xxx\.sonar\cache
[INFO] [12:30:00.156] Install plugins
INFO] [12:30:03.250] ------------- Executing Project Scan
[INFO] [12:30:04.500] Install JDBC driver
INFO] [12:30:04.515] Apply project exclusions
[WARN] [12:30:04.531] H2 database should be used for evaluation purpose only
[INFO] [12:30:04.531] Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
[INFO] [12:30:04.890] Initializing Hibernate
[INFO] [12:30:09.500] ------------- Inspecting Simple Java Maven Project
[INFO] [12:30:09.515] Load module settings
[INFO] [12:30:09.937] Excluded tests:
[INFO] [12:30:09.937] **/package-info.java
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.125s
[INFO] Finished at: Thu Jun 13 12:30:11 IST 2013
[INFO] Final Memory: 9M/28M
[INFO] ------------------------------------------------------------------------
ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d
efault-cli) on project example-java-maven: Can not execute Sonar: You must insta
ll a plugin that supports the language 'java' -> [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/MojoExecutionE
xception
Should I manually put any plugin to analyze java project?
It looks like you have removed the Java plugins from your Sonar home directory. You can upload the latest version at http://docs.codehaus.org/display/SONAR/Java+Ecosystem, copy the plugins into SONAR_HOME/extensions/plugins and restart your Sonar server.

Resources