1.eclipse external tools configuration 添加了 如下 xml 文件;
图一
图二
执行 StoreWebWork buildjida.xml ,控制台 输出 内容如下:
StoreWebWork buildjida.xml 代码如下:
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- EJB3 EntityBean build file eclipse external tools configuration -->
<!-- ======================================================================= -->
<project name="com" default="ejbjar" basedir="..">
<property environment="env" />
<property name="app.dir" value="${basedir}/StoreWebWork" />
<property name="src.dir" value="D:\workspace-yaoxiao2\StoreWebWork\src" />
<property name="src.dir1" value="D:\workspace-yaoxiao2\StoreWebWork\src\com\jida" />
<property name="jboss.home" value="D:\jboss-4.2.3.GA\server\yaoxiao2Test\deploy\web.war\WEB-INF\lib" />
<property name="jboss.server.config" value="all" />
<property name="build.dir" value="${app.dir}/bin" />
<property name="build.classes.dir" value="${build.dir}" />
<!-- Build classpath -->
<path id="build.classpath">
<fileset dir="D:\workspace-yaoxiao2\StoreWebWork">
<include name="*.jar" />
</fileset>
<fileset dir="D:\workspace-yaoxiao2\StoreWebWork">
<include name="comjida.jar" />
</fileset>
<pathelement location="${build.classes.dir}" />
</path>
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare" depends="clean">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes.dir}" />
</target>
<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="prepare" description="编绎">
<javac srcdir="${src.dir1}" destdir="${build.classes.dir}" debug="on" deprecation="on" optimize="off" includes="**">
<classpath refid="build.classpath" />
</javac>
</target>
<target name="ejbjar" depends="compile" description="创建EJB发布包">
<jar jarfile="${app.dir}/comjida.jar">
<fileset dir="${build.classes.dir}">
<include name="**/*.class" />
</fileset>
<metainf dir="${src.dir}/META-INF">
<include name="**" />
</metainf>
</jar>
</target>
<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean">
<delete dir="${build.dir}" />
<delete file="${jboss.home}\comjida.jar" />
</target>
<target name="deploy" depends="ejbjar">
<copy file="${app.dir}\comjida.jar" todir="${jboss.home}" />
</target>
</project>
**
**