一、下载安装与配置

下载

到官网下载:https://www.sonatype.com/download-oss-sonatype

 
image.png

下载的是oss3.x版本的(当时最新版),

 
image.png

安装

1、先将下载后的zip文件解压到指定文件夹
2、直接双击exe文件会闪退,所以使用命令行,管理员方式运行cmd

 
image.png

安装:nexus.exe /install
卸载:nexus.exe /uninstall
启动:nexus.exe /start
停止:neuxs.exe /stop
3、(可做可不做)为了方便使用将bin弄成系统环境变量
4、安装并启动完成后 直接访问http://localhost:8081/(是默认端口) 默认用户:admin 密码:admin123
5、如果要修改端口,就修改配置文件中的 nexus-3.14.0-04\etc\nexus-default.properties 的 application-port

## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties
##
# Jetty section
application-port=8081
application-host=0.0.0.0
nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml
nexus-context-path=/ # Nexus section
nexus-edition=nexus-pro-edition
nexus-features=\
nexus-pro-feature

配置用户

1、自改密码,进入用户账户,change password-->修改为其他密码就行了(1QsAZD0SV)
2、有其他问题直接上官网看文档


二、使用方式

上传jar包(三种方式)

1、如果是使用界面的update比较简单
2、使用配置方式 在maven的setting.xml文件中配置,要分清是自己下载的maven或者是idea的maven

<!-- 把jar包发布到私服中 -->
<!-- 配置服务器--><server>
<id>maven-public</id>
<username>admin</username>
<password>1QsAZD0SV</password> </server> <server>
<id>maven-releases</id>
<username>admin</username>
<password>1QsAZD0SV</password> </server> <server>
<id>maven-snapshots</id>
<username>admin</username>
<password>1QsAZD0SV</password> </server>

项目的pom文件

<distributionManagement>
<repository>
<id>maven-releases</id>
<name>Nexus Release Repository</name>
<url>http://localhost:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://localhost:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>

点击idea中deploy命令即可成功 mvn clean deploy 2.1.3 也可以使用命令行将下载的jar发布到私服

mvn deploy:deploy-file -DgroupId=com.weepal.wp-common
-DartifactId=wp-common -Dversion=1.3.0 -Dpackaging=jar
-DrepositoryId=nexus -Dfile=E:\Document\wp-common-1.3.0-RELEASE.jar-Durl=http://localhost:8081/repository/maven-release/

com.weepal.wp-common为pom中的groupId中的内容;
wp-common为pom中的artifactId中的内容;
1.3.0为pom中的version中的内容; 同时在maven中要添加权限

<server>
<id>nexus</id>
<username>admin</username>
<password>1QsAZD0SV</password>
</server>
<repository>
<id>nexus</id>
<url>http://localhost:8081/repository/maven-release/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>

从私服下载jar包

1、在pom文件中配置

<!-- 假如没有私服 ,则 本地仓库找不到,则访问中心仓库
假如有私服 :访问顺序
首先访问本地仓库
本地仓库没有,则访问私服仓库
私服仓库也没有,则访问中心仓库
-->
<!--下载jar配置开始-->
<repositories>
<repository>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>nexus</id>
<name>Nexus Repository</name>
<url>http://localhoot:8081/repository/maven-public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>Nexus Plugin Repository</name>
<url>http://localhoot:8081/repository/maven-public/</url>
</pluginRepository>
</pluginRepositories>
<!--下载jar包配置结束-->

作者:nayli
链接:https://www.jianshu.com/p/93fac0ac2202
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

