在Maven中自动激活父插件 [英] Automatically activate parent plugin in Maven

查看:110
本文介绍了在Maven中自动激活父插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在父POM中定义一个已停用的插件,当子项继承此插件时,它会自动激活?

Is it possible to have a plugin defined in the parent POM which is deactivated, and when the child inherits this plugin it gets automatically activated?

推荐答案

我想你想在父pom中配置插件,但只在继承的项目中使用它。 Maven有一个部分 - 在pluginManagement中配置你的插件,但是当你需要它时将它们绑定到一个阶段,例如省略pluginManagement中的阶段标记,但在你继承的pom中指定它。

I guess you want to configure the plugin in your parent pom, but use it only in the inherited projects. Maven has a section for this - configure your plugins in pluginManagement, but bind them to a phase just when you needed it, e.g. omit the phase tag in pluginManagement, but specify it under in you inherited pom.

这篇关于在Maven中自动激活父插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