Mavenの構成設定ファイル、PW

ファイル構造

<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
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">  
    <localRepository/>
    <interactiveMode/>
    <offline/>
    <pluginGroups/>
    <servers/>
    <mirrors/>
    <proxies/>
    <profiles/>
    <activeProfiles/>
</settings>
  • localRepository:デフォルトでは、ローカルリポジトリの場所を設定します${user.home}/.m2/repository
  • interactiveMode:ユーザーが対話モードを開き、デフォルトは真であるかどうか
  • オフライン:オフラインモード、デフォルトはfalseです
  • pluginGroups:たとえば<pluginGroup>org.eclipse.jetty</pluginGroup>、デフォルトがありますorg.apache.maven.plugins and org.codehaus.mojo
  • サーバ:設定したユーザー名とパスワードPW
  • ミラー:ミラーブロッカーとして作用し、それがリモートリポジトリアドレスでリクエストのリモートリポジトリ関連のMavenに要求をインターセプトし、アドレス構成にミラーにリダイレクトされます。
  • プロキシ:プロキシの設定
  • プロフィール:環境の設定
  • activeProfiles:デフォルトの設定環境を活性化させます

1 - ユーザー名とパスワードを設定

<!-- 访问私服需要的用户名和密码 -->
<servers>
    <server>
        <id>repo-releases</id>
        <username>admin</username>
        <password>admin</password>
    </server>
    <server>
        <id>repo-snapshots</id>
        <username>admin</username>
        <password>admin</password>
    </server>
</servers>

2-プロファイル構成

次PWアドレスはfalseです。

<!-- 配置 zero-rdc-repo -->
<profile>
    <id>me-repo</id>
    <repositories>
        <!-- 配置的顺序决定了下载 jar 包的顺序 -->
        <!-- 阿里云的 release 版本 -->
        <repository>
            <id>central</id>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <!-- 私服的 release 版本 -->
        <repository>
            <id>repo-releases</id>
            <url>https://repo.rdc.aliyun.com/repository/release/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <!-- 私服的 snapshot 版本 -->
        <repository>
            <id>repo-snapshots</id>
            <url>https://repo.rdc.aliyun.com/repository/snapshot/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <!-- 阿里云插件的 release 版本 -->
        <pluginRepository>
            <id>central</id>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</profile>

ここにリポジトリあなたがそれを設定しない場合、デフォルトの設定Mavenの中央リポジトリがあるだろう、同じpluginRepositories設定されていない場合は、デフォルトの設定は、中央Mavenのリポジトリです。

3層ミラー

<!-- 配置拦截 repository 内的 url 进行重定向 -->
<mirrors>
    <!-- 将 central,!rdc-releases,!rdc-snapshots 的请求重定向到阿里云的公共 Maven 仓库 -->
    <!-- 其它的不重定向到阿里云 -->
    <mirror>
        <id>Nexus-aliyun</id>
        <mirrorOf>central,!rdc-releases,!rdc-snapshots</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    </mirror>
</mirrors>

ここでは、リダイレクトミラーと同様に、URL属性リポジトリを変更します。
これが書かれている、ことを注意central,!rdc-releases,!rdc-snapshotsしていない*,!rdc-releases,!rdc-snapshots私たちは、クラウド・アリにリダイレクト中央Mavenのリポジトリを依頼したいので、必ずしもすべての要求は、クラウド・アリにリダイレクトされます。Mavenの中央リポジトリは単なる倉庫で、オープンhttps://mvnrepository.com/reposは、私たちがよく使うことがわかったhttps://repo1.maven.org/maven2/倉庫に一つだけ多くのを、これは比較的大きく、唯一の倉庫。我々はすべての要求が倉庫にリダイレクトされて置く場合は、見つからないそこに依存します。

答えを求めて質問、

もう一つの問題は、私が構成した場合ということです*,!rdc-releases,!rdc-snapshotsので、そこにあるhttps://repo.spring.io/libs-milestone/倉庫は、jarファイルパッケージをダウンロードしないで、その後の質問は、私の設定がある場合、あるcentral,!rdc-releases,!rdc-snapshots、と設定されていないリポジトリもあるhttps://repo.spring.io/libs-milestone/リポジトリ、それはそれを見つける方法ですか?

おすすめ

転載: www.cnblogs.com/wuqinglong/p/12057934.html