<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问题的解决的更多相关文章

  1. '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. ...

  2. Maven3 package时报 'version' contains an expression but should be a constant

    父pom文件: <modelVersion>4.0.0</modelVersion> <groupId>com.wey</groupId> <ar ...

  3. 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& ...

  4. 关于...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 ...

  5. Invalid JDK version in profile 'doclint-java8-disable': Unbounded range: [1.8, for project com.google.code.gson:gson 解决办法

    利用maven打包的时候遇到这个问题 在git上发现一个解决方案 问题解决

  6. 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 ...

  7. 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 ...

  8. 【dependencyManagement版本管理】dependencies.dependency.version is missing

    maven 的gav的v(版本问题) 报错dependencies.dependency.version is missing 出现的场景 一个项目中有多个模块 父模块中出现dependencies. ...

  9. 运维自动化之ansible的安装与使用(包括模块与playbook使用)(转发)

    原文  http://dl528888.blog.51cto.com/2382721/1435415 我使用过puppet(地址是http://dl528888.blog.51cto.com/2382 ...

随机推荐

  1. ie8点击焦点有虚线框兼容问题

    a标签的: 方法一:在IE下是使用html属性:hideFoucs,在HTML标签中加上hidefocus=”true” 属性即可,但这个属性是IE私有的,Firefox是不认的. <a hre ...

  2. python的传递实参

    你经常会发现,向函数传递列表很有用,这种列表包含的可能是名字.数字或更复杂的对象(如字典).将列表传递给函数后,函数就能直接访问其内容 1.在函数中修改列表 将列表传递给函数后,函数就可对其进行修改. ...

  3. iOS开发之GCD基础

    重新回顾.学习GCD.Block.先贴出一篇不错的讲解GCD基础使用的文章 原文地址:http://blog.csdn.net/aolan1108/article/details/17283415 做 ...

  4. mysql五:pymysql模块

    一.介绍 之前都是通过MySQ自带的命令行客户端工具Mysql来操作数据库,那如何在Python程序中操作数据库呢?这就需要用到pymysql模块了. 这个模块本质就是一个套接字客户端软件,使用前需要 ...

  5. Spring MVC 参数必填项导致客户端报 HTTP 400 并且无法进入断点的问题

    1.问题 Spring MVC 在参数上设置了必填项,post 请求时报 HTTP 400 并且未进入断点,如将“年龄”设置为了必填项: @RequestParam( value="age& ...

  6. jQuery Ajax(异步改同步)

    在实际使用中,我们经常会用的Ajax(异步加载,在不刷新整个网页的前提下对网页部分内容进行更新) 使用时,偶尔会遇上需要从一个接口中得到一个数组和数据对应的id,在另一个接口上再得到数据,最初写法如下 ...

  7. 关于React的生命周期的解释

    ---恢复内容开始--- ---恢复内容结束---

  8. vim右键粘贴 等杂

    putty连上linux,vim编辑个文件,我去,右键不能用用上下面的命令,就好了. set mouse-=a 今天发现mysql倒入utf-8的文件网站显示出来都是乱码,不过用utf-8的控制台看是 ...

  9. Shader之ShaderUI使用方法

    shader中的宏定义在material中Inspector中打开 Shader "Custom/Redify" { Properties{ _MainTex("Base ...

  10. 缩短移动开发周期的ApiCloud

    ApiCloud百度百科介绍: ApiCloud 官网 官方论坛 APICloud经典O2O案例APP视频教程