You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Johnathan gifford (JIRA)" <ji...@codehaus.org> on 2009/12/02 23:25:57 UTC

[jira] Created: (MASSEMBLY-454) Read descriptor file is the same when plugin is ran twice

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

        

[jira] Commented: (MASSEMBLY-454) Read descriptor file is the same when plugin is ran twice

Posted by "Johnathan Gifford (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MASSEMBLY-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=200374#action_200374 ] 

Johnathan Gifford commented on MASSEMBLY-454:
---------------------------------------------

That worked. However, I need to control the first execution of the plugin through a profile so we can control test jars and dependency inclusions in the ear from a production ready ear.  

Any ideas how to make that work?  If not, could you re-open the issue and move the priority from Major to something else. 

> 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
>            Assignee: Benjamin Bentmann
>
> 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

        

[jira] Closed: (MASSEMBLY-454) Read descriptor file is the same when plugin is ran twice

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MASSEMBLY-454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MASSEMBLY-454.
---------------------------------------

    Resolution: Not A Bug
      Assignee: Benjamin Bentmann

You must not declare the same plugin twice in your POM. Use one {{<plugin>}} block with two {{<executions>}} and move the {{<configuration>}} into the respective {{<execution>}} block.

> 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
>            Assignee: Benjamin Bentmann
>
> 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

        

[jira] Commented: (MASSEMBLY-454) Read descriptor file is the same when plugin is ran twice

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MASSEMBLY-454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=200380#action_200380 ] 

Benjamin Bentmann commented on MASSEMBLY-454:
---------------------------------------------

For questions about plugin usage and configuration, please contact the [user list|http://maven.apache.org/mail-lists.html].

As for this issue, there is no use in re-opening it. Not having two or more declarations of the same plugin in the {{<build>}} section is a restriction of the Maven core, it's not related to any plugin.

> 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
>            Assignee: Benjamin Bentmann
>
> 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