Following build.xml is used to create the war file like normal folder
<!-- Build file for epubtoword -->
<project name="epubtoword" default="build" basedir=".">
<!-- ============= -->
<!-- === CLEAN === -->
<!-- ============= -->
<target name="clean" description="removes all generated files">
<delete dir="build" />
</target>
<!-- =============== -->
<!-- === INIT === -->
<!-- =============== -->
<target name="init">
<property name="dirs.base" value="${basedir}"/>
<property name="src" value="${dirs.base}/src"/>
<property environment="env"/>
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
<property name="warDir" value="${jboss.home}/server/default/deploy/epubtoword.war"/>
<!-- Create Web-inf and classes directories -->
<mkdir dir="${warDir}/WEB-INF"/>
<mkdir dir="${warDir}/WEB-INF/classes"/>
<mkdir dir="${warDir}/WEB-INF/lib"/>
<mkdir dir="${warDir}/src"/>
<mkdir dir="${warDir}/css" />
<mkdir dir="${warDir}/images"/>
<mkdir dir="${warDir}/js"/>
<mkdir dir="${warDir}/fonts"/>
</target>
<!-- ================= -->
<!-- === CLASSPATH === -->
<!-- ================= -->
<path id="classpath">
<fileset dir="WebContent/WEB-INF/lib" includes="**/*.jar" />
</path>
<!-- =============== -->
<!-- === COMPILE === -->
<!-- =============== -->
<target name="compile" depends="init">
<echo message="start compiling" />
<javac srcdir="${src}" destdir="${warDir}/WEB-INF/classes" debug="true" includes="**/*.java">
<classpath refid="classpath" />
</javac>
</target>
<!-- =============== -->
<!-- === BUILD ===== -->
<!-- =============== -->
<target name="build" depends="init,compile">
<echo message="start building:" />
<copy todir="${warDir}/src">
<fileset dir="src/" includes="**/*.java"/>
</copy>
<copy todir="${warDir}/">
<fileset dir="${dirs.base}/" includes="*.jsp"/>
</copy>
<copy todir="${warDir}/">
<fileset dir="${dirs.base}/" includes="*.html"/>
</copy>
<copy todir="${warDir}/">
<fileset dir="${dirs.base}/" includes="*.htm"/>
</copy>
<copy todir="${warDir}/">
<fileset dir="${dirs.base}/" includes="**/*.properties"/>
</copy>
<copy todir="${warDir}/WEB-INF">
<fileset dir="${dirs.base}/" includes="web.xml"/>
</copy>
<copy todir="${warDir}/WEB-INF/lib">
<fileset dir="${dirs.base}/WEB-INF/lib" includes="*.jar" />
</copy>
<copy todir="${warDir}/images">
<fileset dir="${dirs.base}/images" includes="*.*"/>
</copy>
<copy todir="${warDir}/js">
<fileset dir="${dirs.base}/js" includes="*.js"/>
</copy>
<copy todir="${warDir}/css">
<fileset dir="${dirs.base}/css" includes="*.css"/>
</copy>
<copy todir="${warDir}/fonts">
<fileset dir="${dirs.base}/fonts" includes="*.*"/>
</copy>
</target>
</project>
No comments:
Post a Comment