其他分享
首页 > 其他分享> > Maven配置Nexus上传下载jar包

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,http,repository,releases,Nexus,上传下载,Maven,nexus
来源: https://blog.csdn.net/zhangjunli/article/details/122689704