如何管理多个项目构建工作在詹金斯共同Ant构建脚本? [英] How to manage a common ant build script across multiple project build jobs on jenkins?

查看:121
本文介绍了如何管理多个项目构建工作在詹金斯共同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...


  1. 店铺Ant脚本中的工件储存库,你的个别项目可以拉,就像任何其他的依赖。

  2. 创建一个包含构建脚本父Git项目。在你父项目,每个子项目拉下作为的 Git的子模块。你可能会需要进行一些小的修改脚本,以参数化的构建脚本子项目引用。

  1. Store the Ant script in an artifact repository that your individual projects can pull from, like any other dependency.
  2. 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.

这篇关于如何管理多个项目构建工作在詹金斯共同Ant构建脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