ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Ferrari <>
Subject problems creating a jar
Date Wed, 20 Feb 2008 13:22:25 GMT
Hi guys,
I've got a problem creating a buildfile for a project of mine, where I'd like 
also to build a jar as final step. This is source tree:

  +src			// java sources
  +srcTest			// junit sources
  +img			// icons
  +lib				// jar required by the project
  +conf			// configuration files

I've created a build file that creates a build directory that compiles the 
sources and copies the resource (images and configuration), producing a tree 
like the following:


where deploy should contain the jar created. The problem is that the jar is 
created but without the directory I'd like to include (classes, conf, img), 
but with the resources in a flat space. For example, instead of having img/ 
I've got all the images in the root of the jar, the same happens for the conf 
directory. I didn't find a solution, can anyone please explain me how to 
include the resource in the jar? 
My jar target is the following:

<target name="dist" depends="compile" >
		<jar destfile="${}" update="false" >
			<!-- include the compiled files (classes directory)-->
			<fileset dir="${build.dir}">

			<!-- include the images (img directory)-->
			<fileset dir="${build.img.dir}">

			<!-- the manifest of this jar -->
				<attribute name="Built-By"    value="${}"          />
				<attribute name="Main-Class"  value="${runtime.mainclass}"  />
				<!-- a section with a few notes -->
				<section name="additional-info">
				      <attribute name="Project-Name"    value="${}"/>
				      <attribute name="Project-Version" value="${build.version}"   />
					  <attribute name="Project-Build"   value="${build.number}"    />



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message