[fedora-java] Almost newbie: Q: How get rid of unused jars?

Mikolaj Izdebski mizdebsk at redhat.com
Mon Mar 16 17:32:12 UTC 2015


On 03/16/2015 05:05 PM, Alec Leamas wrote:
> Last package in this bunch...
> 
> Package builds a number of jars in a hierarchical build. One of these is
> really what I think is called an ũber-jar, and that's the only one I
> want to package.

It's recommended to package all the small JAR files instead of "uber
jar". See http://fedoraproject.org/wiki/Packaging:Java#Split_JAR_files

> However, since the %mvn_build/%mvn_install  discovers also the other
> jars, they also get installed. I could of course just remove them after
> %mvn_install, but they are also part of the metadata, so...
> 
> My question: is there any sane way to remove one or more jars from the
> installed set? Something like %mvn_remove_artifact?

%mvn_install does "the right thing" by default, but if you really want
to invent your own way of packaging you can always install JAR file
manually w/o using %mvn_install.

It is also possible to skip installation of some JARs using
"%mvn_package ... __noinstall" macro. See man mvn_package

-- 
Mikolaj Izdebski
Software Engineer, Red Hat
IRC: mizdebsk


More information about the java-devel mailing list