ephox
ephox

Reputation: 93

How to pass parameters to maven?

I am trying to call a parameter via maven command. This is how the definition of it looks like:

/**
 *
 * @parameter default-value=false
 */
private boolean myBool;

What would be the right way to set it via maven command line?

<groupid>:<artifactid>:<version>:<goal> -myBool=true

does not work

Upvotes: 5

Views: 12739

Answers (1)

VonC
VonC

Reputation: 1323223

You should be able to set it as a property (see Maven Command Line Options)

mvn -DmyBool=true <groupid>:<artifactid>:<version>:<goal>

As noted by Diego Victor De Jesus in the comments:

if it is a boolean parameter that should be set to true, you can do:

mvn -DmyBool <groupid>:<artifactid>:<version>:<goal> 

Upvotes: 9

Related Questions