Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 请教关于ant的build.xml文件
TopCool

Miracle

CJSDN高级会员


发贴: 253
积分: 10
于 2003-06-11 12:47 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
先看看我得build.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!-- An Ant build file for the JBoss Book: JBoss Administration and Development
examples, version 3.0.1
-->

<project name="testejb" default="build-all" basedir=".">

<!-- Allow override from local properties file -->
<property file=".ant.properties" />
<!-- Override with your JBoss/Web server bundle dist location -->
<property name="jboss.dist" value="D:/jboss-3.0.6"/>
<property name="jboss.deploy.dir" value="${jboss.dist}/server/default/deploy"/>

<property name="src.dir" value="${basedir}"/>
<property name="src.resources" value="${basedir}"/>
<property name="build.dir" value="${basedir}/output"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>

<path id="build.path">
<pathelement location="${jboss.dist}/client/concurrent.jar"/>
<pathelement location="${jboss.dist}/client/jaas.jar"/>
<pathelement location="${jboss.dist}/client/jboss-common-client.jar"/>
<pathelement location="${jboss.dist}/client/jboss-client.jar"/>
<pathelement location="${jboss.dist}/client/jboss-system-client.jar"/>
<pathelement location="${jboss.dist}/client/jboss-j2ee.jar"/>
<pathelement location="${jboss.dist}/client/jbosssx-client.jar"/>
<pathelement location="${jboss.dist}/client/jmx-rmi-connector-client.jar"/>
<pathelement location="${jboss.dist}/client/jnet.jar"/>
<pathelement location="${jboss.dist}/client/jnp-client.jar"/>
<pathelement location="${jboss.dist}/client/jsse.jar"/>
<pathelement location="${jboss.dist}/client/log4j.jar"/>
<pathelement location="${jboss.dist}/server/default/lib/javax.servlet.jar"/>
<pathelement location="${jboss.dist}/server/default/lib/jboss.jar"/>
<pathelement location="${jboss.dist}/server/default/lib/jbosssx.jar"/>
<pathelement location="${jboss.dist}/lib/jboss-system.jar"/>
<pathelement location="${jboss.dist}/lib/jboss-jmx.jar"/>
<pathelement location="${build.classes.dir}"/>
</path>

<path id="client.path">
<pathelement location="${jboss.dist}/client/concurrent.jar"/>
<pathelement location="${jboss.dist}/client/jaas.jar"/>
<pathelement location="${jboss.dist}/client/jboss-common-client.jar"/>
<pathelement location="${jboss.dist}/client/jboss-client.jar"/>
<pathelement location="${jboss.dist}/client/jbossmq-client.jar"/>
<pathelement location="${jboss.dist}/client/jboss-system-client.jar"/>
<pathelement location="${jboss.dist}/client/jboss-j2ee.jar"/>
<pathelement location="${jboss.dist}/client/jbosssx-client.jar"/>
<pathelement location="${jboss.dist}/client/jboss-jsr77.jar"/>
<pathelement location="${jboss.dist}/client/jmx-rmi-connector-client.jar"/>
<pathelement location="${jboss.dist}/client/jnet.jar"/>
<pathelement location="${jboss.dist}/client/jnp-client.jar"/>
<pathelement location="${jboss.dist}/client/jcert.jar"/>
<pathelement location="${jboss.dist}/client/jsse.jar"/>
<pathelement location="${jboss.dist}/client/log4j.jar"/>
<pathelement location="${build.classes.dir}"/>
<pathelement location="${src.resources}"/>
</path>

<!-- Validate the jboss.dist value by looking for a the client/jboss-j2ee.jar jar -->
<target name="validate">
<available property="classpath_id" value="build.path" file="${jboss.dist}/client/jboss-j2ee.jar" />
</target>
<target name="fail_if_not_valid" unless="classpath_id">
<fail message="jboss.dist=${jboss.dist} is not a valid JBoss dist directory"/>
</target>
<target name="init" depends="validate,fail_if_not_valid">
<property name="classpath" refid="${classpath_id}" />
<echo message="Using jboss.dist=${jboss.dist}" />
</target>

<!-- Compile all java source under src/main -->
<target name="compile" depends="init">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
classpathref="${classpath_id}"
debug="on"
deprecation="on"
optimize="off">
<include name="**" />
</javac>
</target>
   <target name="build-all" depends="compile">
<ant antfile="src/build.xml" />
</target>

</project>

另一个build.xml
<!-- Build script for the chapter 7 examples -->
<project name="testejb build" default="build-all">

<property name="src.root" value="src" />
<property name="chapter.dir" value="${build.dir}/chap7" />

<target name="prepare">
<mkdir dir="${chapter.dir}" />
</target>

<target name="build-all">
<antcall target="testejb-jar" />
<copy file="${chapter.dir}/testejb.jar" todir="${jboss.deploy.dir}"
overwrite="true" />
   <sleep seconds="1"/>
</target>

<target name="testejb-rar" depends="prepare">
<jar jarfile="${chapter.dir}/testejb.jar">
<fileset dir="${build.classes.dir}"/>
</jar>
</target>
<target name="testejb-jar" depends="prepare">
<jar jarfile="${chapter.dir}/testejb.jar">
<metainf dir="${src.root}" includes="*.xml"/>
<fileset dir="${build.classes.dir}"
includes="**"/>
</jar>
</target>

  <target name="test" depends="testejb-jar">
<copy file="${chapter.dir}/testejb.jar" todir="${jboss.deploy.dir}"
overwrite="true" />
<echo message="Waiting for deploy..." />
</target>
</project>

不知道为什么是两个,可以和成一个么?这两个是我看着例子改的
我觉得应该是一个build.xm文件
就是用ant生成jboss的ejb的.jar文件用的。
另外,我想问一下怎么知道都有什么属性,我想加一个<java target....>
可是用ant编译的时候,说java没有这个属性,那我怎么知道都有什么属性那?

谢谢回答




话题树型展开
人气 标题 作者 字数 发贴时间
4189 请教关于ant的build.xml文件 TopCool 5863 2003-06-11 12:47
2756 Re:请教关于ant的build.xml文件 ww77721 87 2003-06-11 16:02

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923