ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hartman, Shane" <SHART...@thezenith.com>
Subject RE: How to change classpath for two targets of same build?
Date Fri, 28 May 2004 14:46:37 GMT
I have used multiple path id's.. See below..

<?xml version="1.0" encoding="UTF-8"?>
<project name="event" default="compile_source">
	<property file="global.properties"/>
	<path id="library.path">
		<fileset dir="${root}/lib">
			<include name="**/*.jar"/>
			<include name="**/*.zip"/>
		</fileset>
	</path>
	<path id="library2.path">
		<fileset dir="${localdir}/lib">
			<include name="**/*.jar"/>
			<include name="**/*.zip"/>
		</fileset>
	</path>

	<property name="build" location="${localdir}/event/build"/>
	<property name="root" location="${localdir}/event"/>
	
	<!-- Compile the java source into the deploy directory with
optimization -->
	<target name="compile_source">
	<mkdir dir="${localdir}/event/build"/>
		<echo>Compiling source</echo>
		<javac srcdir="${localdir}/framework/src" destdir="${build}"
debug="on">
			<classpath refid="library.path"/>
		</javac>
		 <javac srcdir="${localdir}/event/src" destdir="${build}"
debug="on">
			<classpath refid="library2.path"/>
		</javac>

	  <antcall target="create_jar"/>
	</target>
	<!-- Create the JAR file to be deployed -->
	<target name="create_jar">
		<echo>Creating JAR file from compiled source</echo>
		<jar destfile="${localdir}/lib/event.jar"
			basedir="${build}">
			<fileset dir="${root}" includes="*.xml"/>
		</jar>
	</target>
</project>


-- I think this should resolve your conflict...

-----Original Message-----
From: michael.giroux@objectweb.org [mailto:michael.giroux@objectweb.org] 
Sent: Friday, May 28, 2004 10:38 AM
To: user@ant.apache.org
Subject: How to change classpath for two targets of same build?


I have not been able to figure out how to use different classpath for two 
different targets of the same build, or for two tasks within a target.  In 
my case, I am trying to use <xmlvalidate> with validation using XSD 
schemas.  This works, but it requires that I use xerces 2.6.2 with 
resolver.jar on the classpath.

Unfortunately, this config breaks the <xslt> task.  In order to make 
<xslt> run successfully, I have to remove resolver.jar from the classpath. 
 With resolver.jar on the classpath, I get an exception during the parse. 
Removing resolver.jar from the classpath eliminates the exception.

So the question is -- how can I specify one classpath for the xslt task, 
and a different one for xmlvalidate task.  I tried nested classpath 
elements, but that seems to have no effect.

Michael Giroux

     [xslt] 
C:/GIROUX/JOnAS/TCK_DD_Porting_Tool/templates/sun2jonas.xslt:40:59: Fatal 
Error! java.lang.reflect.InvocationTargetException Cause: 
java.lang.reflect.InvocationTargetException
     [xslt] 
file:/C:/GIROUX/JOnAS/TCK_DD_Porting_Tool/templates/jonas-web-app.xslt:14:49
: 
Fatal Error! Fatal error during transformation Cause: Fatal error during 
transformation
     [xslt] 
C:/GIROUX/JOnAS/TCK_DD_Porting_Tool/templates/sun2jonas.xslt:144:28: Fatal 
Error! Fatal error during transformation Cause: Fatal error during 
transformation
     [xslt] Failed to process 
C:\java\j2eetck\src\com\sun\ts\tests\webservices\handler\localtx\LocalTxHand
lerTest_web.xml

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------------
This email and any attachments constitute non-public information for use
only by intended recipient(s) and may contain confidential information.  If
you are not an intended recipient, please notify our Information Security
Officer immediately at (941) 906-5844 and permanently delete the original of
this email and any attachments, as well as any copies or printouts thereof.
The unauthorized use, dissemination, distribution or reproduction of this
email and any attachments is prohibited and may be unlawful.

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


Mime
View raw message