nexus搭建私服后的本地配置
maven私服安装过程略过,网上都有,这里只简单记录下项目的配置过程
本地配置
前提:在私服中已经创建了仓库(这里假设仓库名test-release) 以及新建了User账号
本地maven配置
修改setting.xml文件,添加私服的账号密码
<servers>
<server>
<!-- 这个id跟项目pom文件里的id对应上就行 -->
<id>theID</id>
<!-- 私服创建的用户名 -->
<username>youUserName</username>
<!-- 私服创建的用户名对应的密码 -->
<password>youPassword</password>
</server>
</servers>项目中配置
在pom文件中添加:
<?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.package</groupId>
<artifactId>test-springboot</artifactId>
<version>1.0-RELEASE</version>
<!--注意限定版本一定为RELEASE,因为上传的对应仓库的存储类型为RELEASE -->
<!--指定仓库地址 -->
<distributionManagement>
<repository>
<!--此名称要和.m2/settings.xml中设置的ID一致 -->
<id>theID</id>
<url>http://yourhost:port/repository/test-release/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<!--发布代码Jar插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
<!--发布源码插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>发布jar包
项目路径下的命令行执行(IDEA自带命令行,可以直接在底部菜单的Terminal里执行)
mvn deploy
相关推荐
Topbeyond 2020-08-21
随心而作 2020-06-04
VanTYS 2020-06-03
liyansring 2020-06-01
kuzilala 2020-01-24
糊一笑 2020-01-17
iamplane 2019-12-29
gongzhiyao0 2011-07-27
咏月东南 2019-11-03
啦啦啦啦啦 2017-11-10
lilygg 2017-11-09
libowenhit 2011-04-22
aobaxiaoli 2019-08-22
zousongshan 2014-05-04
wacsdn 2011-08-12
水果篮 2016-10-23
itmale 2015-07-11