You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2011/12/02 13:10:20 UTC

svn commit: r1209433 - in /maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot: ./ pom.xml setup.bsh test.properties verify.bsh

Author: carlos
Date: Fri Dec  2 12:10:20 2011
New Revision: 1209433

URL: http://svn.apache.org/viewvc?rev=1209433&view=rev
Log:
[MDEPLOY-46] Add IT for snapshot deployment with altDeploymentRepository

Added:
    maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/
    maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml   (with props)
    maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/setup.bsh   (with props)
    maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties   (with props)
    maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/verify.bsh   (with props)

Added: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml?rev=1209433&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml Fri Dec  2 12:10:20 2011
@@ -0,0 +1,81 @@
+<?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.deploy.adrwdms</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+
+  <description>
+    Tests the deployment of snapshots to an alternative repository specified on the CLI when the POM
+    also specifies distribution management.
+  </description>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <distributionManagement>
+    <repository>
+      <id>it</id>
+      <url>file:///${basedir}/target/void</url>
+    </repository>
+  </distributionManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-deploy-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-install-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.1</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-resources-plugin</artifactId>
+        <version>2.2</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3.1</version>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/setup.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/setup.bsh?rev=1209433&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/setup.bsh (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/setup.bsh Fri Dec  2 12:10:20 2011
@@ -0,0 +1,14 @@
+import java.io.*;
+import java.util.*;
+
+import org.codehaus.plexus.util.*;
+
+File file = new File( localRepositoryPath, "org/apache/maven/its/deploy/adrwdms" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+file = new File( basedir, "target/repo" );
+System.out.println( "Deleting " + file );
+FileUtils.deleteDirectory( file );
+
+return true;

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/setup.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/setup.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties?rev=1209433&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties Fri Dec  2 12:10:20 2011
@@ -0,0 +1 @@
+altDeploymentRepository = alt-id::default::file:target/repo

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/test.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/verify.bsh?rev=1209433&view=auto
==============================================================================
--- maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/verify.bsh (added)
+++ maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/verify.bsh Fri Dec  2 12:10:20 2011
@@ -0,0 +1,34 @@
+import java.io.*;
+import java.util.*;
+
+String[] paths =
+{
+    "org/apache/maven/its/deploy/adrwdms/test/maven-metadata.xml",
+};
+String[] paths_absent =
+{
+    "org/apache/maven/its/deploy/adrwdms/test/1.0/test-1.0-SNAPSHOT.pom",
+    "org/apache/maven/its/deploy/adrwdms/test/1.0/test-1.0-SNAPSHOT.jar",
+};
+
+for ( String path : paths )
+{
+    File file = new File( new File( basedir, "target/repo" ), path );
+    System.out.println( "Checking for existence of " + file );
+    if ( !file.isFile() )
+    {
+        throw new FileNotFoundException( "Missing: " + file.getAbsolutePath() );
+    }
+}
+
+for ( String path : paths_absent )
+{
+    File file = new File( new File( basedir, "target/repo" ), path );
+    System.out.println( "Checking for non existence of " + file );
+    if ( file.exists() )
+    {
+        throw new AssertionError( "File exists and shouldn't: " + file.getAbsolutePath() );
+    }
+}
+
+return true;

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/verify.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-deploy-plugin/src/it/alt-deploy-repo-with-dist-mgmt-snapshot/verify.bsh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision