Read descriptor file is the same when plugin is ran twice
---------------------------------------------------------

                 Key: MASSEMBLY-454
                 URL: http://jira.codehaus.org/browse/MASSEMBLY-454
             Project: Maven 2.x Assembly Plugin
          Issue Type: Bug
    Affects Versions: 2.2-beta-4
         Environment: Maven 2.2.1, Multi-Module project
            Reporter: Johnathan gifford


Our module's pom.xml file has two calls to the assembly plugin. The first to 
the plugin happens in the prepare-package lifecycle phase and calls the 
archive-tests.xml assembly descriptor.  The second call to the plugin happens 
in the package phase and calls the archive-dependencies.xml assembly 
descriptor.  

This looks like:

<plugin>
  <!-- Plugin for facilitating the packaging of test artifacts in the ear -->
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <id>copy-test-jars-to-ear</id>
      <phase>prepare-package</phase>
      <goals>
        <goal>directory-single</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <descriptors>
      <descriptor>${basedir}/src/assemble/archive-tests.xml</descriptor>
    </descriptors>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-assembly-plugin</artifactId>
  <executions>
    <execution>
      <id>dependencies</id>
      <phase>package</phase>
      <goals>
        <goal>single</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <descriptors>
      <descriptor>${basedir}/src/assemble/archive-dependencies.xml</descriptor>
    </descriptors>
  </configuration>
</plugin>

When the mvn package is ran, we see the follow output from the two assembly 
plugin calls:

[INFO] [assembly:directory-single {execution: copy-test-jars-to-ear}]
[INFO] Reading assembly descriptor: 
D:\workspace\TMS\applications\tms/src/assemble/archive-tests.xml
[INFO] Copying files to 
D:\workspace\TMS\applications\tms\target\tms-3.17.0-SNAPSHOT-copy-test-jars-to-ear
[INFO] [assembly:single {execution: dependencies}]
[INFO] Reading assembly descriptor: 
D:\workspace\TMS\applications\tms/src/assemble/archive-tests.xml

As you can see both the plugin executed twice (and in the proper sequence).  
However, the second call of assembly plugin reads the descriptor file reference 
from the first execution of the plug-in (archive-tests.xml), not the current 
one (archive-dependencies.xml)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to