日期:2014-05-17  浏览次数:20784 次

各位大神急救ANT执行任务报错,多谢了帮帮忙!
<?xml version="1.0"?>

<project name="Demo0227-01EJB" default="ejbjar" basedir="..">
<property environment="env" />
<property name="app.dir" value="${basedir}"/>
<property name="src.dir" value="${app.dir}\src" />
<property name="jboss.home" value="${env.JBOSS_HOME}" />
<property name="jboss.server.config" value="default" />
<property name="build.dir" value="${app.dir}\build" />
<property name="build.classes.dir" value="${build.dir}\classes" />


<!--build classpath-->
<path id="build.classpath">
<fileset dir="${jboss.home}\client">
<include name="*.jar" />
</fileset>
<pathelement location="${build.classes.dir}" />
</path>
<target name="prepare" depends="clean">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="compile" depends="prepare" description="编译">
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="on" deprecation="on" optimize="off" includes="**">
<classpath refid="build.classpath"></classpath>
</javac>
</target>
<target name="ejbjar" depends="compile" description="创建EJB发布包">
<jar destfile="${src.dir}\Demo0227-01EJB.jar}">
<fileset dir="${build.classes.dir}">
<include name="**/*.class"/>
</fileset>
<metainf dir="${src.dir}/META-INF">
<include name="**"/>
</metainf>
</jar>
</target>
<target name="deploy" depends="ejbjar">
<copy file="${src.dir}\Demo0227-01EJB.jar" todir="${jboss.home}\server\${jboss.server.config}\deploy"></copy>
</target>
<target name="clean">
<delete dir="${build.dir}"></delete>
<delete file="${jboss.home}\server\${jboss.server.config}\deploy\OneToMany.jar" />
</target>
</project>



Buildfile: D:\workspace\myeclipse8.6\Demo0227-01EJB\src\build.xml
clean:
  [delete] Deleting directory D:\workspace\myeclipse8.6\Demo0227-01EJB\build
prepare:
  [mkdir] Created dir: D:\workspace\myeclipse8.6\Demo0227-01EJB\build
  [mkdir] Created dir: D:\workspace\myeclipse8.6\Demo0227-01EJB\build\classes
compile:
  [javac] Compiling 25 source files to D:\workspace\myeclipse8.6\Demo0227-01EJB\build\classes
ejbjar:
  [jar] Building jar: D:\workspace\myeclipse8.6\Demo0227-01EJB\src\Demo0227-01EJB.jar}
deploy:

BUILD FAILED
D:\workspace\myeclipse8.6\Demo0227-01EJB\src\build.xml:40: Warning: Could not find file D:\workspace\myeclipse8.6\Demo0227-01EJB\src\Demo0227-01EJB.jar to copy.

Total time: 2 seconds

如上是我的build.xml和错误异常,运行时不知为何报错,还请各位朋友多多帮助!

------解决方案--------------------
少了jar包,把这个jar加进去:Demo0227-01EJB.jar
------解决方案--------------------
帮顶的