2011-10-27 8 views
1

私は奇妙な問題があります。自分のリモートリポジトリがあり、プラグインをアップロードしています。それから私はパッケージングプロジェクト中にそれをダウンロードしようとします。 Mavenはown_remote_repoからダウンロードを開始しますが、1つのファイルをダウンロードするとrepo1.maven.org/maven2の別のファイルを検索し始めますが、もちろんプラグインが見つかりませんでした。Mavenは異なるリポジトリから1つのプラグインからファイルをダウンロードします

このレポを何度も問題なく使用しています。

[編集]

出力:Mavenの中央からjarファイルをダウンロードしようとするあなたはのmaven-pluginの-1.1.3.pomの達人のdowloading後に見ることができるように

Downloading: http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom 
[INFO] Unable to find resource 'com.my.maven.plugin:maven-plugin:pom:1.1.3' in repository central (http://repo1.maven.org/maven2) 
Downloading: http://<server>:<port>/nexus/content/groups/public/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.pom 
3K downloaded (maven-plugin-1.1.3.pom) 
Downloading: http://repo1.maven.org/maven2/com/my/maven/plugin/maven-plugin/1.1.3/maven-plugin-1.1.3.jar 
[INFO] Unable to find resource 'com.my.maven.plugin:maven-plugin:maven-plugin:1.1.3' in repository central (http://repo1.maven.org/maven2) 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository 

repo ....

プラグインがnexusの同じディレクトリにあり、名前がmavenが見つけようとするjarファイルと同じ名前のjarファイル。 nexusからダウンロードしたmaven-plugin-1.1.3.pomが正しいです。

アイデア?

+1

これを示すmavenのサンプル出力を投稿できますか? –

+0

完了。これがあなたを助けてくれることを願っています – Oleksandr

答えて

2

私はあなたの質問から理解することは、あなたがプラグインを持つ唯一の問題を抱えているということですが、私たちはプロキシとしてnexusを使用して

$USER_HOME/.m2/settings.xml 

は、下記に示すpluginrepositoriesセクションの設定を確認してください設定する必要がありました。

<settings> 
    <mirrors> 
     <mirror> 
      <id>nexus</id> 
      <mirrorof>*</mirrorof> 
      <url>http://nexusurl/content/groups/public</url> 
     </mirror> 
    </mirrors> 
    <profiles> 
     <profile> 
      <id>nexus</id> 
      <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> 
    </profiles> 
    <activeprofiles> 
     <activeprofile>nexus</activeprofile> 
    </activeprofiles> 
</settings> 
+0

ありがとうございました。私のpom.xmlにpluginRepositoriesを追加して、mavenがdowloadを正しく開始するようにしてください。しかし、私は主な問題を解決することはできません:なぜmavenは、別のリポジトリからplubinの一部をdowload開始... – Oleksandr

関連する問題