我已经成功设置了jqassistant,创建了一些规​​则,这些规则已在我们的Maven构建中进行了检查。

但是,当我尝试根据检查结果创建报告时,在运行mvn网站时会从控制台获取以下信息,并且当然不会生成报告:

[INFO] --- maven-site-plugin:3.3:site (default-site) @ mvb-bfa ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-project- info-reports-plugin:2.8.1
[INFO] configuring report plugin    com.buschmais.jqassistant.scm:jqassistant-maven-plugin:1.1.2
[WARNING] ignoring com.buschmais.jqassistant.scm:jqassistant-maven-plugin:1.1.2:report goal since it is not a report: should be removed from reporting configuration in POM


pom.xml的相关部分:

<reporting>
    <plugins>
        <plugin>
            <groupId>com.buschmais.jqassistant.scm</groupId>
            <artifactId>jqassistant-maven-plugin</artifactId>
            <reportSets>
                <reportSet>
                     <reports>
                          <report>report</report>
                     </reports>
                </reportSet>
            </reportSets>
       </plugin>
    </plugins>
</reporting>


扫描和分析正常进行。

有任何想法吗?

编辑:扫描/分析配置

<build>
    <plugins>
        <plugin>
            <groupId>com.buschmais.jqassistant.scm</groupId>
            <artifactId>jqassistant-maven-plugin</artifactId>
            <version>1.1.2</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <id>default</id>
                    <goals>
                        <goal>scan</goal>
                        <goal>analyze</goal>
                    </goals>
                    <configuration>
                        <failOnViolations>false</failOnViolations>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

最佳答案

配置中的问题是您的配置中有<extensions>true</extensions>

documentation中,插件的基本正确配置如下,并请注意:


  jQAssistant Maven插件必须在根模块的pom.xml中进行配置,不应被子模块覆盖。


这意味着此配置需要在多模块项目中位于顶级POM上。

<project>
    ...
    <build>
        <plugins>
            <plugin>
            <groupId>com.buschmais.jqassistant.scm</groupId>
                <artifactId>jqassistant-maven-plugin</artifactId>
                <version>1.1.2</version>
                <executions>
                    <execution>
                        <id>scan</id>
                        <goals>
                            <goal>scan</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.buschmais.jqassistant.scm</groupId>
                <artifactId>jqassistant-maven-plugin</artifactId>
                <version>1.1.2</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
    ...
</project>




看来当前文档具有两个版本(withwithout <extensions>true</extensions>),因为在存在其他扩展名的构建环境中可能需要它。创建了一个跟踪此问题的问题:https://github.com/buschmais/jqassistant/issues/349

10-08 11:26