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

前端 未结 8 1294
长发绾君心
长发绾君心 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 13:53

    I had the same problem but solved it without strace. The mvn exec:exec plugin is used to touch pom.xml in every project, and then find the recently modified pom.xml files:

    ctimeref=`mktemp`
    mvn --quiet exec:exec -Dexec.executable=/usr/bin/touch -Dexec.args=pom.xml
    find . -mindepth 2 -type f -name pom.xml -cnewer "$ctimeref" > maven_projects_list.txt
    rm "$ctimeref"
    

    And you have your projects list in the maven_projects_list.txt file.

提交回复
热议问题