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

前端 未结 9 1906
半阙折子戏
半阙折子戏 2020-12-14 16:13

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

Use Case

There is a Maven build that will only work if the current working direc

9条回答
  •  孤城傲影
    2020-12-14 16:28

    Create a target to checkout the parent.

    • Checkout the parent dir of your build target
    • Set Build -> Goal = clean
    • Run build and ascertain the destination workspace directory (second line of console output, in my sample /var/lib/jenkins/workspace/my_project)

    Create a target to build your path

    • DO NOT check "Delete workspace before build starts"
    • In Build -> Advanced - Check "Change folder of workspace" and paste your /yourtargetdirectory

    It worked for me.

提交回复
热议问题