11

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>

ADF モジュールの pom の依存関係で、バージョンの値として ${ABC} を使用しています。

<dependency>
        <groupId></groupId>
        <artifactId></artifactId>
        <version>${A.B.C}</version>
        <type>bundle</type>
    </dependency>

したがって、エラーが発生しています: バンドルは有効なバージョンである必要がありますが、${ABC} です。

編集:

または、私が定義したように、何らかの方法でCモジュールのバージョンを使用できますか:

<version>${A.B.C}</version> 
4

2 に答える 2

3

それらのモジュールは親 pom を共有していますか? それらをリンクしたい場合、特に多くのモジュール間でモジュールのバージョンを密結合したい場合は、親を介してプロパティを共有することをお勧めします。

于 2014-08-26T06:49:31.050 に答える