Re: GenJar

Martin Gainty <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <BLUPR14MB0259EAFE1DDD125EAD4C0BDFAE250@BLUPR14MB0259.namprd14.prod.outlook.com>
MG2>below

________________________________
From: RAPPAZ Francois <[email protected]>
Sent: Thursday, November 23, 2017 2:00 AM
To: Ant Users List
Subject: RE: GenJar


MG>which specific task do you want ant to implement?

Make a jar using the regular ant jar task:
With using a file selector that
- start with the class file having the main function called to start the application
- takes all the class it depends on, extract the corresponding class file from the jar archive (using the path to find the archive), add this extracted class file in the jar under construction
- repeat this for the class that has been extracted

This is what genjar is doing (or PAR::Packer in perl) but it's a task in himself not a selector in the regular jar task, and it's very convenient to have these  autonomous archive when you want to distribute an application.

François

MG2>so you want a utility which will package your 'main' class plus all dependencies
MG2>easily accomplished with maven bundle-plugin provided <configuration> contains:
MG2><createDependencyReducedPom>false</createDependencyReducedPom> (to include dependencies)
MG2><createDependencyReducedPom>true</createDependencyReducedPom> (to exclude dependencies)

http://felix.apache.org/components/bundle-plugin/manifest-mojo.html
Maven Bundle Plugin – bundle:manifest - Apache Felix<http://felix.apache.org/components/bundle-plugin/manifest-mojo.html>
felix.apache.org
Name Type Since Description; archive: MavenArchiveConfiguration-The archive configuration to use. buildDirectory: String-The directory for the generated JAR.



MG2>does this help?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.