我在Bamboo中创建了SonarQube任务。我有一个包含4个模块的父pom。在运行任务时,它会跳过子任务。我没有得到根本原因???
父母POM。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mastercard.mpts.emailsms</groupId>
<artifactId>emailsms-parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<description>EmailSMS Application</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>ESBMsgProcessor</module>
<module>EmailSMSService</module>
<module>SMTPMsgProcessor</module>
<module>ESBSMSService</module>
</modules>
</project>
以下是SMTPMsgProcessor的子项
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.mastercard.mpts.emailsms</groupId>
<artifactId>emailsms-parent</artifactId>
<version>1.0</version>
</parent>
<groupId>com.mastercard.mpts.emailsms</groupId>
<artifactId>smtpmsgprocessor</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SMTPMsgProcessor</name>
<description>Handle Email for SMTP</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
SonarQube计划的结果是:
30-Mar-2017 08:33:10 [INFO] Reactor Summary:
30-Mar-2017 08:33:10 [INFO]
30-Mar-2017 08:33:10 [INFO] emailsms-parent .................................... SUCCESS [ 33.879 s]
30-Mar-2017 08:33:10 [INFO] ESBMsgProcessor .................................... SKIPPED
30-Mar-2017 08:33:10 [INFO] EmailSMSService .................................... SKIPPED
30-Mar-2017 08:33:10 [INFO] SMTPMsgProcessor ................................... SKIPPED
30-Mar-2017 08:33:10 [INFO] ESBSMSService ...................................... SKIPPED
30-Mar-2017 08:33:10 [INFO] ------------------------------------------------------------------------
30-Mar-2017 08:33:10 [INFO] BUILD SUCCESS
30-Mar-2017 08:33:10 [INFO] ------------------------------------------------------------------------
30-Mar-2017 08:33:10 [INFO] Total time: 34.260 s
30-Mar-2017 08:33:10 [INFO] Finished at: 2017-03-30T08:33:10-05:00
30-Mar-2017 08:33:11 [INFO] Final Memory: 48M/3050M
我没有添加任何东西来跳过。我也无法看到soanr分析,因为模块被跳过了。
答案 0 :(得分:4)
sonar:sonar
Maven目标是一个聚合器:这意味着它只在根模块上触发一次。然后由SonarQube Scanner for Maven自行分析模块。
所以从Maven的角度来看,看起来模块被跳过了,但实际上它们是由SonarQube正确分析的。转到SonarQube Web界面,您将在项目中找到模块。