We put deployment info in the Parent POM's but... We put the logon
credentials only in the settings.xml on the build servers. This way only
authoritative builds can be deployed to the corporate repo.


________________________________

Curt Yanko | Continuous Integration Services | UnitedHealth Group IT 
Making IT Happen, one build at a time, 600 times a day

-----Original Message-----
From: Ron Wheeler [mailto:[email protected]] 
Sent: Thursday, November 04, 2010 2:00 PM
To: [email protected]
Subject: Re: Problem while deploying snapshot to repository

POMs generally do not carry deployment repository information since
deployments generally involve user id and passwords which should be
personal and kept private.

What is in your settings.xml?

Putting repository information in a Parent POM keeps your project POMs
small and uncluttered.

Ron

On 04/11/2010 1:16 PM, Martin Gentry wrote:
> I'm currently experiencing a problem while trying to set up a project 
> to deploy to an internal nexus repository.  Since I'm rather new to 
> Maven in general, I expect that there is just something that I'm not 
> really comprehending in how to set up distribution management.
>
> The basic issue is that when I execute "mvn deploy" the artifact is 
> being successfully deployed to the snapshot repository, but Maven is 
> also attempting to deploy it to the release repository, which is 
> failing ... as it should.  My understanding of my current 
> configuration is that it should NOT be deploying it to the release
repository as well.
>
> I've included the various configuration elements below, but I'm 
> wondering if I actually am supposed to be managing 
> the<distributionManagement>  section with a profile so that snapshot 
> builds only have<snapshotRepository> defined, and release builds have
only<respository>  defined.
>
> Any help/clarification on this would be incredibly appreciated.
>
> I have the following in my POM for distribution management:
>    <distributionManagement>
>      <repository>
>        <id>internal-releases</id>
>        <name>Internal Releases</name>
>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
>      </repository>
>      <snapshotRepository>
>        <id>internal-snapshots</id>
>        <name>Internal Snapshots</name>
>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>      </snapshotRepository>
>    </distributionManagement>
>
> Elsewhere in the POM I have the following set up to allow use of these

> repositories to obtain artifacts:
>    <repositories>
>      <repository>
>        <id>internal-releases</id>
>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
>        <snapshots><enabled>false</enabled></snapshots>
>      </repository>
>      <repository>
>        <id>internal-snapshots</id>
>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
>        <snapshots><enabled>true</enabled></snapshots>
>      </repository>
>      <!-- other repos, etc, etc -->
>    </repositories>
>
> I have the correct settings in my settings.xml to provide credentials 
> to be able to publish to this test nexus instance running on my 
> computer, and it is in fact successfully deploying the snapshot.
>
> The problem is that it also tries to deploy the snapshot to the 
> release repository, which is configured to disallow snapshots.
>
> The output from "mvn deploy" includes the following:
> [INFO] [deploy:deploy {execution: default-deploy}] [INFO] Retrieving 
> previous build number from internal-snapshots
> Uploading:
> http://localhost:8081/nexus/content/repositories/snapshots/com/interna
> l/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-8.war
> 405K uploaded  (service-1.0.0-20101104.170338-8.war)
> [INFO] Retrieving previous metadata from internal-snapshots [INFO] 
> Uploading repository metadata for: 'snapshot 
> com.internal:service:1.0.0-SNAPSHOT'
> [INFO] Retrieving previous metadata from internal-snapshots [INFO] 
> Uploading repository metadata for: 'artifact com.internal:service'
> [INFO] Uploading project information for service 
> 1.0.0-20101104.170338-8 [INFO] [deploy:deploy-file {execution: 
> default}] [INFO] Retrieving previous build number from 
> remote-repository [INFO] repository metadata for: 'snapshot 
> com.internal:service:1.0.0-SNAPSHOT' could not be found on repository:
> remote-repository, so will be created
> Uploading:
> http://localhost:8081/nexus/content/repositories/releases/com/internal
> /service/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar
> [INFO]
> ----------------------------------------------------------------------
> --
> [ERROR] BUILD ERROR
> [INFO]
> ----------------------------------------------------------------------
> -- [INFO] Error deploying artifact: Failed to transfer file:
>
http://localhost:8081/nexus/content/repositories/releases/com/internal/s
ervice/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar.
> Return code is: 400
>
> The log from Nexus contains the following (as I would expect it to):
> jvm 1    | 2010-11-04 13:03:39 INFO  [p-759477796-118] -
> o.s.n.p.m.m.M2Repos~          - Storing of item
> releases:/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.1
> 70338-1.jar is forbidden by Maven Repository policy. Because releases 
> is a RELEASE repository
> jvm 1    | 2010-11-04 13:03:39 ERROR [p-759477796-118] -
> o.s.n.r.ContentPlex~          - Got exception during processing
request "PUT
>
http://localhost:8081/nexus/content/repositories/releases/com/internal/s
ervice/1.0.0-SNAPSHOT/service-1.0.0-20101104.170338-1.jar":
> Storing of item
> releases:/com/internal/service/1.0.0-SNAPSHOT/service-1.0.0-20101104.1
> 70338-1.jar is forbidden by Maven Repository policy. Because releases 
> is a RELEASE repository
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to