PLUGIN: mvn deploy doesn't seem to work with my credentials

21 views
Skip to first unread message

Victor Martinez

unread,
Feb 10, 2017, 1:05:26 PM2/10/17
to Jenkins Developers
Hi there,

Probably this is a typical question, but I'm running out of ideas, beforehand I went through the https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins#HostingPlugins-Frequentlyaskedquestions page.

Current maven setup:

~/.m2/settings.xml
...
  <servers>
    <server>
      <id>repo.jenkins-ci.org</id>
      <username>v2v</username>
      <password>ENCRYPTED_PASSWORD</password>
    </server>
  </servers>
...

I took the encrypted password from:


It seems the reverse proxy is broken, so I'm just using the above url instead.

Then when I run mvn deploy
I get the famous 401 Unauthorized as you can see below 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 28.935 s

[INFO] Finished at: 2017-02-10T17:42:28+00:00

[INFO] Final Memory: 42M/630M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy (default-deploy) on project jenkinslint: Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:jenkinslint:hpi:0.6.0-20170210.174227-1 from/to maven.jenkins-ci.org (https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots): Failed to transfer file: https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.174227-1.hpi. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy (default-deploy) on project jenkinslint: Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:jenkinslint:hpi:0.6.0-20170210.174227-1 from/to maven.jenkins-ci.org (https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots): Failed to transfer file: https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.174227-1.hpi. Return code is: 401, ReasonPhrase: Unauthorized.


I tested it out my artifactory password (plain and encrypted) and I'm able to upload artifacts, see the below CURL commands:

curl -u v2v:PLAY_PASSWORD -X PUT "https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.173439-1.hpi"  -T target/jenkinslint.hpi 

{

  "repo" : "snapshots",

  "path" : "/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.173439-1.hpi",

  "created" : "2017-02-10T17:40:06.289Z",

  "createdBy" : "v2v",

  "downloadUri" : "https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.173439-1.hpi",

  "mimeType" : "application/java-archive",

  "size" : "71249",

  "checksums" : {

    "sha1" : "14348911f3c8eef9d81825e7b8e508f6fd324264",

    "md5" : "1c659bfe171a629a9709c9bd15681d5c"

  },

  "originalChecksums" : {

  },

  "uri" : "https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.173439-1.hpi"

}


curl -u v2v:ENCRYPTED_PASS -X GET "https://jenkinsci.artifactoryonline.com/jenkinsci/api/storage/snapshots/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.173439-1.hpi?stats"

{

  "uri" : "https://jenkinsci.artifactoryonline.com/jenkinsci/snapshots/org/jenkins-ci/plugins/jenkinslint/0.6.0-SNAPSHOT/jenkinslint-0.6.0-20170210.173439-1.hpi",

  "downloadCount" : 1,

  "lastDownloaded" : 1486749534797,

  "lastDownloadedBy" : "v2v",

  "remoteDownloadCount" : 0,

  "remoteLastDownloaded" : 0

}



From the setup i can do anything by command line, but from the maven configuration is failing, so I don't know how to debug further, any ideas/hints? 

Thanks

Daniel Beck

unread,
Feb 10, 2017, 1:10:53 PM2/10/17
to jenkin...@googlegroups.com

> On 10.02.2017, at 19:05, Victor Martinez <victormar...@gmail.com> wrote:
>
> from the maven configuration is failing, so I don't know how to debug further, any ideas/hints?

Make this ID match the one in settings.xml so Maven knows this is the same repo:
https://github.com/jenkinsci/jenkinslint-plugin/blob/b03524732ce0ca810e69b2525caaa16cb77e8c4a/pom.xml#L36

Third item in the note titled "HTTP 401 when transferring a file to the Jenkins Maven repository" on the wiki page ;-)

Also, that host name (one line down) is pretty obsolete -- see INFRA-588.

Victor Martinez

unread,
Feb 10, 2017, 2:23:27 PM2/10/17
to Jenkins Developers, m...@beckweb.net
I'm definitely blind... Thanks so much :)
Reply all
Reply to author
Forward
0 new messages