转:建立maven私服的更多相关文章

  1. nexus建立maven仓库私服及Snapshots、release的版本管理

    环境搭建   1.linux安装maven   wget http://mirrors.cnnic.cn/apache/maven/maven-3/3.0.5/binaries/apache-mave ...

  2. Maven私服Nexus3.x环境构建操作记录

    Maven介绍Apache Maven是一个创新的软件项目管理和综合工具.Maven提供了一个基于项目对象模型(POM)文件的新概念来管理项目的构建,可以从一个中心资料片管理项目构建,报告和文件.Ma ...

  3. Maven学习 (四) 使用Nexus搭建Maven私服

    为什么要搭建nexus私服,原因很简单,有些公司都不提供外网给项目组人员,因此就不能使用maven访问远程的仓库地址,所以很有必要在局域网里找一台有外网权限的机器,搭建nexus私服,然后开发人员连到 ...

  4. 使用Nexus创建Maven私服

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问.利用Nexus你可以只在一个地方就能够完全控制访问和部署在你所维护仓库中的每个Artifact.Nexus ...

  5. Linux下建立Nexus私服

    Linux下建立Nexus私服 要安装3个东西,然后配置私服: 1.JDK 2.Maven 3.Nexus 然后配置 1.JDK的安装 下载JDK安装包,格式为RPM格式,安装即可 安装程序 #rpm ...

  6. Maven使用笔记(五)Sonatype Nexus 搭建Maven 私服

    1. 为什么使用Nexus 如果没有私服,我们所需的所有构件都需要通过maven的中央仓库和第三方的Maven仓库下载到本地, 而一个团队中的所有人都重复的从maven仓库下载构件无疑加大了仓库的负载 ...

  7. Sonatype Nexus 搭建Maven 私服

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html 内部邀请码:C8E245J (不写邀请码,没有现金送) 国 ...

  8. centos7搭建nexus maven私服

    前置条件: 1.安装jdk,可参考 http://www.cnblogs.com/grey-wolf/p/6480489.html 2.nexus仓库管理器,分为两个版本,Nexus Reposito ...

  9. Linux下Maven私服Nexus3.x环境构建操作记录【转】

    Maven介绍Apache Maven是一个创新的软件项目管理和综合工具.Maven提供了一个基于项目对象模型(POM)文件的新概念来管理项目的构建,可以从一个中心资料片管理项目构建,报告和文件.Ma ...

随机推荐

  1. thinkphp中简单的控制器使用

    1.在路由(route.php)中定义一条路由 Route::rule('new/:name/:id','index/News/read'); 2.在index下的controller控制器中新建一个 ...

  2. Centos7下配置Apache的虚拟主机

    一.虚拟主机 虚拟主机是Apache提供的一个功能,通过虚拟主机拉雅在一台服务器上部署多个网站.虽然服务器的IP地址是相同的,但用户当用户使用不同的域名访问时,访问到的是不同的网站. 下面讲解Apac ...

  3. mybatis中jdbcType与oracle/mysql数据类型对应关系

    Mybatis JdbcType Oracle MySql JdbcType ARRAY     JdbcType BIGINT   BIGINT JdbcType BINARY     JdbcTy ...

  4. C++-HDU1003-Max Sum

    时间复杂度O(n) 空间复杂度O(1) #include <cstdio> int main() { int T;scanf("%d",&T); ,n,a,l, ...

  5. AcWing 895. 最长上升子序列

    //设上升序列的最后一个数字为第i个,那么就以第i-1个位分类标准, //i-1可以没有,也可以是在数组中下标为1,下标为2 //一直到下标为i-1的数字 #include <iostream& ...

  6. AAC MDCT

    AAC采用MDCT进行时频变换. 在编码端,以block为单位取出N个sample,乘以合适的window function后再进行MDCT.N通常为2048,256. 每个输入到MDCT的sampl ...

  7. 迭代器:遍历集合元素的操作. iterator()

    package seday11; import java.util.ArrayList;import java.util.Collection;import java.util.Iterator; / ...

  8. Winform遍历窗口的所有控件(几种方式实现)

    本文链接:https://blog.csdn.net/u014453443/article/details/85088733 扣扣技术交流群:460189483 C#遍历窗体所有控件或某类型所有控件 ...

  9. python中的循环结构等相关知识

    ==分支结构== 1.单分支:一般用于只会发生一种情况的场景,if #90以上优秀 score=95 if score>90: print("优秀") 2.双分支:一般用于会 ...

  10. Nuxt项目文件目录结构解释

    |-- .nuxt // Nuxt自动生成,临时的用于编辑的文件,build |-- assets // 用于组织未编译的静态资源入LESS.SASS 或 JavaScript |-- compone ...