This has been asked before in few places.
But the answers are vague.
So let me ask again.
The Apache Maven says in http://maven.apache.org/ref/3.5.0/maven-model/maven.html
But can some one explain what that is. I get the discovery of dependencies. but what is meant by "discovering plugins for builds and reports." and " discovering of extensions" ?
The PluginRepository is where maven searches for maven plugins. That is why it mentions builds (the build lifecycle) and reports (the site lifecycle). E.g. that is where the maven-compile-plugin and maven-surefire-plugin exists
The normal repository is used for dependencies for your application, i.e. the sections <dependencies> and <dependencyManagement>. It could be your junit or commons-logging or whichever jar you needed.
Normally they could both point to the same repositories and in fact by default, they both point to Maven Central, but you could have some special locations you needed in there, or alternatively have different update policies on the repositories.
I found an example in a spring project, where you can see them both being used (at the bottom): https://github.com/spring-projects/spring-data-jpa/blob/master/pom.xml
<repositories>
<repository>
<id>spring-libs-snapshot</id>
<url>https://repo.spring.io/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-plugins-release</id>
<url>https://repo.spring.io/plugins-release</url>
</pluginRepository>
</pluginRepositories>
They are pointing to two separate URLs, so the maven plugins and dependencies are taken from essentially two different places
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With