I created the following simple test project:

test
  |--suba
  |    |
  |    pom.xml
  |--subb
  |    |
  |    pom.xml
  |
  pom.xml

-- test: pom.xml -------------------
<project>
  <modelVersion>4.0.0</modelVersion>

  <groupId>test</groupId>
  <artifactId>test</artifactId>
  <version>1.0-SNAPSHOT</version>
        
  <packaging>pom</packaging>

  <name>testparent</name>
        
  <modules>
    <module>suba</module>
    <module>subb</module>
  </modules>

  <build>
    <resources>
      <resource>
        <targetPath>myLocation/${groupId}/${artifactId}</targetPath>
        <directory>${basedir}</directory>
        <includes>
          <include>pom.xml</include>
        </includes>
      </resource>
    </resources>
  </build>
</project>
------------------------------------

-- suba: pom.xml -------------------
<project>
  <modelVersion>4.0.0</modelVersion>

  <parent>        
    <groupId>test</groupId>
    <artifactId>test</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>               

  <groupId>test</groupId>
  <artifactId>suba</artifactId>
  <version>1.0-SNAPSHOT</version>
        
  <packaging>jar</packaging>
        
  <name>suba</name>
</project>
------------------------------------

-- subb: pom.xml -------------------
<project>
  <modelVersion>4.0.0</modelVersion>

  <parent>        
    <groupId>test</groupId>
    <artifactId>test</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>               

  <groupId>test</groupId>
  <artifactId>subb</artifactId>
  <version>1.0-SNAPSHOT</version>
        
  <packaging>jar</packaging>
        
  <name>suba</name>
</project>
------------------------------------

When I do:

$cd test
$mvn resources:resources

the defined resource for the pom gets copied to the respective subprojects target/classes/myLocation/${groupId}/${artifactId}.

Is this the behaviour you want? In the test project this works without any 
problem.

-Tim


G. B. schrieb:
Oups ...
here is what I did :
in my main pom I added:
<resources>
        <resource>
                <targetPath>myLocation/${groupId}/${artifactId}</targetPath>
                <directory>${basedir}</directory>
                <includes>
                        <include>pom.xml</include>
                </includes>
        </resource>
</resources>
When I run that on component A that contains sub component B and C nothing
appends ...
when I run it on B or C I get it done ... I want that to be inherited and
when executed from A I wand B and C copying the pom :o(

any idea ?
Guillaume


John Casey-3 wrote:
why not add a <resource/> with the directory pointed at ${basedir}, and a
single include of pom.xml with excludes of **/*?

Then, your pom would be copied into target/classes on prepare-resources,
IIRC.

-john


--
View this message in context: 
http://www.nabble.com/Is-execution-inheritance-working--t1438786.html#a3895618
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to