Is it possible to configure maven-checkstyle-plugin to use one of the
project's modules as the source of the checkstyle XML file?

E.g. I have the plugin configured like this:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-checkstyle-plugin</artifactId>
    <version>${maven-checkstyle-plugin.version}</version>
    <dependencies>
        <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>10.12.3</version>
        </dependency>
        <dependency>
            <groupId>com.bs.arm.a2dl</groupId>
            <artifactId>a2dl-build-tools</artifactId>
            <version>${project.version}</version>
        </dependency>
    </dependencies>
    <configuration>
        <configLocation>a2dl/google_checks.xml</configLocation>
        <consoleOutput>true</consoleOutput>
        <failsOnError>true</failsOnError>
        <linkXRef>false</linkXRef>
    </configuration>
    <executions>
        <execution>
            <id>verify-checkstyle</id>
            <phase>verify</phase>
            <goals>
                <goal>check</goal>
            </goals>
        </execution>
    </executions>
</plugin>


The problem is the plugin is looking in my .m2 folder or Maven proxy server
for this dependency.

 <dependency>
            <groupId>com.bs.arm.a2dl</groupId>
            <artifactId>a2dl-build-tools</artifactId>
            <version>${project.version}</version>
 </dependency>

But it doesn't exist there yet as its a module of my/this project so its
one of the modules in the Maven build reactor.  Is it possible to configure
the plugin to use the project modules for this?

-Dave

Reply via email to