简体   繁体   English

如何在jenkins中获取root pom文件位置?

[英]How to get root pom file location in jenkins?

I am building a post build plugin for Jenkins which takes the reports in the maven project target folder to generate a consolidated report. 我正在为Jenkins构建一个后构建插件,该插件将报告保存在maven项目目标文件夹中,以生成合并的报告。 But I do not know the location of target folder inside workspace. 但是我不知道目标文件夹在工作空间中的位置。 Since the target folder will be in the same directory as my pom file, Is there any way I can get location of root pom file specified? 由于目标文件夹将与我的pom文件位于同一目录中,请问有什么方法可以获取指定的根pom文件的位置?

yes there is a way, if you have ssh access to executor (main or slave) go to it and locate build workspace, than you will see and get full path of your pom.xml file. 是的,有一种方法,如果您具有对执行程序(主执行程序或从属执行程序)的ssh访问权,请转到它并找到构建工作区,然后您将看到并获取pom.xml文件的完整路径。

other option is to have several runs of jenkins job and use shell script pwd locate where are you and ls to see what you have there and it will give you idea how to proceed. 另一种选择是运行几次jenkins作业,并使用shell脚本pwd定位您和ls的位置,以查看您那里有什么,它将使您知道如何进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM