如何决定在 maven 中使用哪个插件? [英] How to decide which plugin to use in maven?

查看:84
本文介绍了如何决定在 maven 中使用哪个插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览 Maven 文档.我看到 maven 使用插件工作,每个阶段都有一个或多个插件,每个插件都有一个或多个目标.有用于编译、安装、部署、清理等的插件.我在我的项目中看到他们使用了 maven-clean-plugin.那么如果我们没有放置 maven-install-plugin,maven clean install 命令是如何工作的呢?问题可能有点傻,但我是这个世界的新手,感谢您的帮助.

I was going through the maven documentation. I saw maven works using plugins, for each phase there is one or more plugin and for each plugin there is one or more goals. there are plugin for compile, install, deploy, clean etc. I saw in my project they used maven-clean-plugin. Then how maven clean install command is working if we did not put the maven-install-plugin? Question might be bit silly but i am new the this world and appreciate your help.

推荐答案

这将跟进从 Maven 的 BOM 继承的每个插件的一些默认配置.正在执行

That would follow up with some default configuration of each plugin inherited with Maven's BOM. Executing

mvn dependency:resolve-plugins

将帮助您识别继承的插件的这些版本.

shall help you identify these versions of the plugins inherited.

所以主要是为了确保您使用具有项目所需配置的特定(或更新)版本的插件,您可以在 pom.xml 中明确定义它们,否则,只需让

So primarily to ensure you work with a specific(or updated) version of the plugin with the desired configuration of your project, you can explicitly define them in the pom.xml, otherwise, just let be.

这篇关于如何决定在 maven 中使用哪个插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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