如何在Jenkins中运行没有POM的Maven插件? [英] How to run a maven plugin without a POM in Jenkins?
问题描述
我有一个插件,可以使用pom.xml
来运行,也可以不运行(取决于我们正在构建的工件的版本:新版本没有pom.奇怪,我知道).
I have a plugin which can run either using a pom.xml
or without (depends upon the version of the artifact we're building: new versions go without a pom. Strange, I know).
我想让该插件在Jenkins中运行.
但是在创建Maven项目时,我必须设置一个pom(或者默认情况下,Jenkins假定给定的基本文件夹中有一个).
I want to have that plugin run in Jenkins.
But when creating a maven project, I have to set a pom (or as a default, Jenkins suppose there is one in the base folder given).
问题:是否可以将Jenkins配置为在不使用pom时不使用pom?
Question: Is it possible to configure Jenkins to not use a pom when there is none?
推荐答案
根据我的评论,在这种情况下,您应该使用Jenkins自由式项目构建,以便具有更大的灵活性并避免使用Jenkins Maven构建的默认假设
As per my comment, you should use a Jenkins freestyle project build in this case, in order to have more flexibility and avoid the default assumptions of a Jenkins Maven build.
在这样的构建中,您可以配置一个执行步骤,该步骤执行Shell或Windows命令(取决于Jenkins服务器操作系统).
In such a build, you can then configure a build step executing a shell or a Windows command (depending on the Jenkins server OS).
实际上,在Jenkins Maven构建中,始终需要一个pom文件,如配置">构建">根Pom"条目的帮助支持所述
Indeed, in the Jenkins Maven build, a pom file is always required, as mentioned in the help support of the Configuration > Build > Root Pom entry
如果您的工作区在第一个模块的根目录之外的其他位置具有顶级pom.xml,请在此处指定路径(相对于模块根目录),例如parent/pom.xml. 如果保留为空,则默认为pom.xml
If your workspace has the top-level pom.xml in somewhere other than the 1st module's root directory, specify the path (relative to the module root) here, such as parent/pom.xml. If left empty, defaults to pom.xml
这篇关于如何在Jenkins中运行没有POM的Maven插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!