部署私服 xenus  下载https://www.sonatype.com/download‐oss‐sonatype

我下载了两个版本的nexus:

nexus-3.13.0-01-unix.tar.gz

nexus-3.14.0-04-unix.tar.gz

主要是第一个版本不兼容

配置好jdk环境

 [root@localhost nexus-3.14.0-04]# java -version
 java version "1.8.0_181"
 Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
 Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

解压安装启动

 [root@localhost opt]# tar -xvf nexus-3.14.0-04-unix.tar.gz
 [root@localhost opt]# cd nexus-3.14.0-04
 [root@localhost nexus-3.14.0-04]# sh bin/nexus start
 WARNING: ************************************************************
 WARNING: Detected execution as "root" user.  This is NOT recommended!
 WARNING: ************************************************************
 Starting nexus
 [root@localhost nexus-3.14.0-04]# ss -tanpl |grep 8081  ### 这里启动nexus很慢,需要耐心等几分钟........
 LISTEN     0      50           *:8081                     *:*                   users:(("java",pid=2051,fd=787))
 [root@localhost nexus-3.14.0-04]# ps -ef |grep nexus
 root       2051      1 95 22:10 pts/0    00:00:16 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre/bin/java -server
 -Dinstall4j.jvmDir=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.el7_6.x86_64/jre -Dexe4j.moduleName=/opt/nexus-3.14.0-04/bin/nexus -XX:+UnlockDiagnosticVMOptions -Dinstall4j.launcherId=245 -Dinstall4j.swt=false -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+LogVMOutput -XX:LogFile=../sonatype-work/nexus3/log/jvm.log -XX:-OmitStackTraceInFastThrow -Djava.net.preferIPv4Stack=true -Dkaraf.home=. -Dkaraf.base=. -Dkaraf.etc=etc/karaf -Djava.util.logging.config.file=etc/karaf/java.util.logging.properties -Dkaraf.data=../sonatype-work/nexus3 -Djava.io.tmpdir=../sonatype-work/nexus3/tmp -Dkaraf.startLocalConsole=false -Di4j.vpt=true -classpath /opt/nexus-3.14.0-04/.install4j/i4jruntime.jar:/opt/nexus-3.14.0-04/lib/boot/nexus-main.jar:/opt/nexus-3.14.0-04/lib/boot/org.apache.karaf.main-4.0.9.jar:/opt/nexus-3.14.0-04/lib/boot/org.osgi.core-6.0.0.jar:/opt/nexus-3.14.0-04/lib/boot/org.apache.karaf.diagnostic.boot-4.0.9.jar:/opt/nexus-3.14.0-04/lib/boot/org.apache.karaf.jaas.boot-4.0.9.jar com.install4j.runtime.launcher.UnixLauncher start 9d17dc87   org.sonatype.nexus.karaf.NexusMain
 root       2134   1412  0 22:10 pts/0    00:00:00 grep --color=auto nexus 

访问测试:

ip:8081

 登录账户和密码 ip:8081          admin    admin123

点击设置,进入仓库管理,换国内的阿里云仓库地址

 <mirror>
 <id>nexus-aliyun</id>
 <mirrorOf>*</mirrorOf>
 <name>Nexus aliyun</name>
 <url>http://maven.aliyun.com/nexus/content/groups/public</url>
 </mirror>

将上述http部分复制到下面你的proxy位置代替国外的仓库地址,之后save。

此时去maven的全局配置下配置文件


[root@localhost jeesns]# cd /usr/local/maven/conf
 [root@localhost conf]# ll
 total 16
 drwxr-xr-x. 2 root root    37 Nov 11  2015 logging
 -rw-r--r--. 1 root root 10404 Apr 18 14:31 settings.xml
 -rw-r--r--. 1 root root  3649 Nov 11  2015 toolchains.xml
 [root@localhost conf]# cp settings.xml  settings.xml.bak
 [root@localhost conf]# vim settings.xml #删除了之前的标签
 第一段要添加的内容
 134      <id>my-nexus-releases</id>
 135      <username>admin</username>
 136      <password>admin123</password>
 137      </server>
 138      <server>
 139      <id>my-nexus-snapshot</id>
 140      <username>admin</username>
 141      <password>admin123</password>
 142      </server>
 143   </servers>
 第二段要添加的内容
 157     <mirror>
 158   <id>nexus</id>
 159   <mirrorOf>*</mirrorOf>
 160   <url>http://192.168.171.144:8081/repository/maven-public/</url>
 161   </mirror>
 第三段要添加的内容
 262 <profile>
 263   <id>nexus</id>
 264   <repositories>
 265     <repository>
 266       <id>central</id>
 267       <url>http://192.168.171.145:8081/repository/maven-public/</url>
 268       <releases><enabled>true</enabled></releases>
 269       <snapshots><enabled>true</enabled></snapshots>
 270     </repository>
 271   </repositories>
 272  <pluginRepositories>
 273     <pluginRepository>
 274       <id>central</id>
 275       <url>http://192.168.171.145:8081/repository/maven-public/</url>
 276       <releases><enabled>true</enabled></releases>
 277       <snapshots><enabled>true</enabled></snapshots>
 278     </pluginRepository>
 279   </pluginRepositories>
 280 </profile>
 第四段要添加的内容(激活)
 291 <activeProfiles>
 292 <activeProfile>nexus</activeProfile>
 293 </activeProfiles>

 如果之前有数据就删了,否则创建过程中会失败

 [root@localhost conf]# cd /opt/jeesns
 [root@localhost jeesns]# rm -rf .m2/  ## 删除原来的生成数据
 [root@localhost jeesns]# mvn package
 [INFO] ------------------------------------------------------------------------
 [INFO] Reactor Build Order:
 [INFO]
 [INFO] jeesns
 [INFO] jeesns-core
 [INFO] jeesns-model
 [INFO] jeesns-dao
 [INFO] jeesns-common
 [INFO] jeesns-service
 [INFO] jeesns-web
 [INFO]
 [INFO] ------------------------------------------------------------------------
 [INFO] Building jeesns 1.3
 [INFO] ------------------------------------------------------------------------
 [INFO]
 [INFO] ------------------------------------------------------------------------
 [INFO] Building jeesns-core 1.3
 [INFO] ------------------------------------------------------------------------
 Downloading: http://192.168.171.145:8081/repository/maven-public/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom
 Downloaded: http://192.168.171.145:8081/repository/maven-public/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom (0 B at 0.0 KB/sec)
 maven-public/org/apache/maven/maven-parent/22/maven-parent-22.pom (0 B at 0.0 KB/sec)
 ....................   #####  看地址就知道从自己的服务器上下载数据了
 ..........
 [INFO] jeesns-common ...................................... SUCCESS [  0.113 s]
 [INFO] jeesns-service ..................................... SUCCESS [  0.139 s]
 [INFO] jeesns-web ......................................... SUCCESS [ 23.021 s]
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD SUCCESS
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 31.238 s
 [INFO] Finished at: 2019-04-22T23:21:05+08:00
 [INFO] Final Memory: 13M/32M
 [INFO] ------------------------------------------------------------------------

完成......................

