maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

Empty output for help:evaluate

Open wendigo opened this issue 1 year ago • 6 comments

This returns nothing:

mvnd --quiet help:evaluate -Dexpression=project.version -DforceStdout

This returns a version:

./mvnw --quiet help:evaluate -Dexpression='project.version' -DforceStdout
450-SNAPSHOT%

I think that issue could be a fact that echo is not new-line terminated.

wendigo avatar Jun 17 '24 14:06 wendigo

When the output is redirected to file -Doutput=./file file is populated correctly so I think that this is a new line thingy

wendigo avatar Jun 17 '24 15:06 wendigo

I guess this is on 1.0.0 ?

gnodet avatar Jun 17 '24 15:06 gnodet

Yep, 1.0.0. It works with --raw-streams as a workaround

wendigo avatar Jun 17 '24 15:06 wendigo

Duplicates #904

gnodet avatar Jun 17 '24 15:06 gnodet

Hey, I want to do a similar thing:

REVISION_VERSION="$(./mvnw --raw-streams help:evaluate -Dexpression=revision -DforceStdout -q)"

I already use --raw-streams but it does not work.

When I run it directly with mvn instead it writes the revision in a sapate (new) line

[INFO] Parent                                                             [pom]
[INFO] 
[INFO] -----------------------< org.betonquest:parent >------------------------
[INFO] Building Parent 1.7.0-SNAPSHOT                                     [1/3]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.5.1:evaluate (default-cli) @ parent ---
[INFO] No artifact parameter specified, using 'org.betonquest:parent:pom:1.7.0-SNAPSHOT' as project.
[INFO]
1.7.0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Parent 1.7.0-SNAPSHOT:

but with mvnd --raw-streams it doesn't write it out at all but also some other lines are missing

[INFO] Parent                                                             [pom]
[INFO] 
[INFO] Using the SmartBuilder implementation with a thread count of 19
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Parent 1.7.0-SNAPSHOT:

Wolf2323 avatar Apr 17 '25 11:04 Wolf2323

Ok, I figured out a solution, I could fix it by adding --non-recursive

Wolf2323 avatar Apr 17 '25 12:04 Wolf2323