Maven 3.0.5 vs 3.1.1 vs 3.2.1

今天我访问了官方Maven网站 ,并惊讶地发现其中列出了3个版本:3.0.5,3.1.1和3.2.1

我目前正在使用3.0.5,并想知道我是否应该升级到更新版本。

不幸的是,网站上没有一个单词关于版本之间有什么不同,以及是否建议升级,以及升级到什么版本。

任何人都可以指向相关资源吗?

自Codehaus于2015年4月关闭以来,历史发行说明(例如3.2.1)中的一些链接被打破。 您可以在以下位置浏览:

https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922

需要考虑的一个重点:升级Maven将升级核心插件的默认版本。 几乎所有关于Maven的有趣内容都是在插件中完成的(因此,为什么你不会在Maven本身的发行说明中发现许多令人震惊的变化)。

如果您依赖于默认插件版本,则需要查看插件发行说明以及maven版本。 例如,3.2.1的发行说明不包括Wagon 2.6附带的更改。

我建议不要依赖maven的插件版本默认值,因为对于同事而言,使用略有不同的Maven版本会因插件差异导致不一致的版本太容易。

如果您还没有这样做,我建议您在pom中明确指定您的maven版本; 例如:

 3.0.5  

然后在versions-maven-plugin上添加依赖项并运行

 mvn versions:display-plugin-updates. 

这将为您提供所有可用于您的maven版本的插件的更新列表。 谷歌要查看是否有任何利益变化。 当然,您可以选择仅升级某些插件,但无论是明确指定所有插件依赖项。

使用Maven的软件开发人员需要了解两件事:

  1. Maven 3.0.5只是maven 3.0.4的安全修复程序,仅此而已。 此版本与您之前完全兼容。 所以,如果你有<= 3.0.4,那么3.0.5是最简单的方法。
  2. 某些maven插件可能无法与Maven 3.1.x或3.2.x一起正常工作。 例如,这发生在“飞路”(我们在项目中使用)。 我已经看到一些其他插件失败的报道。 因此,如果您可以进行快速切换,测试,并且没有任何问题,我想您可以使用最新版本。

在其他方面,3.1.x和3.2.x只是maven的演变。 版本3.1.x和3.2.x引入了对内部maven机制的更多更改,而不是用户体验。 他们现在在内部使用SLF4J,改变了一些库实现,一些CDI机制….但是也有一些用户友好的function。 像“版本范围”支持。

总而言之……我开始思考gradle 🙂

我建议你阅读发行说明 ; 例如,3.1.1有错误修复

 [MNG-5459] - failure to resolve pom artifact from snapshotVersion in maven-metadata.xml [MNG-5495] - API incompatibility causes Swagger Maven Plugin (and others) to fail under Maven 3.1.0 [MNG-5499] - maven-aether-provider leaks Sisu Plexus and ObjectWeb classes onto the classpath when they are not required [MNG-5500] - help for --legacy-local-repository option explains _maven.repositories instead of _remote.repositories [MNG-5503] - Maven 3.1.0 fails to resolve artifacts produced by reactor build [MNG-5509] - org.apache.maven.repository.legacy.DefaultWagonManager should set User-Agent 

编辑:

如果您向下滚动,您可能会注意到

