一、修改pom.xml文件,配置私服仓库地址
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.umetrip.qa</groupId>
<artifactId>ApiRequest</artifactId>
<version>10.0-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.RELEASE</version>
<relativePath/>
</parent>
<properties>
<java.version>1.8</java.version>
<mybatis-spring-boot-starter>2.0.0</mybatis-spring-boot-starter>
<mysql-connector-java>5.1.46</mysql-connector-java>
<druid>1.1.14</druid>
<elasticsearch.version>7.4.1</elasticsearch.version>
<protostuff.version>1.5.9</protostuff.version>
<dubbo.version>2.7.4.1</dubbo.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.8</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.3</version>
</dependency>
<dependency>
<groupId>com.umetrip.mid</groupId>
<artifactId>umemid-common</artifactId>
<version>2.5.2</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
<!--pb序列化-->
<dependency>
<groupId>com.umetrip.service</groupId>
<artifactId>ume-serialization</artifactId>
<version>2.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.11</version>
</dependency>
<!--RC4加密-->
<dependency>
<groupId>com.umetrip.mid</groupId>
<artifactId>DesUtilTool</artifactId>
<version>3.0</version>
<exclusions>
<exclusion>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
<exclusion>
<artifactId>umemid-common</artifactId>
<groupId>com.umetrip.mid</groupId>
</exclusion>
<exclusion>
<artifactId>ume-serialization</artifactId>
<groupId>com.umetrip.service</groupId>
</exclusion>
</exclusions>
</dependency>
<!--spring整合的redis-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.11.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.4</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.8</version>
</dependency>
<dependency>
<groupId>com.travelsky.umetrip</groupId>
<artifactId>login-tool</artifactId>
<version>0.1.9</version>
<exclusions>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
<exclusion>
<artifactId>commons-io</artifactId>
<groupId>commons-io</groupId>
</exclusion>
<exclusion>
<artifactId>commons-lang</artifactId>
<groupId>commons-lang</groupId>
</exclusion>
<exclusion>
<artifactId>htmlunit-core-js</artifactId>
<groupId>net.sourceforge.htmlunit</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.2</version>
<exclusions>
<exclusion>
<artifactId>jackson-annotations</artifactId>
<groupId>com.fasterxml.jackson.core</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>2.7.2</version>
<exclusions>
<exclusion>
<artifactId>gson</artifactId>
<groupId>com.google.code.gson</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.datav.servicesv</groupId>
<artifactId>login-tool</artifactId>
<version>0.2.5</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.14</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>7.5.1</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>7.5.1</version>
<exclusions>
<exclusion>
<artifactId>elasticsearch-rest-client</artifactId>
<groupId>org.elasticsearch.client</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java}</version>
</dependency>
</dependencies>
<!-- 指定私服仓库地址 -->
<distributionManagement>
<!-- 配置release版本发布的仓库-->
<repository>
<id> nexus-releases</id>
<name> Nexus Release Repository</name>
<url>http://10.5.146.9:8180/nexus/content/repositories/releases</url>
</repository>
<!-- 配置快照版本发布的仓库-->
<snapshotRepository>
<id> nexus-snapshots</id>
<name> Nexus Snapshot Repository</name>
<url>http://10.5.146.9:8180/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<finalName>ApiRequest</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<encoding>utf-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
二、修改maven的settings.xml
<!-- servers
| This is a list of authentication profiles, keyed by the server-id used within the system.
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|-->
<servers>
<!-- server
| Specifies the authentication information to use when connecting to a particular server, identified by
| a unique name within the system (referred to by the 'id' attribute below).
|
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
| used together.
|
<server>
<id>deploymentRepo</id>
<username>repouser</username>
<password>repopwd</password>
</server>
-->
<!-- Another sample, using keys to authenticate.
<server>
<id>siteServer</id>
<privateKey>/path/to/private/key</privateKey>
<passphrase>optional; leave empty if not used.</passphrase>
</server>
-->
<!-- 配置上传release构建时使用的账户 -->
<server>
<id> nexus-releases</id>
<configuration>
<timeout>600000</timeout> <!-- milliseconds -->
<httpConfiguration>
<all>
<connectionTimeout>600000</connectionTimeout> <!-- milliseconds -->
<readTimeout>600000</readTimeout> <!-- milliseconds -->
</all>
</httpConfiguration>
</configuration>
<username> admin</username>
<password> Umetrip@123</password>
</server>
<!-- 配置上传snapshot构建时使用的账户 -->
<server>
<id> nexus-snapshots</id>
<configuration>
<timeout>600000</timeout> <!-- milliseconds -->
<httpConfiguration>
<all>
<connectionTimeout>600000</connectionTimeout> <!-- milliseconds -->
</all>
</httpConfiguration>
</configuration>
<username> admin</username>
<password> Umetrip@123</password>
</server>
<server>
<id> jboss-local</id>
<configuration>
<timeout>600000</timeout> <!-- milliseconds -->
<httpConfiguration>
<all>
<connectionTimeout>600000</connectionTimeout> <!-- milliseconds -->
<readTimeout>600000</readTimeout> <!-- milliseconds -->
</all>
</httpConfiguration>
</configuration>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
三、上传至私服
点击右侧 Maven-》Lifecycle-》deploy右键Run,结果为Success表示Jar包成功上传至私服