maven2: how to share a plugin configuration between parent and children pom?

六眼飞鱼酱① 提交于 2019-12-04 23:41:57
John Vint

You could wrap the plugins of the parent in a <pluginManagement> tag.

   <build> 
       <pluginManagement>
           <plugins>
               <plugin> ... </plugin>
           </plugins>
       </pluginManagement>
   </build>

Children plugins will then inherit the configurations when they declare the plugin in their build tag.

jgifford25

Have you tried using the plugin management feature of Maven? It'll allow you to push that configuration information down to the children pom.xml files from the parent pom.xml:

   <build> 
       <pluginManagement>
           <plugins>
               <plugin>your_plugin</plugin>
           </plugins>
       </pluginManagement>
   </build>

Now, not all plugins are as well done as those from the org.apache.maven.plugins group. It may be necessary to move your configuration section in between your execution elements.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!