You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2007/10/19 23:04:45 UTC

svn commit: r586615 - in /maven/ant-tasks/branches/maven-ant-tasks-2.0.x: ./ src/main/java/org/apache/maven/artifact/ant/

Author: hboutemy
Date: Fri Oct 19 14:04:45 2007
New Revision: 586615

URL: http://svn.apache.org/viewvc?rev=586615&view=rev
Log:
[MANTTASKS-78]: default id for local repo is "local", and the url for a remote repo

Modified:
    maven/ant-tasks/branches/maven-ant-tasks-2.0.x/sample.build.xml
    maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/LocalRepository.java
    maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/RemoteRepository.java
    maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/Repository.java

Modified: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/sample.build.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/sample.build.xml?rev=586615&r1=586614&r2=586615&view=diff
==============================================================================
--- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/sample.build.xml (original)
+++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/sample.build.xml Fri Oct 19 14:04:45 2007
@@ -38,9 +38,9 @@
   <target name="installSshProvider" depends="initTaskDefs">
     <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
   </target>
-  
+
   <target name="test-all-deps" description="All dependencies tests"
-    depends="test-pom,test-pom-with-parent,test-no-deps,test-pom-deps,test-deps,test-legacy-pom,test-deps-mirror">
+    depends="test-pom,test-pom-with-parent,test-no-deps,test-pom-deps,test-dep-two-repos,test-deps,test-legacy-pom,test-deps-mirror">
     <echo>test-bad-dep and test-invalid-pom-ref must be run manually, since they are intended to fail</echo>
   </target>
 
@@ -170,6 +170,17 @@
       <dependency groupId="it.ant-tasks" artifactId="snapshotUniqueFalse" version="2.0.7-SNAPSHOT"/>
       <localRepository path="${basedir}/target/tmp"/>
       <remoteRepository url="file://${basedir}/target/fake/repository" id="fake-repository" />
+    </artifact:dependencies>
+  </target>
+
+  <target name="test-dep-two-repos" depends="initTaskDefs">
+    <delete dir="target/tmp"/>
+    <!-- MANTTASKS-78 -->
+    <artifact:dependencies verbose="true">
+      <dependency groupId="it.ant-tasks" artifactId="snapshotUniqueFalse" version="2.0.7-SNAPSHOT"/>
+      <localRepository path="target/tmp"/>
+      <remoteRepository url="file://${user.dir}/src/test/repo"/>
+      <remoteRepository url="file://${user.dir}/target/tmp/fake"/>
     </artifact:dependencies>
   </target>
 

Modified: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/LocalRepository.java
URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/LocalRepository.java?rev=586615&r1=586614&r2=586615&view=diff
==============================================================================
--- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/LocalRepository.java (original)
+++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/LocalRepository.java Fri Oct 19 14:04:45 2007
@@ -41,4 +41,9 @@
     {
         this.path = path;
     }
+
+    protected String getDefaultId()
+    {
+        return "local";
+    }
 }

Modified: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/RemoteRepository.java
URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/RemoteRepository.java?rev=586615&r1=586614&r2=586615&view=diff
==============================================================================
--- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/RemoteRepository.java (original)
+++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/RemoteRepository.java Fri Oct 19 14:04:45 2007
@@ -88,4 +88,9 @@
         this.releases = releases;
     }
 
+    protected String getDefaultId()
+    {
+        return getUrl();
+    }
+
 }

Modified: maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/Repository.java
URL: http://svn.apache.org/viewvc/maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/Repository.java?rev=586615&r1=586614&r2=586615&view=diff
==============================================================================
--- maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/Repository.java (original)
+++ maven/ant-tasks/branches/maven-ant-tasks-2.0.x/src/main/java/org/apache/maven/artifact/ant/Repository.java Fri Oct 19 14:04:45 2007
@@ -35,12 +35,14 @@
     private String refid;
 
     private String layout = "default";
+    
+    protected abstract String getDefaultId();
 
     public String getId()
     {
         if ( getInstance().id == null )
         {
-            getInstance().setId( "remote" );
+            getInstance().setId( getDefaultId() );
         }
         return getInstance().id;
     }