Author: krosenvold
Date: Fri Nov 14 17:32:14 2014
New Revision: 1639709

URL: http://svn.apache.org/r1639709
Log:
[MASSEMBLY-733] Finalname missing for fileitems.

Testcase submitted byt Christian Schulte, fixed by me

Added:
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/pom.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/main/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/main/assembly/
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/main/assembly/bin.xml
    
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/verify.bsh
Modified:
    
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/AssemblyProxyArchiver.java

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/pom.xml?rev=1639709&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/pom.xml
 Fri Nov 14 17:32:14 2014
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>localhost</groupId>
+  <artifactId>MASSEMBLY-733</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-assembly-plugin</artifactId>
+          <version>${testVersion}</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>single</goal>
+              </goals>
+              <configuration>
+                <finalName>my-final-name</finalName>
+                <descriptors>
+                  <descriptor>src/main/assembly/bin.xml</descriptor>
+                </descriptors>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-assembly-plugin</artifactId>
+      </plugin>
+    </plugins>
+
+  </build>
+</project>

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/main/assembly/bin.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/main/assembly/bin.xml?rev=1639709&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/main/assembly/bin.xml
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/src/main/assembly/bin.xml
 Fri Nov 14 17:32:14 2014
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+--><assembly 
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1
 http://maven.apache.org/xsd/assembly-1.1.1.xsd";>
+  <id>bin</id>
+
+  <formats>
+    <format>dir</format>
+  </formats>
+
+  <files>
+    <file>
+      <outputDirectory>/root</outputDirectory>
+      <source>src/main/assembly/bin.xml</source>
+    </file>
+  </files>
+
+</assembly>

Added: 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/verify.bsh
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/verify.bsh?rev=1639709&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/verify.bsh
 (added)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-733/verify.bsh
 Fri Nov 14 17:32:14 2014
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.*;
+import java.net.*;
+import java.util.jar.*;
+
+boolean result = true;
+
+try
+{
+    result = new File( basedir, 
"target/my-final-name-bin/my-final-name/root/bin.xml" ).exists();
+}
+catch( IOException e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

Modified: 
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/AssemblyProxyArchiver.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/AssemblyProxyArchiver.java?rev=1639709&r1=1639708&r2=1639709&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/AssemblyProxyArchiver.java
 (original)
+++ 
maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugin/assembly/archive/archiver/AssemblyProxyArchiver.java
 Fri Nov 14 17:32:14 2014
@@ -950,7 +950,7 @@ public class AssemblyProxyArchiver
             inPublicApi.set( Boolean.TRUE );
             try
             {
-                delegate.addResource( resource, destFileName, permissions );
+                delegate.addResource( resource, rootPrefix + destFileName, 
permissions );
             }
             finally
             {


Reply via email to