Bug 130037 - classpath order does not follow ant guidelines
classpath order does not follow ant guidelines
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: ant (Show other bugs)
3.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Fernando Nasser
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-16 14:32 EDT by Gustavo Morozowski
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-10-19 15:20:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
source code to reproduce problem (9.91 KB, application/octet-stream)
2004-08-16 14:34 EDT, Gustavo Morozowski
no flags Details
junit jar file (182.77 KB, application/octet-stream)
2004-08-16 14:40 EDT, Gustavo Morozowski
no flags Details
ant configuration file (860 bytes, text/plain)
2004-08-16 14:42 EDT, Gustavo Morozowski
no flags Details

  None (edit)
Description Gustavo Morozowski 2004-08-16 14:32:04 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3)
Gecko/20040803

Description of problem:
When I run ant -v code in the attached source code the classpath is:


[javac]
'/home/andromeda/clover-1.3.1RC1/tutorial/build:/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/lib/jvm/java/lib/tools.jar:/home/andromeda/.ant/lib/clover.jar:/home/andromeda/.ant/lib/junit.jar'

When the correct order is (http://ant.apache.org/manual/running.html#lib):

    *  -lib jars in the order specified by the -lib elements on the
command line
    * jars from ${user.home}/.ant/lib
    * jars from ANT_HOME/lib

as in:

'/home/andromeda/clover-1.3.1RC1/tutorial/build:/home/andromeda/.ant/lib/clover.jar:/home/andromeda/.ant/lib/junit.jar:/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/usr/share/java/junit.jar:/usr/share/java/ant/ant-junit.jar:/usr/lib/jvm/java/lib/tools.jar'

As I needed the clover.jar coming before the tools.jar in the
classpath I had to put clover.jar in /usr/share/java and edit the
/etc/ant.conf file.

Version-Release number of selected component (if applicable):
ant-1.6.1-1jpp_3rh

How reproducible:
Always

Steps to Reproduce:
1.untar the source code
2.create a dir $HOME/.ant/lib
3.put clover.jar, junit.jar and clover.license inside $HOME/.ant/lib
4.change to dir where is build.xml
5.execute ant -v code
    

Additional info:
Comment 1 Gustavo Morozowski 2004-08-16 14:34:03 EDT
Created attachment 102768 [details]
source code to reproduce problem
Comment 2 Gustavo Morozowski 2004-08-16 14:40:40 EDT
Created attachment 102769 [details]
junit jar file

please put in $HOME/.ant/lib
Comment 3 Gustavo Morozowski 2004-08-16 14:42:36 EDT
Created attachment 102770 [details]
ant configuration file 

This is just the workaround I used
Comment 4 Fernando Nasser 2004-08-17 09:14:37 EDT
This seems to be a documentation error or at least an omission.
The -lib options should/can only be used when invoking ant directly,
i.e., not through the wrapper scripts (which come from Apache itself).

The correct way of doing what you want when using the wrapper scripts
(always the case for RPM installed Ant in any distro, not only Red
Hat) is to set the environment variable OPT_JAR_LIST :

"A user should request optional jars and their dependencies via the
OPT_JAR_LIST variable".

So you would have: 

OPT_JAR_LIST=/home/andromeda/lib/clover.jar

for instance.

Perhaps we should ask Apache to add a note explaining this.  Or better
yet, I believe they should test for a user specified '-lib' and add
the psth specified automatically to what is in OPT_JAR_LIST (what
would you suggest?).  I favor the second.
Comment 5 Fernando Nasser 2005-09-28 10:21:40 EDT
I want to bring this issue upstream.

Do you have an opinion, or would like to add something to:

"Perhaps we should ask Apache to add a note explaining this.  Or better
yet, I believe they should test for a user specified '-lib' and add
the psth specified automatically to what is in OPT_JAR_LIST (what
would you suggest?).  I favor the second."

Regards,
Fernando
Comment 7 RHEL Product and Program Management 2007-10-19 15:20:43 EDT
This bug is filed against RHEL 3, which is in maintenance phase.
During the maintenance phase, only security errata and select mission
critical bug fixes will be released for enterprise products. Since
this bug does not meet that criteria, it is now being closed.
 
For more information of the RHEL errata support policy, please visit:
http://www.redhat.com/security/updates/errata/
 
If you feel this bug is indeed mission critical, please contact your
support representative. You may be asked to provide detailed
information on how this bug is affecting you.

Note You need to log in before you can comment on or make changes to this bug.