有什么办法可以更改Jenkins Maven构建的工作目录吗? [英] Is there any way to change the working directory of a Jenkins Maven build?

查看:573
本文介绍了有什么办法可以更改Jenkins Maven构建的工作目录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改Jenkins Maven构建的工作目录?

Is there any way to change the working directory of a Jenkins Maven build?

有一个Maven构建仅在当前工作目录是其中包含pom.xml的目录时才起作用,因此我希望Maven构建在该目录中执行.

There is a Maven build that will only work if the current working directory is the directory with pom.xml in it, so I want the Maven build to execute in that directory.

带有pom.xml的目录位于git项目的子目录中.

The directory with the pom.xml is in a subdirectory of a git project.

推荐答案

创建目标以签出父对象.

Create a target to checkout the parent.

  • 签出构建目标的父目录
  • 设置构建->目标=干净
  • 运行构建并确定目标工作空间目录(控制台输出的第二行,在我的示例/var/lib/jenkins/workspace/my_project中)

创建目标以构建路径

  • 请勿选中在开始构建之前删除工作区"
  • 在Build-> Advanced中-选中更改工作空间文件夹",然后粘贴/yourtarget目录

对我有用.

这篇关于有什么办法可以更改Jenkins Maven构建的工作目录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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