ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Pu <leon_xf...@yahoo.com.cn>
Subject Confusion of jar in Ant's classpath and system's CLASSPATH
Date Tue, 29 Nov 2005 15:18:54 GMT
Hi all,

I met a very strange problem that one jar doesn't become useful after I
put it to Ant classpath setting, ClassNotFoundException will be thrown
out. After I put the jar to system's CLASSPATH, Ant target runs without
problem.

The cannot be found java class in the special jar is not directly used
by my program, it is invoked by the java class which locate in other
jar.

Here is the sample classpath declaration in my build script. Class
com.foo.task.MyTask extends org.apache.tools.ant.Task, it is included
in 1-1.jar. The ClassNotFound class is located in 2-1.jar which will be
invoked by the class in 3-1.jar.

[build-script]
  <path id="run.class.path">
    <pathelement location="${basic.build.dir}" />
    <fileset dir="${internals.lib.dir}/component1">
      <include name="**/1-1.jar" />
    </fileset>
    <fileset dir="${internals.lib.dir}/component2">
      <include name="**/2-1.jar" />
    </fileset>
    <fileset dir="${internals.lib.dir}/component3">
      <include name="**/3-1.jar" />
    </fileset>
  </path>

  <property name="run.class.path" refid="run.class.path" />

  <target name="run.task">
    <taskdef name="mytask" classname="com.foo.task.MyTask"
classpath="${run.class.path}" />
    <mytask arg1="${arg1}" arg2="${arg2}" />
  </target>
[build-script]


Best regards,
Leon



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Mime
View raw message