xdoclet.xml
2:
3: <!-- Copyright (c) 2002,2003,2004 by eteration a.s.
4: www.eteration.com
5: All rights reserved. -->
6:
7:
8: < project name= " xdocletBuild " default= " ejbdoclet " basedir= " . " >
9:
10: <!-- Init -->
11: < target name= " init " >
12: < property file= " build.properties " />
13:
14: < property name= " ejb.dd.dir " value= " ../META-INF " />
15: < property name= " web.dd.dir " value= " ../WEB-INF " />
16: < property name= " xdoclet.force " value= " true " />
17: < property name= " container.type " value= " ejb-jar " />
18:
19: <!-- Set up java.class.path -->
20: < path id= " project.class.path " >
21: < pathelement location= " ${project.dir}/${bin.dir} " />
22:
23:
24: < fileset dir= " ${eclipse.home}/plugins " >
25: < include name= " **/ant.jar " />
26: < include name= " **/sf.net.xdoclet*/*.jar " />
27: < include name= " **/org.apache.log4j*/**/*.jar " />
28: < include name= " **/org.apache.commons*/**/*.jar " />
29: </ fileset >
30:
31: <!-- append the external classpath lastly -->
32: < pathelement path= " ${java.class.path} " />
33:
34: <!-- append the path sent through eclipse to classpath -->
35: < pathelement path= " ${project.path} " />
36:
37: </ path >
38:
39:
40: </ target >
41:
42: <!-- Run EJBDoclet -->
43: < target name= " ejbdoclet " depends= " init " >
44:
45: < taskdef name= " ejbdoclet " classname= " xdoclet.modules.ejb.EjbDocletTask " >
46: < classpath refid= " project.class.path " />
47: </ taskdef >
48:
49:
50: < ejbdoclet
51: destdir= " ${project.dir}/${ejbsrc.dir} "
52: mergedir= " ${ejb.dd.dir} "
53: excludedtags= " @version,@author,@todo "
54: addedtags= " @lomboz generated "
55: ejbspec= " 2.0 "
56: force= " ${xdoclet.force} "
57: verbose= " true " >
58:
59: <!-- PLEASE KEEP THE BEAN MARKER COMMENTS IF YOU MODIFY THE FILE.
60: CONTENTS BETWEEN THE MARKERS ARE AUTO INSERTED WITH EACH
61: BUILD. -->
62: <!-- BEANS START -->
63: < fileset dir= " ../../src " defaultexcludes= " yes " >
64: < patternset includesfile= " ejbs.xml " />
65: </ fileset >
66: <!-- BEANS END -->
67:
68: < dataobject />
69: < dao pattern= " {0} " destdir= " ${project.dir}/${ejbsrc.dir} " />
70:
71: < valueobject />
72: < utilobject cacheHomes= " true " includeGUID= " true " kind= " physical " />
73:
74: < remoteinterface />
75: < localinterface />
76: < homeinterface />
77: < localhomeinterface />
78:
79: < entitypk />
80: < entitycmp />
81: < entitybmp />
82: < session />
83:
84: < deploymentdescriptor
85: destdir= " ${ejb.dd.dir} "
86: validatexml= " false "
87: mergedir= " ${ejb.dd.dir} "
88: />
89:
90: <!--
91: Have struts form objects generated based on entity beans'
92: data objects. Will require struts.jar to compile. -->
93: < strutsform />
94:
95:
96: <!--
97: Have a mapping.xml file generated for castor classes.
98: -->
99: < castormapping destdir= " ${ejb.dd.dir} " validatexml= " false " />
100: <!-- -->
101:
102: < weblogic
103: version= " 6.1 "
104: xmlencoding= " UTF-8 "
105: destdir= " ${ejb.dd.dir} "
106: validatexml= " false "
107: datasource= " PLEASE_MODIFY_THIS "
108: mergedir= " ${ejb.dd.dir} "
109: persistence= " weblogic "
110: />
111: < jboss
112: version= " 3.0 "
113: unauthenticatedPrincipal= " nobody "
114: xmlencoding= " UTF-8 "
115: destdir= " ${ejb.dd.dir} "
116: validatexml= " false "
117: datasource= " PLEASE_MODIFY_THIS "
118: datasourcemapping= " PLEASE_MODIFY_THIS "
119: preferredrelationmapping= " PLEASE_MODIFY_THIS "
120: />
121:
122: < jrun
123: version= " 4.0 "
124: xmlencoding= " UTF-8 "
125: destdir= " ${ejb.dd.dir} "
126: validatexml= " false "
127: />
128:
129: < webSphere destdir= " ${ejb.dd.dir} " />
130: < jonas
131: version= " 3.2 "
132: xmlencoding= " UTF-8 "
133: destdir= " ${ejb.dd.dir} "
134: validatexml= " false "
135: mergedir= " ${ejb.dd.dir} "
136: />
137:
138: < orion
139: destdir= " ${ejb.dd.dir} "
140: />
141:
142: < apachesoap
143: destdir= " ${ejb.dd.dir} "
144: />
145:
146: </ ejbdoclet >
147: </ target >
148:
149: </ project >
25: <include name="**/ant.jar"/>
26: <include name="**/sf.net.xdoclet*/*.jar"/>
27: <include name="**/org.apache.log4j*/**/*.jar"/>
28: <include name="**/org.apache.commons*/**/*.jar"/>
29: </fileset>
xdoclet.xml
<?xml version="1.0" encoding="GBK"?><!--
Copyright (c) 2002, 2003,2004 Eteration Bilisim A.S.
Naci Dai and others.
Parts developed under contract ref:FT/R&D/MAPS/AMS/2004-09-09/AL are
Copyright France Telecom, 2004.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Eteration Bilisim A.S. - initial API and implementation
Naci Dai
For more information on eteration, please see
<http://www.eteration.com/>.
-->
<project name="xdocletBuild" default="ejbdoclet" basedir=".">
<!-- Init -->
<target name="init">
<property file="build.properties"/>
<property name="ejb.dd.dir" value="../META-INF"/>
<property name="web.dd.dir" value="../WEB-INF"/>
<property name="xdoclet.force" value="true"/>
<property name="container.type" value="ejb-jar"/>
<!-- Set up java.class.path -->
<path id="project.class.path">
<pathelement location="${project.dir}/${bin.dir}" />
<!-- 由于使用links方式安装Lomboz插件,所以需要修改这个目录,使其
正确指向Lomboz目录,还建议使用1.2.2版本的XDoclet 目录下的库
文件来代替 sf.net.xdoclet* 目录下的库文件
-->
<fileset dir="D:/eclipse/myplugins/lomboz-3.0.1/eclipse/plugins">
<include name="**/ant.jar"/>
<include name="**/sf.net.xdoclet*/*.jar"/>
<include name="**/org.apache.log4j*/**/*.jar"/>
<include name="**/org.apache.commons*/**/*.jar"/>
</fileset>
<!-- append the external classpath lastly -->
<pathelement path="${java.class.path}" />
<!-- append the path sent through eclipse to classpath -->
<pathelement path="${project.path}" />
</path>
</target>
<!-- Run EJBDoclet -->
<target name="ejbdoclet" depends="init">
<taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask">
<classpath refid="project.class.path"/>
</taskdef>
<ejbdoclet
destdir="${project.dir}/${ejbsrc.dir}"
mergedir="${ejb.dd.dir}"
excludedtags="@version,@author,@todo"
addedtags="@lomboz generated"
ejbspec="2.1"
force="${xdoclet.force}"
verbose="true" >
<!-- PLEASE KEEP THE BEAN MARKER COMMENTS IF YOU MODIFY THE FILE.
CONTENTS BETWEEN THE MARKERS ARE AUTO INSERTED WITH EACH
BUILD. -->
<!-- BEANS START -->
<fileset dir="../../src" defaultexcludes="yes">
<patternset includesfile="ejbs.xml" />
</fileset>
<!-- BEANS END -->
<dataobject/>
<dao pattern="{0}" destdir="${project.dir}/${ejbsrc.dir}"/>
<valueobject/>
<utilobject cacheHomes="true" includeGUID="true" kind="physical"/>
<remoteinterface/>
<localinterface/>
<homeinterface />
<localhomeinterface/>
<entitypk/>
<entitycmp/>
<entitybmp/>
<session/>
<deploymentdescriptor
destdir="${ejb.dd.dir}"
validatexml="false"
mergedir="${ejb.dd.dir}"
/>
<!--
Have struts form objects generated based on entity beans'
data objects. Will require struts.jar to compile. -->
<strutsform />
<!--
Have a mapping.xml file generated for castor classes.
-->
<castormapping destdir="${ejb.dd.dir}" validatexml="false" />
<!-- -->
<jboss
version="4.0"
unauthenticatedPrincipal="nobody"
xmlencoding="GBK"
destdir="${ejb.dd.dir}"
validatexml="false"
datasource="java:/MySqlDS"
datasourcemapping="mySQL"
preferredrelationmapping="foreign-key"
/>
<apachesoap
destdir="${ejb.dd.dir}"
/>
</ejbdoclet>
</target>
</project>
提醒
|
这时,会在 xdoclet.xml 中添加以下语句:
<fileset dir="${project.dir}/src/" defaultexcludes="yes"> <include name="javamxj/ejb/stateless/HelloBean.java" /> </fileset>
同时,在 beans.xml 中会加入
<bean> <beanClass>javamxj.ejb.stateless.HelloBean</beanClass> <type>Session</type> </bean>
这样,就把 HelloBean.java 加入了 EJBDoclet 的任务中了。
|
提醒
|
打开JBoss-IDE目录下的子目录 D:/eclipse/myplugins/jboss-ide-1.40/eclipse/plugins/org.jboss.ide.eclipse.xdoclet.core_1.4.0 (我采用的 links 方式安装),发现其中的XDoclet库文件是1.2.1版本,最好用1.2.2版本下对应的库文件将其替换掉,其它文件不要乱动。
另外,还可以添加其它如 IBM、BEA 的库文件到这个目录,使 JBoss-IDE 不仅仅支持 JBoss,还可以支持其它服务器,甚至自己编写库文件也可以加入。
还有,至于“Alt+/”是干什么的,可以查看: Eclipse的主窗口 ->帮助 ->提示与技巧 ->Eclipse Java 开发工具,很不错的。
|
21:51:47,656 INFO [EJBDeployer] Deployed: file:/F:/java/jboss/server/default/deploy/helloEJB.jar
22:25:45,156 INFO [STDOUT] Hello javamxj(CSDN)