Maven plugin version not specified

后端 未结 3 1216
闹比i
闹比i 2021-02-05 06:30

I have just noticed that plugin\'s version is optional in maven. I can still build my module without specifying it. Let\'s take an example with maven-bundle-plugin.



        
3条回答
  •  你的背包
    2021-02-05 07:26

    From Maven 3.x Compatibility Notes:

    Automatic Plugin Version Resolution

    When a plugin was invoked without an explicit version given in the POM or on the command line, Maven 2.x used to pick the latest version available where the latest version could either be a release or a snapshot. For the sake of stability, Maven 3.x prefers the latest release version over the latest snapshot version.

    Given the threat of non-reproducible builds imposed by automatic plugin version resolution, this feature is scheduled for removal as far as plugin declarations in the POM are concerned. Users of Maven 3.x will find it output a warning when missing plugin versions are detected to encourage the addition of plugin versions to the POM or one of its parent POMs. The Enforcer rule requirePluginVersions can be used additionally check for missing plugin versions in the POM.

提交回复
热议问题