Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to config sub module target dir #4

Open
shaunthegeek opened this issue Nov 21, 2022 · 5 comments
Open

how to config sub module target dir #4

shaunthegeek opened this issue Nov 21, 2022 · 5 comments

Comments

@shaunthegeek
Copy link

now docs is one target dir:

<violation>
  <parser>CHECKSTYLE</parser>
  <reporter>Checkstyle</reporter>
  <folder>.</folder>
  <pattern>.*/target/checkstyle-result\.xml$</pattern>
</violation>

does this plugin support sub module target dir?

such as:

JavaProject/
--pom.xml
--UserService/
----pom.xml
----target/checkstyle-result.xml
--WikiService/
----pom.xml
----target/checkstyle-result.xml

should I change the folder or pattern?

what's the "folder" config meaning?

@tomasbjerre
Copy link
Owner

Yes, and it looks like the regexp in your issue will match the reports in your issue.

Folder is the base dir to recursively look for matching files in.

@shaunthegeek
Copy link
Author

shaunthegeek commented Dec 7, 2022

no, it's only for root project, not for sub project:

<folder>.</folder>
<pattern>.*/target/pmd\.xml$</pattern>

image

and these are useless too:

<folder>.</folder>
<pattern>.*/.*/target/pmd\.xml$</pattern>
<folder>.</folder>
<pattern>.*/sub-project/target/pmd\.xml$</pattern>
or
<pattern>./sub-project/target/pmd\.xml$</pattern>
<folder>sub-project</folder>
<pattern>.*/target/pmd\.xml$</pattern>
<folder>./sub-project</folder>
<pattern>.*/target/pmd\.xml$</pattern>

image

@shaunthegeek
Copy link
Author

maven plugin failed, npx cli succeed:

npx violations-command-line -cc code-climate-report.json \
 -v "PMD" "." ".*/target/pmd\.xml$" "PMD"

image

@tomasbjerre
Copy link
Owner

Did you run mvn verify? And have the plugin run last. So that the analysis is done before the plugin parses it.

@shaunthegeek
Copy link
Author

sure, I have run mvn validate, and it outputs "success" but no report in multi-java-project.

in another single Java project, it's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants