在使用maven的聚合工程中打包的遇到了一个问题。
原本主pom.xml中是这么写的:
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>${test.version}</version>
<packaging>pom</packaging>
<properties>
<test.version>1.0</test.version>
</properties>
子工程pom.xml的parent 这么写的:
<parent>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>${test.version}</version>
</parent>
开始打包后,maven报错找不到${test.version},并且给出警告version的${test.version}不识别。
查找资料后将verison替换成数字,比如<version>1.0</version>,所有的子工程也同样改了。update maven后 打包工程不报错了。
以后还是写数字吧,基本除了业务服务,子工程版本号一般不会改了。