Maven3 package时报 'version' contains an expression but should be a constant
父pom文件:
<modelVersion>4.0.0</modelVersion>
<groupId>com.wey</groupId>
<artifactId>WEY</artifactId>
<version>${com.wey.version}</version>
<packaging>pom</packaging>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wey</groupId>
<artifactId>WEY</artifactId>
<version>${com.wey.version}</version>
<packaging>pom</packaging>
package web工程时报 'version' contains an expression but should be a constant这个错误提示,这是因为Maven3 不允许出现version为非常量值的情况。
那么就将版本号改成常量后可以正常打包:
父pom文件:
<modelVersion>4.0.0</modelVersion>
<groupId>com.wey</groupId>
<artifactId>WEY</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
子Module
<parent>
<groupId>com.wey</groupId>
<artifactId>WEY</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../WEY/pom.xml</relativePath>
</parent>
<artifactId>WEY.WebApp</artifactId>
<packaging>war</packaging>
<name>WEY.WebApp Maven Webapp</name>
<url>http://maven.apache.org</url>
<modelVersion>4.0.0</modelVersion>
<groupId>com.wey</groupId>
<artifactId>WEY</artifactId>
<version>0.0.2-SNAPSHOT</version>
<packaging>pom</packaging> <parent>
<groupId>com.wey</groupId>
<artifactId>WEY</artifactId>
<version>0.0.2-SNAPSHOT</version>
<relativePath>../WEY/pom.xml</relativePath>
</parent>
<artifactId>WEY.WebApp</artifactId>
<packaging>war</packaging>
<name>WEY.WebApp Maven Webapp</name>
<url>http://maven.apache.org</url>
Maven还会生成一个pom.xml.versionsBackup的备份文件。
提交更新:
>mvn versions:commit
Maven3 package时报 'version' contains an expression but should be a constant的更多相关文章
- 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& ...
- '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. ...
- 'version' contains an expression but should be a constant. @ line 13, column 11问题的解决
<modelVersion>4.0.0</modelVersion> <groupId>cy.nad.cyg</groupId> <artifac ...
- Windows Maven package时报错问题的解决
google了一把,看到别人的说法是Stack size 不够大. Stack Space用来做方法的递归调用时压入Stack Frame.所以当递归调用太深的时候,就有可能耗尽Stack Space ...
- Theos 工程make package时报错
错误: /Applications/Xcode.app/Contents/Developer/usr/bin/make package requires you to have a layout/ d ...
- eclipse点击包(package)时报错,安装hibernate后点击包报错org/eclipse/jpt/common/utility/exception/ExceptionHandler
错误描述: 当我们点击包名时,出现如下错误提示.An error has occurred. See error log for more details.org/eclipse/jpt/common ...
- pycharm安装package时报错
在pycharm pip 包时,提示报错:module 'pip' has no attribute 'main' 原因:由于我的是pip 18.1 版本里没有main() 解决方法: 如不降级 pi ...
- Maven进行install的时候报错,COMPILATION ERROR : Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.13:test (default-test) on project cmu: There are test failures.
maven进行install的时候,test类里面报错: COMPILATION ERROR : [INFO] -------------------------------------------- ...
- 封装smarty类
<?php/** * Project: Smarty: the PHP compiling template engine * File: Smarty.class.php ...
随机推荐
- myeclipse debug模式 报错source not found
myeclipse debug模式下,启动报错 source not found:SignatureParser.current() line: 解决方法:将debug视图下的右上方的jar有断点的地 ...
- echarts3 使用总结
由于项目需要自学了echarts,下面将学到的东西总结如下,如果有哪里写的不好,请批评指正 一.前期准备 1.使用echarts之前先要引入echarts.js,js可以到官网下载 2.写一个div容 ...
- 3.Liunx网络管理命令
大纲: 1.网络信息:hostname.netstat.ifconfig ,route 2.网络配置:netconfig 3.网络测试:ping
- vue-router 按需加载
vue的单页面(SPA)项目,必然涉及路由按需的问题.以前我们是这么做的 //require.ensure是webpack里面的,这样做会将单独拉出来作为一个chunk文件 const Login = ...
- xshellDoc_1base
1◆ 到根目录 cd / 2◆ 创建文件夹 mkdir test 3◆ 到目录 cd /root/test/~~ 4◆修改文件名 mv test testbak 5◆ 查看 ls ...
- matlab 调试日志
debug=; diary off if debug delete('log.txt'); !del log.txt diary('log.txt'); diary ON end diary OFF
- 微信小程序code 换取 session_key
code 换取 session_key 这是一个 HTTPS 接口,开发者服务器使用登录凭证 code 获取 session_key 和 openid.其中 session_key 是对用户数据进行 ...
- Ie11 的改变
摘录地址: http://www.4fang.net/content.jsp?id=30537 微软在上周刚刚发布了用于Windows 8.1上的首个Internet Explorer 11的 ...
- 微信公众号 access_token 没有过期 却失效
最近在开发微信项目的时候 access_token 缓存到 redis里面的,明明在两个小时的有效期内 微信却提示 "errcode":40001,"errmsg& ...
- 前端常用长度单位(px,em,rem,pt)介绍
CSS中有不少属性是以长度作为值的.盒模型的属性就是一些很明显的值属性:width.height.margin.padding.border.除此之外还有很多其他的CSS属性的值同样也是长度值,像偏移 ...