Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.2-beta-3
-
Fix Version/s: 2.2-beta-3
-
Component/s: None
-
Labels:None
-
Environment:HideWindows 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"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 :
Description
Hi guys,
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:
<assembly>
<id>bin</id>
<formats>
<format>ear</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>cactus.samples.ejb-1.8.1-SNAPSHOT.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
and this is my pom.xml:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-3-SNAPSHOT</version>
<executions>
<execution>
<id>create-cactus-archive</id>
<phase>pre-integration-test</phase>
<configuration>
<descriptors>
<descriptor>src/main/app/main.xml</descriptor>
</descriptors>
<archiverConfig>
<appxml>src/main/app/application.xml</appxml>
</archiverConfig>
</configuration>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
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.
Thanks.
This is the patch for the issue.