Bug 130037

Summary: classpath order does not follow ant guidelines
Product: Red Hat Enterprise Linux 3 Reporter: Gustavo Morozowski <gustavo>
Component: antAssignee: Fernando Nasser <fnasser>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-19 19:20:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
source code to reproduce problem
none
junit jar file
none
ant configuration file none

Description Gustavo Morozowski 2004-08-16 18:32:04 UTC
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 18:34:03 UTC
Created attachment 102768 [details]
source code to reproduce problem

Comment 2 Gustavo Morozowski 2004-08-16 18:40:40 UTC
Created attachment 102769 [details]
junit jar file

please put in $HOME/.ant/lib

Comment 3 Gustavo Morozowski 2004-08-16 18:42:36 UTC
Created attachment 102770 [details]
ant configuration file 

This is just the workaround I used

Comment 4 Fernando Nasser 2004-08-17 13:14:37 UTC
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 14:21:40 UTC
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 Program Management 2007-10-19 19:20:43 UTC
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.