You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2007/07/27 05:49:34 UTC
svn commit: r560082 - in /maven/plugins/trunk/maven-dependency-plugin: ./
src/main/java/org/apache/maven/plugin/dependency/
src/test/java/org/apache/maven/plugin/dependency/its/
src/test/resources/its/ src/test/resources/its/resolve/ src/test/resources...
Author: brianf
Date: Thu Jul 26 20:49:33 2007
New Revision: 560082
URL: http://svn.apache.org/viewvc?view=rev&rev=560082
Log:
added it test framework
Added:
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/DependencyPluginTest.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/ExecutionFailedException.java
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/readme.txt
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/resolve/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/resolve/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/a/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/a/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/out.txt
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/
Modified:
maven/plugins/trunk/maven-dependency-plugin/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
Modified: maven/plugins/trunk/maven-dependency-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/pom.xml?view=diff&rev=560082&r1=560081&r2=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-dependency-plugin/pom.xml Thu Jul 26 20:49:33 2007
@@ -157,6 +157,18 @@
<artifactId>maven-model</artifactId>
<version>2.0.6</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-test-tools</artifactId>
+ <version>1.0-alpha-2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.shared</groupId>
+ <artifactId>maven-plugin-testing-tools</artifactId>
+ <version>1.0-alpha-2</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
@@ -166,7 +178,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
- <version>1.0-alpha-9-SNAPSHOT</version>
+ <version>1.0-alpha-9</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java?view=diff&rev=560082&r1=560081&r2=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java Thu Jul 26 20:49:33 2007
@@ -200,12 +200,12 @@
throw new MojoExecutionException( "Error copying artifact from " + artifact + " to " + destFile, e );
}
}
-
+
protected void unpack ( File file, File location )
- throws MojoExecutionException
- {
- unpack( file, location, null, null);
- }
+ throws MojoExecutionException
+ {
+ unpack( file, location, null, null );
+ }
/**
* Unpacks the archive file.
@@ -213,17 +213,22 @@
* @param file File to be unpacked.
* @param location Location where to put the unpacked
* files.
- * @param includes Comma separated list of file patterns to include
- * i.e. **\/*.xml, **\/*.properties
- * @param excludes Comma separated list of file patterns to exclude
- * i.e. **\/*.xml, **\/*.properties
+ * @param includes Comma separated list of file patterns
+ * to include i.e. **\/*.xml,
+ * **\/*.properties
+ * @param excludes Comma separated list of file patterns
+ * to exclude i.e. **\/*.xml,
+ * **\/*.properties
*/
protected void unpack ( File file, File location, String includes, String excludes )
throws MojoExecutionException
{
-
try
{
+ getLog().info(
+ "Unpacking " + file.getPath() + "to\n " + location.getPath()
+ + "\nwith Includes " + includes + " and excludes:" + excludes );
+
location.mkdirs();
UnArchiver unArchiver;
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/AbstractDependencyPluginITCase.java Thu Jul 26 20:49:33 2007
@@ -0,0 +1,337 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugin.dependency.its;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.invoker.InvocationRequest;
+import org.apache.maven.shared.invoker.InvocationResult;
+import org.apache.maven.shared.test.plugin.BuildTool;
+import org.apache.maven.shared.test.plugin.PluginTestTool;
+import org.apache.maven.shared.test.plugin.ProjectTool;
+import org.apache.maven.shared.test.plugin.TestToolsException;
+import org.codehaus.classworlds.ClassRealm;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.util.CollectionUtils;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ * Copied from the Eclipse
+ * AbstractEclipsePluginTestCase v2.4
+ * @version $Id: AbstractDependencyPluginITCase.java 556442
+ * 2007-07-15 20:20:23Z dantran $
+ */
+public abstract class AbstractDependencyPluginITCase
+ extends PlexusTestCase
+{
+
+ private BuildTool buildTool;
+
+ private ProjectTool projectTool;
+
+ /**
+ * Test repository directory.
+ */
+ protected static File localRepositoryDirectory = getTestFile( "target/test-classes/m2repo" );
+
+ /**
+ * Pom File
+ */
+ protected static File PomFile = new File( getBasedir(), "pom.xml" );
+
+ /**
+ * Group-Id for running test builds.
+ */
+ protected static final String GROUP_ID = "org.apache.maven.plugins";
+
+ /**
+ * Artifact-Id for running test builds.
+ */
+ protected static final String ARTIFACT_ID = "maven-dependency-plugin";
+
+ /**
+ * Version under which the plugin was installed to the
+ * test-time local repository for running test builds.
+ */
+ protected static final String VERSION = "test";
+
+ private static final String BUILD_OUTPUT_DIRECTORY = "target/surefire-reports/build-output";
+
+ private static boolean installed = false;
+
+ /**
+ * @see org.codehaus.plexus.PlexusTestCase#setUp()
+ */
+ protected void setUp ()
+ throws Exception
+ {
+ if ( !installed )
+ {
+ System.out
+ .println( "*** Running test builds; output will be directed to: " + BUILD_OUTPUT_DIRECTORY + "\n" );
+ }
+
+ super.setUp();
+
+ buildTool = (BuildTool) lookup( BuildTool.ROLE, "default" );
+
+ projectTool = (ProjectTool) lookup( ProjectTool.ROLE, "default" );
+
+ String mavenHome = System.getProperty( "maven.home" );
+
+ // maven.home is set by surefire when the test is
+ // run with maven, but better make the test run in
+ // IDEs without
+ // the need of additional properties
+ if ( mavenHome == null )
+ {
+ String path = System.getProperty( "java.library.path" );
+ String[] paths = StringUtils.split( path, System.getProperty( "path.separator" ) );
+ for ( int j = 0; j < paths.length; j++ )
+ {
+ String pt = paths[j];
+ if ( new File( pt, "mvn" ).exists() )
+ {
+ System.setProperty( "maven.home", new File( pt ).getAbsoluteFile().getParent() );
+ break;
+ }
+
+ }
+ }
+
+ System.setProperty( "MAVEN_TERMINATE_CMD", "on" );
+
+ synchronized ( AbstractDependencyPluginITCase.class )
+ {
+ if ( !installed )
+ {
+ PluginTestTool pluginTestTool = (PluginTestTool) lookup( PluginTestTool.ROLE, "default" );
+
+ localRepositoryDirectory = pluginTestTool
+ .preparePluginForUnitTestingWithMavenBuilds( PomFile, "test", localRepositoryDirectory );
+
+ System.out.println( "*** Installed test-version of the Dependency plugin to: "
+ + localRepositoryDirectory + "\n" );
+
+ installed = true;
+ }
+ }
+
+ }
+
+ /**
+ * @see org.codehaus.plexus.PlexusTestCase#tearDown()
+ */
+ protected void tearDown ()
+ throws Exception
+ {
+ super.tearDown();
+
+ List containers = new ArrayList();
+
+ containers.add( getContainer() );
+
+ for ( Iterator iter = containers.iterator(); iter.hasNext(); )
+ {
+ PlexusContainer container = (PlexusContainer) iter.next();
+
+ if ( container != null )
+ {
+ container.dispose();
+
+ ClassRealm realm = container.getContainerRealm();
+
+ if ( realm != null )
+ {
+ realm.getWorld().disposeRealm( realm.getId() );
+ }
+ }
+ }
+ }
+
+ /**
+ * Execute the plugin with no properties
+ *
+ * @param projectName project directory
+ * @param goalList comma separated list of goals to
+ * execute
+ * @throws Exception any exception generated during test
+ */
+ protected void testProject ( String projectName, String goalList )
+ throws Exception
+ {
+ Properties props = new Properties();
+ testProject( projectName, props, goalList );
+ }
+
+ /**
+ * Execute the plugin.
+ *
+ * @param projectName project directory
+ * @param properties additional properties
+ * @param goalList comma separated list of goals to
+ * execute
+ * @throws Exception any exception generated during test
+ */
+ protected void testProject ( String projectName, Properties properties, String goalList )
+ throws Exception
+ {
+ File theBasedir = getTestFile( "target/test-classes/its/" + projectName );
+
+ File pom = new File( theBasedir, "pom.xml" );
+
+ String[] goal = goalList.split( "," );
+
+ List goals = new ArrayList();
+
+ for ( int i = 0; i < goal.length; i++ )
+ {
+ goals.add( goal[i] );
+ }
+
+ executeMaven( pom, properties, goals );
+
+ // MavenProject project = readProject( pom );
+
+ /*
+ * String outputDirPath = IdeUtils.getPluginSetting(
+ * project, "maven-dependency-plugin", "outputDir",
+ * null ); File outputDir; File projectOutputDir =
+ * basedir;
+ *
+ * if ( outputDirPath == null ) { outputDir =
+ * basedir; } else { outputDir = new File( basedir,
+ * outputDirPath ); outputDir.mkdirs();
+ * projectOutputDir = new File( outputDir,
+ * project.getArtifactId() ); }
+ */
+ }
+
+ protected File getOutputDirectory ( String projectName )
+ {
+ return getTestFile( "target/test-classes/projects/" + projectName );
+ }
+
+ protected void executeMaven ( File pom, Properties properties, List goals )
+ throws TestToolsException, ExecutionFailedException
+ {
+ executeMaven( pom, properties, goals, true );
+ }
+
+ protected void executeMaven ( File pom, Properties properties, List goals, boolean switchLocalRepo )
+ throws TestToolsException, ExecutionFailedException
+ {
+ // insert the test property to activate the test
+ // profile
+ properties.setProperty( "test", "true" );
+ new File( BUILD_OUTPUT_DIRECTORY ).mkdirs();
+
+ NullPointerException npe = new NullPointerException();
+ StackTraceElement[] trace = npe.getStackTrace();
+
+ File buildLog = null;
+
+ for ( int i = 0; i < trace.length; i++ )
+ {
+ StackTraceElement element = trace[i];
+
+ String methodName = element.getMethodName();
+
+ if ( methodName.startsWith( "test" ) && !methodName.equals( "testProject" ) )
+ {
+ String classname = element.getClassName();
+
+ buildLog = new File( BUILD_OUTPUT_DIRECTORY, classname + "_" + element.getMethodName() + ".build.log" );
+
+ break;
+ }
+ }
+
+ if ( buildLog == null )
+ {
+ buildLog = new File( BUILD_OUTPUT_DIRECTORY, "unknown.build.log" );
+ }
+
+ InvocationRequest request = buildTool.createBasicInvocationRequest( pom, properties, goals, buildLog );
+ request.setUpdateSnapshots( false );
+ request.setShowErrors( true );
+
+ request.setDebug( true );
+
+ if ( switchLocalRepo )
+ {
+ request.setLocalRepositoryDirectory( localRepositoryDirectory );
+ }
+
+ InvocationResult result = buildTool.executeMaven( request );
+
+ if ( result.getExitCode() != 0 )
+ {
+ String buildLogUrl = buildLog.getAbsolutePath();
+
+ try
+ {
+ buildLogUrl = buildLog.toURL().toExternalForm();
+ }
+ catch ( MalformedURLException e )
+ {
+ }
+
+ throw new ExecutionFailedException( "Failed to execute build.\nPOM: " + pom + "\nGoals: "
+ + StringUtils.join( goals.iterator(), ", " ) + "\nExit Code: " + result.getExitCode() + "\nError: "
+ + result.getExecutionException() + "\nBuild Log: " + buildLogUrl + "\n", result );
+ }
+ }
+
+ protected MavenProject readProject ( File pom )
+ throws TestToolsException
+ {
+ return projectTool.readProject( pom, localRepositoryDirectory );
+ }
+
+ protected String getPluginCLISpecification ()
+ {
+ String pluginSpec = GROUP_ID + ":" + ARTIFACT_ID + ":";
+
+ // String pluginVersion = System.getProperty(
+ // "pluginVersion" );
+ //
+ // if ( pluginVersion != null )
+ // {
+ // pluginSpec += pluginVersion + ":";
+ // }
+ //
+ // System.out.println( "\n\nUsing Eclipse plugin
+ // version: " + pluginVersion + "\n\n" );
+
+ // try using the test-version installed during
+ // setUp()
+ pluginSpec += VERSION + ":";
+
+ return pluginSpec;
+ }
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/DependencyPluginTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/DependencyPluginTest.java?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/DependencyPluginTest.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/DependencyPluginTest.java Thu Jul 26 20:49:33 2007
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugin.dependency.its;
+
+
+/**
+ * This class executes the IT tests. The setup will create a pom-test.xml from the plugin
+ * pom. The version is changed to "test" and the tests themselves turned off to avoid an infinite loop.
+ * The test version of the plugin is then built and installed to a new temporary local repo used to
+ * execute the tests. This only occurs once for the suite of tests.
+ *
+ * Each test below just uses the tools to execute Maven on the named project with the passed in goals.
+ *
+ * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
+ *
+ * Copied from the Eclipse AbstractEclipsePluginTestCase v2.4
+ *
+ * @version $Id: DependencyPluginTest.java 554290 2007-07-08 01:25:12Z brianf $
+ */
+public class DependencyPluginTest extends AbstractDependencyPluginITCase
+{
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+ }
+
+
+ /**
+ * Test Resolve Mojo. Simple Harness test essentially
+ *
+ * @throws Exception
+ * any exception thrown during test
+ */
+ public void testSibling() throws Exception
+ {
+ testProject( "siblingReference", "package" );
+ }
+
+ /**
+ * Test Resolve Mojo. Simple Harness test essentially
+ *
+ * @throws Exception
+ * any exception thrown during test
+ */
+ public void testResolve() throws Exception
+ {
+ testProject( "resolve", "dependency:resolve" );
+ }
+
+
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/ExecutionFailedException.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/ExecutionFailedException.java?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/ExecutionFailedException.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/its/ExecutionFailedException.java Thu Jul 26 20:49:33 2007
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugin.dependency.its;
+
+import org.apache.maven.shared.invoker.InvocationResult;
+import org.apache.maven.shared.invoker.MavenInvocationException;
+
+public class ExecutionFailedException
+ extends Exception
+{
+
+ private static final long serialVersionUID = 1L;
+
+ private InvocationResult result;
+
+ public ExecutionFailedException( String message, MavenInvocationException cause )
+ {
+ super( message + " (Maven invoker threw an exception.)", cause );
+ }
+
+ public ExecutionFailedException( String message, InvocationResult result )
+ {
+ super( message + " (Resulting exit code: " + result.getExitCode() + ")" );
+
+ this.result = result;
+ }
+
+ public InvocationResult getInvocationResult()
+ {
+ return result;
+ }
+
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/pom.xml?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/pom.xml Thu Jul 26 20:49:33 2007
@@ -0,0 +1,66 @@
+<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">
+<!--
+ * 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.
+ *
+-->
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>maven-dependency-plugin-it-parent</artifactId>
+ <packaging>pom</packaging>
+ <version>1</version>
+
+ <!--these profiles allow the tests to be run by hand and by the IT tests. The IT tests will activate the test profile so it uses the test version-->
+ <profiles>
+ <profile>
+ <id>manual</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>LATEST</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ <profile>
+ <id>test</id>
+ <activation>
+ <property>
+ <name>test</name>
+ </property>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>test</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ </profiles>
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/readme.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/readme.txt?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/readme.txt (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/readme.txt Thu Jul 26 20:49:33 2007
@@ -0,0 +1,4 @@
+To create an IT test, start with the simplest example "resolve", copy and modify to simulate your condition.
+The root pom of your project(s) need to inherit from the pom.xml in this folder in order to work correctly.
+The tests should be able to be run by hand from this folder, or as part of the IT test suite. Then add a
+new test method to the DependencyPluginTest class to execute your new test.
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/resolve/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/resolve/pom.xml?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/resolve/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/resolve/pom.xml Thu Jul 26 20:49:33 2007
@@ -0,0 +1,50 @@
+<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">
+<!--
+ * 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.
+ *
+-->
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>test</groupId>
+ <artifactId>maven-dependency-plugin-it-parent</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>maven-dependency-plugin-it-resolve</artifactId>
+ <packaging>pom</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>2.0.6</version>
+ </dependency>
+ </dependencies>
+ <!--This must be set so the correct version is used for the IT test-->
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>test</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/a/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/a/pom.xml?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/a/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/a/pom.xml Thu Jul 26 20:49:33 2007
@@ -0,0 +1,30 @@
+<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">
+<!--
+ * 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.
+ *
+-->
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>test</groupId>
+ <artifactId>maven-dependency-plugin-it-sibling-ref</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>a</artifactId>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/out.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/out.txt?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/out.txt (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/out.txt Thu Jul 26 20:49:33 2007
@@ -0,0 +1,115 @@
+Using maven.home=c:\Program Files\maven2\bin\\..
+[INFO] Scanning for projects...
+[INFO] Searching repository for plugin with prefix: 'help'.
+[INFO] ----------------------------------------------------------------------------
+[INFO] Building Unnamed - test:b:jar:1
+[INFO] task-segment: [help:effective-pom] (aggregator-style)
+[INFO] ----------------------------------------------------------------------------
+[INFO] [help:effective-pom]
+[INFO]
+************************************************************************************
+Effective POM for project 'test:b:jar:1'
+************************************************************************************
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>maven-dependency-plugin-it-sibling-ref</artifactId>
+ <groupId>test</groupId>
+ <version>1</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>b</artifactId>
+ <version>1</version>
+ <build>
+ <sourceDirectory>E:\svn\Maven\maven-plugins\maven-dependency-plugin\src\test\resources\its\siblingReference\b\src\main\java</sourceDirectory>
+ <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
+ <testSourceDirectory>E:\svn\Maven\maven-plugins\maven-dependency-plugin\src\test\resources\its\siblingReference\b\src\test\java</testSourceDirectory>
+ <outputDirectory>E:\svn\Maven\maven-plugins\maven-dependency-plugin\src\test\resources\its\siblingReference\b\target\classes</outputDirectory>
+ <testOutputDirectory>E:\svn\Maven\maven-plugins\maven-dependency-plugin\src\test\resources\its\siblingReference\b\target\test-classes</testOutputDirectory>
+ <resources>
+ <resource>
+ <directory>E:\svn\Maven\maven-plugins\maven-dependency-plugin\src\test\resources\its\siblingReference\b\src\main\resources</directory>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>E:\svn\Maven\maven-plugins\maven-dependency-plugin\src\test\resources\its\siblingReference\b\src\test\resources</directory>
+ </testResource>
+ </testResources>
+ <directory>E:\svn\Maven\maven-plugins\maven-dependency-plugin\src\test\resources\its\siblingReference\b\target</directory>
+ <finalName>b-1</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>LATEST</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>LATEST</version>
+ <executions>
+ <execution>
+ <id>unpack-dependencies</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <overWrite>true</overWrite>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-help-plugin</artifactId>
+ <version>2.0.2-SNAPSHOT</version>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>central</id>
+ <name>Maven Repository Switchboard</name>
+ <url>http://repo1.maven.org/maven2</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <releases>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <id>central</id>
+ <name>Maven Plugin Repository</name>
+ <url>http://repo1.maven.org/maven2</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>test</groupId>
+ <artifactId>a</artifactId>
+ <version>1</version>
+ </dependency>
+ </dependencies>
+ <reporting>
+ <outputDirectory>target/site</outputDirectory>
+ </reporting>
+</project>
+************************************************************************************
+
+
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 2 seconds
+[INFO] Finished at: Thu Jul 26 12:39:26 AKDT 2007
+[INFO] Final Memory: 2M/4M
+[INFO] ------------------------------------------------------------------------
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/pom.xml?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/b/pom.xml Thu Jul 26 20:49:33 2007
@@ -0,0 +1,58 @@
+<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">
+<!--
+ * 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.
+ *
+-->
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>test</groupId>
+ <artifactId>maven-dependency-plugin-it-sibling-ref</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>b</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>a</artifactId>
+ <version>1</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-dependencies</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack-dependencies</goal>
+ </goals>
+ <configuration>
+ <overWrite>true</overWrite>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/pom.xml?view=auto&rev=560082
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/its/siblingReference/pom.xml Thu Jul 26 20:49:33 2007
@@ -0,0 +1,35 @@
+<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">
+<!--
+ * 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.
+ *
+-->
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>test</groupId>
+ <artifactId>maven-dependency-plugin-it-parent</artifactId>
+ <version>1</version>
+ </parent>
+
+ <artifactId>maven-dependency-plugin-it-sibling-ref</artifactId>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>a</module>
+ <module>b</module>
+ </modules>
+</project>