[kepler-dev] Re: Missing and duplicate jars in kepler

David Buttler buttler1 at llnl.gov
Mon Mar 15 10:58:23 PST 2004


Just a follow up to this note:

I would suggest that we try to make the JAR files a little more 
understandable.  I problem that I have run across several times is 
errors that crop up because of an older version of a JAR is used, or a 
newer version replaces an older version, but breaks some dependency.  In 
order to help track down these problems I have started labeling all JARs 
with a version number.

For instance, instead of
xercesImpl.jar
I would suggest
xercesImpl_2.5.0.jar
The renaming of the JAR does not affect the classes held inside and 
assists in documenting which version of the JAR is actually being used.
Note that this has been done already in the log4j JAR listed below.

A second question I have regarding the JAR files and the build.xml file:

Currently the classpath is constructed as a long string of variables, 
with a platform-defined separator variable.  Is there any reason why 
this approach was taken as opposed to the ANT idiom of **/*.jar?  This 
would allow ANT to deal with cross-platform issues in specifying the 
classpath rather than encoding this into the build file, which would 
allow a much more concise and understandable build file. 
[I have quoted an example from the ANT manual at the bottom]

Dave

David Buttler wrote:

> I was trying to understand the build path in the ANT file, and I ran 
> across the following strangeness:
>
> Missing JARs
> ------------------
> <property name="monarchjar" value="${fulllibdir}/jar/monarch.jar"/>
> ${fulllibdir}/jar/monarch.jar
>    <property name="ptolemy-jar" value="${ptolemydir}/lib/ptolemy.jar"/>
>    <property name="ptolemyjar" value="${ptolemydir}"/>
> [${ptolemydir}/lib/ptolemy.jar  does not exist, but  
> ${ptolemydir}/ptolemy/ptolemy.jar does]
> ${ptolemydir}  [exists in ${ptolemydir}/ptolemy/ptolemy.jar]
>
> ${seekwsdir}seekWebService.jar
> [I didn't see a JAR in this directory]
>
> duplicate jars
> ------------------
> ${fulllibdir}/jar/log4j-1.2.7 with ${fulllibdir}/jar/soap/log4j-1.2.4
>
> It seems that at least one of these jars is redundant and should be 
> removed
>
>

--------------------------
ANT example:

In addition, DirSet 
<http://ant.apache.org/manual/CoreTypes/dirset.html>s, FileSet 
<http://ant.apache.org/manual/CoreTypes/fileset.html>s, and FileList 
<http://ant.apache.org/manual/CoreTypes/filelist.html>s can be specified 
via nested |<dirset>|, |<fileset>|, and |<filelist>| elements, 
respectively. /Note/: The order in which the files building up a FileSet 
are added to the path-like structure is not defined.

    <classpath>
      <pathelement path="${classpath}"/>
      <fileset dir="lib">
        <include name="**/*.jar"/>
      </fileset>
      <pathelement location="classes"/>
      <dirset dir="${build.dir}">
        <include name="apps/**/classes"/>
        <exclude name="apps/**/*Test*"/>
      </dirset>
      <filelist refid="third-party_jars"/>
    </classpath>

This builds a path that holds the value of |${classpath}|, followed by 
all jar files in the |lib| directory, the |classes| directory, all 
directories named |classes| under the |apps| subdirectory of 
|${build.dir}|, except those that have the text |Test| in their name, 
and the files specified in the referenced FileList.





More information about the Kepler-dev mailing list