You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Martin Gentry <mg...@ieee.org> on 2010/11/04 18:16:47 UTC

Problem while deploying snapshot to repository

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/internal/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/service/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.170338-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/service/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.170338-1.jar
is forbidden by Maven Repository policy. Because releases is a RELEASE
repository

Re: Problem while deploying snapshot to repository

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 04/11/2010 2:25 PM, Martin Gentry wrote:
> The only relevant item in my settings.xml is the credentials.  These
> credentials will in fact only be placed on the build machine (Bamboo being
> used for builds), but right now I'm testing out how to set everything up and
> can't fathom why Maven is trying to deploy a 1.0.0-SNAPSHOT versioned
> artifact to the release repo.
>
> Only relevant settings.xml content is (no repos defined there):
>    <servers>
>     <server>
>      <id>internal-releases</id>
>      <username>.....</username>
>      <password>.....</password>
>     </server>
>     <server>
>      <id>internal-snapshots</id>
>      <username>.....</username>
>      <password>.....</password>
>     </server>
>    </servers>
>
> Whether or not the distributionManagement node is in a parent POM or in the
> project's POM directly seems somewhat irrelevant to the problem at hand
> since it will amount to a basically identical effective POM.  The issue at
> hand is still that I have no idea why Maven is trying to deploy a SNAPSHOT
> to the release repo.
>
You may be right about distribution management.
However, you have made a mistake somewhere in your configuring of your 
deployment repositories.
The point of the questions is to locate where you have gone wrong.

I am assuming that you have looked in all the places that you know and 
you are asking the forum to help you find the spot where you have 
screwed up.
The possibility that I was investigating is that you have contradictory 
specifications somewhere.
Getting rid of duplicate specifications and consolidating the 
information into 1 spot might lead to a correct, consistent set of POMs 
and settings.


Ron

> Thanks,
> -martin
>
> On Thu, Nov 4, 2010 at 2:11 PM, Yanko, Curtis<cu...@uhc.com>  wrote:
>
>>   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:rwheeler@artifact-software.com]
>> Sent: Thursday, November 04, 2010 2:00 PM
>> To: users@maven.apache.org
>> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>> 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: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem while deploying snapshot to repository

Posted by Martin Gentry <mg...@ieee.org>.
BTW, my particular issue has already been resolved by Wendy pointing out
that according to the logging messages there seemed to be something
configured to deploy a jar in addition to the war that I was expecting to be
deployed.  The jar is what was being deployed to the releases repo.

The distributionManagement and respository configurations were all correct.
Someone had hooked up an additional "deploy-file" to attempt to deploy the
classes used in the war and was improperly directly using
${project.distributionManagement.repository.url}
for it's URL.

This was changed to use the attachClasses option of the war plugin so that a
jar is also deployed with the 'classes' classifier.

RE: Problem while deploying snapshot to repository

Posted by "Yanko, Curtis" <cu...@uhc.com>.
 
Nothing looks wrong there, do you have your wires crossed in Nexus?

________________________________

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

-----Original Message-----
From: Martin Gentry [mailto:mgentry@ieee.org] 
Sent: Thursday, November 04, 2010 2:26 PM
To: Maven Users List
Subject: Re: Problem while deploying snapshot to repository

The only relevant item in my settings.xml is the credentials.  These
credentials will in fact only be placed on the build machine (Bamboo
being used for builds), but right now I'm testing out how to set
everything up and can't fathom why Maven is trying to deploy a
1.0.0-SNAPSHOT versioned artifact to the release repo.

Only relevant settings.xml content is (no repos defined there):
  <servers>
   <server>
    <id>internal-releases</id>
    <username>.....</username>
    <password>.....</password>
   </server>
   <server>
    <id>internal-snapshots</id>
    <username>.....</username>
    <password>.....</password>
   </server>
  </servers>

Whether or not the distributionManagement node is in a parent POM or in
the project's POM directly seems somewhat irrelevant to the problem at
hand since it will amount to a basically identical effective POM.  The
issue at hand is still that I have no idea why Maven is trying to deploy
a SNAPSHOT to the release repo.

Thanks,
-martin

On Thu, Nov 4, 2010 at 2:11 PM, Yanko, Curtis <cu...@uhc.com>
wrote:

>
>  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:rwheeler@artifact-software.com]
> Sent: Thursday, November 04, 2010 2:00 PM
> To: users@maven.apache.org
> 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/inter
> > na 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/intern
> > al /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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem while deploying snapshot to repository

Posted by Martin Gentry <mg...@ieee.org>.
The only relevant item in my settings.xml is the credentials.  These
credentials will in fact only be placed on the build machine (Bamboo being
used for builds), but right now I'm testing out how to set everything up and
can't fathom why Maven is trying to deploy a 1.0.0-SNAPSHOT versioned
artifact to the release repo.

