Modifying the Compilation Script
WebLogic provides tools such as wlcompile, ejbgen, and wlappc to facilitate compilation. You do not need to repeatedly configure classpath, and EJB source files are automatically generated.
Instead, you can simply run the javac, jar, and war commands to replace this advanced function. For example, you can use the javac command to configure the wlcompile source path and output path. For details, see the following example.
- Before:
<target name="build.ear" description="Compile EAR for split directory deployment."> <wlcompile srcdir="${dist}" destdir="${examples.build.dir}/${bean.ear}" includes="${ejb.name},${war.name}"> <ejbgen source="${sourceVersion}"/> <javac deprecation="${deprecation}"/> <javac debug="${debug}"/> </wlcompile> <!--"Enhance entity class"--> <taskdef name="weave" classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeaveAntTask"/> <weave source="${dist}/${war.name}/WEB-INF/classes" target="${dist}/${war.name}/WEB-INF/classes"> <classpath> <path location="${examples.build.dir}/${bean.ear}/${ejb.name}"/> <pathelement path="${java.class.path}"/> </classpath> </weave> <wlappc source="${examples.build.dir}/${bean.ear}" debug="${debug}" deprecation="${deprecation}"/> </target> - After:
<target name="compile" depends="prepare"> <javac srcdir="${ejb-src}" destdir="${dist-ejb-classes}" debug="on" deprecation="on" optimize="off" includes="**"> <classpath refid="classpath" /> </javac> <javac srcdir="${web-src}" destdir="${dist-web-classes}" debug="on" deprecation="on" optimize="off" includes="**"> <classpath refid="classpath" /> </javac> </target> <target name="jar" depends="compile"> <jar jarfile="${dist}/simpleEJB.jar"> <fileset dir="${dist}/${ejb.name}"> <include name="**/*.*" /> </fileset> </jar> </target> <target name="war" depends="jar"> <war warfile="${dist}/${war.name}.war"> <fileset dir="${dist}/${war.name}"> <include name="**/*.*" /> </fileset> </war> </target> <target name="assemble-app" depends="war"> <jar jarfile="${dist}/${project.name}.ear"> <metainf dir="${dist}/META-INF"> <include name="application.xml" /> </metainf> <fileset dir="${dist}" includes="*.jar,*.war" /> </jar> </target>
Parent topic: Porting WebLogic Applications to TomEE