'version' contains an expression but should be a constant. @ line 13, column 11问题的解决
<modelVersion>4.0.0</modelVersion>
<groupId>cy.nad.cyg</groupId>
<artifactId>pay</artifactId>
<version>${myproject.version}</version>
<packaging>pom</packaging>
<name>pay-parent</name> <modules>
<module>pay-web</module>
<module>pay-manage</module>
<module>pay-dao</module>
</modules> <properties>
<myproject.version>3.0.2</myproject.version>

在子module中

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>pay</artifactId>
<groupId>cy.nad.cyg</groupId>
<version>${myproject.version}</version>
</parent>
<artifactId>pay-web</artifactId>
<packaging>war</packaging>
<name>pay-web</name>
<properties>
<sso-client.version>0.0.3</sso-client.version>
</properties>
<dependencies> <dependency>
<groupId>cy.nad.cyg</groupId>
<artifactId>pay-dao</artifactId>
<version>${project.version}</version>
</dependency>

但是升级到maven3之后,会出这个问题:
[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这个命令,就会将所有依赖的地方全部变成新的版本号,从而帮我们完成该问题。
'version' contains an expression but should be a constant. @ line 13, column 11问题的解决的更多相关文章
- 'version' contains an expression but should be a constant
[WARNING] Some problems were encountered while building the effective model for com.app:cache:jar:4. ...
- Maven3 package时报 'version' contains an expression but should be a constant
父pom文件: <modelVersion>4.0.0</modelVersion> <groupId>com.wey</groupId> <ar ...
- maven2 up to maven3的'version' contains an expression but should be a constant
在Maven2时,为了保障版本一致,一般之前我们的做法时: Parent Pom中 <project xmlns="http://maven.apache.org/POM/4.0.0& ...
- 关于...corresponds to your MySQL server version for the right syntax to use near '?' at line 1的解决办法
完整报错信息: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual tha ...
- Invalid JDK version in profile 'doclint-java8-disable': Unbounded range: [1.8, for project com.google.code.gson:gson 解决办法
利用maven打包的时候遇到这个问题 在git上发现一个解决方案 问题解决
- ERROR 1235 (42000): This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'问题的解决
.与limit相关的sql语句作为临时表 select * from 临时表 limit ) as B 缺点:只能查临时表的数据 .可以查原表的数据 select * from test where ...
- build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing
maven test项目时遇到一下错误 Some problems were encountered while building the effective model for cn.temptat ...
- 【dependencyManagement版本管理】dependencies.dependency.version is missing
maven 的gav的v(版本问题) 报错dependencies.dependency.version is missing 出现的场景 一个项目中有多个模块 父模块中出现dependencies. ...
- 运维自动化之ansible的安装与使用(包括模块与playbook使用)(转发)
原文 http://dl528888.blog.51cto.com/2382721/1435415 我使用过puppet(地址是http://dl528888.blog.51cto.com/2382 ...
随机推荐
- tomcat8.5.8遇到的两个问题
压力测试场景,前端nginx反向代理到4个tomcat实例,在其中的一个实例上产生了大量的countDownConnection Incorrect connection count警告 WARNIN ...
- Ling之select
select用法: 1.Dictionary<string, string>转json Newtonsoft.Json.JsonConvert.SerializeObject(dicSub ...
- 理解JavaScript作用域
这是一篇译文,这里贴上译文地址:http://www.zcfy.cc/article/understanding-scope-in-javascript-8213-scotch-4075.html 这 ...
- HTML行内元素、块状元素和行内块状元素的区分
HTML 5 的常用元素分类 HTML可以将元素分类方式分为行内元素.块状元素和行内块状元素三种,这三者是可以互相转换的,通过display属性可以实现互相转换 (1)display:inline;转 ...
- idea 新建文件夹目录问题解决
选中工程,设置,去掉选项“Compact Empty Middle Packages” .
- C++字符分割
AfxExtractSubString 表头: <afxwin.h> BOOL AFXAPI AfxExtractSubString ( CString& rString, LPC ...
- FlexPaper实现文档在线浏览(附源码)
园子里也有关于FlexPaper的文章,但都不怎么详细. 没有较全的参数说明.就连官方网站都没有.没法,最后只得将swf文件反编译后查看了源码才将里面的参数全部弄出来. 好了,废话不多说,开始正题. ...
- 新发布 | Azure镜像市场正式上线
由世纪互联运营的 Azure 镜像市场于2016年9月21日正式落地中国市场,在客户和软件开发商间搭建起了一站式门户.来自全球和本地领先软件开发商并基于 Azure 的云应用.云服务和解决方案在门户中 ...
- 插上翅膀,让Excel飞起来——xlwings(三)
xlwings基本对象 xlwings基本对象 App相当于Excel程序,Book相当于工作簿.N个Excel程序则由apps表示,N个工作簿由books表示. 对工作簿的操作 #导入xlwings ...
- [转]Ubuntu桌面入门指南
Ubuntu桌面入门指南 http://wiki.ubuntu.org.cn/Ubuntu%E6%A1%8C%E9%9D%A2%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97