[ 
https://issues.apache.org/jira/browse/MCHECKSTYLE-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17711868#comment-17711868
 ] 

Alexis Jehan edited comment on MCHECKSTYLE-431 at 4/13/23 12:23 PM:
--------------------------------------------------------------------

I have just tested it, the behavior is the same except that the checkstyle 
plugin (defined only in the agregator "pom.xml") is not inherited by modules. 
But unnecessary target files are still generated for the agregator.

I think every "pom.xml" defined with {{<packaging>pom</packaging>}} should be 
excluded from the "check" goal.



was (Author: alexisj):
I have just tested it, the behavior is the same except that the checkstyle 
plugin (defined only in the agregator "pom.xml") is not inherited by modules. 
But unnecessary target files are still generated for the agregator.

> Avoid creating unnecessary target files for pom projects
> --------------------------------------------------------
>
>                 Key: MCHECKSTYLE-431
>                 URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-431
>             Project: Maven Checkstyle Plugin
>          Issue Type: Improvement
>          Components: checkstyle:check
>    Affects Versions: 3.2.1
>            Reporter: Alexis Jehan
>            Priority: Minor
>
> Because pom projects do not have Java code, It is not necessary to create 
> "target/checkstyle-cachefile", "target/checkstyle-checker.xml", 
> "target/checkstyle-result.xml" and "target/checkstyle-suppressions.xml" files 
> for these projects.
> Maven configuration:
> {code:xml}
> <plugin>
>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-checkstyle-plugin</artifactId>
>       <version>3.2.1</version>
>       <dependencies>
>               <dependency>
>                       <groupId>com.puppycrawl.tools</groupId>
>                       <artifactId>checkstyle</artifactId>
>                       <version>10.9.3</version>
>               </dependency>
>       </dependencies>
>       <configuration>
>               <configLocation>checkstyle.xml</configLocation>
>               
> <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
>               <includeTestSourceDirectory>true</includeTestSourceDirectory>
>               <violationSeverity>info</violationSeverity>
>       </configuration>
>       <executions>
>               <execution>
>                       <id>checkstyle-check</id>
>                       <phase>validate</phase>
>                       <goals>
>                               <goal>check</goal>
>                       </goals>
>               </execution>
>       </executions>
> </plugin>
> {code}
> Maven output:
> {noformat}
> [INFO] --- checkstyle:3.2.1:check (checkstyle-check) @ parent-project ---
> [INFO] You have 0 Checkstyle violations.
> {noformat}
> Content of the generated "target/checkstyle-result.xml":
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <checkstyle version="10.9.3">
> </checkstyle>
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to