How to decide which plugin to use in maven?

大兔子大兔子 提交于 2021-01-28 01:45:38

问题


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.


回答1:


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.

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.




回答2:


The Maven lifecycle has standard bindings for plugins to the different phases.

If you run mvn clean install you run the plugins that a attached to the phases by default.



来源:https://stackoverflow.com/questions/65507580/how-to-decide-which-plugin-to-use-in-maven

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