Maven 2.x Assembly Plugin

Custom manifest attributres are ignored.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.1
  • Fix Version/s: 2.2-beta-2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP SP2
    Java JDK 1.5.0_07
    Maven 2.0.4
  • Number of attachments :
    2

Description

Configure custom manifest entry in pom.xml
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.1</version>
<inherited>false</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${basedir}/src/main/assembly/install.xml</descriptor>
</descriptors>
<outputDirectory>${project.build.directory}</outputDirectory>
<workDirectory>${project.build.directory}/assembly/work</workDirectory>
<archive>
<manifest>
<mainClass>com.company.Install</mainClass>
</manifest>
<manifestEntries>
<mode>development</mode>
</manifestEntries>
</archive>
</configuration>
</execution>
</executions>
</plugin>
Custom manifest entry "mode" does not appear in jar manifest (although main class entry does).

Issue Links

Activity

Hide
John Casey added a comment -

Fixed version should be hitting snapshot repository in a minute.

Show
John Casey added a comment - Fixed version should be hitting snapshot repository in a minute.
Hide
Bernd added a comment -

I can't get that fix to work.

I assume maven downloads the respective snapshot:

[DEBUG] maven-assembly-plugin: resolved to version 2.2-20070112.063452-32 from repository apache.org
...
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-assembly-plugin:2.2-SNAPSHOT:assembly' -->

It finds my custom attribute:
[DEBUG] (f) manifestEntries = {mode=development}

but they still do not appear in the assembly.

What is wrong?

Show
Bernd added a comment - I can't get that fix to work. I assume maven downloads the respective snapshot: [DEBUG] maven-assembly-plugin: resolved to version 2.2-20070112.063452-32 from repository apache.org ... [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-assembly-plugin:2.2-SNAPSHOT:assembly' --> It finds my custom attribute: [DEBUG] (f) manifestEntries = {mode=development} but they still do not appear in the assembly. What is wrong?
Hide
Bernd added a comment -

Attaching a testcase to hopefully make the problem reproducable.

run

mvn archetype:create -DgroupId=test -DartifactId=massembly121

modify the pom

  • add snapshot repo
  • add assembly config to add custom attributes to manifest

run

mvn clean package assembly:assembly

Then the assembly does not contain a manifest with custom attributes.

The zip contains the project, including the modified pom and the target dir.
In the project root is the output of mvn .X ... in file log.txt

Clearing the local repo does not help, no other repos involved.

Hopefully the helps to reproduce my problem.

Show
Bernd added a comment - Attaching a testcase to hopefully make the problem reproducable. run mvn archetype:create -DgroupId=test -DartifactId=massembly121 modify the pom
  • add snapshot repo
  • add assembly config to add custom attributes to manifest
run mvn clean package assembly:assembly Then the assembly does not contain a manifest with custom attributes. The zip contains the project, including the modified pom and the target dir. In the project root is the output of mvn .X ... in file log.txt Clearing the local repo does not help, no other repos involved. Hopefully the helps to reproduce my problem.
Hide
Bernd added a comment -

I retried on a freshly installed W2K,JDK1.5_10,mvn2.0.4 box and still the same problem.

It gets a snapshot:
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/plugins/maven-assembly-plugin/2.2-SNAPSHOT/maven-assembly-plugin-2.2-20070112.063452-32.jar

Is this the snapshot with the fix?

but no entries in the manifest file.

Show
Bernd added a comment - I retried on a freshly installed W2K,JDK1.5_10,mvn2.0.4 box and still the same problem. It gets a snapshot: Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/maven/plugins/maven-assembly-plugin/2.2-SNAPSHOT/maven-assembly-plugin-2.2-20070112.063452-32.jar Is this the snapshot with the fix? but no entries in the manifest file.
Hide
Brian Fox added a comment -

I added a test, can someone please verify if the test is valid?

I can not re-open it (not priviliges for me?) Can someone do that for me please? Or shall I open a new one and link to -121?

thanks

Bernd

Show
Brian Fox added a comment - I added a test, can someone please verify if the test is valid? I can not re-open it (not priviliges for me?) Can someone do that for me please? Or shall I open a new one and link to -121? thanks Bernd
Hide
Paul Gier added a comment -

Attaching a small change that seems to fix the issue without breaking any of the other tests.

Show
Paul Gier added a comment - Attaching a small change that seems to fix the issue without breaking any of the other tests.
Hide
John Casey added a comment -

brian: What's the test you added? Is it an IT, or a unit test, or...? I'll check this out, in addition to looking at the new patch.

Show
John Casey added a comment - brian: What's the test you added? Is it an IT, or a unit test, or...? I'll check this out, in addition to looking at the new patch.
Hide
John Casey added a comment -

Applied. Thanks!

Show
John Casey added a comment - Applied. Thanks!
Hide
Petar Tahchiev added a comment -

I am currently using 2.2-beta2 and it is STILL not fixed.

Show
Petar Tahchiev added a comment - I am currently using 2.2-beta2 and it is STILL not fixed.
Hide
Dennis Lundberg added a comment -

Petar, what is it that isn't working for you?
Can you please supply us with your configuration.

Show
Dennis Lundberg added a comment - Petar, what is it that isn't working for you? Can you please supply us with your configuration.
Hide
Petar Tahchiev added a comment -

I tried now with 2.1, 2.2-beta-1, 2.2-beta-2, 2.2-beta-3-SNAPSHOT from both the project root and the parent's directory and it works well.

You can go on and close the issue, sorry for my previous post.

Thanks, Petar.

Show
Petar Tahchiev added a comment - I tried now with 2.1, 2.2-beta-1, 2.2-beta-2, 2.2-beta-3-SNAPSHOT from both the project root and the parent's directory and it works well. You can go on and close the issue, sorry for my previous post. Thanks, Petar.

People

Vote (4)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: