Search code examples
jqassistant

How to tell jQAssistant to scan .git directory in maven?


I configured jQAssistant in a Maven project to scan jacoco reports:

<scanInclude>
    <path>my-maven-submodule/target/site/jacoco</path>
</scanInclude>

This works fine. Then I configured jQA to scan a Git repo:

<scanInclude>
    <path>.git</path>
</scanInclude>

This does not work because the .git directory is not entered. There is no "Entering .git" log message and the Git Scanner Plugin shows in its debug output that no file from this directory is offered. Why? And how do I configure jQA to scan the .git directory? The standalone program used e.g. by Gradle works fine, there the Git repo gets imported.


Solution

  • Just modified and tried it with the Spring Petclinic sample (http://github.com/buschmais/spring-petclinic) - it's working:

            <!-- jQAssistant -->
            <plugin>
                <groupId>com.buschmais.jqassistant.scm</groupId>
                <artifactId>jqassistant-maven-plugin</artifactId>
                <version>${jqassistant.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>scan</goal>
                            <goal>analyze</goal>
                        </goals>
                        <configuration>
                            <failOnViolations>false</failOnViolations>
                            <!--
                            <groups>
                                <group>default</group>
                            </groups>
                            -->
                            <scanIncludes>
                                <scanInclude>
                                    <path>.git</path>
                                </scanInclude>
                            </scanIncludes>
                            <reportProperties>
                                <graphml.report.directory>${project.build.directory}/graphml</graphml.report.directory>
                            </reportProperties>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.buschmais.jqassistant.plugin</groupId>
                        <artifactId>jqassistant.plugin.jpa2</artifactId>
                        <version>${jqassistant.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.buschmais.jqassistant.plugin</groupId>
                        <artifactId>jqassistant.plugin.graphml</artifactId>
                        <version>${jqassistant.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>de.kontext-e.jqassistant.plugin</groupId>
                        <artifactId>jqassistant.plugin.git</artifactId>
                        <version>1.1.1</version>
                    </dependency>
                </dependencies>
            </plugin>