You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jayshao <ja...@shao.org> on 2010/06/09 18:59:11 UTC

Question re: inheritance of declarations in pom.xml

Hi everyone, was wondering if anyone can shed some light on inheritance of
the <build><resources> elements in pom.xml as relates to resource processing
and the WAR plugin.

The documentation for the pom [1] has resources listed under "Elements in
the POM that are merged". Some experimentation on my local poms against
maven 2.2.1 don't appear to exhibit that behavior. What I see is it looks
like <resources> is inherited by child projects (in a multi-module build),
but that if any of those projects have their own <resources> block it
replaces the parent, not merged. Is that correct?

Example:

parent-pom.xml
|
|-> child-pom.xml

== 

The following works as I'd expect, with files in dev not included in a final
WAR.

parent-pom.xml

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>${dev-config.path}</exclude>
                </excludes>
            </resource>
        <resources>

child-pom.xml

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>${dev-config.path}</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/rules</directory>
            </resource>
            <resource>
                <directory>src/test/rules</directory>
            </resource>
        </resources>

== 

The following change to the child (removing any declaration for
src/main/resources) appears to result in src/main/resource not being
considered during process-resources, not inheriting from the parent as I'd
expected.

Any help appreciated,
Jason

[1] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
s
-- 
View this message in context: http://maven-users.828.n2.nabble.com/Question-re-inheritance-of-resources-declarations-in-pom-xml-tp5159433p5159433.html
Sent from the maven users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org