zoukankan      html  css  js  c++  java
  • deploy工程到nexus

    一、上传私服

    0.修改maven的settings.xml。加上:

        <server>
          <id>nexus-snapshots</id>
          <username>bofeng</username>
          <password>123456</password>
        </server>
        <server>
          <id>nexus-releases</id>
          <username>bofeng</username>
          <password>123456</password>
        </server>

    ● snapshots

    1.下载要deploy的工程

    2.修改该工程的pom.xml

    3.修改pom.xml

    1)添加maven仓库和snapshots deploy仓库

        <!-- 去此仓库找依赖 -->
        <repositories>
            <repository>
                <id>nexus-snapshots</id>
                <name>Nexus Snapshots</name>
                <url>file:///C:/Users/bofeng/.m2/mavenResp</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
                <releases>
                    <enabled>true</enabled>
                </releases>
            </repository>
        </repositories>
        <!-- 部署到此仓库 -->
        <distributionManagement>
            <snapshotRepository>
                <id>nexus-snapshots</id>
                <name>Nexus Snapshot</name>
                <url>http://39.106.171.57:8081/repository/maven-snapshots/</url>
            </snapshotRepository>
            <site>
                <id>nexus-snapshots</id>
                <name>Nexus Sites</name>
                <url>dav:http://39.106.171.57:8081/repository/maven-snapshots/</url>
            </site>
        </distributionManagement>

    其中maven-snapshots对应nexus仓库

    2)版本号加上-SNAPSHOTS

        <groupId>com.lbh360.platform</groupId>
        <artifactId>parent</artifactId>
        <packaging>pom</packaging>
        <version>0.0.1-SNAPSHOT</version>

    5..进入到要deploy工程与pom.xml同级的目录,执行

    mvn deploy

    deploy成功

     ● releases

    1.版本号不加-SNAPSHOTS

        <groupId>com.lbh360.platform</groupId>
        <artifactId>parent</artifactId>
        <packaging>pom</packaging>
        <version>0.0.1</version>

    2.pom.xml指定releases deploy仓库

        <!-- 部署到此仓库 -->
        <distributionManagement>
            <snapshotRepository>
                <id>nexus-snapshots</id>
                <name>Nexus Snapshot</name>
                <url>http://39.106.171.57:8081/repository/maven-snapshots/</url>
            </snapshotRepository>
            <site>
                <id>nexus-snapshots</id>
                <name>Nexus Sites</name>
                <url>dav:http://39.106.171.57:8081/repository/maven-snapshots/</url>
            </site>
            <repository>
                <id>nexus-releases</id>
                <name>Nexus Releases</name>
                <url>http://39.106.171.57:8081/repository/maven-releases/</url>
            </repository>
        </distributionManagement>

     其中maven-releases对应nexus仓库

    3. 进入到要deploy工程与pom.xml同级的目录,执行

    mvn deploy -P release

    其余同snapshots 

    二、配置使用此私服

    在parent工程的pom.xml加配置

        <repositories>
            <repository>
                <id>nexus</id>
                <name>Nexus Snapshot</name>
                <url>http://39.106.171.57:8081/repository/maven-snapshots/</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>

     三、强制使用私服上的maven仓库

    clean install docker:build -DpushImage -U
  • 相关阅读:
    1.unix网络编程基础知识
    eclipse中如何获得feature与plugin的list
    eclipse中Debug的三种方式
    Eclipse Update Site中Nested Features问题
    java中URL,URLConnection,HttPURLConnection的使用
    iBatis简单入门教程
    Git 常用命令整理
    【整理】chmod和chown命令的用法
    【原创】Gson使用,json转换为java对象
    CSS reset 一份很全的样式表,附YUI的css reset
  • 原文地址:https://www.cnblogs.com/naixin007/p/12292147.html
Copyright © 2011-2022 走看看