【发布时间】:2013-01-21 10:08:33
【问题描述】:
为什么这不起作用?如何从属性文件中选择版本号。
读取 pom.xml 中的属性
<project>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
</execution>
<configuration>
<files>
<file>dev.properties</file>
</files>
</configuration>
</executions>
</plugin>
</plugins>
</build>
</project>
在 dev.properties 中
org.aspectj.aspectjrt.version=1.6.11
pom.xml 中的依赖关系
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj.aspectjrt.version}</version>
</dependency>
错误:依赖项必须是有效版本
【问题讨论】:
-
为什么不指定版本?来自 pom 文件?