this is a snippet from a multi-module parent pom. How can I run a goal in all submodules of the project?
<modules>
<module>../utp</module>
<module>../testdependency</module>
</modules>
When I try to run this goal by mvn -am -pl utp help:evaluate -Dexpression=project.artifactId, I’ll only get the result for the parent pom, I don’t get any result for the utp and eventual dependencies.
How can I run a goal on all submodules of a project?
As per the documentation, we could use
help:evaluateto evaluate some Maven expressions.This works in an interactive way or takes
artifactandexpressionas parameter. It reports the result for the project if run on the project pom or theartifactif run without a pom.It is not meant to give the artifact details for all dependencies.
Not sure what your requirement is… If it is to get the various dependency details, you could try one of the goals of maven dependency plugin, like
mvn dependency:listormvn dependency:tree. If it is to know if the versions of the dependencies are upto date, you could try a goal in versions maven plugin likemvn display-dependency-updates.Edit:
Plugins which are defined in
<pluginManagement> section of parent pom are run only in those modules, where these<plugins>are declared. In other modules, they are not run. Perhaps mvn help:effective-pom can give some info.