发行说明 – Maven – 3.1.0版(仅限3.0.5)Bug

 [MNG-3131] - Error message is misleading if a missing plugin parameter is of a type like List [MNG-5016] - A mirror's layout setting should default to 'default' since thats' the only layout supported lay in maven 3 [MNG-5206] - plexus container never disposed [MNG-5208] - Parallel (-T option) multi module build fires wrong "project failed event" [MNG-5209] - MavenProject.getTestClasspathElements can return null elements [MNG-5212] - DefaultPluginDescriptorCache does not retain pluginDescriptor dependencies [MNG-5214] - Dependency resolution substitutes g:a:v:jar for j:a:v:something-else when something-else isn't in the reactor [MNG-5233] - ArtifactMetadataRetrievalException from org.apache.maven.artifact.metadata is not anymore binary compatible. [MNG-5258] - localRepository in settings.xml does not handle ~ as home.dir [MNG-5261] - upgrade wagon version to 2.3 to fix issues with redirect [MNG-5270] - README.bootstrap.txt says "Ant 1.6.5 or later" BUT 1.8 or later is needed [MNG-5280] - Inconsistent order of repositories and pluginRepositories from profiles in settings (regression Maven 3) [MNG-5289] - -Dmaven.repo.local not honored [MNG-5312] - MavenProject.getParent intolerably slow when import scope used heavily [MNG-5313] - Unnecessary DefaultModelBuilder.build overload [MNG-5314] - DefaultModelValidator misuses String.matches [MNG-5336] - Descriptor Reference for settings.xml is incorrect [MNG-5387] - Add ability to replace an artifact in mid-build [MNG-5390] - mvn -rf (no argument) results in NPE [MNG-5395] - logger name for plugins should not be DefaultMavenPluginManager [MNG-5396] - logger name for execution events should not be MavenCli [MNG-5398] - scriptSourceDirectory in superpom is not prefixed with /usr/home/cmsslave/slave15/maven-site-staging/build/trunk/ [MNG-5403] - tar.gz release artifacts have wrong permissions on directories [MNG-5418] - Can't activate a profile by checking for the presence of a file in $myProperty [MNG-5430] - use wagon 2.4 [MNG-5444] - ModelSource API is not sufficient to resolve project hierachies [MNG-5445] - Missing PathTranslator @Requirement in org.apache.maven.project.interpolation.StringSearchModelInterpolator [MNG-5456] - Maven skips modules and reports success if parallel build encounters java.lang.Error [MNG-5477] - "malformed POM" warning issued when no version in reporting section 

起色

 [MNG-4505] - use slf4j to control various logging frameworks [MNG-5181] - New resolution from local repository is very confusing [MNG-5239] - Maven integration developers would like to be able to override the maven logging appender. [MNG-5245] - upgrade default plugins versions [MNG-5338] - Accept a directory with -f/--file [MNG-5350] - improve @threadSafe error message: tell which goal [MNG-5399] - Upgrade version of maven-release-plugin in superpom to 2.3.2 [MNG-5400] - Upgrade version of maven-dependency-plugin in superpom to 2.5 [MNG-5402] - Better build number for git [MNG-5480] - document in POM descriptor reference how urls are interpolated from parent [MNG-5482] - Catch NoClassDefFoundError org/sonatype/aether 

新function

 [MNG-519] - Timestamps on messages [MNG-5306] - for IDE embedding have ways of collecting model problems without failing the process [MNG-5343] - Allow the use of JSR330 annotation in Maven extensions and plugins [MNG-5344] - Allow the SLF4J loggers to be @Injected [MNG-5354] - Integrate Eclipse Aether 0.9.0.M2 [MNG-5380] - Cannot preserve whitespace in Maven plugin configuration [MNG-5381] - Restore MavenSession.getRepositoryCache() [MNG-5382] - Add an IT for @Inject used in plugins [MNG-5386] - Dispose of ClassRealms after invocation to prevent out of Permgen errors [MNG-5388] - Restore embedded integration tests [MNG-5391] - Update the default WAR plugin version to avoid version 2.3 [MNG-5393] - Look at Sonar's use of SLF4J and Logback [MNG-5397] - Use SLF4J for logging [MNG-5407] - Change MavenITmng1830ShowVersionTest to account for SHA1 as version 

任务

 [MNG-5279] - add CLI options to documentation [MNG-5365] - Replace Aether's deprecated ConfigurationProperties with ConfigUtils [MNG-5372] - remove classes that were added during Maven 3 alpha and beta but were deprecated before 3.0 final release [MNG-5373] - Document the usage and benefits of JSR330 [MNG-5374] - Fix transfer listener after the JSR330 merge [MNG-5375] - Document use of SLF4J [MNG-5376] - Account for changes between the Apple and Oracle JDKs on OSX [MNG-5453] - Update Maven 3 build to use Eclipse/Sisu 

希望

 [MNG-5370] - separate artifact-handlers configuration from plugin bindings to default lifecycle [MNG-5461] - rename _maven.repositories tracking file to _remote.repositories 

最后, 这里记录了 3.2.1。