You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Costin Caraivan (JIRA)" <ji...@codehaus.org> on 2008/12/19 09:58:19 UTC
[jira] Created: (MNG-3923) Executions do not pick up configurations
per execution element (except for the first one)
Executions do not pick up configurations per execution element (except for the first one)
-----------------------------------------------------------------------------------------
Key: MNG-3923
URL: http://jira.codehaus.org/browse/MNG-3923
Project: Maven 2
Issue Type: Bug
Components: Artifacts and Repositories, General, Plugins and Lifecycle, POM
Affects Versions: 2.0.9
Environment: Windows XP SP2, Java 1.5.0.11
Reporter: Costin Caraivan
Priority: Minor
I'm running a
mvn clean install -Dintegration (I have a profile which is activated by the property named "integration").
I wanted to set 2 different configuration sections in 2 different execution sections for the jar plugin, because I need to make a jar and embed it in another jar (PS: I know it's not exactly kosher, but due to various limitations it's the only solutions I could use). So I make 2 jars at different lifecycle phases:
<!-- Make the jar out of the compiled classes. Must be done BEFORE packaging, so it can be included in the greater jar. -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>jar-classes</id>
<!-- The jaring must be done at the compile phase, so we can have the jar ready for packaging in the greater jar. -->
<phase>compile</phase>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<finalName>external</finalName>
</configuration>
<goals>
<goal>jar</goal>
</goals>
</execution>
<execution>
<id>jar-all</id>
<!-- This is the greater jar: classes jar + resources. -->
<phase>package</phase>
<!-- This configuration section is ignored (bug? my error?) -->
<configuration>
<archive>
<manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
<goals>
<goal>jar</goal>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
However, the second jar does not get the required manifest - ergo, the configuration does not work. I worked around it by calling the plugin twice, but I don't think this is correct (if the configuration can be placed there, i presume that you should be able to configure each execution separately). The first jar is ok, so its configuration is picked up.
Regards.
--
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: (MNG-3923) Executions do not pick up configurations
per execution element (except for the first one)
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter closed MNG-3923.
-----------------------------
Assignee: Brett Porter
Resolution: Not A Bug
the jar is created in the main lifecycle, and the second execution is recreating it. However, the JAR is up to date, so nothing is done.
Instead, add:
<forceCreation>true</forceCreation> to the second version.
Or, you can add the manifest creation to the main plugin configuration, though you'll need to unset that for the extra execution.
> Executions do not pick up configurations per execution element (except for the first one)
> -----------------------------------------------------------------------------------------
>
> Key: MNG-3923
> URL: http://jira.codehaus.org/browse/MNG-3923
> Project: Maven 2
> Issue Type: Bug
> Components: Artifacts and Repositories, General, Plugins and Lifecycle, POM
> Affects Versions: 2.0.9
> Environment: Windows XP SP2, Java 1.5.0.11
> Reporter: Costin Caraivan
> Assignee: Brett Porter
> Priority: Minor
>
> I'm running a
> mvn clean install -Dintegration (I have a profile which is activated by the property named "integration").
> I wanted to set 2 different configuration sections in 2 different execution sections for the jar plugin, because I need to make a jar and embed it in another jar (PS: I know it's not exactly kosher, but due to various limitations it's the only solutions I could use). So I make 2 jars at different lifecycle phases:
> <!-- Make the jar out of the compiled classes. Must be done BEFORE packaging, so it can be included in the greater jar. -->
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <executions>
> <execution>
> <id>jar-classes</id>
> <!-- The jaring must be done at the compile phase, so we can have the jar ready for packaging in the greater jar. -->
> <phase>compile</phase>
> <configuration>
> <outputDirectory>${project.build.outputDirectory}</outputDirectory>
> <finalName>external</finalName>
> </configuration>
> <goals>
> <goal>jar</goal>
> </goals>
> </execution>
> <execution>
> <id>jar-all</id>
> <!-- This is the greater jar: classes jar + resources. -->
> <phase>package</phase>
> <!-- This configuration section is ignored (bug? my error?) -->
> <configuration>
> <archive>
> <manifestFile>${basedir}/META-INF/MANIFEST.MF</manifestFile>
> </archive>
> </configuration>
> <goals>
> <goal>jar</goal>
> <goal>sign</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> However, the second jar does not get the required manifest - ergo, the configuration does not work. I worked around it by calling the plugin twice, but I don't think this is correct (if the configuration can be placed there, i presume that you should be able to configure each execution separately). The first jar is ok, so its configuration is picked up.
> Regards.
--
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