1. 程式人生 > >'version' contains an expression but should be a constant

'version' contains an expression but should be a constant

modules count tle pro pda for 依賴 只需要 contains

[WARNING] Some problems were encountered while building the effective model for com.app:cache:jar:4.0.0
[WARNING] ‘version‘ contains an expression but should be a constant. @ com.app:webapi:${myproject.version}, /usr/local/jenkins/webapi/pom.xml, line 8, column 14

[WARNING] Some problems were encountered while building the effective model for cy.nad.cyg:pay-web:war:3.0.2
[WARNING] ‘version‘ contains an expression but should be a constant. @ cy.nad.cyg:pay:${myproject.version}, D:\workspace\idea\pay\pom.xml, line 7, column 14

這是因為Maven3 不允許出現version為非常量值的情況,我們就需要第三方插件來幫我們自動完成升級版本的工作。

參見下文:

http://mojo.codehaus.org/versions-maven-plugin/examples/update-child-modules.html

這個插件等於只需要我們在parent pom中變更一下版本號,然後執行

mvn -N versions:update-child-modules這個命令,就會將所有依賴的地方全部變成新的版本號,從而幫我們完成該問題。

http://www.cnblogs.com/beiyeren/p/4275032.html

'version' contains an expression but should be a constant