【发布时间】:2011-01-18 09:24:03
【问题描述】:
我有一个包含两个依赖项的 WebApp,如下所示。我想使用 Ant + Ivy 构建一个用于在 Tomcat 上部署的战争文件。
+
+-MyWebApp // this Dynamic Java Web Application (deployed Tomcat and launches
// a thread contained in MyApp)
+-MyApp // this is just a vanilla Java Application
+-MyCommonStuff // these are common classes shared between MyApp and MyWebApp
// Ex. Database access code & business classes
使用 Ant 文档,我研究了如何为每个项目创建适当的 build.xml 文件。 也就是说每个项目都有一个独立的build.xml,所以为了构建整个项目我要做的就是:
mkdir build
cd build
export SOME_COMMONBASE=`pwd`
svn co https://mybuildmachine.lan/svn/mycommonstuff mycommonstuff
cd mycommonstuff
ant
cd ..
% this produces mycommonstuff.jar
svn co https://mybuildmachine.lan/svn/myapp myapp
cd myapp
ant
cd ..
% this produces myapp.jar
svn co https://mybuildmachine.lan/svn/mywebapp mywebapp
cd mycommonstuff
ant
cd ..
% this produces mywebapp.war and deploys it to Tomcat
现在我想做的是将它们整合在一起,以便我可以开始一个构建。从表面上看,我应该能够以某种方式创建一个将依赖项连接在一起的 Ivy build.xml。但是,我已经阅读了 Ivy 文档并在 Google 上搜索了示例,但我仍然对如何完成这项任务一无所知。 有人可以给我一些关于如何做到这一点的指示吗?
【问题讨论】:
标签: java ant build-automation ivy