You can configure the maven-deploy-plugin in the POM of a module to exclude it from the deploy:
<build>If done, correctly you should see the following after running mvn deploy in your build output:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
...
</build>
[INFO] [deploy:deploy]
[INFO] skipping artifact deployement
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
Nice article! It helped me a lot. Wrote an article where a link to this article:
ReplyDeletehttp://myossdevblog.blogspot.com/2010/02/some-words-about-microlog-and-some.html
Hi,
ReplyDeleteCan we avoid the deployment of the parent POM with the above code?
the parent POM in my project doesnt do anything , so it would be senseless to put it in the repo.
is there a way to avoid deployment of parent POM?
Please help.
Thanks,
NAzia
Hey Nazia, if you run "mvn deploy" from the child module, the parent POM should not be deployed. If you are running from the parent's directory, I think you can put the same configuration in the parent POM turning inheritance off:
ReplyDelete<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.4</version>
<configuration>
<skip>true</skip>
</configuration>
<inherited>false</inherited>
<plugin>