ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zyellowman2 <zyellowm...@gmail.com>
Subject javac task cannot find jar, but jar exists
Date Thu, 09 Jul 2009 23:16:00 GMT

I am having an issue where my javac task is trying to include a jar in the
classpath, but says that it cannot find the reference.  The location that it
says it is looking is in fact the directory that contains the exact jar it
is looking for, case-sensitive and all.
The problem does not arise when I am running this build.xml on a mac, only
when I'm running it on Windows XP.
Here is the build.xml file:
--------------------------------------------
<project basedir="../../.." default="main">

    <property name="dir.build" value="${basedir}/build"/>
    <property name="dir.resulttask" value="${dir.build}/SetResultTask"/>
	<property name="dir.resulttask.src" value="${dir.resulttask}/src"/>
	<property name="dir.resulttask.output" value="${dir.resulttask}/bin"/>
	<property name="dir.build.libs" value="${dir.build}/libs"/>
	<property name="dir.build.libs.webservice"
value="${dir.build.libs}/webservice"/>
	<property name="result" value="${build}/WSresult.xml"/>
	
	<target name="main" depends="jar">
		<taskdef name="setresult" classname="WebClient"
classpath="${dir.resulttask.output}/WebClient.jar"/>
		<setresult resultlocation="${result}"/>
	</target>

	<target name="compile">
		<mkdir dir="${dir.resulttask.output}"/>
		<javac srcdir="${dir.resulttask.src}" destdir="${dir.resulttask.output}">
			<classpath refid="${dir.build.libs.webservice}/jaxrpc.jar"/>
			<classpath refid="${dir.build.libs.webservice}/axis.jar"/>
			<classpath
refid="${dir.build.libs.webservice}/org.apache.commons.logging_1.0.4.v20080605-1930.jar"/>
			<classpath
refid="${dir.build.libs.webservice}/commons-discovery-0.2.jar"/>
			<classpath refid="${dir.build.libs.webservice}/saaj.jar"/>
			<classpath
refid="${dir.build.libs.webservice}/javax.activation_1.1.0.v200806101325.jar"/>
			<classpath
refid="${dir.build.libs.webservice}/javax.mail_1.4.0.v200804091730.jar"/>
			<classpath
refid="${dir.build.libs.webservice}/javax.wsdl_1.4.0.v200806030407.jar"/>
			<classpath
refid="${dir.build.libs.webservice}/javax.wsdl_1.5.1.v200806030408.jar"/>
		</javac>
	</target>

	<target name="jar" depends="compile">
		<jar destfile="${dir.resulttask.output}/WebClient.jar"
basedir="${dir.resulttask.output}" excludes="WebClient.jar">
			<zipfileset src="${dir.build.libs.webservice}/jaxrpc.jar" includes="**/*"
excludes="META-INF/*" />
			<zipfileset src="${dir.build.libs.webservice}/axis.jar" includes="**/*"
excludes="META-INF/*" />
			<zipfileset
src="${dir.build.libs.webservice}/org.apache.commons.logging_1.0.4.v20080605-1930.jar"
includes="**/*" excludes="META-INF/*" />
			<zipfileset src="${dir.build.libs.webservice}/commons-discovery-0.2.jar"
includes="**/*" excludes="META-INF/*" />
			<zipfileset src="${dir.build.libs.webservice}/saaj.jar" includes="**/*"
excludes="META-INF/*" />
			<zipfileset
src="${dir.build.libs.webservice}/javax.activation_1.1.0.v200806101325.jar"
includes="**/*" excludes="META-INF/*" />
			<zipfileset
src="${dir.build.libs.webservice}/javax.mail_1.4.0.v200804091730.jar"
includes="**/*" excludes="META-INF/*" />
			<zipfileset
src="${dir.build.libs.webservice}/javax.wsdl_1.4.0.v200806030407.jar"
includes="**/*" excludes="META-INF/*" />
			<zipfileset
src="${dir.build.libs.webservice}/javax.wsdl_1.5.1.v200806030408.jar"
includes="**/*" excludes="META-INF/*" />
		</jar>
	</target>

</project>
--------------------------------------------
Here is the output when I run ant:
--------------------------------------------
Buildfile: build.xml

compile:
    [javac] Compiling 1 source file to
C:\projects\project1\build\SetResultTask\bin

BUILD FAILED
C:\projects\project1\build\SetResultTask\build\build.xml:18: Reference
../../libs/webservice/jaxrpc.jar not found.

Total time: 0 seconds

--------------------------------------------

My directory structure is as follows:

build
L--libs
     L--ant-contrib-1.0b3.jar
     L--webservice
          L--ant.jar
          L--axis.jar
          L--commons-discovery-0.2.jar
          L--javax.activation_1.1.0.v200806101325.jar
          L--javax.mail_1.4.0.v200804091730.jar
          L--javax.wsdl_1.4.0.v200806030407.jar
          L--javax.wsdl_1.5.1.v200806030408.jar
          L--jaxrpc.jar
          L--saaj.jar
          L--org.apache.commons.logging_1.0.4.v20080605-1930.jar
L--SetResultTask
     L--bin
          L--WebClient.class
     L--build
          L--build.xml
     L--src
          L--WebClient.java

--------------------------------------------

SetResultTask is a java project that creates the task that is called in the
build.xml in the main target.  It invokes a web service that I have running
locally on a Tomcat server.
If you need more info to help me, please contact me.  Thank you,
Andrew
-- 
View this message in context: http://www.nabble.com/javac-task-cannot-find-jar%2C-but-jar-exists-tp24419426p24419426.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Mime
View raw message