views:

758

answers:

2

I have a super pom defined in which I specify a "resources" directory for resources. In one of my projects, my pom extends that super pom, and I would like to add an additional resource. I tried:

 <resources>
  <resource>
   <targetPath>/</targetPath>
   <directory>additionalDir</directory>    
  </resource>
 </resources>

But that results in only additionalDir being in the resources and does not include the super pom's resources. Is there a way to extend the super pom's resources?

+4  A: 

The behaviour you've described is expected.

Remember that your super POM is inheriting from Maven's default POM and pretty much any plugin that you define in your pom effectively overrides the setting in the default POM. As an example, to enable filtering on the default resource, you have to specify the path in your POM. You do this:

<resources>
  <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
  </resource>
</resources>

Not this:

<resources>
  <resource>
    <filtering>true</filtering>
  </resource>
</resources>

The default directory does not bubble up for you, even if you've specified it there. There might be a special MOJO to do it for you, but I couldn't find one.

Mike Cornell
thank you for clarifying.
Jeff Storey