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>

上一篇:Python 直接赋值、浅拷贝和深度拷贝


下一篇:OpenCV入门