[maven-scm] copy for tag maven-ant-tasks-2.0.7
git-svn-id: https://svn.apache.org/repos/asf/maven/ant-tasks/tags/maven-ant-tasks-2.0.7@551463 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index 0047523..3e4b63c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>maven-ant-tasks</artifactId>
- <version>2.0.7-SNAPSHOT</version>
+ <version>2.0.7</version>
<name>Maven Ant Task</name>
<build>
<pluginManagement>
@@ -82,7 +82,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
- <version>2.0.6</version>
+ <version>2.0.7</version>
<exclusions>
<exclusion>
<artifactId>junit</artifactId>
@@ -93,12 +93,12 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-error-diagnostics</artifactId>
- <version>2.0.6</version>
+ <version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
- <version>2.0.6</version>
+ <version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
@@ -118,7 +118,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact-manager</artifactId>
- <version>2.0.6</version>
+ <version>2.0.7</version>
<exclusions>
<exclusion>
<artifactId>junit</artifactId>
@@ -134,7 +134,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>2.0.6</version>
+ <version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
@@ -147,4 +147,10 @@
<version>1.0-alpha-9-stable-1</version>
</dependency>
</dependencies>
+
+ <scm>
+ <connection>scm:svn:https://svn.apache.org/repos/asf/maven/ant-tasks/tags/maven-ant-tasks-2.0.7</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/ant-tasks/tags/maven-ant-tasks-2.0.7</developerConnection>
+ <url>https://svn.apache.org/repos/asf/maven/ant-tasks/tags/maven-ant-tasks-2.0.7</url>
+ </scm>
</project>
diff --git a/sample.build.xml b/sample.build.xml
index e5d48da..ec8ff49 100644
--- a/sample.build.xml
+++ b/sample.build.xml
@@ -39,7 +39,7 @@
</target>
<target name="test-all-deps" description="All dependencies tests"
- depends="test-pom,test-no-deps,test-pom-deps,test-deps,test-legacy-pom">
+ depends="test-pom,test-pom-with-parent,test-no-deps,test-pom-deps,test-deps,test-legacy-pom">
<echo>test-bad-dep and test-invalid-pom-ref must be run manually, since they are intended to fail</echo>
</target>
@@ -47,7 +47,7 @@
depends="test-deploy-spaces,test-deploy,test-no-dist-mgmt,test-install-attached,test-deploy-attached"/>
<target name="test-all" description="All tests"
- depends="test-all-deps,test-all-pubs">
+ depends="test-all-deps,test-all-pubs,test-install-provider">
<echo>test-scm not run, since it fails...</echo>
</target>
@@ -59,6 +59,11 @@
</copy>
</target>
+ <target name="test-empty-settings" depends="initTaskDefs">
+ <artifact:dependencies filesetId="runtime.fileset" settingsFile="${basedir}/src/test/settings-empty.xml">
+ </artifact:dependencies>
+ </target>
+
<target name="test-bad-dep" depends="initTaskDefs">
<artifact:dependencies pathId="dependency.classpath" filesetId="dependency.fileset">
<dependency groupId="foo" artifactId="foo" version="1.0-alpha-2"/>
@@ -86,13 +91,12 @@
<dependency groupId="org.apache.maven.wagon" artifactId="wagon-provider-test" version="1.0-alpha-4">
<exclusion groupId="junit" artifactId="junit"/>
</dependency>
- <dependency groupId="org.apache.maven.archiva" artifactId="archiva-configuration" version="1.0-SNAPSHOT">
- <exclusion groupId="junit" artifactId="junit"/>
- </dependency>
<dependency groupId="org.apache.maven" artifactId="maven-core-it-support-old-location" version="1.1"/>
+ <dependency groupId="it.ant-tasks" artifactId="snapshotUniqueFalse" version="2.0.7-SNAPSHOT"/>
+ <dependency groupId="it.ant-tasks" artifactId="snapshotUniqueTrue" version="2.0.7-SNAPSHOT"/>
<localRepository refid="local.repository"/>
<remoteRepository url="http://repo1.maven.org/maven2" id="central" />
- <remoteRepository url="http://people.apache.org/repo/m2-snapshot-repository">
+ <remoteRepository url="file://${user.dir}/src/test/repo">
<snapshots enabled="true"/>
<releases enabled="false"/>
</remoteRepository>
@@ -106,9 +110,11 @@
</copy>
<available file="target/files/binaries/junit/junit" type="dir" property="exclusion.dependency"/>
<fail if="exclusion.dependency">excluded dependency junit:junit shouldn't be in target/files/binaries</fail>
- <available file="target/files/binaries/org/apache/maven/archive/archiva-configuration" type="dir" property="snapshot.dependency"/>
+ <available file="target/files/binaries/it/ant-tasks/snapshotUniqueFalse" type="dir" property="snapshot.dependency.uniqueFalse"/>
+ <fail unless="snapshot.dependency.uniqueFalse">SNAPSHOT dependency it.ant-tasks:snapshotUniqueFalse:2.0.7-SNAPSHOT should be in target/files/binaries</fail>
+ <available file="target/files/binaries/it/ant-tasks/snapshotUniqueTrue" type="dir" property="snapshot.dependency.uniqueTrue"/>
<!-- MANTTASKS-18 -->
- <fail unless="snapshot.dependency">SNAPSHOT dependency org.apache.maven.archiva:archiva-configuration:1.0-SNAPSHOT should be in target/files/binaries</fail>
+ <fail unless="snapshot.dependency.uniqueTrue">SNAPSHOT dependency it.ant-tasks:snapshotUniqueTrue:2.0.7-SNAPSHOT should be in target/files/binaries</fail>
</target>
<target name="test-pom-deps" depends="initTaskDefs">
@@ -265,5 +271,22 @@
<attach file="${basedir}/target/sample-build-test.pom.asc" type="pom.asc"/>
</artifact:install>
</target>
-</project>
+ <target name="test-install-provider" depends="initTaskDefs">
+ <artifact:install-provider groupId="it.ant-tasks" artifactId="wagon-foo" version="1.0-beta-2">
+ <localRepository refid="local.repository"/>
+ <remoteRepository url="file://${user.dir}/src/test/repo"/>
+ </artifact:install-provider>
+ </target>
+
+ <target name="test-pom-with-parent" depends="initTaskDefs">
+ <artifact:pom file="${user.dir}/src/test/pom-with-parent.xml" id="my.maven.project">
+ <localRepository refid="local.repository"/>
+ <remoteRepository url="file://${user.dir}/src/test/repo"/>
+ </artifact:pom>
+
+ <echo>Artifact ID = ${my.maven.project.artifactId}</echo>
+
+ <echo>Parent Artifact ID = ${my.maven.project.parent.artifactId}</echo>
+ </target>
+</project>
diff --git a/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java b/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java
index dcbb203..52d91dd 100644
--- a/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java
+++ b/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java
@@ -91,6 +91,11 @@
return new DefaultArtifactRepository( "local", "file://" + localRepository.getPath(), repositoryLayout );
}
+ /**
+ * Create a core-Maven ArtifactRepository from a Maven Ant Tasks's RemoteRepository definition.
+ * @param repository the remote repository as defined in Ant
+ * @return the corresponding ArtifactRepository
+ */
protected ArtifactRepository createRemoteArtifactRepository( RemoteRepository repository )
{
ArtifactRepositoryLayout repositoryLayout =
@@ -177,8 +182,6 @@
{
if ( settings == null )
{
- settings = new Settings();
-
File settingsFile = new File( System.getProperty( "user.home" ), ".ant/settings.xml" );
if ( !settingsFile.exists() )
{
@@ -205,19 +208,19 @@
if ( settingsFile.exists() )
{
- loadSettings(settingsFile);
+ loadSettings( settingsFile );
}
-
- if ( StringUtils.isEmpty( settings.getLocalRepository() ) )
+ else
{
- String location = new File( System.getProperty( "user.home" ), ".m2/repository" ).getAbsolutePath();
- settings.setLocalRepository( location );
+ settings = new Settings();
+ checkSettingsLocalRepository();
}
}
return settings;
}
- private void loadSettings(File settingsFile) {
+ private void loadSettings( File settingsFile )
+ {
FileReader reader = null;
try
{
@@ -227,6 +230,8 @@
SettingsXpp3Reader modelReader = new SettingsXpp3Reader();
settings = modelReader.read( reader );
+
+ checkSettingsLocalRepository();
}
catch ( IOException e )
{
@@ -244,10 +249,20 @@
}
}
- public void setSettingsFile(File settingsFile) {
- if (!settingsFile.exists()) throw new BuildException("settingsFile does not exist: " + settingsFile.getAbsolutePath());
- settings = new Settings();
- loadSettings(settingsFile);
+ private void checkSettingsLocalRepository()
+ {
+ if ( StringUtils.isEmpty( settings.getLocalRepository() ) )
+ {
+ String location = new File( System.getProperty( "user.home" ), ".m2/repository" ).getAbsolutePath();
+ settings.setLocalRepository( location );
+ }
+ }
+
+ public void setSettingsFile( File settingsFile )
+ {
+ if ( !settingsFile.exists() )
+ throw new BuildException( "settingsFile does not exist: " + settingsFile.getAbsolutePath() );
+ loadSettings( settingsFile );
}
protected RemoteRepository createAntRemoteRepository( org.apache.maven.model.Repository pomRepository )
@@ -322,18 +337,6 @@
}
}
- protected static RemoteRepository getDefaultRemoteRepository()
- {
- // TODO: could we utilise the super POM for this?
- RemoteRepository remoteRepository = new RemoteRepository();
- remoteRepository.setId( "central" );
- remoteRepository.setUrl( "http://repo1.maven.org/maven2" );
- RepositoryPolicy snapshots = new RepositoryPolicy();
- snapshots.setEnabled( false );
- remoteRepository.addSnapshots( snapshots );
- return remoteRepository;
- }
-
protected synchronized PlexusContainer getContainer()
{
if ( container == null )
diff --git a/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactWithRepositoryTask.java b/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactWithRepositoryTask.java
new file mode 100644
index 0000000..e0fd58a
--- /dev/null
+++ b/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactWithRepositoryTask.java
@@ -0,0 +1,109 @@
+package org.apache.maven.artifact.ant;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.tools.ant.Project;
+
+/**
+ * Base class for atifact tasks that are able to download artifact from repote repositories.
+ * @version $Id:$
+ */
+public abstract class AbstractArtifactWithRepositoryTask
+ extends AbstractArtifactTask
+{
+ /**
+ * List of Ant Tasks RemoteRepository-ies
+ */
+ private List remoteRepositories = new ArrayList();
+
+ /**
+ * Get the default remote repository.
+ * @return central repository
+ */
+ private static RemoteRepository getDefaultRemoteRepository()
+ {
+ // TODO: could we utilise the super POM for this?
+ RemoteRepository remoteRepository = new RemoteRepository();
+ remoteRepository.setId( "central" );
+ remoteRepository.setUrl( "http://repo1.maven.org/maven2" );
+ RepositoryPolicy snapshots = new RepositoryPolicy();
+ snapshots.setEnabled( false );
+ remoteRepository.addSnapshots( snapshots );
+ return remoteRepository;
+ }
+
+ private static String statusAsString( RepositoryPolicy policy )
+ {
+ return (policy == null) || policy.isEnabled() ? "enabled" : "disabled";
+ }
+
+ /**
+ * Create the list of ArtifactRepository-ies where artifacts can be downloaded. If
+ * no remote repository has been configured, adds central repository.
+ * @return the list of ArtifactRepository-ies
+ * @see #createRemoteArtifactRepository(RemoteRepository)
+ */
+ protected List createRemoteArtifactRepositories()
+ {
+ if ( getRemoteRepositories().isEmpty() )
+ {
+ addRemoteRepository( getDefaultRemoteRepository() );
+ }
+
+ log( "Using remote repositories:", Project.MSG_VERBOSE );
+ List list = new ArrayList();
+ for ( Iterator i = remoteRepositories.iterator(); i.hasNext(); )
+ {
+ RemoteRepository remoteRepository = (RemoteRepository) i.next();
+
+ StringBuffer msg = new StringBuffer();
+ msg.append( " - id=" + remoteRepository.getId() );
+ msg.append( ", url=" + remoteRepository.getUrl() );
+ msg.append( ", releases=" + statusAsString( remoteRepository.getReleases() ) );
+ msg.append( ", snapshots=" + statusAsString( remoteRepository.getSnapshots() ) );
+ if ( remoteRepository.getAuthentication() != null )
+ {
+ msg.append( ", authentication=" + remoteRepository.getAuthentication().getUserName() );
+ }
+ if ( remoteRepository.getProxy() != null )
+ {
+ msg.append( ", proxy=" + remoteRepository.getProxy().getHost() );
+ }
+ getProject().log( msg.toString(), Project.MSG_VERBOSE );
+
+ list.add( createRemoteArtifactRepository( remoteRepository ) );
+ }
+ return list;
+ }
+
+ public List getRemoteRepositories()
+ {
+ return remoteRepositories;
+ }
+
+ public void addRemoteRepository( RemoteRepository remoteRepository )
+ {
+ remoteRepositories.add( remoteRepository );
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java b/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java
index fda83a7..8559d5f 100644
--- a/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java
+++ b/src/main/java/org/apache/maven/artifact/ant/DependenciesTask.java
@@ -63,12 +63,10 @@
* @version $Id$
*/
public class DependenciesTask
- extends AbstractArtifactTask
+ extends AbstractArtifactWithRepositoryTask
{
private List dependencies = new ArrayList();
- private List remoteRepositories = new ArrayList();
-
private String pathId;
private String filesetId;
@@ -134,12 +132,7 @@
ArtifactResolutionResult result;
Set artifacts;
- if ( getRemoteRepositories().isEmpty() )
- {
- addRemoteRepository( getDefaultRemoteRepository() );
- }
-
- List remoteArtifactRepositories = createRemoteArtifactRepositories( getRemoteRepositories() );
+ List remoteArtifactRepositories = createRemoteArtifactRepositories();
try
{
@@ -196,7 +189,6 @@
{
throw new BuildException( "Reference ID " + pathId + " already exists" );
}
- */
if ( filesetId != null && getProject().getReference( filesetId ) != null )
{
@@ -207,6 +199,7 @@
{
throw new BuildException( "Reference ID " + sourcesFilesetId + " already exists" );
}
+ */
FileList fileList = new FileList();
fileList.setDir( getLocalRepository().getPath() );
@@ -232,6 +225,7 @@
for ( Iterator i = result.getArtifacts().iterator(); i.hasNext(); )
{
Artifact artifact = (Artifact) i.next();
+ artifact.isSnapshot(); // MNG-2961: DefaultArtifact getBaseVersion is changed to "xxxx-SNAPSHOT" only if you first call isSnapshot()
String filename = localRepo.pathOf( artifact );
FileList.FileName file = new FileList.FileName();
@@ -301,49 +295,6 @@
}
}
- private static String statusAsString( RepositoryPolicy policy )
- {
- return (policy == null) || policy.isEnabled() ? "enabled" : "disabled";
- }
-
- private List createRemoteArtifactRepositories( List remoteRepositories )
- {
- log( "Using remote repositories:", Project.MSG_VERBOSE );
- List list = new ArrayList();
- for ( Iterator i = remoteRepositories.iterator(); i.hasNext(); )
- {
- RemoteRepository remoteRepository = (RemoteRepository) i.next();
-
- StringBuffer msg = new StringBuffer();
- msg.append( " - id=" + remoteRepository.getId() );
- msg.append( ", url=" + remoteRepository.getUrl() );
- msg.append( ", releases=" + statusAsString( remoteRepository.getReleases() ) );
- msg.append( ", snapshots=" + statusAsString( remoteRepository.getSnapshots() ) );
- if ( remoteRepository.getAuthentication() != null )
- {
- msg.append( ", authentication=" + remoteRepository.getAuthentication().getUserName() );
- }
- if ( remoteRepository.getProxy() != null )
- {
- msg.append( ", proxy=" + remoteRepository.getProxy().getHost() );
- }
- getProject().log( msg.toString(), Project.MSG_VERBOSE );
-
- list.add( createRemoteArtifactRepository( remoteRepository ) );
- }
- return list;
- }
-
- public List getRemoteRepositories()
- {
- return remoteRepositories;
- }
-
- public void addRemoteRepository( RemoteRepository remoteRepository )
- {
- remoteRepositories.add( remoteRepository );
- }
-
public List getDependencies()
{
return dependencies;
diff --git a/src/main/java/org/apache/maven/artifact/ant/InstallDeployTaskSupport.java b/src/main/java/org/apache/maven/artifact/ant/InstallDeployTaskSupport.java
index 8f470e9..be30d16 100644
--- a/src/main/java/org/apache/maven/artifact/ant/InstallDeployTaskSupport.java
+++ b/src/main/java/org/apache/maven/artifact/ant/InstallDeployTaskSupport.java
@@ -21,18 +21,10 @@
import java.io.File;
import java.util.List;
-import java.util.Iterator;
import java.util.ArrayList;
-import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.installer.ArtifactInstaller;
-import org.apache.maven.artifact.installer.ArtifactInstallationException;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
-import org.apache.maven.project.MavenProjectBuilder;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
-import org.apache.tools.ant.BuildException;
/**
* Support for install/deploy tasks.
diff --git a/src/main/java/org/apache/maven/artifact/ant/InstallTask.java b/src/main/java/org/apache/maven/artifact/ant/InstallTask.java
index f18432e..36312bc 100644
--- a/src/main/java/org/apache/maven/artifact/ant/InstallTask.java
+++ b/src/main/java/org/apache/maven/artifact/ant/InstallTask.java
@@ -20,7 +20,6 @@
*/
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.installer.ArtifactInstallationException;
import org.apache.maven.artifact.installer.ArtifactInstaller;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
@@ -29,9 +28,6 @@
import org.apache.maven.project.artifact.ProjectArtifactMetadata;
import org.apache.tools.ant.BuildException;
-import java.io.File;
-import java.util.List;
-import java.util.ArrayList;
import java.util.Iterator;
/**
diff --git a/src/main/java/org/apache/maven/artifact/ant/InstallWagonProviderTask.java b/src/main/java/org/apache/maven/artifact/ant/InstallWagonProviderTask.java
index 72d1889..658b49e 100644
--- a/src/main/java/org/apache/maven/artifact/ant/InstallWagonProviderTask.java
+++ b/src/main/java/org/apache/maven/artifact/ant/InstallWagonProviderTask.java
@@ -23,7 +23,6 @@
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
@@ -34,6 +33,7 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.codehaus.plexus.PlexusContainerException;
+
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -45,13 +45,23 @@
* @version $Id$
*/
public class InstallWagonProviderTask
- extends AbstractArtifactTask
+ extends AbstractArtifactWithRepositoryTask
{
+ private String groupId = "org.apache.maven.wagon";
+
private String artifactId;
private String version;
- private static final String WAGON_GROUP_ID = "org.apache.maven.wagon";
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
public String getArtifactId()
{
@@ -76,12 +86,6 @@
public void doExecute()
throws BuildException
{
- MavenMetadataSource metadataSource = (MavenMetadataSource) lookup( ArtifactMetadataSource.ROLE );
-
- ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE );
- ArtifactRepository artifactRepository = createRemoteArtifactRepository( getDefaultRemoteRepository() );
- List remoteRepositories = Collections.singletonList( artifactRepository );
-
VersionRange versionRange;
try
{
@@ -90,16 +94,20 @@
catch ( InvalidVersionSpecificationException e )
{
throw new BuildException( "Unable to get extension '" +
- ArtifactUtils.versionlessKey( WAGON_GROUP_ID, artifactId ) + "' because version '" + version +
+ ArtifactUtils.versionlessKey( groupId, artifactId ) + "' because version '" + version +
" is invalid: " + e.getMessage(), e );
}
ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
- Artifact providerArtifact = factory.createExtensionArtifact( WAGON_GROUP_ID, artifactId, versionRange );
+ Artifact providerArtifact = factory.createExtensionArtifact( groupId, artifactId, versionRange );
ArtifactResolutionResult result;
try
{
+ MavenMetadataSource metadataSource = (MavenMetadataSource) lookup( ArtifactMetadataSource.ROLE );
+ ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE );
+ List remoteRepositories = createRemoteArtifactRepositories();
+
result = resolver.resolveTransitively( Collections.singleton( providerArtifact ),
createArtifact( createDummyPom() ), createLocalArtifactRepository(),
remoteRepositories, metadataSource, null );
diff --git a/src/main/java/org/apache/maven/artifact/ant/Pom.java b/src/main/java/org/apache/maven/artifact/ant/Pom.java
index 7d60ca4..da222c1 100644
--- a/src/main/java/org/apache/maven/artifact/ant/Pom.java
+++ b/src/main/java/org/apache/maven/artifact/ant/Pom.java
@@ -19,24 +19,42 @@
* under the License.
*/
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.model.Build;
import org.apache.maven.model.CiManagement;
import org.apache.maven.model.DependencyManagement;
import org.apache.maven.model.DistributionManagement;
import org.apache.maven.model.IssueManagement;
+import org.apache.maven.model.Model;
import org.apache.maven.model.Organization;
+import org.apache.maven.model.Parent;
import org.apache.maven.model.Reporting;
import org.apache.maven.model.Scm;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.artifact.MavenMetadataSource;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.PropertyHelper;
import org.codehaus.plexus.util.introspection.ReflectionValueExtractor;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Collections;
+import java.util.List;
/**
* A POM typedef.
@@ -53,7 +71,7 @@
* @version $Id$
*/
public class Pom
- extends AbstractArtifactTask
+ extends AbstractArtifactWithRepositoryTask
{
private String refid;
@@ -123,6 +141,8 @@
// TODO: should this be in execute() too? Would that work when it is used as a type?
if ( file != null )
{
+ checkParentPom();
+
try
{
// TODO: should the profiles be constructed and passed in here? From Ant, or perhaps settings?
@@ -130,7 +150,7 @@
}
catch ( ProjectBuildingException e )
{
- throw new BuildException( "Unable to build project: " + file, e );
+ throw new BuildException( "Unable to initialize POM " + file.getName() + ": " + e.getMessage(), e );
}
}
else if ( refid != null )
@@ -138,6 +158,56 @@
getInstance().initialise( builder, localRepository );
}
}
+
+ private void checkParentPom()
+ {
+ Model model = null;
+ try
+ {
+ InputStream in = new FileInputStream( file );
+ Reader reader = new InputStreamReader( in, "UTF-8" );
+ model = new MavenXpp3Reader().read( reader );
+ }
+ catch ( IOException e )
+ {
+ throw new BuildException( "IO error while reading pom: " + e.getMessage(), e );
+ }
+ catch ( XmlPullParserException e )
+ {
+ throw new BuildException( "Error parsing pom: " + e.getMessage(), e );
+ }
+
+ if ( model.getParent() != null && model.getParent().getRelativePath() != null )
+ {
+ // resolve parent pom
+ Parent parent = model.getParent();
+ String groupId = parent.getGroupId();
+ String artifactId = parent.getArtifactId();
+ String version = parent.getVersion();
+
+ ArtifactFactory factory = (ArtifactFactory) lookup( ArtifactFactory.ROLE );
+ Artifact parentArtifact = factory.createParentArtifact( groupId, artifactId, version );
+
+ try
+ {
+ MavenMetadataSource metadataSource = (MavenMetadataSource) lookup( ArtifactMetadataSource.ROLE );
+ ArtifactResolver resolver = (ArtifactResolver) lookup( ArtifactResolver.ROLE );
+ List remoteRepositories = createRemoteArtifactRepositories();
+
+ resolver.resolveTransitively( Collections.singleton( parentArtifact ),
+ createArtifact( createDummyPom() ), createLocalArtifactRepository(),
+ remoteRepositories, metadataSource, null );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new BuildException( "Error downloading parent pom: " + e.getMessage(), e );
+ }
+ catch ( ArtifactNotFoundException e )
+ {
+ throw new BuildException( "Unable to download parent pom in remote repository: " + e.getMessage(), e );
+ }
+ }
+ }
protected MavenProject getMavenProject()
{
diff --git a/src/main/java/org/apache/maven/artifact/ant/Repository.java b/src/main/java/org/apache/maven/artifact/ant/Repository.java
index a7472ff..7601cd0 100644
--- a/src/main/java/org/apache/maven/artifact/ant/Repository.java
+++ b/src/main/java/org/apache/maven/artifact/ant/Repository.java
@@ -19,7 +19,6 @@
* under the License.
*/
-import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.ProjectComponent;
/**
diff --git a/src/test/pom-with-parent.xml b/src/test/pom-with-parent.xml
new file mode 100644
index 0000000..456289a
--- /dev/null
+++ b/src/test/pom-with-parent.xml
@@ -0,0 +1,10 @@
+<project>
+ <parent>
+ <artifactId>pom</artifactId>
+ <groupId>it.ant-tasks</groupId>
+ <version>1.0</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>project-with-parent-pom</artifactId>
+ <version>2.0-beta-4-SNAPSHOT</version>
+</project>
diff --git a/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom b/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom
new file mode 100644
index 0000000..574f345
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom
@@ -0,0 +1,16 @@
+<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>it.ant-tasks</groupId>
+ <artifactId>pom</artifactId>
+ <packaging>pom</packaging>
+
+ <name>Maven Ant Tasks IT SNAPSHOT pom</name>
+ <version>1.0</version>
+
+ <distributionManagement>
+ <repository>
+ <id>repo</id>
+ <url>file://${user.dir}/repo</url>
+ </repository>
+ </distributionManagement>
+</project>
diff --git a/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom.md5 b/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom.md5
new file mode 100644
index 0000000..0748940
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom.md5
@@ -0,0 +1 @@
+83dc779101b514f898431a0873ee3f1f
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom.sha1 b/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom.sha1
new file mode 100644
index 0000000..a71fc2e
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/pom/1.0/pom-1.0.pom.sha1
@@ -0,0 +1 @@
+6c262222ef56991b914d11fe7cdba81513abb7f2
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/pom/maven-metadata.xml b/src/test/repo/it/ant-tasks/pom/maven-metadata.xml
new file mode 100644
index 0000000..35ba595
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/pom/maven-metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>it.ant-tasks</groupId>
+ <artifactId>pom</artifactId>
+ <version>1.0</version>
+ <versioning>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ <lastUpdated>20070618210615</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/pom/maven-metadata.xml.md5 b/src/test/repo/it/ant-tasks/pom/maven-metadata.xml.md5
new file mode 100644
index 0000000..1608d19
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/pom/maven-metadata.xml.md5
@@ -0,0 +1 @@
+b81c9e896504fa17bcedddaa1e91c333
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/pom/maven-metadata.xml.sha1 b/src/test/repo/it/ant-tasks/pom/maven-metadata.xml.sha1
new file mode 100644
index 0000000..0bf0804
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/pom/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+afd867c8bc9765a3e79bdbef5d738da151a2658f
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml
new file mode 100644
index 0000000..198c271
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>it.ant-tasks</groupId>
+ <artifactId>snapshotUniqueFalse</artifactId>
+ <version>2.0.7-SNAPSHOT</version>
+ <versioning>
+ <snapshot>
+ <buildNumber>1</buildNumber>
+ </snapshot>
+ <lastUpdated>20070610180522</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml.md5
new file mode 100644
index 0000000..86a17d9
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml.md5
@@ -0,0 +1 @@
+d1d30292e56f1247de26b7e5a6123da5
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml.sha1
new file mode 100644
index 0000000..ee20d54
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+11c3918c1a10cbbf0e10537fc1fe250cb4051674
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar
new file mode 100644
index 0000000..7172d45
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar
Binary files differ
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar.md5
new file mode 100644
index 0000000..2150aba
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar.md5
@@ -0,0 +1 @@
+e79b88841ed827762ba9ec61a8f7d11b
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar.sha1
new file mode 100644
index 0000000..95478d5
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.jar.sha1
@@ -0,0 +1 @@
+6c2631cc342671b17302af817a0b2d2231749a0e
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom
new file mode 100644
index 0000000..0b0183d
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom
@@ -0,0 +1,17 @@
+<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>it.ant-tasks</groupId>
+ <artifactId>snapshotUniqueFalse</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Maven Ant Tasks IT SNAPSHOT uniqueVersion="false"</name>
+ <version>2.0.7-SNAPSHOT</version>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>repo</id>
+ <url>file://${user.dir}/snapshotUniqueFalse</url>
+ <uniqueVersion>false</uniqueVersion>
+ </snapshotRepository>
+ </distributionManagement>
+</project>
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom.md5
new file mode 100644
index 0000000..8e467b6
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom.md5
@@ -0,0 +1 @@
+8bb41bff31db1754472637ed43c02dce
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom.sha1
new file mode 100644
index 0000000..f24de67
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/2.0.7-SNAPSHOT/snapshotUniqueFalse-2.0.7-SNAPSHOT.pom.sha1
@@ -0,0 +1 @@
+b69533a448a5b488a70ff2c27d5f503cdf40b59e
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml
new file mode 100644
index 0000000..8afcef7
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>it.ant-tasks</groupId>
+ <artifactId>snapshotUniqueFalse</artifactId>
+ <version>2.0.7-SNAPSHOT</version>
+ <versioning>
+ <versions>
+ <version>2.0.7-SNAPSHOT</version>
+ </versions>
+ <lastUpdated>20070610180522</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml.md5
new file mode 100644
index 0000000..f04986c
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml.md5
@@ -0,0 +1 @@
+2f304ab4c413fcfbf176d56ea1a8e74a
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml.sha1
new file mode 100644
index 0000000..6ee6c8d
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueFalse/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+20e10fa808f4ec4c7b2628e6c9999b09c11ea65b
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml
new file mode 100644
index 0000000..3c786e5
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>it.ant-tasks</groupId>
+ <artifactId>snapshotUniqueTrue</artifactId>
+ <version>2.0.7-SNAPSHOT</version>
+ <versioning>
+ <snapshot>
+ <timestamp>20070610.180356</timestamp>
+ <buildNumber>1</buildNumber>
+ </snapshot>
+ <lastUpdated>20070610180356</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml.md5
new file mode 100644
index 0000000..bf45e5c
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml.md5
@@ -0,0 +1 @@
+4a75053fb8d1c96dd7957d7764121904
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml.sha1
new file mode 100644
index 0000000..0d1dd98
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+e91515c9ce29ab01b52587a787e4fa44496e8c6f
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar
new file mode 100644
index 0000000..c330772
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar
Binary files differ
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar.md5
new file mode 100644
index 0000000..8b1dae9
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar.md5
@@ -0,0 +1 @@
+59da3a1d16909a26ae8a4245a4df0fb9
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar.sha1
new file mode 100644
index 0000000..e465898
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.jar.sha1
@@ -0,0 +1 @@
+6e7b36dcfa105ad2c15b040abac8dedc831bf643
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom
new file mode 100644
index 0000000..9450ab7
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom
@@ -0,0 +1,17 @@
+<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>it.ant-tasks</groupId>
+ <artifactId>snapshotUniqueTrue</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Maven Ant Tasks IT SNAPSHOT uniqueVersion="true"</name>
+ <version>2.0.7-SNAPSHOT</version>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>repo</id>
+ <url>file://${user.dir}/snapshotUniqueTrue</url>
+ <uniqueVersion>true</uniqueVersion>
+ </snapshotRepository>
+ </distributionManagement>
+</project>
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom.md5
new file mode 100644
index 0000000..c42e2a5
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom.md5
@@ -0,0 +1 @@
+a4e79877d5c1a2d65cb504a2900e0a4e
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom.sha1
new file mode 100644
index 0000000..d8191d4
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/2.0.7-SNAPSHOT/snapshotUniqueTrue-2.0.7-20070610.180356-1.pom.sha1
@@ -0,0 +1 @@
+caff40094a5b98048b9d8527a06b68dc7c67fe7d
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml
new file mode 100644
index 0000000..4c52dd7
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>it.ant-tasks</groupId>
+ <artifactId>snapshotUniqueTrue</artifactId>
+ <version>2.0.7-SNAPSHOT</version>
+ <versioning>
+ <versions>
+ <version>2.0.7-SNAPSHOT</version>
+ </versions>
+ <lastUpdated>20070610180356</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml.md5 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml.md5
new file mode 100644
index 0000000..7c04cc2
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml.md5
@@ -0,0 +1 @@
+747d1d058c5d7487cd045cd2bf0dac16
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml.sha1 b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml.sha1
new file mode 100644
index 0000000..92febaa
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/snapshotUniqueTrue/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+0dd3f3bc656120aff33b5c3d20d9422a6632682f
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar
new file mode 100644
index 0000000..0b2cdd8
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar
Binary files differ
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar.md5 b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar.md5
new file mode 100644
index 0000000..2d66a11
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar.md5
@@ -0,0 +1 @@
+ccc75b04bc295209cb7573ead5582ef0
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar.sha1 b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar.sha1
new file mode 100644
index 0000000..f2d4c38
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.jar.sha1
@@ -0,0 +1 @@
+6313864dafeff900b2ffdef9968f64ea437ffdb0
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom
new file mode 100644
index 0000000..1d11d50
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom
@@ -0,0 +1,24 @@
+<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>it.ant-tasks</groupId>
+ <artifactId>wagon-foo</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Maven Ant Tasks IT SNAPSHOT wagon foo</name>
+ <version>1.0-beta-2</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-file</artifactId>
+ <version>1.0-beta-2</version>
+ </dependency>
+ </dependencies>
+
+ <distributionManagement>
+ <repository>
+ <id>repo</id>
+ <url>file://${user.dir}/repo</url>
+ </repository>
+ </distributionManagement>
+</project>
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom.md5 b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom.md5
new file mode 100644
index 0000000..44bf07a
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom.md5
@@ -0,0 +1 @@
+b344cb511b170ba2084b8ea854371eff
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom.sha1 b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom.sha1
new file mode 100644
index 0000000..ae780a2
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/1.0-beta-2/wagon-foo-1.0-beta-2.pom.sha1
@@ -0,0 +1 @@
+59d868fd2aeb0fd33679d7bd6264482e70a197d0
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml b/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml
new file mode 100644
index 0000000..5d533d8
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>it.ant-tasks</groupId>
+ <artifactId>wagon-foo</artifactId>
+ <version>1.0-beta-2</version>
+ <versioning>
+ <versions>
+ <version>1.0-beta-2</version>
+ </versions>
+ <lastUpdated>20070619175310</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml.md5 b/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml.md5
new file mode 100644
index 0000000..964c26e
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml.md5
@@ -0,0 +1 @@
+2bb4e14969cc07bab03b456d073dd3db
\ No newline at end of file
diff --git a/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml.sha1 b/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml.sha1
new file mode 100644
index 0000000..a2d9959
--- /dev/null
+++ b/src/test/repo/it/ant-tasks/wagon-foo/maven-metadata.xml.sha1
@@ -0,0 +1 @@
+1f6154e5f4e65fc6eeaa7cfd37b201cfeed3dea9
\ No newline at end of file
diff --git a/src/test/settings-empty.xml b/src/test/settings-empty.xml
new file mode 100644
index 0000000..991b978
--- /dev/null
+++ b/src/test/settings-empty.xml
@@ -0,0 +1 @@
+<settings></settings>
\ No newline at end of file