Maven: Trying to Deploy with credentials in settings.xml file

前端 未结 2 1571
萌比男神i
萌比男神i 2021-02-01 02:23

This seemed to be working last week and now it doesn\'t.

  • We use Artifactory as our Maven repository.
  • I am deploying a jar and pom using the deploy:d
相关标签:
2条回答
  • 2021-02-01 02:40

    You can also specify your snapshot repository id in distributionManagement

    <distributionManagement>
    <repository>
      <id>releases</id>
      <url>${env.MAVEN_RELEASE_REPOSITORY_URL}</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <url>${env.MAVEN_SNAPSHOT_REPOSITORY_URL}</url>
    </snapshotRepository>
    </distributionManagement>
    

    the ids here should match ones in servers

    0 讨论(0)
  • 2021-02-01 02:44

    You need to provide the repositoryId=VeggieCorp (not id) property so that maven knows from which <server> configuration it has to read the credentials.

    $ mvn deploy:deploy-file \
     -Durl=http://repo.veggiecorp.com/artifactory/ext-release-local \
     -Dfile=crypto.jar \
     -DpomFile=pom.xml \
     -DrepositoryId=VeggieCorp
    

    See http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html

    0 讨论(0)
提交回复
热议问题