Error returned from Maven deploy to nexus: return code is: 401, reasonphrase: unauthorized

Source: Internet
Author: User

An error is reported when the node is submitted to nexus:

[Error] failed to execute goal org. Apache. Maven. plugins: Maven-deploy-plugin: 2.7: deploy (default-deploy) on Project *: failed to deploy artifacts: cocould
Not transfer artifact *: jar: 1.0 from/to releases (http: // 10.1.81.199: 8081/nexus/content/repositories/releases/): failed to transfer file: http: // 10.1.81.199: 8081/nexus/content/repositories/releases/COM/cs2c/security-management-client */1.0/*-1.0.jar.
Return code is: 401, reasonphrase: unauthorized.

Authentication is not configured.

In setting. xml of conf in Maven directory,

    <server>      <id>releases</id>      <username>admin</username>      <password>admin123</password>    </server>  <server>  <id>snapshots</id>  <username>admin</username>  <password>admin123</password>    </server>  </servers>

Both the user name and password are nexus. Deploy again.

Note that the ID here must be consistent with the remote deploy address in POM. xml. In my pom. xml configuration:

<! -- Configure remote publishing to private server, MVN deploy --> <distributionmanagement> <repository> <ID> releases </ID> <Name> nexus release repository </Name> <URL> HTTP: // 10.1.81.199: 8081/nexus/content/repositories/releases/</URL> </Repository> <snapshotrepository> <ID> snapshots </ID> <Name> nexus snapshot repository </Name> <URL> HTTP: // 10.1.81.199: 8081/nexus/content/repositories/snapshots/</URL> </snapshotrepository> </distributionmanagement>

If this parameter is not configured, an error is returned:

Error: failed to execute
Goal Org. apache. maven. plugins: Maven-deploy-plugin: 2.5: deploy (default-deploy) on Project Git-demo: Deployment failed: repository element was not specified in the POM inside distributionmanagement element or in-daltdeploymentrepository = ID: Layout: URL parameter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.