I am new to Maven, and struggling to find out how does maven decide what version of a plugin (e.g. maven-compiler) to use when no version is defined in pom.xml.
Using latest maven version 3.8.1. Created a hello-world java program and ran mvn compile. And it downloads following versions: maven-resources-plugin:2.6:resources (default-resources) maven-compiler-plugin:3.1:compile (default-compile)
maven-compiler-plugin:3.1 was released in April 2013. Latest is 3.8.1. Why is maven not using the latest version when I have not given anything specific in pom ?
Same with maven-resources-plugin:2.6. This version was released in August 2012. Latest version is 3.2.0.
I know I can define the latest versions of these plugins in pom. But why default maven is using such old versions ? Am I missing any configuration ?
You are missing the configuration meaning that you have to define the appropriate plugins via pluginManagement(all plugins with their versions).
If the defaults would be changed there would we a lot of project which would fail.
I can strongly recommend to define the versions given here https://maven.apache.org/plugins/
Usually the definition of plugin versions is a task for a corporate parent to have a single location define all the plugins and default configurations.
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