Riduidel
Riduidel

Reputation: 22292

How to run a maven plugin without a POM in Jenkins?

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).

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).

Question: Is it possible to configure Jenkins to not use a pom when there is none?

Upvotes: 3

Views: 3534

Answers (1)

A_Di-Matteo
A_Di-Matteo

Reputation: 27812

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.

In such a build, you can then configure a build step executing a shell or a Windows command (depending on the Jenkins server OS).

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

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

Upvotes: 2

Related Questions