You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/11/23 23:12:54 UTC

svn commit: r883519 - in /maven/core-integration-testing/trunk/core-it-suite/src/test: java/org/apache/maven/it/ resources/mng-4465/ resources/mng-4465/repo/ resources/mng-4465/repo/org/ resources/mng-4465/repo/org/apache/ resources/mng-4465/repo/org/a...

Author: bentmann
Date: Mon Nov 23 22:12:53 2009
New Revision: 883519

URL: http://svn.apache.org/viewvc?rev=883519&view=rev
Log:
[MNG-4465] [regression] can't run mvn help:effective-settings when offline

o Added IT

Added:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/pom.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-metadata.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.jar   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.pom
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/maven-metadata.xml   (with props)
    maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/settings-template.xml   (with props)
Modified:
    maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java

Modified: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java?rev=883519&r1=883518&r2=883519&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java (original)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java Mon Nov 23 22:12:53 2009
@@ -85,6 +85,7 @@
         // suite.addTestSuite( MavenIT0109ReleaseUpdateTest.class );
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.class );
         suite.addTestSuite( MavenITmng4461ArtifactUploadMonitorTest.class );
         suite.addTestSuite( MavenITmng4459InMemorySettingsKeptEncryptedTest.class );
         suite.addTestSuite( MavenITmng4453PluginVersionFromLifecycleMappingTest.class );

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java?rev=883519&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java Mon Nov 23 22:12:53 2009
@@ -0,0 +1,86 @@
+package org.apache.maven.it;
+
+/*
+ * 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 org.apache.maven.it.Verifier;
+import org.apache.maven.it.util.FileUtils;
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a href="http://jira.codehaus.org/browse/MNG-4465">MNG-4465</a>.
+ * 
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest
+    extends AbstractMavenIntegrationTestCase
+{
+
+    public MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest()
+    {
+        super( "[2.1.0,3.0-alpha-1),[3.0-alpha-6,)" );
+    }
+
+    /**
+     * Verify that locally cached metadata of non-accessible remote repos is still considered when resolving
+     * plugin prefixes.
+     */
+    public void testit()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4465" );
+
+        // phase 1: get the metadata into the local repo
+
+        Verifier verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.deleteArtifacts( "org.apache.maven.its.mng4465" );
+        verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", verifier.newDefaultFilterProperties() );
+        verifier.setLogFileName( "log1.txt" );
+        verifier.getCliOptions().add( "-s" );
+        verifier.getCliOptions().add( "settings.xml" );
+        verifier.executeGoal( "mng4465:touch" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertFilePresent( "target/touch.properties" );
+
+        // phase 2: re-try with the remote repo being inaccessible (due to bad URL)
+
+        verifier = new Verifier( testDir.getAbsolutePath() );
+        verifier.setAutoclean( false );
+        verifier.deleteDirectory( "target" );
+        verifier.filterFile( "settings-template.xml", "settings.xml", "UTF-8", 
+            Collections.singletonMap( "@baseurl@", "bad://localhost:63412" ) );
+        verifier.setLogFileName( "log2.txt" );
+        verifier.getCliOptions().add( "-s" );
+        verifier.getCliOptions().add( "settings.xml" );
+        verifier.executeGoal( "mng4465:touch" );
+        verifier.verifyErrorFreeLog();
+        verifier.resetStreams();
+
+        verifier.assertFilePresent( "target/touch.properties" );
+    }
+
+}

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4465PluginPrefixFromLocalCacheOfDownRepoTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/pom.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/pom.xml?rev=883519&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/pom.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/pom.xml Mon Nov 23 22:12:53 2009
@@ -0,0 +1,34 @@
+<?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>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.mng4465</groupId>
+  <artifactId>test</artifactId>
+  <version>0.1</version>
+
+  <name>Maven Integration Test :: MNG-4465</name>
+  <description>
+    Verify that locally cached metadata of non-accessible remote repos is still considered when resolving
+    plugin prefixes.
+  </description>
+</project>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-metadata.xml?rev=883519&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-metadata.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-metadata.xml Mon Nov 23 22:12:53 2009
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <plugins>
+    <plugin>
+      <name>Maven Integration Test :: MNG-4465 :: Plugin</name>
+      <prefix>mng4465</prefix>
+      <artifactId>maven-mng4465-plugin</artifactId>
+    </plugin>
+  </plugins>
+</metadata>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.jar
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.jar?rev=883519&view=auto
==============================================================================
Binary file - no diff available.

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.pom
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.pom?rev=883519&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.pom (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/0.1/maven-mng4465-plugin-0.1.pom Mon Nov 23 22:12:53 2009
@@ -0,0 +1,66 @@
+<?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.mng4465</groupId>
+  <artifactId>maven-mng4465-plugin</artifactId>
+  <version>0.1</version>
+  <packaging>maven-plugin</packaging>
+
+  <name>Maven Integration Test :: MNG-4465 :: Plugin</name>
+  <inceptionYear>2009</inceptionYear>
+
+  <distributionManagement>
+    <repository>
+      <id>maven-core-it</id>
+      <url>file:///${basedir}/repo</url>
+    </repository>
+  </distributionManagement>
+
+  <properties>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <resources>
+      <resource>
+        <directory>.</directory>
+        <includes>
+          <include>pom.xml</include>
+          <include>src/**</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+  </build>
+</project>

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/maven-metadata.xml?rev=883519&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/maven-metadata.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/maven-metadata.xml Mon Nov 23 22:12:53 2009
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+  <groupId>org.apache.maven.its.mng4465</groupId>
+  <artifactId>maven-mng4465-plugin</artifactId>
+  <version>0.1</version>
+  <versioning>
+    <latest>0.1</latest>
+    <release>0.1</release>
+    <versions>
+      <version>0.1</version>
+    </versions>
+    <lastUpdated>20091123190109</lastUpdated>
+  </versioning>
+</metadata>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/repo/org/apache/maven/its/mng4465/maven-mng4465-plugin/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/settings-template.xml
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/settings-template.xml?rev=883519&view=auto
==============================================================================
--- maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/settings-template.xml (added)
+++ maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/settings-template.xml Mon Nov 23 22:12:53 2009
@@ -0,0 +1,80 @@
+<?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.
+-->
+
+<settings>
+  <pluginGroups>
+    <pluginGroup>org.apache.maven.its.mng4465</pluginGroup>
+  </pluginGroups>
+  <profiles>
+    <profile>
+      <id>maven-core-it-repo</id>
+      <repositories>
+        <repository>
+          <id>mng4465</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+            <updatePolicy>always</updatePolicy>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+        <repository>
+          <id>central</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>mng4465</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <checksumPolicy>ignore</checksumPolicy>
+            <updatePolicy>always</updatePolicy>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
+        <pluginRepository>
+          <id>central</id>
+          <url>@baseurl@/repo</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>maven-core-it-repo</activeProfile>
+  </activeProfiles>
+</settings>

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/settings-template.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-4465/settings-template.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision