`

私服服务器Nexus的安装

阅读更多
1 下载
  https://www.sonatype.com/download-oss-sonatype
2 安装与配置
  1) 解压
  2) 将解压目录\nexus-2.14.0-01\bin加入到path环境变量中
  3) cmd窗口执行nexus出现以下
     Usage: nexus { console : start : stop : restart : install : uninstall }
  4) 修改配置文件
    打开 nexus-2.14.0-01\bin\jsw\conf\wrapper.conf 找到
   # Set the JVM executable
   # (modify this to absolute path if you need a Java that is not on the OS path)
    wrapper.java.command=java(此处改为java命令文件路径)
   5) 执行 nexus install 安装
   6) 启动 nexus start 就启动了 或者 在"服务"找到nexus启动
   7) 打开浏览器 输入以下 URL
      http://127.0.0.1:8081/nexus/
      登录的用户名和密码 admin/admin123 可以所有的仓库
   (8) 下载的jar包存储在
    
     安装目录\sonatype-work\nexus\storage

3 mvn deploy 命令 将代码提交给工厂或者仓库
4 hosted proxy
  hosted 本地的 Releases
  proxy 代理的 需要联外网的
  group 分组 将hosted 和proxy组合 (常用)
5 配置默认去私服下载(单独项目)
  
<repositories>
		<repository>
			<id>nexus</id>
			<name>nexus Respository</name>
			<url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>
      <!-- 配置jar-->
        <dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>9.4.0.RC0</version>
		</dependency>

    可以看到已经下载成功了 如图



6  修改setting.xml(所有项目)
    1) 只要修改了setting.xml 一定要执行
     


  2) profile 但是如果私服不能访问 还可以从中央工厂下载
     注意 中央工厂 可以在 安装目录\lib\maven-model-builder-3.3.9.jar 找到pom-4.0.0.xml里面看到
   
<profiles>
     <profile>
      <id>nexus</id>

      <repositories>
		<repository>
			<id>nexus</id>
                        <name>nexus repository</name>
			<url>私服URL</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories> 
    </profile>  
  
    </profiles>
    <!-- 只有激活才能生效-->
     <activeProfiles>
       <activeProfile>nexus</activeProfile>
      </activeProfiles>

  3) mirror 可以配置只能从中央工厂下载

   
 <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>私服URL</url>
    </mirror>


   注意 这个可能会有问题 本地仓库有插件而私服仓库没有的话 会报错 解决方案
   把下载的本地仓库拷贝到私服仓库中时 需要更新索引(Repair index) 比较慢需要等一会再看 然后重新编译
6 配置发布
   1) pom.xml配置
  
<distributionManagement>
		<repository>
			<id>user-release</id>
			<name>user release respo</name>
			<url>http://127.0.0.1:8081/nexus/content/repositories/releases/</url>
		</repository>
		<snapshotRepository>
			<id>user-snapshot</id>
			<name>user snapshot respo</name>
			<url>http://127.0.0.1:8081/nexus/content/repositories/snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

   2) setting.xml配置发布用户 进行授权
     
<servers>
	<server>
      <id>user-release</id>
      <username>deployment</username>
      <password>deployment123</password>
    </server>
    <id>user-snapshot</id>
      <username>deployment</username>
      <password>deployment123</password>
    </server>
    </servers>

      
  • 大小: 13.3 KB
  • 大小: 10.7 KB
分享到:
评论

相关推荐

    nexus私服服务器

    首先介绍一下背景,公司访问外网有限制,项目组大部分人员不能访问maven的central repository,因此在局域网里找一台有外网权限的机器,搭建nexus私服,然后开发人员连到这台私服上 环境是:nexus-2.1.1、maven-...

    Nexus私服搭建步骤

    Nexus私服搭建步骤,详细教程,自己整理,注意,nexus版本不同,安装方式不同,使用方式一样.

    Linux版maven私服nexus

    Linux版本的Nuxus下载,官网下载不下来

    nexus 搭建maven私服详解

    使用nexus 可以搭建maven私服,如何使用nexus搭建maven 本地服务器呢?

    nexus服务器,maven私服for Linux,兼容最新版

    lunix版,亲测可用,兼容比较稳定,用于搭建jar包的资源库,统一管理jar包版本

    nexus3.19.0-win64.zip

    maven 私服服务器 nexus3 windows版 安装程序,官网直接下载。最新的版本,搭建本地私服maven服务器必备。

    maven私服nexus.war

    maven私有服务器搭建工具nexus的war包,可直接放在如tomcat之类的服务器下部署运行。

    使用Nexus2搭建Maven私服配置说明.doc

    安装Nexus由于服务器为window 2003 x86版本的,不能支持nexus 3.0,下载2.13版本的文件解压到指定文件夹中,加压后nexus文件中包含,两个文件夹:sonatype-work(私服上的文件默认存放路径)和nexus-2.13.0-01...

    Maven私服环境(Nexus)搭建

    私服即私有服务器,是公司内部Maven项目使用的服务器,Nexus是常用的私用Maven服务器

    官网下载的OSS版:nexus-2.15.1-02-bundle.zip

    如果你使用Maven,你可以从Maven中央仓库 下载所需要的构件(artifact),但这通常不是一个好的做法,你应该在本地架设一个Maven仓库服务器,在代理远程仓库的同时维护本地仓库,以节省带宽和时间,Nexus就可以满足...

    nexus3远程搭建maven私服(离线)

    如果安装nexus3.x搭建maven私服,前提需要在Linux服务器安装1.8JDK以及3.xMAVEN版本 1、安装jdk和maven: (1)、下载jdk1.8Linux版本,上传于指定目录下并解压(maven也一样), (2)、执行 vim /etc/profile命令...

    windows和linux下Maven私服nexus-3.27.0-03搭建

    maven私服必备神器,该压缩包包含最新版的nexus安装包,含windows和linux版。 Nexus 是Maven仓库管理器,如果你使用Maven,你可以从Maven中央仓库 下载所需要的构件(artifact),但这通常不是一个好的做法,你应该...

    【nexus二进制库Jar包批量上传脚本工具】

    实现本地库或指定jar包的批量上传nexus二进制库服务器

    maven Nexus私服

    windows版maven Nexus2.14私服服务器,亲试是可以的使用的。。。。。。。。。。。。。

    nexus私服搭建1

    nexus私服搭建1

    Linux版Nexus私服.zip

    Deepin Linux配置私服nexus,Nexus 是Maven仓库管理器,如果你使用Maven,你可以从Maven中央仓库 下载所需要的构件(artifact),但这通常不是一个好的做法,你应该在本地架设一个Maven仓库服务器,在代理远程仓库的...

    Nexus Repository Manager 3.28.1-01

    正常做法是在本地架设一个Maven仓库服务器,即利用Nexus私服可以只在一个地方就能够完全控制访问和部署在你所维护仓库中的每个Artifact。 Nexus在代理远程仓库的同时维护本地仓库,以降低中央仓库的负荷,节省外网...

    用Nexus做Maven私服全攻略

    Nexus是Sonatype推出的强大Maven仓库管理器产品,要比以前TSS上介绍的Artifactory要好使用的多,也是一个拆箱即用的Java App,内嵌Jetty容器和Java Wrapper做Windows服务,安装简单到解压然后双击install即可。...

    使用Nexus添加jar包到私服里的方法步骤

    主要介绍了使用Nexus添加jar包到私服里的方法步骤,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

    window 版本的Nexus的服务器

    window 版本的Nexus2的服务器, maven 私服 nexus2 安装包,该版本的操作比较方便,不会出现3.X版本那种很不熟悉的感觉

Global site tag (gtag.js) - Google Analytics