Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1.0
-
Fix Version/s: 3.0.0-beta-1
-
Component/s: deploy task
-
Labels:None
-
Environment:Ant 1.7.1, Maven ant tasks 2.1.0
-
Number of attachments :
Description
Given a ~/.m2/settings.xml file containing a mirror element
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>external:*</mirrorOf>
<url>https://xxx.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
a pom.xml file with a distributionManagement section
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
and a build.xml file with the following deploy task:
<target name="deploy" depends="-check"> <artifact:pom id="gin-pom" file="pom.xml" /> <artifact:deploy file="${gin.jar.file}"> <pom refid="gin-pom" /> <attach file="${gin.javadoc.file}" classifier="javadoc" /> </artifact:deploy> </target>
When running ant deploy the deployment is done on xxx.com instead of oss.sonatype.org . Removing the mirror from the settings file solves the problem.
same behavior occurs when <remoterepository> is defined inside <artifact:deploy>. The <mirror> inside settings.xml replaces the url completely.