linux部署安装maven私有库
1、先安装好jdk
2、下载sonatype Nexus
下载地址:
3、在linux根目录下创建文件夹
# mkdir nexus
4、将安装包上传至linux系统上
上传至nexus文件夹内
# cd /nexus
5、解压Nexus
# tar zxvf nexus-2.14.2-01-bundle.tar.gz
6、会解压出2个文件夹
nexus-2.14.2-01(nexus服务,启动也是这个)
sonatype-work(私有库目录)
7、配置一下Nexus端口和启动参数
# cd /nexus/nexus-2.14.2-01/conf
# vi nexus.properties
[root@localhost conf]# vi nexus.properties ## Sonatype Nexus (TM) Open Source Version# Copyright (c) 2008-present Sonatype, Inc.# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.## This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.## Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the# Eclipse Foundation. All other trademarks are the property of their respective owners.## Sonatype Nexus# ==============# This is the most basic configuration of Nexus.# Jetty sectionapplication-port=8081application-host=0.0.0.0nexus-webapp=${bundleBasedir}/nexusnexus-webapp-context-path=/nexus# Nexus sectionnexus-work=${bundleBasedir}/../sonatype-work/nexusruntime=${bundleBasedir}/nexus/WEB-INF# orientdb buffer size in megabytesstorage.diskCache.bufferSize=4096
application-port=8081(启动后访问的端口号,可以自行修改)
application-host=0.0.0.0(访问限制,0.0.0.0表示任何地址都可以访问)
我们保持默认不变,继续。。。
8、编辑nexus脚本,配置启动角色
# vi /nexus/nexus-2.14.2-01/bin/nexus
默认是下面这一条:
# RUN_AS_USER=
修改成:
RUN_AS_USER=root
9、linux防火墙打开8081端口:
# vi /etc/sysconfig/iptables
添加一条:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8081 -j ACCEPT
重启防火墙:
# service iptables restart
10、启动nexus
# /nexus/nexus-2.14.2-01/bin/nexus start
11、访问Nexus
访问地址:
Nexus刚启动的时候,有默认的帐号和密码,如果有需要可以自己去改
帐号:admin
密码:admin123
12、配置maven连接Nexus私有库
(maven安装和配置这里不详细介绍了)
首先配置一下maven本地库位置:
贴一下settings_dubbo.xml配置文件
D:/apache-maven-3.3.9/.m2/repository true false org.mortbay.jetty org.jenkins-ci.tools nexus-releases deployment deployment123 nexus-snapshots deployment deployment123 edu false 1.7 nexus http://192.168.226.130:8081/nexus/content/groups/public/ true true nexus http://192.168.226.130:8081/nexus/content/groups/public/ true true edu
上面配置完成之后,在配置一下eclipse里面的pom文件
nexus-releases Nexus Release Repository http://192.168.226.130:8081/nexus/content/repositories/releases/ nexus-snapshots Nexus Snapshot Repository http://192.168.226.130:8081/nexus/content/repositories/snapshots/
13、配置完成之后,开始使用Nexus私有库吧