Uploaded image for project: 'Maven Ant Tasks (RETIRED)'
  1. Maven Ant Tasks (RETIRED)
  2. MANTTASKS-253

Deploy doesn't authenticate to remote repository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.1.3
    • None
    • deploy task
    • None

    Description

      I can't get my deploy task to authenticate to remote repository. The same works just fine when using `mvn deploy:depoy-file -D...`. On the server log I see that ant tries to make a PUT request without being authenticated, while maven is using the right user.

      <?xml version="1.0" encoding="UTF-8"?>
      <project name="sabbus" default="deploy" xmlns:artifact="urn:maven-artifact-ant">
      
        <description>Test ant depoy.</description>
        <target name="init">
          <path id="maven-ant-tasks.classpath" path="lib/ant/maven-ant-tasks-2.1.3.jar" />
          <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
      
          <property name="settings.file" value="${user.home}/.m2/settings.xml" />
          <property name="remote.repository" value="http://artifactory.server.com:8081/artifactory/libs-release" />
          <property name="repository.credentials.id" value="my-releases" />
          <property name="path" value="${basedir}/dists/maven/2.11.7/scala-compiler/scala-compiler" />
        </target>
        <target name="deploy" depends="init">
          <!--<echoproperties/>-->
          <artifact:deploy file="${path}.jar" settingsFile="${settings.file}">
            <remoteRepository id="${repository.credentials.id}" url="${remote.repository}" />
            <artifact:pom file="${path}-pom-filtered.xml" />
            <artifact:attach type="jar" file="${path}-src.jar" classifier="sources" />
            <artifact:attach type="jar" file="${path}-docs.jar" classifier="javadoc" />
          </artifact:deploy>
        </target>
      </project>
      

      My ~/.m2/settings.xml file has the proper id, and maven picks it up correctly and deploys successfully.

        <servers>
          <server>
            <id>my-releases</id>
            <username>deployer</username>
            <password>...</password>
          </server>
          <server>
            <id>my-snapshots</id>
            <username>deployer</username>
            <password>..</password>
          </server>
        </servers>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dragos Dragos Dascalita Haut
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: