如何访问maven multimodule项目中其他模块pom中定义的属性

Him*_*huR 11 java pom.xml maven buildnumber-maven-plugin

在ABC的pom我已经将属性定义为abc,其中ABC是模块.现在我想在ADF模块的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>
Run Code Online (Sandbox Code Playgroud)

我在$ ADF模块的pom中使用$ {ABC}作为版本的值.

<dependency>
        <groupId></groupId>
        <artifactId></artifactId>
        <version>${A.B.C}</version>
        <type>bundle</type>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

所以它给了我错误:bundle必须是有效的版本,但是$ {ABC}.

编辑:

或者我可以在某种程度上使用C模块的版本,因为我已经定义:

<version>${A.B.C}</version> 
Run Code Online (Sandbox Code Playgroud)

Him*_*huR 2

回答这个问题时提供的解释很好地解释了可以使用什么以及何时使用。

从 Maven 中的 POM 文件读取属性文件