Reputation: 7374
I am trying to implement step by step all instructions that are defined here:
and I have got a question regarding section: 11.4 Running the example
They wrote:
At this point our application should work. Since we have used the spring-boot-starter-parent POM we have a useful run goal that we can use to start the application. Type mvn spring-boot:run from the root project directory to start the application
I did not add spring-boot-maven-plugin directly to my pom.xml
I see that in spring-boot-starter-parent module spring-boot-maven-plugin are defined in pom.xml only in < pluginManagement> section, it means that in parent module only default configuration for plugin described.
And now I can't understand how and where the plugin is loaded?
Upvotes: 0
Views: 303
Reputation: 66
As stated in the documentation, Maven is just a collection of plugins that do everything your project needs to be correctly compiled.
But note that you don't explicitly declare a vast majority of them. For example, the Clean plugin (which removes the target directory) is not declared in your pom, but if you type mvn clean
the plugin is loaded and executed.
It's Maven itself that loads the plugin and it's the same with spring-boot-maven-plugin
, as long as you have a configuration for this plugin, which is the case as you declare the spring-boot-starter-parent
as your parent.
To further understand this, you can try the build configuration described in 13.2.2 Using Spring Boot without the Parent POM of this Spring documentation.
You'll see that if you don't explicitely include the spring boot plugin, you'll get an error "No plugin found for prefix 'spring-boot' in the current project"
Upvotes: 0