Maven exec:java goal on a multi-module project

前端 未结 3 1625
星月不相逢
星月不相逢 2020-12-05 13:05

I\'m trying to run exec-maven-plugin\'s exec:java goal on a simple two-module project where one module depends on the other. So far I can\'t find a

3条回答
  •  無奈伤痛
    2020-12-05 13:34

    Goals in a multi-module project, when run from the parent, will run against all modules. I don't think that's what you want. You can try:

    mvn exec:java -pl module2 -Dexec.mainClass=MyMain
    

    That might work? More info:

    • Running a specific Maven plugin goal from the command line in a sub-module of a multi-module reactor project

    However, I think it's more intuitive to change directory to the sub-module containing the executable before running it.

提交回复
热议问题