...
If the upload fails with Error deploying artifact: Failed to transfer file: ... Return code is: 401
then either the username/password are incorrect, or Nexus has not yet been set up for the commons component.
Deploying to a local directory
The deploy target can easily be overridden by defining the altDeploymentRepository property. For example, the following will deploy to the local directory target/deploy
:
Wiki Markup |
---|
{{mvn deploy -Prelease \[-Dgpg.skip\] \[-DskipTests\] -DaltDeploymentRepository=id::default::file:target/deploy}} |
It's difficult to type and remember this parameter. One solution is to create a profile in your settings.xml:
No Format |
---|
<profile>
<id>local-deploy</id>
<properties>
<altDeploymentRepository>id::default::file:target/deploy</altDeploymentRepository>
</properties>
</profile>
|
You can then add -Plocal-deploy
to the deploy command to change the deployment to use target/deploy
.
Creating a Nexus staging release
...
Wiki Markup |
---|
{{mvn deploy -Prelease \[-DskipTests\] \[-Plocal-deploy\]}} |
The -Plocal-deploy
parameter can be used as described above to redirect the deployment to target/deploy.
OtherwiseThis time, the artifacts will be deployed to the release staging repository in Nexus.
...