Reputation: 8284
I am trying to build and run an analyses on a non-maven java project by building it on Hudson and then running a Sonar analyses via the Hudson-Sonar-plugin.
The trouble is, Sonar assumes that the project is a maven project, and fails the build when it doesn't find a pom file.
How can I fix this?
Here's the relevant parts from the stack trace from Hudson:
[workspace] $ mvn.bat -f D:\Hudson\jobs\BirdApp\workspace\pom.xml -e -B sonar:sonar -Dsonar.jdbc.url=jdbc:mysql://localhost:3306/sonar -Dsonar.host.url=http://orbuild01:9000 ******** ********
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM D:\Hudson\jobs\BirdApp\workspace\pom.xml: D:\Hudson\jobs\BirdApp\workspace\pom.xml (The system cannot find the file specified) @
.........
Sonar analysis completed: FAILURE
[DEBUG] Skipping watched dependency update for build: BirdApp #8 due to result: FAILURE
Finished: FAILURE
I am not sure what other information you might need in my question, but let me know in a comment and I'll add it.
Upvotes: 1
Views: 951
Reputation: 4724
For non-Maven Java projects, you have to use the dedicated Sonar analysis build step, which relies on the standalone SonarQube Runner.
Upvotes: 3