Only relevant settings.xml content is (no repos defined there):
  <servers>
   <server>
    <id>internal-releases</id>
    <username>.....</username>
    <password>.....</password>
   </server>
   <server>
    <id>internal-snapshots</id>
    <username>.....</username>
    <password>.....</password>
   </server>
  </servers>

Whether or not the distributionManagement node is in a parent POM or in the
project's POM directly seems somewhat irrelevant to the problem at hand
since it will amount to a basically identical effective POM.  The issue at
hand is still that I have no idea why Maven is trying to deploy a SNAPSHOT
to the release repo.

Thanks,
-martin

On Thu, Nov 4, 2010 at 2:11 PM, Yanko, Curtis <cu...@uhc.com> wrote:

>
>  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:rwheeler@artifact-software.com]
> Sent: Thursday, November 04, 2010 2:00 PM
> To: users@maven.apache.org
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Problem while deploying snapshot to repository

Posted by "Yanko, Curtis" <cu...@uhc.com>.
 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:rwheeler@artifact-software.com] 
Sent: Thursday, November 04, 2010 2:00 PM
To: users@maven.apache.org
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem while deploying snapshot to repository

Posted by Brian Topping <to...@codehaus.org>.
On Nov 4, 2010, at 5:08 PM, Ron Wheeler wrote:

> On 04/11/2010 2:36 PM, Brian Topping wrote:
>> On Nov 4, 2010, at 1:59 PM, Ron Wheeler wrote:
>> 
>>> Putting repository information in a Parent POM keeps your project POMs small and uncluttered.
>> I often make an exception to this very good advice:  If I am working with snapshot versions from a remote repository, I'll temporarily put that repository declaration in the POM for the project with the dependency, not at the top level.   This speeds up builds because every defined repository with snapshots enabled are consecutively searched until the latest version of any snapshot can be confirmed.  Reduce the number of repositories to search, speed up the build!
> You are clearly a user that is comfortable with Maven and can deal with a significant amount of complexity so I will gladly accept your exception.
> You are also braver than I am (or stuck with third party developers who hate to actually say that they have finished something), so you need to experiment with remote Snapshots. So far, I have been lucky in this regard.

FWIW, the first "discovery" I made on this route was adding these two lines to every repository:

            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>

Then do a build and turn on snapshots for the repositories you need them on.  The ones that you turn them on with, these are candidates for moving to a sub-build.  But even without moving them, disabling snapshots on repositories that don't have any snapshots will speed up your build as well.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem while deploying snapshot to repository

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 04/11/2010 2:36 PM, Brian Topping wrote:
> On Nov 4, 2010, at 1:59 PM, Ron Wheeler wrote:
>
>> Putting repository information in a Parent POM keeps your project POMs small and uncluttered.
> I often make an exception to this very good advice:  If I am working with snapshot versions from a remote repository, I'll temporarily put that repository declaration in the POM for the project with the dependency, not at the top level.   This speeds up builds because every defined repository with snapshots enabled are consecutively searched until the latest version of any snapshot can be confirmed.  Reduce the number of repositories to search, speed up the build!
You are clearly a user that is comfortable with Maven and can deal with 
a significant amount of complexity so I will gladly accept your exception.
You are also braver than I am (or stuck with third party developers who 
hate to actually say that they have finished something), so you need to 
experiment with remote Snapshots. So far, I have been lucky in this regard.

Ron
> Of course, this is not a problem if you use a nearby repository manager.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem while deploying snapshot to repository

Posted by Brian Topping <to...@codehaus.org>.
On Nov 4, 2010, at 1:59 PM, Ron Wheeler wrote:

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

I often make an exception to this very good advice:  If I am working with snapshot versions from a remote repository, I'll temporarily put that repository declaration in the POM for the project with the dependency, not at the top level.   This speeds up builds because every defined repository with snapshots enabled are consecutively searched until the latest version of any snapshot can be confirmed.  Reduce the number of repositories to search, speed up the build!

Of course, this is not a problem if you use a nearby repository manager.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem while deploying snapshot to repository

Posted by Ron Wheeler <rw...@artifact-software.com>.
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/internal/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/service/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.170338-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/service/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.170338-1.jar
> is forbidden by Maven Repository policy. Because releases is a RELEASE
> repository
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problem while deploying snapshot to repository

Posted by Jon Paynter <ki...@gmail.com>.
On Thu, Nov 4, 2010 at 11:53 AM, Martin Gentry <mg...@ieee.org> wrote:

