2013-04-23 8 views
7

年齢の "サンプル" settings.xmlファイルをコピーしていましたが、ほとんどのファイルにURL http://centralのリポジトリが含まれているようです。これは本当に "中央"と呼ばれるローカルドメイン上に実際にマシンが存在する可能性があるので、これはバグです。これは有効なURNですが、Mavenにとって特別な意味を持つ必要があります。Maven settings.xmlで「http:// central」とは何ですか?

一般的に使用されているが、実際のURLは無視されていますか?私はそれを他の何かに置き換えることができますか、それとも完全に取り除くことができますか?それはどこに文書化されていますか?

重要な点は、内部iBiblioミラーを備えた企業ネットワーク上で開発することです。このミラーは、私たちの「中心」として機能します。

答えて

14

私の知る限りでは、それは、次の例のようにConfigure Maven to Download from Nexusで言及a bogus URLある: -

<settings> 
    <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> 
    </profiles> 
    <activeProfiles> 
    <!--make the profile active all the time --> 
    <activeProfile>nexus</activeProfile> 
    </activeProfiles> 
</settings> 

nexus profile

http://centrala bogus URLcentral repositoryからダウンロードするように構成されています。

このURL はあなたのsingle Nexus groupのURLを指すように同じsettings.xmlファイルにを設定するミラーによって上書きされます。ネクサスグループは、activeProfiles要素にアクティブなプロファイルとしてリストされます。

こちらがお役に立てば幸いです。

関連する問題