You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2019/01/12 18:46:29 UTC

[maven-dependency-plugin] 02/04: Setup ResourceArtifact-1.0.jar as a mock JAR to be dealt with mrm-maven-plugin.

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MDEP-586
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit 36b1d3f39c780d626745fc38130a64a0406c8746
Author: Andre Tadeu de Carvalho <an...@gmail.com>
AuthorDate: Fri Jan 11 15:31:06 2019 -0200

    Setup ResourceArtifact-1.0.jar as a mock JAR to be dealt with mrm-maven-plugin.
---
 .../ResourceArtifact-1.0.pom                       |  30 +++++++++++++++++++++
 .../ResourceArtifact-1.0.jar/resource1.txt}        |  27 +------------------
 .../ResourceArtifact-1.0.jar/resource2.txt}        |  27 +------------------
 .../ResourceArtifact/1.0/ResourceArtifact-1.0.jar  | Bin 604 -> 0 bytes
 .../projects/mdep-586-unpacking-resources/pom.xml  |   9 +------
 .../mdep-586-unpacking-resources/verify.groovy     |  26 ++++--------------
 6 files changed, 38 insertions(+), 81 deletions(-)

diff --git a/src/it/mrm/repository/ResourceArtifact-1.0.jar/ResourceArtifact-1.0.pom b/src/it/mrm/repository/ResourceArtifact-1.0.jar/ResourceArtifact-1.0.pom
new file mode 100644
index 0000000..322146d
--- /dev/null
+++ b/src/it/mrm/repository/ResourceArtifact-1.0.jar/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/verify.groovy b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource1.txt
similarity index 57%
copy from src/it/projects/mdep-586-unpacking-resources/verify.groovy
copy to src/it/mrm/repository/ResourceArtifact-1.0.jar/resource1.txt
index ad9e168..53e657c 100644
--- a/src/it/projects/mdep-586-unpacking-resources/verify.groovy
+++ b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource1.txt
@@ -17,29 +17,4 @@
  * under the License.
  */
 
-File file = new File( basedir, "build.log" );
-assert file.exists();
-
-try
-{
-    File file1 = new File( basedir, "resources1/resource1.txt" )
-    if ( !file1.exists() || !file1.isFile() )
-    {
-        println( "Error: cannot open file resources1/resource1.txt" )
-        return false
-    }
-    File file2 = new File( basedir, "resources2/resource2.txt" )
-    if ( !file2.exists() || !file2.isFile() )
-    {
-        println( "Error: cannot open file resources2/resource2.txt" )
-        return false
-    }
-}
-catch ( Throwable e )
-{
-    e.printStackTrace()
-    return false;
-}
-
-
-return true
\ No newline at end of file
+Resource 1
diff --git a/src/it/projects/mdep-586-unpacking-resources/verify.groovy b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource2.txt
similarity index 57%
copy from src/it/projects/mdep-586-unpacking-resources/verify.groovy
copy to src/it/mrm/repository/ResourceArtifact-1.0.jar/resource2.txt
index ad9e168..132d211 100644
--- a/src/it/projects/mdep-586-unpacking-resources/verify.groovy
+++ b/src/it/mrm/repository/ResourceArtifact-1.0.jar/resource2.txt
@@ -17,29 +17,4 @@
  * under the License.
  */
 
-File file = new File( basedir, "build.log" );
-assert file.exists();
-
-try
-{
-    File file1 = new File( basedir, "resources1/resource1.txt" )
-    if ( !file1.exists() || !file1.isFile() )
-    {
-        println( "Error: cannot open file resources1/resource1.txt" )
-        return false
-    }
-    File file2 = new File( basedir, "resources2/resource2.txt" )
-    if ( !file2.exists() || !file2.isFile() )
-    {
-        println( "Error: cannot open file resources2/resource2.txt" )
-        return false
-    }
-}
-catch ( Throwable e )
-{
-    e.printStackTrace()
-    return false;
-}
-
-
-return true
\ No newline at end of file
+Resource 2
diff --git a/src/it/projects/mdep-586-unpacking-resources/lib/test/ResourceArtifact/1.0/ResourceArtifact-1.0.jar b/src/it/projects/mdep-586-unpacking-resources/lib/test/ResourceArtifact/1.0/ResourceArtifact-1.0.jar
deleted file mode 100644
index 7c41edc..0000000
Binary files a/src/it/projects/mdep-586-unpacking-resources/lib/test/ResourceArtifact/1.0/ResourceArtifact-1.0.jar and /dev/null differ
diff --git a/src/it/projects/mdep-586-unpacking-resources/pom.xml b/src/it/projects/mdep-586-unpacking-resources/pom.xml
index 8733381..2cf1e58 100644
--- a/src/it/projects/mdep-586-unpacking-resources/pom.xml
+++ b/src/it/projects/mdep-586-unpacking-resources/pom.xml
@@ -30,19 +30,12 @@ under the License.
 
     <dependencies>
         <dependency>
-            <groupId>test</groupId>
+            <groupId>org.apache.maven.its.dependency</groupId>
             <artifactId>ResourceArtifact</artifactId>
             <version>1.0</version>
         </dependency>
     </dependencies>
 
-    <repositories>
-        <repository>
-            <id>lib</id>
-            <url>file:${project.basedir}/lib</url>
-        </repository>
-    </repositories>
-
     <build>
         <plugins>
             <plugin>
diff --git a/src/it/projects/mdep-586-unpacking-resources/verify.groovy b/src/it/projects/mdep-586-unpacking-resources/verify.groovy
index ad9e168..b771bf3 100644
--- a/src/it/projects/mdep-586-unpacking-resources/verify.groovy
+++ b/src/it/projects/mdep-586-unpacking-resources/verify.groovy
@@ -18,28 +18,12 @@
  */
 
 File file = new File( basedir, "build.log" );
-assert file.exists();
+assert file.isFile();
 
-try
-{
-    File file1 = new File( basedir, "resources1/resource1.txt" )
-    if ( !file1.exists() || !file1.isFile() )
-    {
-        println( "Error: cannot open file resources1/resource1.txt" )
-        return false
-    }
-    File file2 = new File( basedir, "resources2/resource2.txt" )
-    if ( !file2.exists() || !file2.isFile() )
-    {
-        println( "Error: cannot open file resources2/resource2.txt" )
-        return false
-    }
-}
-catch ( Throwable e )
-{
-    e.printStackTrace()
-    return false;
-}
+File file1 = new File( basedir, "resources1/resource1.txt" )
+assert file1.isFile()
 
+File file2 = new File( basedir, "resources2/resource2.txt" )
+assert file2.isFile()
 
 return true
\ No newline at end of file