10

Maven 3.0.4 と Nexus 2.0.6 を使用しています。単一のリポジトリを使用するための Nexus 命令ショーとして、settings.xml をセットアップしました。maven が maven -U clean を実行しようとすると、以下のエラーが発生します。

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its d
ependencies could not be resolved: Failed to read artifact descriptor for org.ap
ache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not find artifact org.apa
che.maven.plugins:maven-clean-plugin:pom:2.4.1 in nexus (http://localhost:8081/n
exus/content/groups/public) -> [Help 1]

設定から nexus ミラーを削除し、maven central に直接移動すると、コマンドが機能します。nexus の Maven リポジトリの設定は、それがサービス中であり、パブリック グループにあることを示しています (最後にリストされています)。

私はインターネットにアクセスするためのプロキシの背後にいません。

これが私のsettings.xmlです

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<offline>false</offline>
<mirrors>
    <mirror>
        <!--This sends everything else to /public -->
        <id>nexus</id>
        <mirrorOf>*</mirrorOf>
        <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
</mirrors>
<profiles>
    <profile>
        <id>nexus</id>
        <!--Enable snapshots for the built in central repo to direct -->
        <!--all requests to nexus via the mirror -->
        <repositories>
            <repository>
                <id>central</id>
                <url>http://central</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>central</id>
                <url>http://central</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
    <profile>
        <id>maven-central</id>
        <!--Enable snapshots for the built in central repo to direct -->
        <!--all requests to nexus via the mirror -->
        <repositories>
            <repository>
                <id>central</id>
                <url>http://repo1.maven.org/maven2/</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>central</id>
                <url>http://repo1.maven.org/maven2/</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </pluginRepository>
        </pluginRepositories>
     </profile>
</profiles>
    <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
</activeProfiles>


</settings>
4

3 に答える 3

5

Centralプロキシ リポジトリが適切に構成されていること、およびプロキシされた URL が であることを確認してくださいhttp://repo1.maven.org/maven2/。リポジトリの URL でキャッシュされたアーティファクトが表示されることを確認してくださいhttp://localhost:8081/nexus/content/repositories/central/org/apache/maven/plugins/maven-clean-plugin/2.4.0/maven-clean-plugin-2.4.1.pom

セントラル プロキシがあることを確認してくださいhttp://localhost:8081/nexus/content/repositories/central/

プロキシの背後にいる場合は、 [管理] -> [Nexus ]ペインの[デフォルトの HTTP プロキシ設定 (オプション)]セクションでプロキシを構成できます。

次に、含まれるリポジトリのリストにそのリポジトリPublic Repositoriesを含めるようにグループ リポジトリが構成されていることを確認します。Central

これまでのところすべて問題ないように見える場合は、ログを確認してください。役立つメッセージが含まれている可能性があります。

于 2012-12-21T06:23:54.153 に答える
3

これを Web ブラウザから直接ダウンロードしてみてください。

http://localhost:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom

これが機能しない場合は、sonatype-work/nexus/logs/nexus.log ファイルで失敗の詳細を確認してください。

于 2012-07-03T17:03:12.797 に答える