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