mbruns42
mbruns42

Reputation: 448

What's the default command Jenkins executes for a Maven Job?

I set up a Maven Job on our Jenkins server and it's running fine. In the configuration, I only had to specify the pom file, no goal/command whatsoever.

I'd like to run the same build locally and build a profile for doing that. I want to see wether it's working just like the job on the server (so I can test locally before committing). I can execute Maven commands just fine, I just don't know what command I need to get the comparable output. What does Jenkins use as the default Maven command? mvn clean install?

Edit: Picture of build configuration

Upvotes: 2

Views: 3985

Answers (2)

mbruns42
mbruns42

Reputation: 448

Apparently, Jenkins executes mvn install if a project is specified as a maven job without any goals and options configured. I can see all previous phases executed.

Also, the build does not fail when tests fail, so I suspect -Dmaven.test.failure.ignore=true is involved as well.

I agree with other answers that this behaviour is unusual and it would be more intuitive to offer a visible default command instead of executing a build if no goal is specified.

Upvotes: 3

OhadR
OhadR

Reputation: 8839

create an "execute shell" box, and there you can type the maven command, such as mvn clean install.

See below:

enter image description here

Upvotes: 3

Related Questions