3

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.

Swastik
  • 499
  • 1
  • 4
  • 10

2 Answers2

2

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.

Naman
  • 27,789
  • 26
  • 218
  • 353
  • 1
    Yeah, true. @JFabianMeier Even I don't think that way. But I wanted to refer to the parent most pom(in Maven) in some way. – Naman Dec 30 '20 at 14:09
  • You mean the super POM, not the BOM, right? – J Fabian Meier Dec 30 '20 at 14:11
  • yeah @JFabianMeier – Naman Dec 30 '20 at 14:11
  • 1
    Yes I saw even if I commented the compiler plugin, the build was successful. So, my understanding is, all the default plugins comes from the Super POM. right? I executed the command you provided i saw maven-compiler-plugin and maven-install-plugin. Therefore, it comes from super POM. Thanks for the explanations. – Swastik Dec 30 '20 at 14:26
0

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.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142