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

remoteRepository ignores password settings in .m2/settings.xml

    XMLWordPrintableJSON

Details

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

    Description

      remoteRepository only recognizes '<authentication username="username" password="password"/>'.
      I would expect it to recognize '<authentication username="username"/>' and then read the password (based on the repository id) from my settings.xml.
      Also doesn't recognize '<authentication username="username" privateKey="${home}/.ssh/private_key_file"/>'. Still prompts for password. Although, it will fail if the path specified does not exist.
      If I leave out the authentication altogether, it prompts for my login password, even if it is specified in my .m2/settings.xml file.

      My ant build file looks like this (with the various authentication items I've tried):

      <target name="mvn.init">
      	  <artifact:remoteRepository id="releases" url="scp://server/NEXUS/sonatype-work/nexus/storage/releases">
      		    <authentication username="nexus" privateKey="${user.home}/.ssh/id_dsa"/>  OR
      		    <authentication username="nexus"/>  OR
      		    <authentication username="nexus" password="encryptedPassword"/>  OR
      		    <authentication username="nexus" password="password"/>  THIS IS THE ONLY ONE THAT WORKS
      	  </artifact:remoteRepository>
      
      	    <artifact:install-provider groupId="org.apache.maven.wagon"
      				       artifactId="wagon-ssh"
      				       version="1.0-beta-7">
      	    </artifact:install-provider>
      </target>
      
      <target name="deploy.artifacts" depends="mvn.init,compile.all">
      	    <echo>Deploying artifacts to Nexus:</echo>
      	    
      	    <echo>- deploying ${artifact}</echo>
      	    <artifact:pom id="mypom" groupId="${groupId}" artifactId="${artifactId}" version="${version}" packaging="${type}"/>
      	    <artifact:writepom pomRefId="mypom" file="mypom.xml"/>  HAD TO DO THIS BECAUSE IT USES A BOGUS finalName IF I JUST USE A REFID BELOW.
      	   
      	    <artifact:deploy file="${file}">
      		    <pom file="mypom.xml"/>
      		    <remoteRepository refid="releases"/>
      	    </artifact:deploy>
      	    
      	    <!-- Remove dynamic pom -->
      	    <delete file="mypom.xml"/>
      </target>
      
      

      And my settings.xml looks like this:

      <settings>
          <servers>
              <server>
                  <id>releases</id>
                  <username>username</username>
                  <password>password</password>
              </server>
          </servers>
      </settings>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            walshmatt Matt Walsh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: