簡體   English   中英

Maven 3.0.5 vs 3.1.1 vs 3.2.1

[英]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,並想知道我是否應該升級到更新版本。

不幸的是,網站上沒有一個單詞關於版本之間有什么不同,以及是否建議升級,以及升級到什么版本。

任何人都可以指向相關資源嗎?

使用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機制......但是也有一些用戶友好的功能。 像“版本范圍”支持。

總而言之......我開始思考gradle :)

自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版本; 例如:

<prerequisites>
    <maven>3.0.5</maven>
</prerequisites>

然后添加對versions-maven-plugin的依賴並運行

mvn versions:display-plugin-updates.

這將為您提供所有可用於您的maven版本的插件的更新列表。 谷歌查看是否有任何利益變化。 當然,您可以選擇僅升級某些插件,但無論是明確指定所有插件依賴項。

我建議你閱讀發行說明 ; 例如,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

新功能

[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。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM