You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nazia Ghawte <ng...@premierfarnell.com> on 2011/09/29 12:42:38 UTC

Skip Pom deployment

How to skip the deployment of parent Pom into the maven repository?

--
View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843439.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Skip Pom deployment

Posted by Guillaume Polet <gu...@gmail.com>.
Sorry but you got me lost there. I really don't know how you get very 
two different results running the same command with the same parameters 
and without changing the pom.xml's. Do you run those with a command line 
or do you use an IDE? Maybe somebody else has a better understanding 
than I am of what your problem is.

Anyway, I don't see why you would have to modify anything to your pom, 
since the result you want can be obtained just by changing the current 
directory when launching Maven.

Hope someone can help you more.

Guillaume

Le 29/09/2011 14:53, Nazia Ghawte a écrit :
> Follwoing is the output on running the deploy command
>
> First  when i chnage the version from 2.4 to 2.6
>
> [INFO] Uploading repository metadata for: 'artifact
> commons.adapter:pricing-ra'
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Resource Adapter
> [INFO]    task-segment: [deploy]
> [INFO]
> ------------------------------------------------------------------------
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.6/maven-deploy-plugin-2.6.pom
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/19/maven-plugins-19.pom
> Downloading:
> http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.6/maven-deploy-plugin-2.6.jar
> [INFO] Reloading plugin container for:
> org.apache.maven.plugins:maven-deploy-plugin. The plugin artifact has
> changed.
> [INFO] [site:attach-descriptor]
> [INFO] [install:install]
> [INFO] Installing /home/dev/SVNWorkspace/resourceadapter/pom.xml to
> /usr/local/apache-maven-2.0.9/repo/com/pf/resourceadapter/1.0-SNAPSHOT/resourceadapter-1.0-SNAPSHOT.pom
> [INFO] [deploy:deploy]
> [INFO] Skipping artifact deployment
> [INFO]
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> ------------------------------------------------------------------------
> [INFO] commons-adapter ....................................... SUCCESS
> [9.058s]
> [INFO] parser ................................................ SUCCESS
> [4.884s]
> [INFO] uri-ra ................................................ SUCCESS
> [5.204s]
> [INFO] tax-ra ................................................ SUCCESS
> [5.134s]
> [INFO] pricing-ra ............................................ SUCCESS
> [5.085s]
> [INFO] Resource Adapter ...................................... SUCCESS
> [2.941s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
>
>
> 2) when i run the same command again
> [INFO] Uploading repository metadata for: 'artifact
> commons.adapter:pricing-ra'
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Resource Adapter
> [INFO]    task-segment: [deploy]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [site:attach-descriptor]
> [INFO] [install:install]
> [INFO] Installing /home/dev/SVNWorkspace/resourceadapter/pom.xml to
> /usr/local/apache-maven-2.0.9/repo/com/pf/resourceadapter/1.0-SNAPSHOT/resourceadapter-1.0-SNAPSHOT.pom
> [INFO] [deploy:deploy]
> altDeploymentRepository = null
> [INFO] Retrieving previous build number from maven
> Uploading:
> scp://10.11.19.113/home/dev/com/pf/resourceadapter/1.0-SNAPSHOT/resourceadapter-1.0-20110929.112106-10.pom
> 4K uploaded
> [INFO] Retrieving previous metadata from maven
> [INFO] Uploading repository metadata for: 'artifact com.pf:resourceadapter'
> [INFO] Retrieving previous metadata from maven
> [INFO] Uploading repository metadata for: 'snapshot
> com.pf:resourceadapter:1.0-SNAPSHOT'
> [INFO]
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> ------------------------------------------------------------------------
> [INFO] commons-adapter ....................................... SUCCESS
> [9.585s]
> [INFO] parser ................................................ SUCCESS
> [4.946s]
> [INFO] uri-ra ................................................ SUCCESS
> [5.186s]
> [INFO] tax-ra ................................................ SUCCESS
> [5.059s]
> [INFO] pricing-ra ............................................ SUCCESS
> [5.133s]
> [INFO] Resource Adapter ...................................... SUCCESS
> [6.234s]
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
>
>
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843774.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Skip Pom deployment

Posted by Nazia Ghawte <ng...@premierfarnell.com>.
Follwoing is the output on running the deploy command 

First  when i chnage the version from 2.4 to 2.6

