ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peterrei...@apache.org>
Subject Re: DO NOT REPLY [Bug 28046] - Ant includes JARs in working directory
Date Fri, 03 Sep 2004 15:46:09 GMT

Does anyone know the reason why the launcher
code in ant 1.6 gets the jars in a directory specified in
the CLASSPATH and adds them to ant's classpath ?

It does seem to be a strange thing to do.

Lancher.java: line 128
                if (element.isDirectory()) {
                    // add any jars in the directory
                    URL[] dirURLs = Locator.getLocationURLs(element);
                    for (int j = 0; j < dirURLs.length; ++j) {
                        libPathURLs.add(dirURLs[j]);
                    }
                }


It may be an oversight - -lib <path> is used to pass the CLASSPATH
to ant in the ant script.
So the code that parses this lib <path> is the same code that parses the
normal -lib option to ant.

Perhaps we need to be the CLASSPATH in a different manner in Launcher,java ?

either explicitly or implicitly ?

Peter

bugzilla@apache.org wrote:

>DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
>RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
><http://issues.apache.org/bugzilla/show_bug.cgi?id=28046>.
>ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
>INSERTED IN THE BUG DATABASE.
>
>http://issues.apache.org/bugzilla/show_bug.cgi?id=28046
>
>Ant includes JARs in working directory
>
>
>
>
>
>------- Additional Comments From heydowns@borg.com  2004-09-03 13:57 -------
>I agree with the original poster.  I hit this behavior today as well and it
>broke our build system.
>
>We have targets to build JARs from a compiled source tree - the JAR output is
>placed in the same directory as our build file. We also have targets to run an
>app (for developers) from the compiled source tree.  
>
>After upgrading to ant 1.6, this system breaks -- the run target now pulls
>classes from the JAR files, much to the confusion of many.  I finally found the
>new, one-line description in the manual stating that 'all elements of env. var.
>CLASSPATH are passed as -lib arguments to ant' -- thus they are scanned for JAR
>files.
>
>This is very inconsistent with Java's standard behavior regarding CLASSPATH...
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message