apache / apache/maven-checkstyle-plugin

[MCHECKSTYLE-379] checkstyle-aggregate with multi source directories doesn't work

Open
#291 0 comments 0 reactions 0 assignees View on GitHub
bug priority:major
Dominant language
Java
Stars
97
Forks
67
Avg merge
14h 50m
Merged PRs (30d)
6

Description

**[Crest](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=didierc)** opened **[MCHECKSTYLE-379](https://issues.apache.org/jira/browse/MCHECKSTYLE-379?redirect=false)** and commented

Dear Sir or Madam,

 

While using the feature of checkstyle-aggregate to generate the report with two sub module maven, the report is only displaying the Java files of the "src/main/java" sub folder in the Project Documentation/Project Reports/Checkstyle on the aggregate report.

The report for the individual sub module in Project Documentation/Project Reports/Checkstyle is diplaying both Java file from the "src/main/java" and the "gen/main/java".

It would be expected that the aggregate report would contain all the Java files described in each of the sub modules.

I added the new source folder (gen/main/java) in children poms with the plugin "build-helper-maven-plugin".

I also tried different configuration with the sourceDirectories tag without success.

I think my problem is that the aggregate report is generated with the parent module before the build-helper-maven-plugin phase to add source folders in children pom.

I attached an example that is highlighting the undesired behavior. The cli is "mvn -Pcheckstyle clean compile site"

It seems to me that the observed behavior is not aligned with the expected functionality of the plugin. I could not find a work around or an alternative to obtain the desired aggregate functionality.

 

Kind Regards,

 

---

**Affects:** 3.1.0

**Attachments:**
- [checkstyle-aggregate-multi-source-folder.tgz](https://issues.apache.org/jira/secure/attachment/12980733/checkstyle-aggregate-multi-source-folder.tgz) (_2.14 kB_)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attached checkstyle-aggregate-multi-source-folder.tgz reproducer and run `mvn -Pcheckstyle clean compile site`. Compare the aggregate report with the individual module reports, focusing on the `src/main/java` and `gen/main/java` source directories; done means the aggregate report includes all Java files from each submodule.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.