使用 ang 排除某些类在 OC4j 上部署
我正在使用 Eclipse,它使用 Ant 将 EJB 部署到本地 OC4J 容器。
我需要从部署中排除一些文件。
我已经打开文件: D:\eclipse\plugins\org.eclipse.jst.server.generic.oc4j_1.5.206.v20090812\buildfiles\oracle.10.1.3.xml
并发现:
<target name="package.module.ejb">
<jar destfile="${server.publish.dir}/${module.name}.jar">
<zipfileset dir="${module.dir}">
<include name="**/*.*"/>
<exclude name="**/*.java"/>
</zipfileset>
</jar>
</target>
我需要排除的文件有以下模式:
XXXTest.class (以 Test.class 结尾)
我尝试添加:
<exclude name="**/*Test.class"/>
编辑
我在 EAR 中部署 JAR,以下是部署的 Ear 的目录结构:
MyApp.ear
- META-INF
- MyApp.jar
但没有效果。
I am using Eclipse, which uses Ant to deploy EJB to local OC4J container.
I need to exclude some files from being deployed.
I've open the file:D:\eclipse\plugins\org.eclipse.jst.server.generic.oc4j_1.5.206.v20090812\buildfiles\oracle.10.1.3.xml
And found:
<target name="package.module.ejb">
<jar destfile="${server.publish.dir}/${module.name}.jar">
<zipfileset dir="${module.dir}">
<include name="**/*.*"/>
<exclude name="**/*.java"/>
</zipfileset>
</jar>
</target>
The files that I need to exclude have the following pattern:
XXXTest.class (ends with Test.class)
I've tried adding:
<exclude name="**/*Test.class"/>
Edit
I deploy the JAR within an EAR, the following is the directory structure of the deployed ear:
MyApp.ear
- META-INF
- MyApp.jar
But with no effect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您开发/调试时,您是否想在不使用某些类的情况下部署应用程序?
build.xml 是插件的一部分,因此更改它是不明智的。我想您可以接受这些类在开发期间用于部署,除非这些类给您带来问题。
如果您正在构建应用程序的发布版本,您有几个选择:
- 为此使用 ant/maven。您可以更好地控制结果。
- 您仍然想纯粹使用 Eclipse java 构建器来完成它吗?然后你必须对你的罐子进行后期处理。
Do you want to deploy the application without some classes when you are developing/debugging?
That build.xml is part of the plugin so it is not wise to change it. I guess you can just accept that the classes are there for deployment during development unless those classes give you problems.
If you are building the release version of your application you have couple of choices:
- use ant/maven for that. You can control the result much better.
- Do you still want to do it purely with Eclipse java builders? Then you have to post process your jars.