You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by GitBox <gi...@apache.org> on 2019/01/13 15:05:58 UTC

[maven-dependency-plugin] Diff for: [GitHub] rfscholte closed pull request #9: [MDEP-586] Unpacking different resources into different location from the same artifact do work.

diff --git a/pom.xml b/pom.xml
index 5496cb4..895e884 100644
--- a/pom.xml
+++ b/pom.xml
@@ -400,7 +400,7 @@ under the License.
           <plugin>
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>mrm-maven-plugin</artifactId>
-            <version>1.0.0</version>
+            <version>1.2.0</version>
             <executions>
               <execution>
                 <goals>
diff --git a/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource1.txt b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource1.txt
new file mode 100644
index 0000000..53e657c
--- /dev/null
+++ b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource1.txt
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+Resource 1
diff --git a/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource2.txt b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource2.txt
new file mode 100644
index 0000000..132d211
--- /dev/null
+++ b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource2.txt
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+Resource 2
diff --git a/src/it/mrm/repository/ResourceArtifact-1.0.pom b/src/it/mrm/repository/ResourceArtifact-1.0.pom
new file mode 100644
index 0000000..322146d
--- /dev/null
+++ b/src/it/mrm/repository/ResourceArtifact-1.0.pom
@@ -0,0 +1,30 @@
+<?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>org.apache.maven.its.dependency</groupId>
+    <artifactId>ResourceArtifact</artifactId>
+    <version>1.0</version>
+    <packaging>jar</packaging>
+
+</project>
\ No newline at end of file
diff --git a/src/it/projects/mdep-586-unpacking-resources/pom.xml b/src/it/projects/mdep-586-unpacking-resources/pom.xml
new file mode 100644
index 0000000..2cf1e58
--- /dev/null
+++ b/src/it/projects/mdep-586-unpacking-resources/pom.xml
@@ -0,0 +1,78 @@
+<?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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.maven.plugins.dependency.its</groupId>
+    <artifactId>mdep-586-unpacking-resource</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <description>Unpacking different files in the same JAR in different locations</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.maven.its.dependency</groupId>
+            <artifactId>ResourceArtifact</artifactId>
+            <version>1.0</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>@project.version@</version>
+                <executions>
+                    <execution>
+                        <id>unpack-resource1</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>ResourceArtifact</includeArtifactIds>
+                            <includes>resource1.txt</includes>
+                            <outputDirectory>resources1</outputDirectory>
+                            <markersDirectory>
+                                ${project.build.directory}/resource1/dependency-maven-plugin-markers
+                            </markersDirectory>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>unpack-resource2</id>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeArtifactIds>ResourceArtifact</includeArtifactIds>
+                            <includes>resource2.txt</includes>
+                            <outputDirectory>resources2</outputDirectory>
+                            <markersDirectory>
+                                ${project.build.directory}/resource2/dependency-maven-plugin-markers
+                            </markersDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
diff --git a/src/it/projects/mdep-586-unpacking-resources/verify.groovy b/src/it/projects/mdep-586-unpacking-resources/verify.groovy
new file mode 100644
index 0000000..a358498
--- /dev/null
+++ b/src/it/projects/mdep-586-unpacking-resources/verify.groovy
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+File file = new File( basedir, "build.log" );
+assert file.isFile();
+
+File file1 = new File( basedir, "resources1/resource1.txt" )
+assert file1.isFile()
+
+File file2 = new File( basedir, "resources2/resource2.txt" )
+assert file2.isFile()
\ No newline at end of file


With regards,
Apache Git Services