问题
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