Where should be placed maven-compiler-plugin declaration: in or ?

后端 未结 2 1192
暖寄归人
暖寄归人 2020-12-18 01:55

I have a multi-module maven project, and I want to cause all my submodules to use maven-compiler-plugin specified in root pom.xml. Where I should p

2条回答
  •  甜味超标
    2020-12-18 02:47

    It depends on what you're after. If you include them under the plugins section, they will execute for all POMs...including the parent. If you only want child POMs to execute the plugin goals, then you should place them under pluginManagement. However, in that case, you will have to enable them in each child POM.

    That said, the easiest thing to do is try under plugins first. If there's no build failure, then you're good to go. Otherwise, you will need to move some or all over to pluginManagement.

提交回复
热议问题