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 ...
随机推荐
- hadoopMR自定义输入格式
输入格式 1.输入分片与记录 2.文件输入 3.文本输入 4.二进制输入 5.多文件输入 6.数据库格式输入 详细的介绍:https://blog.csdn.net/py_123456/ar ...
- Spring Boot: remove jsessionid from url
参考代码 :Spring Boot: remove jsessionid from url 我的SpringBoot用2.0.*,答案中的第一二个方案亲测无效. 应该在继承了Configuration ...
- webapp检测安卓app是否安装并launch
1. cordova插件 1)查看所有已安装的安卓app https://www.npmjs.com/package/cordova-plugin-packagemanager A simple pl ...
- ssh和ssl的联系和区别
ssh:Secure Shell,安全Shell,是一个软件,处于应用层旨在取代明文通信的telnet:对应的开源实现程序是openssh. ssl:Secure Sockets Layer,安全套接 ...
- Nop 4.1版本已经迁移到.net core2.1版本
1. github 下载,4.1版本,运行, install时,会让你新增后台账户密码,sql服务器 2. 在Configuration 新增Language 3. 上传中文语言包 , 你也可以先导出 ...
- SpringBoot与docker
1.简介 Docker是一个开源的应用容器引擎: Docker支持将软件编译成一个镜像:然后在镜像中各种软件做好配置,将镜像发布出去,其它使用者开源直接使用这个镜像: 运行中的这个镜像称为容器,容器启 ...
- API设计和命名
1.前言 对于前端开发而言,肯定会和API打交道,大家也都会想过怎么设计自己的API.优秀的 API 之于代码,就如良好内涵对于每个人.好的 API 不但利于使用者理解,开发时也会事半功倍,后期维护更 ...
- python settings :RROR 1130: Host 'XXXXXX' is not allowed to connect to this MySQL server
pymysql.err.InternalError: (1130, u"Host '127.0.0.1' is not allowed to connect to this MySQL se ...
- xpath & <tr><td><br>
python : 3.6 lxml : 4.2.1 from lxml.html import etree test_html = ''' <!DOCTYPE html PUBLIC " ...
- 图的邻接矩阵存储实现,C++描述
body, table{font-family: 微软雅黑; font-size: 13.5pt} table{border-collapse: collapse; border: solid gra ...