我很久以前就开始使用maven和sonar qube了,并且习惯于使用sonar qube从pom.xml抓取源文件来运行分析。
但在将sonar qube从5.x更新到6.7.3之后,我注意到这对我的项目不再起作用。
包含<sourceDirectory>src</sourceDirectory>的项目pom.xml
但是当分析运行时,它会显示“源路径: pom.xml”。
因此,我必须添加<sonar.sources>src</sonar.sources>才能让它再次运行。
为什么sonar qube不能从pom.xml获取源文件夹?
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version>
</plugin>发布于 2018-06-11 16:33:03
我认为你需要这个:
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.0.905</version>
<executions>
<execution>
<id>sonar-run</id>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>也许执行部分对你来说不是必需的。
https://stackoverflow.com/questions/50765028
复制相似问题