How to list active sub-modules in a Maven project?

前端 未结 8 1288
长发绾君心
长发绾君心 2020-12-24 13:26

I have a complex project where there are many directories that have POM files, but only some of which are sub-modules (possibly transitively) of a particular parent project.

8条回答
  •  孤独总比滥情好
    2020-12-24 14:07

    This is quite simple but it only gets the artifactId, from the root (or parent) module:

    mvn --also-make dependency:tree | grep maven-dependency-plugin | awk '{ print $(NF-1) }'

    If you want the directories

    mvn -q --also-make exec:exec -Dexec.executable="pwd"

提交回复
热议问题