2011-11-14 3 views
3

私はNexusを初めて使用しており、単一のNexusサーバに対してMavenプロジェクトを実行しようとしています。プロジェクトを実行すると(適切にビルドされて動作することが分かっているSpring Rooの例)、2つのマイルストーンジャーがロードされています。私の答え(おそらく最高ではない)は、POMのものを直接Nexusサーバー(ホストされたレポ)に見つけてアップロードし、パブリックグループに入れたものでした。アーティファクトがダウンロードされましたが、私の単一のNexusサーバからは使用されていません

mvnプロジェクトを再実行すると(mvn package tomcat:runを使用して)、2つのファイルがサーバからダウンロードされているように見えますが、まだmvnプロジェクトでは見つかりません。なぜプロジェクトは明らかにそれらを呼んでいるが、それらを使わないのだろうか?ありがとう。

ここでは、ダウンロードが行われているが、プロジェクトで使用されていないコンソール出力と、settings.xml(問題のjarsはaspectjrt-1.6.11.M1とaspectjweaver-1.6.11.M1です):

Last login: Mon Nov 14 06:03:25 on console 
Macintosh-2:~ wlaprise$ cd coursemanager/ 
Macintosh-2:coursemanager wlaprise$ mvn package tomcat:run 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building Course Manager Chapter 4 0.1.0.BUILD-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.pom 
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.pom (909 B at 0.5 KB/sec) 
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.pom 
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.pom (912 B at 1.0 KB/sec) 
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.annotations/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml 
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.osgi.bundle/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml 
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.root/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml 
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.jar 
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.jar 
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.jar (1640 KB at 689.5 KB/sec) 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 13.607s 
[INFO] Finished at: Mon Nov 14 06:17:42 CST 2011 
[INFO] Final Memory: 5M/81M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project course-manager-chapter-04: Could not resolve dependencies for project org.rooinaction.coursemanager:course-manager-chapter-04:war:0.1.0.BUILD-SNAPSHOT: Could not find artifact org.aspectj:aspectjweaver:jar:1.6.11.M1 in nexus (http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public) -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException 
Macintosh-2:coursemanager wlaprise$ 

のsettings.xml -

<settings> 
    <mirrors> 
     <mirror> 
      <!--This sends everything else to /public --> 
      <id>nexus</id> 
      <mirrorOf>*</mirrorOf> 
      <url>http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public</url> 
     </mirror> 
    </mirrors> 
    <profiles> 
     <profile> 
      <id>nexus</id> 
      <!--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> 
    </profiles> 
    <activeProfiles> 
     <activeProfile>nexus</activeProfile> 
    </activeProfiles> 
    <pluginGroups> 
     <pluginGroup>com.sonatype.maven.plugins</pluginGroup> 
     <pluginGroup>org.sonatype.plugins</pluginGroup> 
    </pluginGroups> 
</settings> 

答えて

1

すべてのURL http://centralの最初の罰金です。ミラーを定義しているため、決して使用されないダミーのプレースホルダです。

ただし、使用しているミラーURLが間違っている可能性があります。通常、Nexusのリポジトリはホストされているか、またはプロキシされていて、それをパブリック "グループ"に集約しています。サーバーとApacheの後ろにプロキシまたはとにかく

ポート80上で実行されている場合は省略ポート...ではlocalhostとhttp://localhost:8081/nexus/content/groups/public/ を置き換え

パブリックグループのURLのデフォルトURLが主なポイントは、ありますurlは/ content/GROUPS/publicです。あなたのURLは間違っている可能性が最も高いです。テストするには、ブラウザのURLからURLを試してみてください。

もちろん、パブリックグループで利用できるすべてのリポジトリを追加する必要があります。

+0

ありがとうManfred。それは私を軌道に戻してくれます。 –

+0

もしあなたが私の答えを受け入れるべきであれば、さらに詳細については無料のNexusの本をチェックアウトしてください。 –

+0

あまりにも助けてくれてありがとう:) –

0

独自のNexusサーバで実行しているため、設定したリポジトリでjarファイルを使用することはできません。 Springソースマイルストーン、リリース、およびスナップショットリポジトリをパブリックグループに追加する必要があります。

OSSにはSpringソースリポジトリのインスタンスがあり、マイルストーン、リリース、およびスナップショットを含む単一のグループURLがあります。リンクはhttps://oss.sonatype.org/content/groups/springsource-all/

https://oss.sonatype.org/content/groups/springsource-all/を指すプロキシリポジトリを追加し、リポジトリポリシーをスナップショットに設定する必要があります。

次に、新しいリポジトリをパブリックグループに追加します。最後に、インデックスを再構築すると、Mavenはファイルを今すぐ見つけられるはずです。

また、NexusでSpringを設定する際の参考になるリンクがいくつかあります。 http://www.sonatype.com/people/2009/12/spring-maven-nexus-best-practices/ http://blog.springsource.com/2009/12/02/obiting-spring-3-artifacts-with-maven/

関連する問題