The Maven Help Plugin has some functions, including printing evaluated project 
parameters.


RESULT=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)

https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html


--
http://bernd.eckenfels.net
________________________________
Von: Laurian Angelescu <angelescu.laur...@gmail.com>
Gesendet: Tuesday, June 7, 2022 5:43:26 PM
An: users@maven.apache.org <users@maven.apache.org>
Betreff: How to retrieve target folder or jar paths from multi-module Maven 
project

Is it possible to invoke *mvn* on the command line to output either 1) the
paths to all target folders where jars get packaged or 2) the file paths of
the jars themselves?

For example, in a multi-module project like
https://github.com/apache/httpcomponents-core.git, I would like to invoke:

*mvn <magic-parameters>*

and have output to standard out:

/<project-root>/httpcore5/target/httpcore5-5.2-beta1.jar
/<project-root>/httpcore5-h2/target/httpcore5-h2-5.2-beta1.jar
...
etc.

I want to essentially be able to get a list of the JARs created in *any *Maven
multimodule project.

Reply via email to