2013-11-27 31 views
17

私は私のpom.xmlにonejar-のmaven-プラグインを使用しようとしています:EclipseのMavenプラグイン経由でそれを構築しようとすると、Sonatype Nexusを強制的に更新するには?

<plugin> 
    <groupId>org.dstovall</groupId> 
    <artifactId>onejar-maven-plugin</artifactId> 
    <version>1.4.4</version> 
    <executions> 
     <execution> 
      <configuration> 
       <mainClass>com.exmaple.myproj.MpPort_MpSoapPort_Client</mainClass> 
       <onejarVersion>0.97</onejarVersion> 
       <attachToBuild>true</attachToBuild> 
       <classifier>onejar</classifier> 
      </configuration> 
      <goals> 
       <goal>one-jar</goal> 
      </goals> 
     </execution> 
    </executions> 
</plugin> 

<pluginRepositories> 
    <pluginRepository> 
     <id>onejar-maven-plugin.googlecode.com</id> 
     <url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url> 
    </pluginRepository> 
</pluginRepositories> 

が、何らかの理由で(Mavenのインストール)ビルドエラーで結果:

Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom 
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository onejar-maven-plugin.googlecode.com (http://onejar-maven-plugin.googlecode.com/svn/mavenrepo) 
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom 
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2) 
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom 
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2) 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] Error building POM (may not be this project's POM). 


Project ID: org.dstovall:onejar-maven-plugin 

Reason: POM 'org.dstovall:onejar-maven-plugin' not found in repository: Unable to download the artifact from any repository 

    org.dstovall:onejar-maven-plugin:pom:1.4.4 

from the specified remote repositories: 
    Nexus (https://mynexus.example.com/nexus/content/repositories/central) 

for project org.dstovall:onejar-maven-plugin 

は、だから私は手動でonejar-maven-plugin.jarをダウンロードして、コマンドラインからそれをインストールし、私は、同様のエラーを取得しているようだ:

C:\Users\daniel\myproj>mvn install:install-file -Dfile=onejar-maven-plugin-1.4.4.jar -DgroupId=com.jolira -DartifactId=onejar-maven-plugin -Dversion=1.4.4 -Dpackaging=jar 
[INFO] Scanning for projects... 
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom 
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository onejar-maven-plugin.googlecode.com (http://onejar-maven-plugin.googlecode.com/svn/mavenrepo) 
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom 
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2) 
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom 
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2) 
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] Error building POM (may not be this project's POM). 


Project ID: org.dstovall:onejar-maven-plugin 

Reason: POM 'org.dstovall:onejar-maven-plugin' not found in repository: Unable to download the artifact from any repository 

    org.dstovall:onejar-maven-plugin:pom:1.4.4 

from the specified remote repositories: 
    Nexus (https://mynexus.example.com/nexus/content/repositories/central) 

for project org.dstovall:onejar-maven-plugin 

私は、特定のアーティファクトを含んでいないネクサスミラーを持っているので、物事が混乱することが理解できます。

How to force Sonatype Nexus Regenerate/Reindex its Metadataの手順に従ってみましたが、「ブラウズインデックス」タブにそのようなコンテキストメニューはありません。 Sonatype Nexusの

enter image description here

私は「ネクサスは、クライアントのみが要求されているアーティファクトをキャッシュします。あなたが適切なバージョンを要求するために、プロジェクトのPOMSを設定する必要がありますので」とhereをお読みください。しかし、私がをやっているのと全く同じ結果であるを変更することなく。

この「chicken & egg」の状況からどうやって取得し、このonejar-maven-plugin verを取得しますか?私のNexusミラーに1.4.4?

(また、どのように私は私の地元の.m2キャッシュにそれを得るのですか?)

答えて

20

あなたは地元のレポは、成果物に関するメタデータが含まれている場合でも-U

で利用できない場合、再び更新するために、Mavenを強制し、要求依存することができます
mvn clean install -U 

が有効です。

また、settings.xmlを変更して、中央のリポジトリだけでなくパブリックグループを指すようにする必要があります。詳細はin the Nexus bookです。

セントラルリポジトリには、使用しようとしているonejarプラグインがありません。 search resultsをチェックアウトし、groupIdcom.joiliraなくorg.dstovall

であるかを確認また、より多くのあなたが本当にorg.dstovallからonejarプラグインを使用したい場合は、ネクサスへのプロキシリポジトリとしてURL http://onejar-maven-plugin.googlecode.com/svn/mavenrepo/を追加する必要があり、公共のグループに追加しますsettings.xml

+0

私は 'settings.xml'で' '要素を一時的にコメントアウトしようとしていました(少なくともパッケージをローカルの' .m2'に入れるための回避策として)。あなたがもっと賢明な洞察力を持っていることに気付きました。彼のネクサスはcom.dotovalではなくcom.joliraを指しています。 +1! – sfinja

+1

誤った参照を持つpom.xmlファイルです。実際にNexusとは関係ありません。 –

+0

彼が提供したスクリーンショットを見ると、彼のネクサスは 'nejar-maven-plugin'を指しています。' dstoval'ではなく 'jolira'からのみです。これが彼のMavenのインストールを失敗させる原因にはなりませんか? – sfinja

関連する問題