From ded92e5e2ae39ad0fc01f0618e7928bccd92a753 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Mon, 12 Sep 2005 07:17:11 +0000 Subject: [PATCH] disallow snapshots from the default repository in the ant tasks git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@280278 13f79535-47bb-0310-9956-ffa450edef68 --- maven-artifact-ant/sample.build.xml | 16 ++++++++-------- .../maven/artifact/ant/AbstractArtifactTask.java | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/maven-artifact-ant/sample.build.xml b/maven-artifact-ant/sample.build.xml index a3a833539a..6e6a1bf7d0 100644 --- a/maven-artifact-ant/sample.build.xml +++ b/maven-artifact-ant/sample.build.xml @@ -29,11 +29,11 @@ - - - - - + + + + + @@ -61,7 +61,7 @@ - + @@ -135,7 +135,7 @@ - + @@ -154,7 +154,7 @@ - + diff --git a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java b/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java index 63130b60b8..c51b3a8598 100755 --- a/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java +++ b/maven-artifact-ant/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java @@ -294,6 +294,9 @@ public abstract class AbstractArtifactTask // TODO: could we utilise the super POM for this? RemoteRepository remoteRepository = new RemoteRepository(); remoteRepository.setUrl( "http://repo1.maven.org/maven2" ); + RepositoryPolicy snapshots = new RepositoryPolicy(); + snapshots.setEnabled( false ); + remoteRepository.addSnapshots( snapshots ); return remoteRepository; }