'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 ...
随机推荐
- bootstrap清除数据源
下拉框使用动态数据源,当下拉框触发change事件时,想让下拉框改变数据源,加了个if判断 $('#@idForCostCategory').change(function (event) { if( ...
- 《Unity系列》Json文件格式的解析——初级教程
Json作为轻量级的数据交换格式,被广泛应用于网络数据传输中.相关的解析工具层出不穷,一般掌握一个工具的应用其他的相应工具就能立马学会. 这里以C#中的LitJson为例给大家示范一下解析工具的用法. ...
- java基础--提示对话框的使用
java基础--提示对话框的使用 2019-03-17-00:35:50-----云林原创 一.显示信息对话框:使用“JOptionPane.showMessageDialog”显示: 图标 对话 ...
- css之margin,padding的百分比
注意:上下内边距与左右内边距一致:即上下内边距的百分数会相对于父元素宽度设置,而不是相对于高度. PS:而且是基于父元素内容的宽度(width属性的大小),不是基于父元素整个框架的宽度
- vue——组件
一.组件概念 vue的核心基础就是组件的使用,玩好了组件才能将前面学的基础更好的运用起来.组件的使用更使我们的项目解耦合.更加符合vue的设计思想MVVM. // 定义一个名为 button-coun ...
- 利用Surfingkeys和tampermonkey效率操作网页
tampermonkey可以实现网页载入后自动进行某些操作,适合有规律的操作,实现完全自动化. 而Surfingkeys可以实现用各种按键实现各种功能,功能全部用JavaScript写,自定义性更强.
- libxml2库函数详解
许多事物符合80/20法则,libxml中也是20%的函数提供了80%的功能.下面的列表列出了libxml的主要函数及其用法说明. 1. 全局函数说明 头文件引用 xml2config --cfl ...
- python25 python的三目运算符
其他语言的三目运算符大类似: 条件 ? 条件为真返回值: 条件为假返回值 python不一样: 条件为真的返回值 if 条件 else 条件为假的返回值 或者 ...
- typescript 添加基础类型的扩展方法
以时间转换为案例: //声明接口,也是在声明date这个基础类型要定义一个format的扩展方法,不写接口声明会报错 interface Date { Format(fmt:string):strin ...
- SQLServer用存储过程实现插入更新数据
实现 1)有同样的数据,直接返回(返回值:0): 2)有主键同样,可是数据不同的数据,进行更新处理(返回值:2): 3)没有数据,进行插入数据处理(返回值:1). [创建存储过程] Create pr ...