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 2008/03/02 19:33:24 UTC

svn commit: r632808 - in /maven/ant-tasks/trunk: pom.xml sample.build.xml src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java src/test/settings-profile-default.xml src/test/settings-profile-file.xml

Author: hboutemy
Date: Sun Mar  2 10:33:22 2008
New Revision: 632808

URL: http://svn.apache.org/viewvc?rev=632808&view=rev
Log:
[MANTTASKS-105] add profiles support

Added:
    maven/ant-tasks/trunk/src/test/settings-profile-default.xml   (with props)
    maven/ant-tasks/trunk/src/test/settings-profile-file.xml   (with props)
Modified:
    maven/ant-tasks/trunk/pom.xml
    maven/ant-tasks/trunk/sample.build.xml
    maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java

Modified: maven/ant-tasks/trunk/pom.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/pom.xml?rev=632808&r1=632807&r2=632808&view=diff
==============================================================================
--- maven/ant-tasks/trunk/pom.xml (original)
+++ maven/ant-tasks/trunk/pom.xml Sun Mar  2 10:33:22 2008
@@ -204,7 +204,7 @@
   </dependencies>
 
   <properties>
-    <mavenVersion>2.0.8</mavenVersion>
+    <mavenVersion>2.0.9-SNAPSHOT</mavenVersion>
     <wagonVersion>1.0-beta-2</wagonVersion>
   </properties>
 </project>

Modified: maven/ant-tasks/trunk/sample.build.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/sample.build.xml?rev=632808&r1=632807&r2=632808&view=diff
==============================================================================
--- maven/ant-tasks/trunk/sample.build.xml (original)
+++ maven/ant-tasks/trunk/sample.build.xml Sun Mar  2 10:33:22 2008
@@ -40,7 +40,7 @@
   </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-two-repos,test-deps,test-legacy-pom,test-deps-mirror,test-deps-order,test-deps-sources,test-deps-sources-empty">
+    depends="test-pom,test-pom-with-parent,test-no-deps,test-pom-deps,test-deps-two-repos,test-deps,test-legacy-pom,test-deps-mirror,test-deps-order,test-deps-sources,test-deps-sources-empty,test-deps-profile">
     <echo>test-bad-dep and test-invalid-pom-ref must be run manually, since they are intended to fail</echo>
   </target>
 
@@ -318,6 +318,20 @@
 
     <available file="${basedir}/target/files/empty/javadoc.bin" property="javadoc.bin"/>
     <fail if="javadoc.bin">no dependencies javadoc should have been found</fail>
+  </target>
+
+  <target name="test-deps-profile" depends="initTaskDefs">
+    <delete dir="${basedir}/target/tmp"/>
+    <artifact:dependencies settingsFile="./src/test/settings-profile-default.xml">
+      <dependency groupId="it.ant-tasks" artifactId="release" version="2.0.7"/>
+      <localRepository path="${basedir}/target/tmp"/>
+    </artifact:dependencies>
+
+    <delete dir="${basedir}/target/tmp"/>
+    <artifact:dependencies settingsFile="./src/test/settings-profile-file.xml">
+      <dependency groupId="it.ant-tasks" artifactId="release" version="2.0.7"/>
+      <localRepository path="${basedir}/target/tmp"/>
+    </artifact:dependencies>
   </target>
 
   <target name="test-deploy-spaces" depends="initTaskDefs,installSshProvider">

Modified: maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java?rev=632808&r1=632807&r2=632808&view=diff
==============================================================================
--- maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java (original)
+++ maven/ant-tasks/trunk/src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java Sun Mar  2 10:33:22 2008
@@ -27,6 +27,7 @@
 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.profiles.DefaultProfileManager;
 import org.apache.maven.profiles.ProfileManager;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
@@ -273,8 +274,7 @@
             settings.setLocalRepository( location );
         }
 
-        // removed since it breaks dependencies order when injecting profile dependencies
-        //profileManager = new DefaultProfileManager( getContainer(), getSettings(), System.getProperties() );
+        profileManager = new DefaultProfileManager( getContainer(), getSettings(), System.getProperties() );
 
         WagonManager wagonManager = (WagonManager) lookup( WagonManager.ROLE );
         wagonManager.setDownloadMonitor( new AntDownloadMonitor() );

Added: maven/ant-tasks/trunk/src/test/settings-profile-default.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/test/settings-profile-default.xml?rev=632808&view=auto
==============================================================================
--- maven/ant-tasks/trunk/src/test/settings-profile-default.xml (added)
+++ maven/ant-tasks/trunk/src/test/settings-profile-default.xml Sun Mar  2 10:33:22 2008
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<settings 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/xsd/settings-1.0.0.xsd">
+  <profiles>
+    <profile>
+      <id>test-repo</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <repositories>
+        <repository>
+          <id>test.repo</id>
+          <url>file:./src/test/repo</url>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+        </repository>
+      </repositories>
+    </profile>
+  </profiles>
+</settings>
\ No newline at end of file

Propchange: maven/ant-tasks/trunk/src/test/settings-profile-default.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: maven/ant-tasks/trunk/src/test/settings-profile-file.xml
URL: http://svn.apache.org/viewvc/maven/ant-tasks/trunk/src/test/settings-profile-file.xml?rev=632808&view=auto
==============================================================================
--- maven/ant-tasks/trunk/src/test/settings-profile-file.xml (added)
+++ maven/ant-tasks/trunk/src/test/settings-profile-file.xml Sun Mar  2 10:33:22 2008
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<settings 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/xsd/settings-1.0.0.xsd">
+  <profiles>
+    <profile>
+      <id>test-repo</id>
+      <activation>
+        <file><exists>./pom.xml</exists></file>
+      </activation>
+      <repositories>
+        <repository>
+          <id>test.repo</id>
+          <url>file:./src/test/repo</url>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+        </repository>
+      </repositories>
+    </profile>
+  </profiles>
+</settings>
\ No newline at end of file

Propchange: maven/ant-tasks/trunk/src/test/settings-profile-file.xml
------------------------------------------------------------------------------
    svn:eol-style = native