ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luca Ferrari <fluca1...@infinito.it>
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:

projectRoot
  +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:

build
 +classes
 +conf
 +img
 +lib
 +deploy

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="${build.jar.name}" update="false" >
			
			<!-- include the compiled files (classes directory)-->
			<fileset dir="${build.dir}">
			</fileset>
			

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

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

		</jar>
		
	</target>


Thanks,
Luca

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


Mime
View raw message