What's the id defined in the distributionMgmt section? It should map to the
id for the server creds defined in settings.xml ('nexus').

/Anders

On Wed, Oct 8, 2014 at 11:14 AM, DJViking <sverre....@gmail.com> wrote:

> I decided to start using HTTP/HTTPS instead of SCP for uploading and
> downloading artefacts from my Nexus server.
> However switching the URL didn't work.
>
> I have created a user in Nexus called build.
> In my settings.xml I have the following configuration taken from
> http://books.sonatype.com/nexus-book/reference/maven-sect-single-group.html
>
>     <server>
>       <id>nexus</id>
>       <username>build</username>
>       <password>XXXXXXXXXXXXXXX</password>
>     </server>
>
>     <mirror>
>       <id>nexus</id>
>       <mirrorOf>*</mirrorOf>
>       <url>http://maven-vm1:8081/nexus/content/groups/public</url>
>     </mirror>
>
>     <profile>
>       <id>nexus</id>
>       <repositories>
>         <repository>
>           <id>central</id>
>           <url>http://central</url>
>           <releases>
>             <enabled>true</enabled>
>             <updatePolicy>always</updatePolicy>
>           </releases>
>           <snapshots>
>             <enabled>true</enabled>
>             <updatePolicy>always</updatePolicy>
>           </snapshots>
>         </repository>
>       </repositories>
>
>       <pluginRepositories>
>         <pluginRepository>
>           <id>central</id>
>           <url>http://central</url>
>           <releases>
>             <enabled>true</enabled>
>           </releases>
>           <snapshots>
>             <enabled>true</enabled>
>           </snapshots>
>         </pluginRepository>
>       </pluginRepositories>
>     </profile>
>
>   <activeProfiles>
>     <activeProfile>nexus</activeProfile>
>   </activeProfiles>
>
> In my pom.xml I changed the following in distributionManagement
> <url>scp://maven-vm1/srv/maven/snapshots</url>
> to
> <url>http://maven-vm1:8081/nexus/content/repositories/snapshots</url>
>
> Still I cannot get it to upload to Nexus:
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-deploy-plugin:2.8.1:deploy (default-deploy)
> on project MyApp: Failed to deploy artifacts: Could not transfer artifact
> no.company:MyApp:jar:2.5.1-20141008.085615-1 from/to snapshots
> (http://maven-vm1:8081/nexus/content/repositories/snapshots): Failed to
> transfer file:
>
> http://maven-vm1:8081/nexus/content/repositories/snapshots/no/company/MyApp/2.5.1-SNAPSHOT/MyApp-2.5.1-20141008.085615-1.jar
> .
> Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/maven-deploy-artifacts-to-Nexus-repository-tp5751512p5808056.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>
>

Reply via email to