[INFO] Uploading repository metadata for: 'artifact
commons.adapter:pricing-ra'
[INFO]
------------------------------------------------------------------------
[INFO] Building Resource Adapter
[INFO]    task-segment: [deploy]
[INFO]
------------------------------------------------------------------------
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.6/maven-deploy-plugin-2.6.pom
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-plugins/19/maven-plugins-19.pom
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.6/maven-deploy-plugin-2.6.jar
[INFO] Reloading plugin container for:
org.apache.maven.plugins:maven-deploy-plugin. The plugin artifact has
changed.
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /home/dev/SVNWorkspace/resourceadapter/pom.xml to
/usr/local/apache-maven-2.0.9/repo/com/pf/resourceadapter/1.0-SNAPSHOT/resourceadapter-1.0-SNAPSHOT.pom
[INFO] [deploy:deploy]
[INFO] Skipping artifact deployment
[INFO] 
[INFO] 
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
------------------------------------------------------------------------
[INFO] commons-adapter ....................................... SUCCESS
[9.058s]
[INFO] parser ................................................ SUCCESS
[4.884s]
[INFO] uri-ra ................................................ SUCCESS
[5.204s]
[INFO] tax-ra ................................................ SUCCESS
[5.134s]
[INFO] pricing-ra ............................................ SUCCESS
[5.085s]
[INFO] Resource Adapter ...................................... SUCCESS
[2.941s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------


2) when i run the same command again
[INFO] Uploading repository metadata for: 'artifact
commons.adapter:pricing-ra'
[INFO]
------------------------------------------------------------------------
[INFO] Building Resource Adapter
[INFO]    task-segment: [deploy]
[INFO]
------------------------------------------------------------------------
[INFO] [site:attach-descriptor]
[INFO] [install:install]
[INFO] Installing /home/dev/SVNWorkspace/resourceadapter/pom.xml to
/usr/local/apache-maven-2.0.9/repo/com/pf/resourceadapter/1.0-SNAPSHOT/resourceadapter-1.0-SNAPSHOT.pom
[INFO] [deploy:deploy]
altDeploymentRepository = null
[INFO] Retrieving previous build number from maven
Uploading:
scp://10.11.19.113/home/dev/com/pf/resourceadapter/1.0-SNAPSHOT/resourceadapter-1.0-20110929.112106-10.pom
4K uploaded
[INFO] Retrieving previous metadata from maven
[INFO] Uploading repository metadata for: 'artifact com.pf:resourceadapter'
[INFO] Retrieving previous metadata from maven
[INFO] Uploading repository metadata for: 'snapshot
com.pf:resourceadapter:1.0-SNAPSHOT'
[INFO] 
[INFO] 
[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
------------------------------------------------------------------------
[INFO] commons-adapter ....................................... SUCCESS
[9.585s]
[INFO] parser ................................................ SUCCESS
[4.946s]
[INFO] uri-ra ................................................ SUCCESS
[5.186s]
[INFO] tax-ra ................................................ SUCCESS
[5.059s]
[INFO] pricing-ra ............................................ SUCCESS
[5.133s]
[INFO] Resource Adapter ...................................... SUCCESS
[6.234s]
[INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------



--
View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843774.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Skip Pom deployment

Posted by Nazia Ghawte <ng...@premierfarnell.com>.
Yep absolutely thats the case..

--
View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843746.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Skip Pom deployment

Posted by Guillaume Polet <gu...@gmail.com>.
You mean that if you run twice the exact same command, you get two 
different results? Then there is something really wrong with your project.

Anyway, let's say you have a project with the following structure:

  * Root
      o A
      o B
      o C

in Root, you declare the 3 modules A,B,C (aggregation), and in A,B,C, 
you declare Root as their parent (inheritance).

If you run 'mvn deploy' from Root, all four projects should get 
deployed. If you run 'mvn deploy' from A, B or C, then only A, B or C 
should get deployed. Isn't this what you are looking for?

Guillaume

Le 29/09/2011 14:30, Nazia Ghawte a écrit :
> ok, one revelation here.
>              <plugin>
>                  <groupId>org.apache.maven.plugins</groupId>
>                  <artifactId>maven-deploy-plugin</artifactId>
>                  <version>2.7</version>
>                  <configuration>
>                    <skip>${skipDeploy}</skip>
>                  </configuration>
>              </plugin>
> On changing the plugin version from 2.4 to 2.7 the artifact deployment was
> skipped for the first time,but it agin got deployed on running the deploy
> command for the second time.
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843702.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


Re: Skip Pom deployment

Posted by Nazia Ghawte <ng...@premierfarnell.com>.
ok, one revelation here.
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                  <skip>${skipDeploy}</skip>
                </configuration>
            </plugin>
On changing the plugin version from 2.4 to 2.7 the artifact deployment was
skipped for the first time,but it agin got deployed on running the deploy
command for the second time.

--
View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843702.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Skip Pom deployment

Posted by Guillaume Polet <gu...@gmail.com>.
Ok, I guess I am missing something here, but if you run 'mvn deploy' 
from one of your child module, then only that module (and its child 
modules, if any) is build and deployed. The parent pom is deployed only 
if you run 'mvn deploy' from the parent or one of its ancestor.

Can you post your pom's here ?

Cheers,
Guillaume
Le 29/09/2011 14:21, Nazia Ghawte a écrit :
> i have tried again but with no success. the main reason for the POM not to be
> deployed because it is only needed when i run the parent project,where as
> the child modules are independant of each other and can be built on their
> own as well.the parent module is only needed to be built if we want all the
> artifacts in the project to be freshly built all at once.
> Any solutions?
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843668.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Skip Pom deployment

Posted by Stephen Connolly <st...@gmail.com>.
Rule of thumb:

If you feel like you are fighting Maven then either:

1. You are doing it wrong, do it the Maven way and you won't be fighting; or
2. You maybe should be using a different build tool that does not have its
own "way".

In your case you are probably trying to double-use the deploy plugin to
"ship" your jars rather than what it is intended for, i.e. deploying
artifacts to a maven repository.

Use a different plugin to "ship" your jars... one plugin that I use for
these cases is the ship-maven-plugin.

A maven repository is built on the assumption that every GAV has a pom
deployed, you are trying to break that assumption and hence fighting maven.

-Stephen

On 29 September 2011 13:21, Nazia Ghawte <ng...@premierfarnell.com> wrote:

> i have tried again but with no success. the main reason for the POM not to
> be
> deployed because it is only needed when i run the parent project,where as
> the child modules are independant of each other and can be built on their
> own as well.the parent module is only needed to be built if we want all the
> artifacts in the project to be freshly built all at once.
> Any solutions?
>
> --
> View this message in context:
> http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843668.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Skip Pom deployment

Posted by Nazia Ghawte <ng...@premierfarnell.com>.
i have tried again but with no success. the main reason for the POM not to be
deployed because it is only needed when i run the parent project,where as
the child modules are independant of each other and can be built on their
own as well.the parent module is only needed to be built if we want all the
artifacts in the project to be freshly built all at once.
Any solutions?

--
View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843668.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Skip Pom deployment

Posted by Guillaume Polet <gu...@gmail.com>.
I just tested with the following pom and it works like a charm:
<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>x.y.z</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Test</name>
<packaging>pom</packaging>
<properties>
<skipDeploy>false</skipDeploy>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<configuration>
<skip>${skipDeploy}</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

However, there is a major flaw in this solution, because you will have 
to redeclare the deploy plugin in all your children to indicate that you 
want them to be deployed
I feel like this is getting complicated just to avoid the deployment of 
a single pom file. Any good reason for not deploying this pom? Maybe 
some Maven-guru has a better option?

Cheers,
Guillaume
Le 29/09/2011 13:11, Nazia Ghawte a écrit :
> Thanks for your reply.
> i have tried putting the following into the parent POM
>
>                           <properties>
>                                <skipDeploy>true</skipDeploy>
>                           </properties>
>
> but it still doesnt work and the pom gets deployed.
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843521.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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: Skip Pom deployment

Posted by Nazia Ghawte <ng...@premierfarnell.com>.
Thanks for your reply.
i have tried putting the following into the parent POM

                         <properties>
                              <skipDeploy>true</skipDeploy>
                         </properties>

but it still doesnt work and the pom gets deployed.

--
View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843521.html
Sent from the maven users mailing list archive at Nabble.com.

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


Re: Skip Pom deployment

Posted by Guillaume Polet <gu...@gmail.com>.
Small errata, by default you should of course set the skipDeploy to 
'false' of course so that by default your pom is deployed.

G.

Le 29/09/2011 13:01, Guillaume Polet a écrit :
> You must then configure the following property in the 
> maven-deploy-plugin: 
> http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#skip
> If you want to be able to choose that from the CLI, add a property 
> (let's say skipDeploy) in your parent pom.xml with the value 'true', 
> bind that property to the m-d-p in the parent pom and then you can 
> choose to skip deployment for the parent pom with 'mvn 
> -DskipDeploy=true deploy' which will result in the build and 
> deployment of all the modules except the parent pom.
>
> Cheers,
> Guillaume
>
> Le 29/09/2011 12:42, Nazia Ghawte a écrit :
>> How to skip the deployment of parent Pom into the maven repository?
>>
>> -- 
>> View this message in context: 
>> http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843439.html
>> Sent from the maven users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> 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: Skip Pom deployment

Posted by Guillaume Polet <gu...@gmail.com>.
You must then configure the following property in the 
maven-deploy-plugin: 
http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#skip
If you want to be able to choose that from the CLI, add a property 
(let's say skipDeploy) in your parent pom.xml with the value 'true', 
bind that property to the m-d-p in the parent pom and then you can 
choose to skip deployment for the parent pom with 'mvn -DskipDeploy=true 
deploy' which will result in the build and deployment of all the modules 
except the parent pom.

Cheers,
Guillaume

Le 29/09/2011 12:42, Nazia Ghawte a écrit :
> How to skip the deployment of parent Pom into the maven repository?
>
> --
> View this message in context: http://maven-users.828.n2.nabble.com/Skip-Pom-deployment-tp6843439p6843439.html
> Sent from the maven users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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