简体   繁体   English

无法让SonarQube分析非maven java项目

[英]Trouble getting SonarQube to analyze non-maven java project

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. 我试图通过在Hudson上构建并通过Hudson-Sonar插件运行Sonar分析来构建和运行非maven java项目的分析。

The trouble is, Sonar assumes that the project is a maven project, and fails the build when it doesn't find a pom file. 麻烦的是,Sonar假设该项目是一个maven项目,并且在找不到pom文件时无法构建。

How can I fix this? 我怎样才能解决这个问题?

Here's the relevant parts from the stack trace from Hudson: 这是来自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. 我不确定在我的问题中您可能需要哪些其他信息,但请在评论中告诉我,我会添加它。

对于非Maven Java项目,您必须使用专用的Sonar分析构建步骤,该步骤依赖于独立的SonarQube Runner。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM