Author: olamy
Date: Fri Oct 28 13:02:02 2011
New Revision: 1190291

URL: http://svn.apache.org/viewvc?rev=1190291&view=rev
Log:
[MDEP-331] Add to purge-local-repository goal ability to clean only snapshots.
add it test

Added:
    
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/
    
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/invoker.properties
   (with props)
    
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/pom.xml
   (with props)
    
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/setup.bsh
   (with props)
    
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/test.properties
   (with props)
    
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/validate.bsh
   (with props)

Added: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/invoker.properties?rev=1190291&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/invoker.properties
 (added)
+++ 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/invoker.properties
 Fri Oct 28 13:02:02 2011
@@ -0,0 +1 @@
+invoker.goals = 
${project.groupId}:${project.artifactId}:${project.version}:purge-local-repository

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/pom.xml?rev=1190291&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/pom.xml
 Fri Oct 28 13:02:02 2011
@@ -0,0 +1,52 @@
+<?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.its.dependency</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <name>Test</name>
+  <description>
+    Test dependency:purge-local-repository
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.dependency</groupId>
+      <artifactId>purged</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.its.dependency</groupId>
+      <artifactId>snap-purged</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+</project>

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/setup.bsh
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/setup.bsh?rev=1190291&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/setup.bsh
 (added)
+++ 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/setup.bsh
 Fri Oct 28 13:02:02 2011
@@ -0,0 +1,18 @@
+import java.io.*;
+
+File purgedJar = new File( localRepositoryPath, 
"org/apache/maven/its/dependency/purged/1.0/purged-1.0.jar" );
+
+purgedJar.getParentFile().mkdirs();
+purgedJar.createNewFile();
+
+System.out.println( "Created dummy JAR " + purgedJar );
+
+purgedJar = new File( localRepositoryPath, 
"org/apache/maven/its/dependency/snap-purged/1.0-SNAPSHOT/snap-purged-1.0-SNAPSHOT.jar"
 );
+
+purgedJar.getParentFile().mkdirs();
+purgedJar.createNewFile();
+
+System.out.println( "Created dummy JAR " + purgedJar );
+
+
+return true;

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/setup.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/setup.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/test.properties
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/test.properties?rev=1190291&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/test.properties
 (added)
+++ 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/test.properties
 Fri Oct 28 13:02:02 2011
@@ -0,0 +1,2 @@
+reResolve = false
+snapshotsOnly = true

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/test.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/test.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/validate.bsh
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/validate.bsh?rev=1190291&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/validate.bsh
 (added)
+++ 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/validate.bsh
 Fri Oct 28 13:02:02 2011
@@ -0,0 +1,22 @@
+import java.io.*;
+
+File nonPurgedJar = new File( localRepositoryPath, 
"org/apache/maven/its/dependency/purged/1.0/purged-1.0.jar" );
+
+System.out.println( "Checking for presence of dummy JAR " + nonPurgedJar );
+
+if ( !nonPurgedJar.exists() )
+{
+    throw new Exception( "JAR was purged: " + nonPurgedJar );
+}
+
+
+File purgedJar = new File( localRepositoryPath, 
"org/apache/maven/its/dependency/snap-purged/1.0-SNAPSHOT/snap-purged-1.0-SNAPSHOT.jar"
 );
+
+System.out.println( "Checking for absence of dummy JAR " + purgedJar );
+
+if ( purgedJar.exists() )
+{
+    throw new Exception( "JAR was not purged: " + purgedJar );
+}
+
+return true;

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/validate.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-snapshots-only/validate.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision


Reply via email to