maven下载,上传设置

复制代码
<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">
    
   <!--就是配置maven本地仓库的地址为自定义的地址-->
    <localRepository>C:\Users\abc\.m2\repository_demo</localRepository>
    <!--nexus服务器-->
     <servers>
          <server>
            <id>releases</id>
                <username>admin</username>
                <password>admin123</password>
          </server>
          <server>
            <id>snapshots</id>
            <username>admin</username>
                <password>admin123</password>
          </server>
          <server>
            <id>public</id>
            <username>admin</username>
                <password>admin123</password>
          </server>
      </servers>

    <mirrors>
        <mirror>
            <id>public</id>
            <mirrorOf>central</mirrorOf>
            <name>public central</name>
            <url>http://localhost:8081/repository/my_group/</url>
        </mirror>
    </mirrors>
    
    <profiles>
        <profile>
            <id>default</id>
复制代码
    <repositories>
                <repository>
                    <id>releases</id>
                    <url>http://localhost:8081/repository/my_hosted_release/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>    
                <repository>
                    <id>snapshots</id>
                    <url>http://localhost:8081/repository/my_hosted_snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>            
            </repositories>
复制代码

 

            <!--从远处仓库下载 public 包含了可以不用配置-->
             <pluginRepositories>
                <pluginRepository>
                    <id>releases</id>
                    <url>http://localhost:8081/repository/my_hosted_release/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>snapshots</id>
                    <url>http://localhost:8081/repository/my_hosted_snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>default</activeProfile>
    </activeProfiles>
    
</settings>
复制代码

 上传到私有库配置

复制代码
 <!--上传到私有库-->
    <distributionManagement>
        <repository>
            <id>releases</id>
            <name>internal releases</name>
            <url>http://localhost:8081/repository/my_hosted_release/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>internal snapshot</name>
            <url>http://localhost:8081/repository/my_hosted_snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
复制代码

 

posted @   快乐就好  阅读(390)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架
历史上的今天:
2014-10-23 15个具有高度影响力的Apache开源项目
点击右上角即可分享
微信分享提示