Discussion:
maven-deploy-plugin: exclude specific project artifact(s)?
Jim Garrison
2014-01-20 20:28:49 UTC
Permalink
I have a simple project that uses the assembly plugin to build a jar-with-dependencies and then a zip file containing the jar-with-dependencies and a shell script. When I run "mvn deploy" it deploys all three artifacts (the original jar, the jwd and the zip file) to Nexus.

Is there a way to prevent deployment of the jar and jwd, and only upload the zip file to Nexus? I've read the maven-deploy-plugin documentation page but there doesn't seem to be a way to prevent those artifacts from being deployed.
Robert Scholte
2014-01-20 21:59:58 UTC
Permalink
Hi,

Make sure it is not attached to the project.
For assembly-plugin, see
http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#attach
Set this value to false.

Robert

Op Mon, 20 Jan 2014 21:28:49 +0100 schreef Jim Garrison
Post by Jim Garrison
I have a simple project that uses the assembly plugin to build a
jar-with-dependencies and then a zip file containing the
jar-with-dependencies and a shell script. When I run "mvn deploy" it
deploys all three artifacts (the original jar, the jwd and the zip file)
to Nexus.
Is there a way to prevent deployment of the jar and jwd, and only upload
the zip file to Nexus? I've read the maven-deploy-plugin documentation
page but there doesn't seem to be a way to prevent those artifacts from
being deployed.
---------------------------------------------------------------------
Jim Garrison
2014-01-20 22:14:16 UTC
Permalink
Post by Robert Scholte
Op Mon, 20 Jan 2014 21:28:49 +0100 schreef Jim Garrison
Post by Jim Garrison
I have a simple project that uses the assembly plugin to build a
jar-with-dependencies and then a zip file containing the
jar-with-dependencies and a shell script. When I run "mvn deploy" it
deploys all three artifacts (the original jar, the jwd and the zip
file) to Nexus.
Is there a way to prevent deployment of the jar and jwd, and only
upload the zip file to Nexus? I've read the maven-deploy-plugin
documentation page but there doesn't seem to be a way to prevent those
artifacts from being deployed.
From: Robert Scholte
Sent: Monday, January 20, 2014 2:00 PM
To: Maven Users List
Subject: Re: maven-deploy-plugin: exclude specific project artifact(s)?
Make sure it is not attached to the project.
For assembly-plugin, see
http://maven.apache.org/plugins/maven-assembly-plugin/single-
mojo.html#attach
Set this value to false.
I can do that for the jar-with-dependencies but I don't see a way to "unattach" the primary jar from the project.
Gordon Cody
2014-01-21 12:42:59 UTC
Permalink
Hello

We use this to prevent deploying ears/wars into our repo. Everything is
built but not everything gets deployed.
Newer versions of the deploy plugin allow you to skip deployment so within
a few specific poms you can add.

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>

This should work as long as you assemble each piece separately (each has
its own pom.xml) so divide and conquer.
Hope this helps.
--
Best Regards, Gord Cody

Release Manager Zafin Labs Americas Inc.
179 Colonnade Road-Suite 100, Ottawa ON, Canada
Phone: +1 (613) 216-2504 Fax: +1 (613) 688-1374 Mobile: +1 613-601-2734
Web: http://zafin.com Email: ***@zafin.com
--
Zafin - Canada
--
http://zafin.com

<http://zafin.com/>

------------------------------

Connect with us

<http://www.youtube.com/user/ZafinGlobal> <http://www.linkedin.com/company/Zafin>
<http://twitter.com/Zafin>

News and Events

Zafin among Top 10 FinTech Companies to Watch in 2014: American Banker<http://zafin.com/zafin-among-top-10-fintech-companies-to-watch-in-2014-american-banker/>
Loading...