Ant: To dist or not to dist...



Hello!

I still see no reason as to why I should write my build.xml's dist
target to put the created JAR file into the dist directory and not the
root directory.

Here my dir tree:

<root>
+--build
+--dist
| +--app.jar
+--lib
| +--lib1.jar
| +--lib2.jar
| +--lib3.jar
+--src

I have a packaged Swing GUI application, the manifest should (but
doesn't have to) use libraries specified via the Class-Path: lib/
lib1.jar lib/lib2.jar lib/lib3.jar line, so putting the JAR into dist
seems to be somewhat inappropriate. The lib dir is in the project root
(where build.xml is) and it seems to be the perfect place to also put
the JAR file into the root.

I regularly launch the JAR file to see if everything is working.

Maybe someone can explain to me why "disting" to the dist dir parallel
to the lib dir is preferrable (as I keep reading in a smart book).

Of course I can change the manifest to include the libs from the
parent dir's lib with "Class-Path: ../lib/lib1.jar ../lib/lib2.jar ../
lib/lib3.jar". I just imagine moving the dist JAR into some other dir,
then the manifest entries would actually reference the parent dir's
lib dir files which I find very confusing. I find putting the JAR into
a dir along with a subdir lib much more intuitive.

Perhaps the question must be answered what the dist file is there
for...? Is it made for launching at all? Just for deployment? The
concept of dist is a little unclear to me...

TIA
Karsten

.



Relevant Pages

  • Re: Running java programs from class files
    ... public static void main{ ... I can get it to work if I put the jar file in the Class-Path: line in the manifest and put the jar file in the same directory as the program jar file but not from the command line. ... The Lib class has been compiled and put into a jar file, ...
    (comp.lang.java.programmer)
  • Re: JAR files and manifest: Class-Path
    ... where the application JAR file resides. ... >dir, there's also a lib dir, nothing special really. ... a directory called "drivers" which is below the directory where the ... ClassLoader loader = ExtensionClassLoader.getSingleton; ...
    (comp.lang.java.programmer)
  • Re: JAR files and manifest: Class-Path
    ... > I have a base dir, where the application JAR file resides. ... > dir, there's also a lib dir, nothing special really. ... Point is: use relative path ...
    (comp.lang.java.programmer)
  • JAR files and manifest: Class-Path
    ... where the application JAR file resides. ... dir, there's also a lib dir, nothing special really. ... Is there any way to use the Class-Path entry in the manifest, ...
    (comp.lang.java.programmer)
  • jar file from Eclipse at the root of the jar file rather than nested in directories
    ... When I generate a jar file from Eclipse v3.3.2, ... These are my steps to create a jar file in Eclipse: ... I create project "Same" and use "Import, File System, Filter Types, ... the files are showing up at the root. ...
    (comp.lang.java.programmer)