13

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

一般的に使用されているのは単なる省略表現ですが、実際の URL は無視されますか? 他のものに置き換えるか、完全に削除できますか? それはどこかに文書化されていますか?

重要な場合は、私たちの「中心」として機能する内部 iBiblio ミラーを持つ企業ネットワークで開発しています。

4

2 に答える 2

21

私の知る限り、次の例として、 NexusからダウンロードするようにMavenを構成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からダウンロードするように設定されてcentral repositorya bogus URLますhttp://central

この URLは、同じファイルのミラー設定によってオーバーライドされ、 . nexus グループは、activeProfiles 要素にアクティブなプロファイルとしてリストされます。settings.xmlsingle Nexus group

これが役立つことを願っています。

于 2013-04-23T09:25:15.237 に答える