I'm using NetBeans IDE v5.5 to compile a collection of sources into an executable .jar file.
What I'm trying to do is get NetBeans to automatically build a second .jar (ccd.jar) based on a subset (*1) of my code, everything except the aqm folder, which compiles in all the external libraries (*2), to produce a single .jar solely dependent upon the JRE. I've included a file structure appendix below.
[Parts]
*1 Subset
The code is common between both jars except that:
aqm.jar includes all the source files and its Main class is apecc.qm.aqm.App
ccd.jar includes all sources except the aqm folder (see file structure below) and its Main clas is apecc.qm.ccd.App
*2 External libraries
aqm.jar works in an environment where it has access to the external libraries, so the current jar building process leaves them as external references.
ccd.jar needs to build those external libraries into itself, to produce a single unified jar with no external references (except the JRE obviously).
As I understand it, Jar (the tool, not the file) can't build jar files that recursively include other jar files, so I think I need to flatten the external libraries to include them in ccd.jar
[Existing files]
Here are links to my current Ant files within NetBeans:
http://www.lightenna.com/sitefiles/lightenna.com/build.xmlhttp://www.lightenna.com/sitefiles/lightenna.com/build-impl.xmlhttp://www.lightenna.com/sitefiles/lightenna.com/project.xmlThey currently compile the sources and produce a single .jar file ( aqm.jar) which contains all my code, leaving a dozen or so libraries as external references.
[File structure]
My code
build
+ classes
+ apecc
+ qm
+ aqm (included in aqm.jar, excluded from ccd.jar)
+ ccd
+ core
+ geo
+ hub
+ qed
+ rep
+ test
+ com (directory containing a hierarchy of library .classes compiled from
source - "Internal libs")
- log4j.properties
External libs (left as external references for aqm.jar, compiled into
ccd.jar)
+ dist
+ lib
- J2PrinterWorks.jar
- TrayIcon.jar
- activation.jar
- beandt.jar
- commons-collections-3.1.ja
r
- commons-configuration-1.2.
jar
- commons-email-1.0.jar
- commons-lang-2.1.jar
- commons-logging.jar
- commons-pool-1.3.jar
- concurrent.jar
- dbswing.jar
- dx.jar
- jai_codec.jar
- jai_core.jar
- jakarta-oro-2.0.8.jar
- jbcl.jar
- jdom.jar
- junit-3.8.1.jar
- log4j-1.2.9.jar
- mail.jar
- mysql-connector-java-3.1.1
2-bin.jar
- openmap.jar
Any questions please let me know.
Cheers, Alex