0

I have a multi module project:

grandparent module
     > parent module
        > child module
     > parent module

When I run the maven command I will execute like this

c:\projects\myproject\grandparent module\mvn package

I have defined my PDM configuration in the grandparent module.

                <rulesets>
                   <ruleset>${basedir}/pmd-ruleset.xml</ruleset>
                </rulesets>

The trouble is that every project needs to have pmd-ruleset.xml. I want to put it in the grandparent module and for all project to use it from here.

how can I achieve that?

jax
  • 37,735
  • 57
  • 182
  • 278
  • Have just had a brief search in SO, seems similar questions has been asked before: http://stackoverflow.com/questions/14885048/share-specific-pmd-rulesets-across-multi-module-maven-project – Adrian Shum Sep 03 '13 at 05:57

1 Answers1

0

The way to share a PMD, checkstyle, findbugs, and etc configuration across a multi-module Maven project is similar. You may visit Checkstyle Maven plugin for the detail.

http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html

In short, in Maven, resources are not inherited from parent project. You can create a separate module to contain all these shared QA configurations, and use this QA module as the dependency in other child modules to execute the PMD/Checkstyle/Findbugs plugins.

Adrian Shum
  • 38,812
  • 10
  • 83
  • 131