2017-09-06 11 views
1

ローカルMavenリポジトリとしてnexusをセットアップしました。私は2つのプロキシリポジトリが必要です。 1つは、reficio repositoryからの別の中央の依存関係を取得します。Nexusリポジトリに複数のプロキシリポジトリを作成するにはどうすればいいですか?

新しいプロキシリポジトリmaven-reficioを作成し、それをグループリポジトリmaven-publicに追加しました。また、私は以下のようにsettings.xmlを編集しましたpost

しかし、私はまだreficioリポジトリから依存関係を取得できず、キャッシュされていない依存関係も取得できません。お知らせ下さい。

Screenshot of my nexus

私のsettings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> 

    <pluginGroups></pluginGroups> 
    <proxies></proxies> 
    <servers></servers> 

    <mirrors> 
     <mirror> 
      <id>nexus</id> 
      <mirrorOf>*</mirrorOf> 
      <url>http://localhost:8081/repository/maven-public/</url> 
     </mirror> 
    </mirrors> 

    <profiles> 
     <profile> 
      <id>nexus</id> 
      <repositories> 
       <repository> 
        <id>reficio</id> 
        <name>Reficio repository</name> 
        <url>http://repo.reficio.org/maven/</url> 
       </repository> 
      </repositories> 
     </profile> 
    </profiles> 

    <activeProfiles> 
     <activeProfile>nexus</activeProfile> 
    </activeProfiles> 

</settings> 

ここではkhmarbaiseを聞いた後、私の問題を解決し、私の最終のsettings.xmlです:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> 
    <mirrors> 
    <mirror> 
     <!--This sends everything else to /public --> 
     <id>nexus</id> 
     <mirrorOf>*</mirrorOf> 
     <url>http://localhost:8081/repository/maven-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>https://repo1.maven.org/maven2/</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </repository> 
     <repository> 
      <id>reficio</id> 
      <url>http://repo.reficio.org/maven/</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </repository> 
     </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>central</id> 
      <url>https://repo1.maven.org/maven2/</url> 
      <releases><enabled>true</enabled></releases> 
      <snapshots><enabled>true</enabled></snapshots> 
     </pluginRepository> 
     <pluginRepository> 
      <id>reficio</id> 
      <url>http://repo.reficio.org/maven/</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> 
+0

は、ネクサスの達人 - 公開グループで定義されたプロキシリポジトリの使用方法を定義し、設定からrepo.reficio.orgを削除します。 – khmarbaise

+0

khmarbaise、 "設定からrepo.reficio.orgを削除する"というのは、URLのみかプロファイル全体のタブを意味しますか? – Gazelover

答えて

0

あなたが設定を形作る必要があります.xmlは次のようになります。

<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> 

そして、コンフィギュレーション、他のリポジトリ自分のネクサスで...

+0

ありがとう!できます! – Gazelover

関連する問題