jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Ant Tasks
  • MANTTASKS-174

Mirror declaration replaces url from distributionManagement

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.1.0
  • Fix Version/s: None
  • Component/s: deploy task
  • Labels:
    None
  • Environment:
    Ant 1.7.1, Maven ant tasks 2.1.0

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.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Eric Quilantang added a comment - 18/Jul/11 2:16 PM

same behavior occurs when <remoterepository> is defined inside <artifact:deploy>. The <mirror> inside settings.xml replaces the url completely.

Show
Eric Quilantang added a comment - 18/Jul/11 2:16 PM same behavior occurs when <remoterepository> is defined inside <artifact:deploy>. The <mirror> inside settings.xml replaces the url completely.
Hide
Permalink
Eric Quilantang added a comment - 18/Jul/11 2:39 PM

When I remove the Mirror override clause in AbstractArtifactTask, the task works as expected for me.

It's not clear to me why I would ever want my remote distribution to be overridden since my mirror usually points to my Nexus public group.

code found in updateRepositoryWithSettings( RemoteRepository repository )

Show
Eric Quilantang added a comment - 18/Jul/11 2:39 PM When I remove the Mirror override clause in AbstractArtifactTask, the task works as expected for me. It's not clear to me why I would ever want my remote distribution to be overridden since my mirror usually points to my Nexus public group. code found in updateRepositoryWithSettings( RemoteRepository repository )
Hide
Permalink
Jonathan Kinred added a comment - 14/Mar/12 6:20 PM

This is a quite annoying problem especially as many people would be using Nexus/Artifactory and would therefore have a <mirror> section in settings.xml.

Will you accept a patch for this?

Show
Jonathan Kinred added a comment - 14/Mar/12 6:20 PM This is a quite annoying problem especially as many people would be using Nexus/Artifactory and would therefore have a <mirror> section in settings.xml. Will you accept a patch for this?

People

  • Assignee:
    Unassigned
    Reporter:
    Robert Munteanu
Vote (5)
Watch (5)

Dates

  • Created:
    02/Feb/10 4:10 PM
    Updated:
    14/Mar/12 6:20 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.