Affects Version/s: 2.2-beta-3
Fix Version/s: 2.2-beta-3
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)
Maven version: 2.0.9
Java version: 1.6.0_10
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"ShowWindows XP, java version "1.6.0_11" Java(TM) SE Runtime Environment (build 1.6.0_11-b03) Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing) Maven version: 2.0.9 Java version: 1.6.0_10 OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
Number of attachments :
I found this issue when trying to create an ear file with the maven-assembly version 2.2-beta-3 unreleased version.
I used this configration xml:
and this is my pom.xml:
When executing it on Linux it all works fine, but when executing it on Windows I get the cactus file included with a leading slash (see the screenshot).
I found that the execution flow goes this way:
AbstractAssemblyMojo (line 354) -> DefaultAssemblyArchiver (line 187) -> FileSetAssemblyPhase (line 69) -> AddFileSetsTask (line 87/167) -> AddDirectoryTask (line 116) -> AssemblyProxyArchiver (line 705)
On this line we create a PrefixedFileSet and pass the rootPrefix to be '', which is fine. But if we look into the constructor of the PrefixedFileSetArchiver we see that it checks to see if the rootPrefix ends with a / symbol and in case it doesn't it adds one. Which is exactly our case. I think the PrefixedFileSet needs to check also to see if the root prefix is not ''.
I attach a patch that needs to be applied. With this patch it all works well.
I am sorry for not being able to provide an integration test. I will be able to provide integration test in a 7-day period if this is fine.