ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 18700] New: - Stange classpath problem
Date Fri, 04 Apr 2003 09:08:01 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18700>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18700

Stange classpath problem

           Summary: Stange classpath problem
           Product: Ant
           Version: 1.5.2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: nicolas.mailhot@laposte.net


Hi,

We use xsls to generate a fairly big final static build.xml. It includes
numerous build targets, and therefore classpaths are pretty involved.

A typical classpath is declared at the top of the file like this :

   <path id="webkit.classpath">
      <!--Direct dependencies-->
      <!-- Jars generated during another build stage -->
      <fileset dir="${lib}">
	 <include name="api_common-3.5.137.jar"/>
	 <include name="api_search-3.5.137.jar"/>
	 <include name="api_database-3.5.137.jar"/>
      </fileset>
      <!-- external binary jars -->
      <pathelement path="${servlet-2.2b.servlet.jar}"/>
      <pathelement path="${xml-tr2.xml.jar}"/>
      <pathelement path="${foo-1.1.9.bar.jar}"/>
      <!--Indirect dependencies : inherited paths-->
      <path refid="api_common.classpath"/>
      <path refid="api_search.classpath"/>
      <path refid="api_database.classpath"/>
   </path>

The external pathelements (servlet-2.2b.servlet.jar) are read from a property
file if it is found :
<loadproperties srcFile="extlib.properties"/>) 

and autodetected otherwise 
<exec executable="build-classpath" failonerror="true"
outputproperty="servlet-2.2b.servlet.jar">
    <arg value="servlet"/>
</exec>

An echo check shows the properties are correctly set
[echo] servlet-2.2b.servlet.jar = extlib/servlet-2.2b/servlet-2.2b.jar

However a later javac task in another target 

 <javac verbose="off" deprecation="off" optimize="off" encoding="iso-8859-15"
includeAntRuntime="no" fork="yes" debug="off" destdir="${webkit.class}">
         <src path="${webkit.java}"/>
         <classpath refid="webkit.classpath"/>
      </javac>

fails with :

    [javac]
/tmp/test/kitu-3.5.137/src/java/webkit/com/foo/common/ClientPlatform.java:13:
cannot resolve symbol
    [javac] symbol  : class ServletRequest
    [javac] location: package servlet
    [javac] import javax.servlet.ServletRequest;

so somehow the pathelements are not resolved, as shown by an echo check :

<property name="mytest" refid="webkit.classpath"/>
<echo> test : ${mytest}</echo>

gives :

[echo]  test :
/tmp/test/kitu-3.5.137/lib/api_database-3.5.137.jar:/tmp/test/kitu-3.5.137/lib/api_search-3.5.137.jar:/tmp/test/kitu-3.5.137/lib/api_common-3.5.137.jar:/tmp/test/kitu-3.5.137/${servlet-2.2b.servlet.jar}:/tmp/test/kitu-3.5.137/${xml-tr2.xml.jar}:/tmp/test/kitu-3.5.137/${foo-1.1.9.bar.jar}

I'm really at a loss here, my (admitedly shallow) reading of ant manual is that
this should work, but it doesn't.

Did I make a stupid mistake somewhere ? Is there any workaround here ?

Mime
View raw message