> On Thu, Nov 4, 2010 at 2:33 PM, Wendy Smoak <ws...@gmail.com> wrote:
>
> > On Thu, Nov 4, 2010 at 1:16 PM, Martin Gentry <mg...@ieee.org> wrote:
> > > 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.
> >
> > It's not... I see a war going to snapshots and a _jar_ going to releases.
> >
> > What's in the pom?  I see:
> > [INFO] [deploy:deploy-file {execution: default}]
> >
> > And 'deploy-file' is not part of the default lifecycle, it's usually
> > used at the command line.
> >
> > My guess is that someone has configured an execution of the deploy
> > plugin trying to push an extra jar into the repo.  (If you're trying
> > to deploy the class files from a webapp, the war plugin has an option
> > to do that for you, though it's better to put the classes in a
> > separate module.)
> >
>
> And here goes where my n00b status with Maven comes into play. :)  So with
> this pointer I've located the problem in the main project POM that seems to
> be the culprit.
>
> Someone had added:
> <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>  <artifactId>maven-deploy-plugin</artifactId>
>  <executions>
>    <execution>
>      <phase>deploy</phase>
>        <goals>
>          <goal>deploy-file</goal>
>        </goals>
>        <configuration>
>          <packaging>jar</packaging>
>          <generatePom>true</generatePom>
>          <url>${project.distributionManagement.repository.url}</url>
>          <artifactId>${project.artifactId}</artifactId>
>          <groupId>${project.groupId}</groupId>
>          <version>${project.version}</version>
>
>  <file>${project.build.directory}/${project.build.finalName}.jar</file>
>        </configuration>
>      </execution>
>    </executions>
>  </plugin>
>
> Which for one, directly
> references ${project.distributionManagement.repository.url}.  Commenting
> that section out resolves my particular issue, now I just have to determine
> why this was there in the first place and resolve that issue. :)
>

Just as an aside - thanks for supplying the the deploy-file entry for a pom.
 This is exactly what I needed to greatly simplify managing our thirdparty
jar files.

Re: Problem while deploying snapshot to repository

Posted by Martin Gentry <mg...@ieee.org>.
On Thu, Nov 4, 2010 at 2:33 PM, Wendy Smoak <ws...@gmail.com> wrote:

> On Thu, Nov 4, 2010 at 1:16 PM, Martin Gentry <mg...@ieee.org> wrote:
> > 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.
>
> It's not... I see a war going to snapshots and a _jar_ going to releases.
>
> What's in the pom?  I see:
> [INFO] [deploy:deploy-file {execution: default}]
>
> And 'deploy-file' is not part of the default lifecycle, it's usually
> used at the command line.
>
> My guess is that someone has configured an execution of the deploy
> plugin trying to push an extra jar into the repo.  (If you're trying
> to deploy the class files from a webapp, the war plugin has an option
> to do that for you, though it's better to put the classes in a
> separate module.)
>

And here goes where my n00b status with Maven comes into play. :)  So with
this pointer I've located the problem in the main project POM that seems to
be the culprit.

Someone had added:
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-deploy-plugin</artifactId>
  <executions>
    <execution>
      <phase>deploy</phase>
        <goals>
          <goal>deploy-file</goal>
        </goals>
        <configuration>
          <packaging>jar</packaging>
          <generatePom>true</generatePom>
          <url>${project.distributionManagement.repository.url}</url>
          <artifactId>${project.artifactId}</artifactId>
          <groupId>${project.groupId}</groupId>
          <version>${project.version}</version>

 <file>${project.build.directory}/${project.build.finalName}.jar</file>
        </configuration>
      </execution>
    </executions>
  </plugin>

Which for one, directly
references ${project.distributionManagement.repository.url}.  Commenting
that section out resolves my particular issue, now I just have to determine
why this was there in the first place and resolve that issue. :)

No doubt your pointer to the war plugin options for deploying the class
files as a first step will be helpful since deploying the classes as a jar
separately does seem what was wanted.  Though obviously breaking that out
into a separate module that the web app depends on is obviously the better
solution.

Thanks!

PS - If you're a StackOverflow user, feel free to go answer at the question
I posted there for the points. :)
http://stackoverflow.com/questions/4099412/why-is-maven-incorrectly-deploying-my-snapshot-to-both-the-release-and-snapsho

Re: Problem while deploying snapshot to repository

Posted by Wendy Smoak <ws...@gmail.com>.
On Thu, Nov 4, 2010 at 1:16 PM, Martin Gentry <mg...@ieee.org> wrote:
> 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.

It's not... I see a war going to snapshots and a _jar_ going to releases.

What's in the pom?  I see:
[INFO] [deploy:deploy-file {execution: default}]

And 'deploy-file' is not part of the default lifecycle, it's usually
used at the command line.

My guess is that someone has configured an execution of the deploy
plugin trying to push an extra jar into the repo.  (If you're trying
to deploy the class files from a webapp, the war plugin has an option
to do that for you, though it's better to put the classes in a
separate module.)

Can you reproduce this with a sample project and file:///path/to/repo
urls and show us the pom?

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org