nexus 3.17.0-01 windows安裝及使用


1.解壓后執行 nexus.exe /run 啟動私服服務

2.打開 192.168.1.21:8081 進入私服管控台

2.1.在 sonatype-work\nexus3 下查看 admin.password 密碼並 sign in 進行修改 (test password nexus)

3.在 Repository -> Repositories -> maven-central 下添加阿里倉庫遠程代理 https://maven.aliyun.com/nexus/content/groups/public/

4.maven settings.xml 配置
<mirrors>
    <!-- 阿里雲倉庫
    <mirror>
        <id>alimaven</id>
        <mirrorOf>central</mirrorOf>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
    </mirror>
     -->
    <!-- 中央倉庫1
    <mirror>
        <id>repo1</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://repo1.maven.org/maven2/</url>
    </mirror>
    -->
    <!-- 中央倉庫2
    <mirror>
        <id>repo2</id>
        <mirrorOf>central</mirrorOf>
        <name>Human Readable Name for this Mirror.</name>
        <url>http://repo2.maven.org/maven2/</url>
    </mirror>
     -->
    <mirror>
        <id>public</id>
        <mirrorOf>central</mirrorOf>
        <name>central repository</name>
        <url>http://192.168.1.21:8081/repository/maven-public/</url>
    </mirror>
</mirrors>

<profiles>
    <profile>
        <id>nexusProfile</id>
        <repositories>
            <repository>
                <id>nexus</id>
                <name>nexus</name>
                <url>http://192.168.1.21:8081/repository/maven-central/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    </profile>
</profiles>

<activeProfiles>
    <activeProfile>nexusProfile</activeProfile>
</activeProfiles>

<servers>
    <server>
        <id>releases</id>
        <username>admin</username>
        <password>nexus</password>
    </server>

    <server>
        <id>snapshots</id>
        <username>admin</username>
        <password>nexus</password>
    </server>
</servers>

5.pom.xml 配置
<distributionManagement>
    <repository>
        <id>releases</id>
        <name>User Project RELEASES</name>
        <url>http://192.168.1.21:8081/repository/maven-releases/</url>
    </repository>

    <snapshotRepository>
        <id>snapshots</id>
        <name>User Project SNAPSHOTS</name>
        <url>http://192.168.1.21:8081/repository/maven-snapshots/</url>
    </snapshotRepository>
</distributionManagement>

6.deploy 模塊

7.在 Browse -> maven-releases 中查看發布的模塊

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM