<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. Design Pattern理解碎片

    开发封闭原则(Open-Closed Principle OCP)Software entities(classes,modules,functions etc) should open for ex ...

  2. 解决The current branch is not configured for pull No value for key branch.master.merge found in config

    使用Git Pull项目的时候出现这个问题: The current branch is not configured for pull No value for key branch.master. ...

  3. hibernate表关系

    1.一对一 用户表可以查分成两个表,一个userInfo.一个userLogin表 实现方式: (1)使用外键:外键+唯一性约束+非空约束 (2)公用主键:公用主键,从表的主键同时也是外键,来源于主表 ...

  4. intent 活动之间穿梭

    1.从当前activity,跳转到当前应用程序的activity Intent intent = new Intent(MainActivity.this, Intent2Activity.class ...

  5. 网站部署中遇到的问题-网页中js,css和图片资源无法加载

    问题描述: 打开的网页跑版,图片无法加载,用控制台调试发现css和js都没有加载. 原因: 没有启用IIS"静态内容". 解决方法: 设置"打开或关闭windows功能& ...

  6. C# ADO.NET面向对象想法

    我认为的面向对象就是把各种问题拆分开来 逐一解决,  我想的是先是数据库,到底有什么, 然后新建一个类,类里面先是private的私有的,但是可以有无数个可以连接private的pubilc的属性 可 ...

  7. Django——CBV与FBV

    一.FBV FBV(function base views) 就是在视图里使用函数处理请求. 二.CBV CBV(class base views) 就是在视图里使用类处理请求. Python是一个面 ...

  8. File I/O 小结

    1 .I/0: input/output 2.java.io.File 3 .表示:文件或者文件夹(目录) 4. File f = new File("文件路径"); 5 .注意: ...

  9. 2017年Nature文章“Millions of online book co-purchases reveal partisan differences in the consumption of science”阅读笔记

    论文:      Millions of online book co-purchases reveal partisan differences in the consumption of scie ...

  10. Mirco F-measure and Macro F-measure