7

内部に Apache Archiva ベースのリポジトリがあり、pom.xml の repositories タグを次のように構成しました。内部リポジトリにアクセスできる場合はすべての依存関係アクセスが内部リポジトリによって解決され、内部リポジトリが特定の理由でダウンしている場合は、以下にリストされている他のリポジトリによって解決されると想定できますか。

<repositories>
        <repository>
            <id>internal</id>
            <name>Internal Repository</name>
            <url>http://192.168.1.2/archiva/repository/internal</url>
        </repository>

        <repository>
            <id>jboss</id>
            <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
....
</repositories>

編集:

.m2/settings.xml ファイルを廃止したい。これを pom.xml ファイルで定義したいので、リポジトリ マネージャーが稼働中である場合はランタイムをそこに接続し、それ以外の場合は他のリポジトリにフォールバックするようにします。これは可能でしょうか?

4

1 に答える 1

4

以下の Maven 開発者の Jira でわかるように、Maven 3.0 では修正されています。検索は、宣言された順序で行われます。

https://issues.apache.org/jira/browse/MNG-4400

于 2013-04-26T20:58:59.123 に答える