Why am I getting a “401 Unauthorized” error in Maven?

前端 未结 21 1782
栀梦
栀梦 2020-11-29 18:06

Why am I getting a \"401 Unauthorized\" error in Maven?

Here\'s the error I\'m getting when calling mvn deploy (full logs at the bottom):

21条回答
  •  温柔的废话
    2020-11-29 18:34

    I had the same error. I tried and rechecked everything. I was so focused in the Stack trace that I didn't read the last lines of the build before the Reactor summary and the stack trace:

    [DEBUG] Using connector AetherRepositoryConnector with priority 3.4028235E38 for http://www:8081/nexus/content/repositories/snapshots/
    [INFO] Downloading: http://www:8081/nexus/content/repositories/snapshots/com/wdsuite/com.wdsuite.server.product/1.0.0-SNAPSHOT/maven-metadata.xml
    [DEBUG] Could not find metadata com.group:artifact.product:version-SNAPSHOT/maven-metadata.xml in nexus (http://www:8081/nexus/content/repositories/snapshots/)
    [DEBUG] Writing tracking file /home/me/.m2/repository/com/group/project/version-SNAPSHOT/resolver-status.properties
    [INFO] Uploading: http://www:8081/nexus/content/repositories/snapshots/com/...-1.0.0-20141118.124526-1.zip
    [INFO] Uploading: http://www:8081/nexus/content/repositories/snapshots/com/...-1.0.0-20141118.124526-1.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary:
    

    This was the key : "Could not find metadata". Although it said that it was an authentication error actually it got fixed doing a "rebuild metadata" in the nexus repository.

    Hope it helps.

提交回复
热议问题