Maven配置Nexus上传下载jar包

修改Maven配置文件settings.xml

    <server>
      <id>nexus-releases</id>
      <username>admin</username>
      <password>Nexus321</password>
    </server>
    <server>
      <id>nexus-snapshots</id>
      <username>admin</username>
      <password>Nexus321</password>
     </server> 

pom.xml中修改上传jar包】配置

    <distributionManagement>
        <repository>
            <id>nexus-releases</id>
            <name>Nexus ReleaseRepository</name>
            <url>http://111.62.52.214:31234/repository/maven-releases/</url>
        </repository>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <name>Nexus SnapshotRepository</name>
            <url>http://111.62.52.214:31234/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

pom.xml中修改【下载jar包】配置

    <repositories>
        <!-- 配置nexus远程仓库 -->
        <repository>
            <id>nexus-releases</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://*****:31234/repository/maven-public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <!-- 配置从哪个仓库中下载构件,即jar包 -->
    <pluginRepositories>
        <pluginRepository>
            <id>nexus-releases</id>
            <name>Nexus Snapshot Repository</name>
            <url>http://*****:31234/repository/maven-public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

相关文章

前言 此种方式已过时,不再推荐,当下推荐方式:自我救赎 →...
前言 项目中用到了maven,而且用到的内容不像利用maven/ecli...
开心一刻 今天去幼儿园接小侄女,路上聊起了天 小侄女:小叔...
本篇文章和大家了解一下怎么搭建maven私有仓库。有一定的参考...
今天小编给大家分享的是如何解决Maven依赖冲突,相信很多人都...
这篇文章主要介绍了Maven仓库分类的优先级是什么的相关知识,...