Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The idea is to create the war and put the file into the ear directory, see the following build.xml code</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;project name="Add war to ear example" default="all" basedir="."&gt; &lt;target name="init"&gt; &lt;property name="root.directory" value="${basedir}"/&gt; &lt;property name="classdir" value="${root.directory}/build/src"/&gt; &lt;property name="src" value="${root.directory}/src"/&gt; &lt;property name="web" value="${root.directory}/web"/&gt; &lt;property name="deploymentdescription" value="${root.directory}/build/deploymentdescriptors"/&gt; &lt;property name="war.file" value="test.war"/&gt; &lt;property name="ear.file" value="test.ear"/&gt; &lt;property name="ear.directory" value="${root.directory}/build/ear"/&gt; &lt;property name="war.directory" value="${root.directory}/build/war"/&gt; &lt;!-- Create Web-inf and classes directories --&gt; &lt;mkdir dir="${war.directory}/WEB-INF"/&gt; &lt;mkdir dir="${war.directory}/WEB-INF/classes"/&gt; &lt;!-- Create Meta-inf and classes directories --&gt; &lt;mkdir dir="${ear.directory}/META-INF"/&gt; &lt;/target&gt; &lt;!-- Main target --&gt; &lt;target name="all" depends="init,build,buildWar,buildEar"/&gt; &lt;!-- Compile Java Files and store in /build/src directory --&gt; &lt;target name="build" &gt; &lt;javac srcdir="${src}" destdir="${classdir}" debug="true" includes="**/*.java" /&gt; &lt;/target&gt; &lt;!-- Create the War File --&gt; &lt;target name="buildWar" depends="init"&gt; &lt;copy todir="${war.directory}/WEB-INF/classes"&gt; &lt;fileset dir="${classdir}" includes="**/*.class" /&gt; &lt;/copy&gt; &lt;copy todir="${war.directory}/WEB-INF"&gt; &lt;fileset dir="${deploymentdescription}" includes="web.xml" /&gt; &lt;/copy&gt; &lt;copy todir="${war.directory}"&gt; &lt;fileset dir="${web}" includes="**/*.*" /&gt; &lt;/copy&gt; &lt;!-- Create war file and place in ear directory --&gt; &lt;jar jarfile="${ear.directory}/${war.file}" basedir="${war.directory}" /&gt; &lt;/target&gt; &lt;!-- Create the War File --&gt; &lt;target name="buildEar" depends="init"&gt; &lt;copy todir="${ear.directory}/META-INF"&gt; &lt;fileset dir="${deploymentdescription}" includes="application.xml" /&gt; &lt;/copy&gt; &lt;!-- Create ear file and place in ear directory --&gt; &lt;jar jarfile="${root.directory}/${ear.file}" basedir="${ear.directory}" /&gt; &lt;/target&gt; &lt;/project&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload