在A.B.C的POM文件中,我定义了一个名为"abc"的属性,其中A、B、C是模块。现在我想在A.D.F模块的POM文件中访问该属性。
在A.B.C的POM文件中,我定义了一个名为"abc"的属性,其中A、B、C是模块。现在我想在A.D.F模块的POM文件中访问该属性。
<properties>
<A.B.C>${buildNumber}</A.B.C>
</properties>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>buildnumber</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<timestampFormat>{0,date,dd-MM-yyyy HH:mm:ss}</timestampFormat>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<providerImplementations>
<svn>javasvn</svn>
</providerImplementations>
<revisiononscmfailure>
<!-- 71 Generate sequence build number based on: 72 build number and
timestamp 73 -->
<format>Build: #{0} ({1,date})</format>
<items>
<item>buildNumber\d*</item>
<item>timestamp</item>
</items>
</revisiononscmfailure>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.code.maven-scm-provider-svnjava</groupId>
<artifactId>maven-scm-provider-svnjava</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.5</version>
</dependency>
</dependencies>
</plugin>
我在 A.D.F 模块的 pom 文件中,将 ${A.B.C} 作为依赖项版本的值。
<dependency>
<groupId></groupId>
<artifactId></artifactId>
<version>${A.B.C}</version>
<type>bundle</type>
</dependency>
所以它给了我一个错误:
bundle必须是一个有效的版本,但是它是 ${A.B.C}。
编辑:
或者我可以以某种方式使用C模块的版本,因为我已经定义了:
<version>${A.B.C}</version>
${revision}
、${changelist}
和${sha1}
。 - khmarbaise