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

前端 未结 3 1371
半阙折子戏
半阙折子戏 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:58

    Just in case someone else has this one too:

    I also encountered this error message. The reason was that by accident I had been in one of my (sub-)modules in the path in terminal.

    Of course the command has to be executed in the project's root hierarchy. According to the example above you have to assure that you execute a command like:

    clean install -pl projectB
    at Poject A
    

    not e.g. at ProjectY or somewhere else deeper in the project structure.

    Correct:

    user:~/workspace/IdeaProjects/pojecta{master}$ clean install -pl projectB
    

    Wrong:

    user:~/workspace/IdeaProjects/pojecta/projecty{master}$ clean install -pl projectB
    

提交回复
热议问题