Maven build second level+ child projects using reactor option -pl

前端 未结 3 1374
半阙折子戏
半阙折子戏 2021-02-05 08:10

My maven project structure is as below

Project A 
  pom.xml
  - ProjectB
    pom.xml
    - ProjectC
      pom.xml
    - ProjectD
      pom.xml
  - ProjectY
    p         


        
3条回答
  •  梦毁少年i
    2021-02-05 08:56

    This is an answer from a similar question that is also relevant here.
    By using artifactIds you don't have to know the structure of your project.


    If you only use the artifactIds of the given project you have to define that correctly on command line:

    help output of Maven (mvn --help)

    Comma-delimited list of specified reactor projects to build of all projects. A project can be specified by [groupId]:artifactId or by its relative path

    This means in your case you have to define:

    mvn clean install --projects :projectC,:ProjectY
    

    Notice the : that is prepended to the artifactIds to indicate you omit the groupId

提交回复
热议问题