ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: adding JAR files to the classpath and copying them to another location
Date Tue, 29 Jun 2004 06:46:48 GMT
Hi Martin, I think this will do the job:

<!-- Decalring the jars that will be copied and set in
classpath-->
<fileset id="jar.fileset"
dir="${projectRoot}/archives/jakarta-tomcat-3.2.3/lib">
    <include name="**/*.jar"/>
</fileset>

<!-- Now setting the in the path -->
<path id="project.classpath">
    <fileset refid="jar.fileset"/>
</path>

<!-- Now copying them -->
<copy todir="${distPath}"/>
    <fileset refid="jar.fileset"/>
</copy>

HTH Ivan

--- Martin Goldhahn <MG@VismaUnique.no> wrote:
> Hi,
> I've got a set of jar files that I want to have
> added to the class path
> and the same set of files needs to be copied to
> another location. How
> can I achieve this without defining the set twice.
> 
> At the moment the build file looks like this:
> 
> <project name="concept" default="deploy"
> basedir=".">
> 	<path id="project.class.path">
> 
> 		<!--Tomcat-->
> 		<fileset
>
dir="${projectRoot}/archives/jakarta-tomcat-3.2.3/lib">
> 			<include name="**/*.jar"/>
> 		</fileset>		
> 	
> 		<!--Xerces-->
> 		<fileset dir="${projectRoot}/archives/xerces">
> 			<include name="**/*.jar"/>
> 		</fileset>		
> 	</path>
> 
> 	<cut/>
> 
> 	<target name="copyResources" depends="init"
> description="copy
> resource files">
> 		
> 		<!--Copy jar files-->
> 		<copy todir="${distPath}">
> 			<!--Tomcat-->
> 			<fileset
>
dir="${projectRoot}/archives/jakarta-tomcat-3.2.3/lib">
> 				<include name="**/*.jar"/>
> 			</fileset>		
> 		
> 			<!--Xerces-->
> 			<fileset dir="${projectRoot}/archives/xerces">
> 				<include name="**/*.jar"/>
> 			</fileset>		
> 		</copy>
> 
> 		<cut/>
> 	</target>
> 
> 	<target name="compile" depends="init"
> description="compile">
> 		<javac 
> 			srcdir="${sourcePath}" 
> 			destDir="${outputPath}" 
> 			classpathref="project.class.path"
> 			excludes="**/JU*.java" />
> 	</target>
> 
> 	<cut/>
> </project>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
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