1

I've set up jqassistant successfully, created some rules which are checked in our maven build.

However, when I try to create a Report from the results of the checks I'm getting the following infofrom the console when running mvn site and of course no report is generated:

[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

Relevant part of 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>

Scanning and analyzing is working without problems.

Any Ideas?

Edit: Configuration for scan/analyze

<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>
tom
  • 1,455
  • 1
  • 8
  • 13

1 Answers1

3

The problem in your configuration is that you have <extensions>true</extensions> in your configuration.

From the documentation, the basic correct configuration for the plugin is the following and note that:

The jQAssistant Maven plugin must be configured in the pom.xml of the root module, it should not be overwritten by sub-modules.

This means this configuration needs to be at the top-level POM in a multi-module project.

<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>

It appears that the current documentation has both versions (with and without <extensions>true</extensions>) because it might be needed in build environments where other extensions are present. An issue was created to track this: https://github.com/buschmais/jqassistant/issues/349

Tunaki
  • 132,869
  • 46
  • 340
  • 423