[jboss-user] [EJB 3.0] - Re: Good build.xml to build the ear file

waynebaylor do-not-reply at jboss.com
Fri Oct 19 15:45:19 EDT 2007


here's one i threw together, i'll leave it to you to figure out the dir structure that goes along with it :)

<project name="web budget" default="" basedir=".">
  | 
  | 	<property name="ejb.src.dir" value="ejb/src"/>
  | 	<property name="web.src.dir" value="web/src"/>
  | 	<property name="entity.src.dir" value="entity/src"/>
  | 		
  | 	<property name="ejb.meta-inf.dir" value="ejb/META-INF"/>
  | 	<property name="web.web-inf.dir" value="web/WEB-INF"/>
  | 	<property name="entity.meta-inf.dir" value="entity/META-INF"/>
  | 	<property name="meta-inf.dir" value="META-INF"/>
  | 	
  | 	<property name="build.dir" value="build"/>
  | 	<property name="dist.dir" value="${build.dir}/dist"/>
  | 	<property name="classes.dir" value="${build.dir}/classes"/>
  | 	<property name="archives.dir" value="${build.dir}/archives"/>
  | 	
  | 	<property name="jboss.deploy.dir" value="C:\Program Files\jboss-4.2.0.GA\server\default\deploy"/>
  | 	<property name="jboss.lib.dir" value="C:\Program Files\jboss-4.2.0.GA\server\default\lib"/>
  | 	
  | 	<target name="compile">
  | 		<mkdir dir="${classes.dir}"/>
  | 		
  | 		<javac destdir="${classes.dir}">
  | 			<classpath>
  | 				<fileset dir="${jboss.lib.dir}" includes="jboss-ejb3x.jar, ejb3-persistence.jar, servlet-api.jar"/>
  | 			</classpath>
  | 			
  | 			<src path="${entity.src.dir}"/>
  | 			<src path="${ejb.src.dir}"/>
  | 			<src path="${web.src.dir}"/>
  | 		</javac>
  | 		<copy todir="${classes.dir}" flatten="true">
  | 			<fileset dir="${web.src.dir}" includes="**/*.jsp"/>
  | 		</copy>
  | 	</target>
  | 	
  | 	<target name="package">
  | 		<mkdir dir="${archives.dir}"/>
  | 		<mkdir dir="${dist.dir}"/>
  | 		
  | 		<jar destfile="${archives.dir}/entity.jar" 	basedir="${classes.dir}" includes="**/model/*.class">
  | 			<metainf dir="${entity.meta-inf.dir}" includes="*.xml"/>
  | 		</jar>
  | 		
  | 		<jar destfile="${archives.dir}/ejb.jar" basedir="${classes.dir}" includes="**/eao/*.class">
  | 			<metainf dir="${ejb.meta-inf.dir}" includes="*.xml"/>
  | 		</jar>
  | 		
  | 		<war destfile="${archives.dir}/web.war" webxml="${web.web-inf.dir}/web.xml">
  | 			<webinf dir="${web.web-inf.dir}" includes="*.xml" excludes="web.xml"/>
  | 			<classes dir="${classes.dir}" includes="**/servlet/*.class"/>
  | 			<fileset dir="${classes.dir}" includes="**/*.jsp"/>
  | 		</war>
  | 		
  | 		<ear destfile="${dist.dir}/budget.ear" basedir="${archives.dir}"
  | 			appxml="${meta-inf.dir}/application.xml">
  | 			<metainf dir="${meta-inf.dir}" includes="*.xml" excludes="application.xml"/>
  | 		</ear>
  | 	</target>
  | 	
  | 	<target name="clean">
  | 		<delete dir="${build.dir}"/>
  | 	</target>
  | 	
  | 	<target name="deploy">
  | 		<copy file="${dist.dir}/budget.ear" todir="${jboss.deploy.dir}"/>
  | 	</target>
  | </project>

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097101#4097101

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097101



More information about the jboss-user mailing list