与调用SVN和Maven创建工作詹金斯 [英] Create job in jenkins with calling svn and maven

查看:204
本文介绍了与调用SVN和Maven创建工作詹金斯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关现在我有使用svn,并呼吁行家全新安装的更新项目命令与批处理文件。如何创建詹金斯类似行动的一些工作?
我应该把它写蚂蚁文件(对不起,如果这是愚蠢的想法,我只是听说过,但我不知道究竟是什么,我有什么可以做这个),或者还有其他办法吗?

For now I have a batch file with commands for update projects using svn and calling maven 'clean install'. How to create some job in Jenkins for similar actions? Should I write it to ant file (sorry if it's stupid idea, I've just heard about it but I don't know what is it exactly and what can I do with this) or there is other way?

感谢

推荐答案

像arghtype建议,你需要使用通过配置SVN作为SCM源和提供凭据的Maven构建作业部分詹自己的源代码code管理。

Like arghtype suggested, you need to be using Jenkin's own Source Code Management by configuring SVN as SCM source and supplying credentials as part of Maven build job.

如果您包含以使用自己的本地工作副本,你正在组织是错误的,你将失去其詹金斯管理SVN的变化,并在年底,该组织将给予的所有优点你在未来更多的无法解决的问题。想想人们赋予这里的建议,并配备了一个理由的为什么的,你需要有一个本地工作区詹金斯管理以外的詹金斯生成计算机上。我唯一​​的猜测是:您的詹金斯和开发机是相同的。这又是不是应该如何组织。詹金斯是一个CI服务器,而不是个人的构建的Automator。

If you have to use your own local working copy, you are organizing it wrong, you will lose on all the benefits of having Jenkins manage SVN changes, and in the end, this organization will give you more unsolvable problems in the future. Think about the advice people are giving here and come with up a reason why you need to have a local workspace outside of Jenkins management on a Jenkins build machine. My only guess is: your Jenkins and Development machine are the same. That again is not how it should be organized. Jenkins is a CI-server, not a personal build "automator".

无论如何,如果你还愿意做你所说的。

Regardless, if you still want to do what you say.

你觉得你想要什么


  • 创建一个新的自由式工作

  • 生成步骤,点击添加构建步骤

  • 选择执行Windows批处理命令

  • 写批处理在那里执行命令。你的工作目录将是詹金斯的 $ WORKSPACE ,所以相应地改变到你要运行它你的路径。

  • Create a new Freestyle job
  • Under Build Steps, click Add build step
  • Select Execute Windows batch command
  • Write your batch execute command in there. Your working directory will be Jenkins's $WORKSPACE, so change your path accordingly to where you want to run it.

但随着上面的配置,你可能也把批处理文件,windows下的调度......你是不是真的用詹金斯与上面的。

But with the above configuration, you might have as well put the batch file under windows scheduler... You are not really using Jenkins with the above.

你应该做的,而不是


  • 创建一个新的了maven2 / 3 建立工作

  • 来源$ C ​​$ C管理下,选择颠覆

  • 库网址输入远程SVN回购(即 http://your.svnsever.com/path/to/project

  • 建立,输入您的根POM 的位置(这将是相对于你的SVN结账的位置,所以如果你的POM是在 http://your.svnserver.com/path/to/project/maven/pom.xml ,然后输入的Maven / pom.xml的

  • 目标和选项,输入全新安装

  • 点击保存

  • Create a new maven2/3 build job
  • Under Source Code Management, select Subversion
  • Under Repository URL enter the remote SVN repo (i.e. http://your.svnsever.com/path/to/project)
  • Under Build, enter your Root POM location (this will be relative to the location of your SVN checkout, so if your POM is under http://your.svnserver.com/path/to/project/maven/pom.xml, then enter maven/pom.xml.
  • Under Goals and options, enter clean install
  • Click Save

来源$ C ​​$ C管理的节会照顾设立本地工作区和签出库到该工作区。默认情况下,每一个新的构建被触发时,它将运行 SVN更新上的工作空间为您服务。

The Source Code Management section will take care of setting up a local workspace and checkout the repository into that workspace. By default, every time a new build is triggered, it will run svn update on that workspace for you.

Maven构建的一步将运行Maven的照顾,但是请注意,它被配置为使用默认的〜/ .m2目录/库位置。如果你的本地Maven回购需求是不同的,根据詹金斯全局配置改变这种

The Maven Build step will take care of running your Maven, however note that it is configured to use default ~/.m2/repository location. If your local maven repo needs to be different, change this under Jenkins Global Configuration

这篇关于与调用SVN和Maven创建工作詹金斯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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