Maven私服nexus的更多相关文章

  1. Centos 基础开发环境搭建之Maven私服nexus

    hmaster 安装nexus及启动方式 /usr/local/nexus-2.6.3-01/bin ./nexus status Centos 基础开发环境搭建之Maven私服nexus . 软件  ...

  2. Ubuntu server下搭建Maven私服Nexus

    Ubuntu server下搭建Maven私服Nexus Maven私服Nexus的作用,主要是为了节省资源,在内部作为maven开发资源共享服务器来使用. 1.下载 通过root用户进去Ubuntu ...

  3. maven私服nexus安装

    maven私服nexus安装 1.nexus特性 1.1.nexus私服实际上是一个javaEE的web 系统 1.2.作用:用来管理一个公司所有的jar包,实现项目jar包的版本统一 1.3.jar ...

  4. Maven私服Nexus的搭建

    # Maven私服Nexus的搭建 ## 私服存在的合理性 Maven中的依赖是从服务器仓库中下载的,Maven的仓库只有两大类: - 1) 本地仓库 - 2) 远程仓库,其中在远程仓库中又分成了3种 ...

  5. maven私服nexus搭建(windows)

    1.下载nexus 地址:https://www.sonatype.com/download-oss-sonatype 下载相应版本的zip包. 2.安装nexus 下载完成后,解压到本地任意目录. ...

  6. maven私服nexus清理释放磁盘空间

    应用背景: 自建的maven私服(或者叫私仓)nexus在使用过程中,因很多服务不断迭代更新上传jar包至nexus中,底层存放在一个叫Blob Stores的存储中,最近发现该存储已增大至好几百G, ...

  7. 持续集成之三:Maven私服Nexus使用

    环境 Red Hat Enterprise Linux Server release 7.3 (Maipo) jdk1.7.0_80 apache-tomcat-7.0.90 mysql-5.7.23 ...

  8. 持续集成之三:搭建Maven私服Nexus

    安装环境 Red Hat Enterprise Linux Server release 7.3 (Maipo) jdk1.7.0_80 apache-tomcat-7.0.90 mysql-5.7. ...

  9. Maven私服Nexus详解

    maven的仓库只有两大类:1.本地仓库 2.远程仓库,在远程仓库中又分成了3种:2.1 中央仓库 2.2 私服 2.3 其它公共库. 私服是一种特殊的远程仓库,它是架设在局域网内的仓库服务,私服代理 ...

  10. Linux下搭建maven私服Nexus 3.2.1-01

    1. 私服介绍私服是指私有服务器,是架设在局域网的一种特殊的远程仓库,目的是代理远程仓库及部署第三方构建.有了私服之后,当 Maven 需要下载构件时,直接请求私服,私服上存在则下载到本地仓库:否则, ...

随机推荐

  1. 记一次Struts2 内核问题分析解决

    问题场景描述 生产环境某个处理耗时比较长的接口,吞吐能力极差.客服反馈此功能长期处于毫无响应状态. 具体表现 系统启动后第一次调用耗时极慢,长时间不响应.紧随之后发起的请求也同时没有响应. 等待第一次 ...

  2. 使用JS在页面进行数据处理时显示等待画面

    使用js在页面进行数据处理期间显示等待画面: 在页面选择执行函数进行数据处理期间,显示等待画面. <script> function fun(the,row_id) { //测试函数 // ...

  3. Maven中阿里云私服配置

    在国内maven仓库连接速度太慢 ,虽然对于很多互联网企业和大中型软件公司,建个镜像是分分钟的事.但对于个人开发者确实是个问题.解决办法可以用阿里云的MAVEN私服.有两种方法: 1.在$MAVEN_ ...

  4. N2N windows下编译安装文件

    n2n安装 n2n原理编译版下载,可直接使用:windows下vpn客户端 n2n_v2_linux_x64 n2n_v2_Win32TAP网卡驱动 #linux环境编译yum install -y ...

  5. memcache集群

    实现memcache集群   一:memcache本身没有redis锁具备的数据持久化功能,比如RDB和AOF都没有,但是可以通过做集群的方式,让各memcache的数据进行同步,实现数据的一致性,即 ...

  6. 【MyBatis-Spring】Mybatis和并入Spring框架

    1.参考书籍:<深入浅出MyBatis技术原理与实战> 2.知识基础:Spring.Mybatis.Spring MVC. 配置数据源 配置SqlSessionFactory SqlSes ...

  7. 构建你的spring boot代码

    Spring boot不需要任何特定的代码布局来工作.然而,有一些最佳实践可以帮助您. 1.避免使用缺省包 当一个类不包含包声明时,它被认为是在“缺省包”中.“默认包”的使用通常是不鼓励的,应该避免. ...

  8. asp.net core部署到iis中出现 HTTP Error 502.5 - Process Failure的问题

    环境是windows Server2012  问题的原因是缺少文件:api-ms-win-crt-runtimel1-1-0.dll, dotnet 启动程序失败. 解决方案1: 安装系统补丁: 20 ...

  9. Gitlab使用时的一些注意事项

    1 gitlab-runner 不选中,在commit没有tab的时候,runner不会进行运行 2 在新安装的gitlab的环境上更改@localhost为远程地址 2.1  vim /opt/gi ...

  10. Paper | 深度网络中特征的可迁移性

    目录 1. 核心贡献 2. 实验设置 2.1. 任务设置 2.2. 网络设置 3. 实验结果 4. 启发 论文:How transferable are features in deep neural ...