---------------------nexus----------------------

1、编辑nexus脚本, 配置 RUN_AS_USER 参数
vi /usr/local/src/nexus2/nexus-2.12.0-01/bin/nexus
#NEXUS_HOME=".." 改为:NEXUS_HOME="/usr/local/src/nexus2/nexus-2.12.0-01"
#RUN_AS_USER= 改为: RUN_AS_USER=root

2、修改JDK:
vi /home/nexus/nexus-2.12.0-01/bin/jsw/conf/wrapper.conf

wrapper.java.command=/usr/local/src/java/jdk1.7.0_51/bin/java

3、打开8081端口
a)/sbin/iptables -I INPUT -p tcp --dport 8081 -j ACCEPT

保存
b)/etc/rc.d/init.d/iptables save

查看端口打开
c)/etc/init.d/iptables status

4、启动 nexus
/usr/local/src/nexus2/nexus-2.12.0-01/bin/nexus start

5、设置开机启动(在/usr/local/src/nexus2/nexus-2.12.0-01/bin路径下)
cp nexus /etc/rc.d/init.d/

cd /etc/rc.d/init.d/

chkconfig --add nexus
chkconfig --list | grep nexus
chkconfig nexus on
chkconfig --list | grep nexus

6、执行如下命令启动、停止nexus服务
# service nexus start
# service nexus stop

------------------------maven-----------------------

1、解压maven 文件
tar -xvf apache-maven-3.3.9-bin.tar.gz

2、配置maven的环境变量
vim /etc/profile
export MAVEN_HOME=/usr/local/src/maven
export PATH=$PATH:$MAVEN_HOME/bin

3、使文件生效
source /etc/profile

4.测试maven是否安装成功
mvn -version

5、配置与Maven使用私服
a) linux在路径{maven_home}/conf settings.xml 文件中,
为所有仓库配置一个镜像仓库,镜像仓库的地址即私服的地址

b) windows在c盘用户.m2 settings.xml文件中,
为所有仓库配置一个镜像仓库,镜像仓库的地址即私服的地址

6、配置本地仓库(settings.xml)
<localRepository>E:\wangfg\repo</localRepository>

7、配置nexus maven针对私有项目

a) settings.xml文件
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>

b) pom文件
<!-- 自动发布构件到远程仓库-->
<distributionManagement>
<repository>
<id>nexus</id><!--这个ID需要与你的release仓库的Repository ID一致-->
<url>http://192.168.162.93:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>nexus</id><!--这个ID需要与你的snapshots仓库的Repository ID一致-->
<url>http://192.168.162.93:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<!-- 配置Maven从Nexus下载构件 -->
<repositories>
<repository>
<id>nexus</id>
<name>Team Maven Repository</name>
<url>http://192.168.162.93:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

8、配置通用nexus maven(settings.xml)
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</server>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>nexus</id>
<url>http://nexus-releases</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<url>http://nexus-releases</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>

linux 安装配置nexus以及maven私服应用的更多相关文章

  1. Linux下使用Nexus搭建Maven私服

    在开发过程中,有时候会使用到公司内部的一些开发包,显然把这些包放在外部是不合适的.另外,由于项目一直在开发中,这些内部的依赖可能也在不断的更新.可以通过搭建公司内部的Maven服务器,将第三方和内部的 ...

  2. Maven学习二:使用Nexus搭建Maven私服及相关配置

    处于安全等原因的考虑,一些企业内部网络是不允许访问外部网络的,但是项目内部搭建的项目又是Maven架构,这样就需要企业在内部网络中搭建自己的Maven仓库服务,再者一些大型企业或者内部模块化组件化划分 ...

  3. 配置maven从自己的私服下载jar包nexus、maven私服仓库(二)

    配置maven项目从私服下载jar包 pom文件配置从maven私服下载jar包 settings文件配置从maven私服下载jar包 (方便自己关键字搜索,所以多写了几行o(* ̄︶ ̄*)o) 今天自 ...

  4. 配置Nexus为maven的私服

    1.配置Nexus为maven的私服 第一种方式:在项目的POM中如下配置 <repositories> <repository> <id>nexus_public ...

  5. Maven-004-使用 Nexus 搭建 maven 私服

    从去年至今,自己一直在学习自动化测试工具,想利用自动化工具尽可能的将重复的.关键的.耗时耗力的工作实现自动化,减轻日常测试工作,提升测试效率.在学习的过程中,将 maven 作为了项目开发管理工具,进 ...

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

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

  7. 使用Nexus搭建Maven私服问题总结

    #业务场景 最近项目要交付给客户了,之前项目开发和测试一直都是使用公司内部的一套环境,项目交付后客户购置了大量服务器,也要将整套测试环境迁移至客户的服务器上,后续的需求变更以及新需求的开发都会在客户服 ...

  8. nexus搭建maven私服及私服jar包上传和下载

    nexus搭建maven私服及私服jar包上传和下载 标签: nexus管理maven库snapshot 2017-06-28 13:02 844人阅读 评论(0) 收藏 举报 分类: Maven(1 ...

  9. nexus 搭建 maven 私服

    nexus 搭建 maven 私服 本机环境 Win 8 JDK 7 Maven 3.2 Nexus 2.11 版本选择 http://www.sonatype.org/nexus/archivedn ...

随机推荐

  1. fastjson序列化乱序问题

    1.初始化为有序json对象 JSONObject jsonOrdered= new JSONObject(true); 2.将String对象转换过程中,不要调整顺序 JSONObject json ...

  2. git stash命令详解

    git stash命令用于将更改储藏在脏工作目录中. 使用语法 git stash list [<options>] git stash show [<stash>] git ...

  3. 关于IP,这里有你想知道的一切!

    关于IP,这里有你想知道的一切! 原创: 同盾反欺诈研究院 先知安全技术社区 2017-07-13 今日,就来跟大家聊聊关于IP地址方方面面的研究,其实可以归到三个问题上: 1.这个IP在哪儿? 2. ...

  4. Grafana数据可视化

    1.1 Grafana简介 1.1.1 Grafana是什么? 一个类似Kibana的东西,也是对后端的数据进行实时展示,那么Grafana和Kibana有什么区别?在我看来区别不大,不过在大家的日常 ...

  5. yarn upgrade

    更新一个依赖 yarn upgrade 用于更新包到基于规范范围的最新版本 yarn upgrade --latest # 忽略版本规则,升级到最新版本,并且更新 package.json .

  6. PHP异步扩展Swoole笔记(2)

    dispatch_mode, 数据包分发策略 可以选择7种类型,默认为21,轮循模式,收到会轮循分配给每一个Worker进程2,固定模式,根据连接的文件描述符分配Worker.这样可以保证同一个连接发 ...

  7. 删除 nuget 文件夹内容

    vs2017 ->工具->选项->NuGet 包管理器->清除所有NuGet缓存

  8. WCF Restful Service Get / Post请求

    Rest 它是用于创建分布式超文本媒体的一种架构方式,我们可以通过标准的HTTP(GET,POST,PUT,DELETE)操作来构建基于面向资源的软件架构方式(Resource-Oriented Ar ...

  9. csproj文件中copy指令的使用方式

    实际开发中有很多项目需要引用第三方的dll或者资源文件,且文件比较多,在运行时这些文件需要被拷贝到BIN目录. 使用VS自带的"复制到输出目录",似然方便,但是比较不零活,经过多次 ...

  10. 如何在宿主机上查看kvm虚拟机的IP

    # arp -a ? (:3c:ce::f2: [ether] on br0 gateway (:c8:ac:d5 [ether] on br0 ? (:d4:fc: [ether] on br0 ? ...