2017-02-24 171 views
0

所以試圖通過Maven Release plugin以下目標,以創建一個定製版本的Maven構建在詹金斯和指定選項:

-B release:prepare -DdryRun=true -DreleaseVersion=${POM_VERSION}-VERSION 

不過,我得到以下錯誤:

Error parsing version, cannot determine next version: Unable to parse the version string: "${POM_VERSION}-VERSION" 

${POM_VERSION}其自己的工作很好,或者其他字符串,如-DreleaseVersion=1.1.1,似乎有一個串聯字符串和參數的問題。

這是在Jenkins中設置的Maven項目,而不是Freestyle項目。

+0

我設法得到的東西與-DreleaseVersion = 「$ {} POM_VERSION -version」 的工作,但可以解析爲: -DreleaseVersion = 0.0.3-快照版本 – enkor

+0

是'0.0.3-SNAPSHOT'不是當前' 你的POM?爲什麼限定詞「-VERSION」? –

回答

0

VERSION不是一個通常的限定詞。參見從Understanding Maven Version Numbers如下:

If you do not follow Maven versioning standards in your project versioning scheme, then for version comparison, Maven interprets the entire version as a simple string. Maven and its core plug-ins use version comparison for a number of tasks, most importantly, the release process.

If you use a nonstandard versioning scheme, Maven release and version plug-in goals might not yield the expected results. Because basic string comparison is performed on nonstandard versions, version comparison calculates the order of versions incorrectly in some cases.

使用-DreleaseVersion=${POM_VERSION}是有點矛盾的。 release:prepare通常意味着準備新版本版本以及新版本版本。

+0

是的,完全同意,但解決了另一個問題。使用Adobe Enterprise Manager,其中包管理器在快照版本中嵌套發行版本。 – enkor