如何管理多个项目构建工作在詹金斯共同Ant构建脚本?
我有一组Java项目,从中我想与詹金斯建立不同的Git仓库来了。
I have a set of java projects coming from different git repositories which I want to be built with Jenkins.
他们都共享同一个Ant构建脚本,它采用工程的具体配置部件(如编译类路径),通过蚂蚁进口机制。
All of them share the same ant build script, which employs project specific configuration parts (e.g. compile class path) via ant import mechanism.
目前,我手动执行此共享,但是这是非常容易出错的改变公共部分。
At the moment I do this sharing manually, but this is very error prone on changes to the common part.
所以我的问题是:什么是管理詹金斯服务器上的多个版本的工作共享的Ant构建脚本的好办法
So my question is: What is a good approach to manage a shared ant build script across multiple build jobs on a jenkins server?
一对夫妇的想法......
A couple of ideas...
- 店铺Ant脚本中的工件储存库,你的个别项目可以拉,就像任何其他的依赖。
- 创建一个包含构建脚本父Git项目。在你父项目,每个子项目拉下作为的 Git的子模块。你可能会需要进行一些小的修改脚本,以参数化的构建脚本子项目引用。
- Store the Ant script in an artifact repository that your individual projects can pull from, like any other dependency.
- Create a parent Git project that contains the build script. In your parent project, pull down each individual sub-project as a Git submodule. You would probably need to make some minor modification to your script in order to parameterize the sub-project references in the build script.
这答案是不特定詹金斯,应该移植到其他生成服务器。
This answer is not specific to Jenkins and should be portable to other build servers.