jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Assembly Plugin
  • MASSEMBLY-179

Assembled jar includes artifact names in path

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 2.2
  • Fix Version/s: 2.2-beta-2
  • Labels:
    None

Description

This issue does not occur in 2.1 and began occurring in 2.2-SNAPSHOT (roughly) a couple months ago.
After assembling a jar, the path for each of the included files begins with what seems to be ${artifactId}-${version}.${packaging}
This includes files from dependent jars and files from sub-modules - all files.
The plugin is configured in the POM as follows:
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>1</id>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</execution>
</executions>
<version>2.2-SNAPSHOT</version>
<configuration>
<descriptor>assembly.xml</descriptor>
</configuration>
</plugin>
</plugins>
</build>
The entire assembly.xml is as follows:
<assembly>
<id>dependencies</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>

Issue Links

supercedes

Bug - A problem which impairs or prevents the functions of the product. MASSEMBLY-162 In a multiproject environment, assembly takes wrong dependencies

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Henri Tremblay added a comment - 22/Jan/07 7:46 PM

I think I've encountered the same issue. I use, in 2.1, to have a jar containing a merge of jars from submodules. No, inside the final jar, there is a root dir for project.

e.g.:

parent
sub-x
sub-y

will create a jar containing:

sub-x-0.1/.../my classes from sub-x
sub-y-0.1/.../my classes from sub-y

For <sources/>, the solution was to add <includeModuleDirectory>false</includeModuleDirectory> but it isn't supported for <binaries>. If definetly should and it it quite critical... I can't build my application anymore with this plugin.

Show
Henri Tremblay added a comment - 22/Jan/07 7:46 PM I think I've encountered the same issue. I use, in 2.1, to have a jar containing a merge of jars from submodules. No, inside the final jar, there is a root dir for project. e.g.: parent sub-x sub-y will create a jar containing: sub-x-0.1/.../my classes from sub-x sub-y-0.1/.../my classes from sub-y For <sources/>, the solution was to add <includeModuleDirectory>false</includeModuleDirectory> but it isn't supported for <binaries>. If definetly should and it it quite critical... I can't build my application anymore with this plugin.
Hide
Permalink
Milos Volauf added a comment - 25/Jan/07 3:03 AM

I found this issue too.

Workaround:

<dependencySet>
<outputDirectory>/</outputDirectory>
<unpack>true</unpack>

<!-- use this empty name if using maven-assembly-plugin 2.2-SNAPSHOT,
otherwise the artifacts are unpacked into unwanted subfolders -->
<outputFileNameMapping/>

<scope>runtime</scope>
</dependencySet>

Show
Milos Volauf added a comment - 25/Jan/07 3:03 AM I found this issue too. Workaround: <dependencySet> <outputDirectory>/</outputDirectory> <unpack>true</unpack> <!-- use this empty name if using maven-assembly-plugin 2.2-SNAPSHOT, otherwise the artifacts are unpacked into unwanted subfolders --> <outputFileNameMapping/> <scope>runtime</scope> </dependencySet>
Hide
Permalink
Jonathan Komorek added a comment - 25/Jan/07 12:41 PM

Thanks Milos, that workaround works perfectly for me.

Shall I close this issue then, or does anyone believe that this is still an "issue"?

Show
Jonathan Komorek added a comment - 25/Jan/07 12:41 PM Thanks Milos, that workaround works perfectly for me. Shall I close this issue then, or does anyone believe that this is still an "issue"?
Hide
Permalink
Milos Volauf added a comment - 26/Jan/07 3:58 AM

I think it is an issue because:
1. the behavior is different than in 2.1 assembly plugin
2. as far as I know it is not documented

I had this problem when I switched from 2.1 to 2.2-SNAPSHOT.
I assume that when 2.2 will be released, people will have problems.
So it should be either corrected so that it works as in 2.1,
or it should be documented (with red color )...

Show
Milos Volauf added a comment - 26/Jan/07 3:58 AM I think it is an issue because: 1. the behavior is different than in 2.1 assembly plugin 2. as far as I know it is not documented I had this problem when I switched from 2.1 to 2.2-SNAPSHOT. I assume that when 2.2 will be released, people will have problems. So it should be either corrected so that it works as in 2.1, or it should be documented (with red color )...
Hide
Permalink
Henri Tremblay added a comment - 26/Jan/07 6:42 PM

I totally agree with Milos. It works but assuming that it's a maybe useful regression, it should at least be heavily documented.

Show
Henri Tremblay added a comment - 26/Jan/07 6:42 PM I totally agree with Milos. It works but assuming that it's a maybe useful regression, it should at least be heavily documented.
Hide
Permalink
Patrick Kimber added a comment - 22/Jun/07 9:45 AM

I have a sample project which reproduces this issue. Let me know if you want me to attach a copy.

Show
Patrick Kimber added a comment - 22/Jun/07 9:45 AM I have a sample project which reproduces this issue. Let me know if you want me to attach a copy.
Hide
Permalink
John Casey added a comment - 25/Jun/07 9:49 AM

dependency sets with unpack == true no longer use <outputFileNameMapping/> at all.

Show
John Casey added a comment - 25/Jun/07 9:49 AM dependency sets with unpack == true no longer use <outputFileNameMapping/> at all.

People

  • Assignee:
    John Casey
    Reporter:
    Jonathan Komorek
Vote (3)
Watch (3)

Dates

  • Created:
    22/Jan/07 10:17 AM
    Updated:
    01/Feb/08 10:37 AM
    Resolved:
    25/Jun/07 9:49 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.