How to specify a command line parameter expression for maven-help-plugin?

I want to specify an expression for calculation on the command line, so the plugin does not go into interactive mode.

According to docs, the parameter expressionshould do the trick.

I tried:

mvn help:evaluate -Dexpression=project.groupId

and

mvn help:evaluate -Dexpression=xxx

but is expressionignored, and the plugin goes online as unwanted.

Curiously, the following works very well:

mvn help:describe -Dplugin=help

(“Curious,” because it's the same plugin, and I follow the same convention for specifying parameters, but once it works, and another time it doesn't.)

+3
source share
1 answer

2.1 , MPH-71:

help:evaluate . , , ( ).

, 2.1.1 :

$ mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Demo - Child
[INFO]    task-segment: [org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [help:evaluate {execution: default-cli}]
[INFO] No artifact parameter specified, using 'my.group.id:child:jar:1.0-SNAPSHOT' as project.
[INFO] 
1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
...
+3

Source: https://habr.com/ru/post/1753874/


All Articles