nexus和maven的安装与配置
如果用普通用户安装就需要创建用户 属组例
groupadd configer //创建用户组
useradd -g configer configer //创建用户并指定用户组
passwd configer //为用户分配密码
cd /opt
mkdir maven #创建maven目录
chown -R configer:configer /opt/maven #属组属主改为普通用户
chmod 755 /opt/maven #修改为755 的 权限
su -l configer #切换到普通用户下 进行操作
我这里是用root用户操作的就不需要以上的操作了
创建存放macen的目录
mkdir -p /newtouch/maven
将软件上传
将软件移到新建的目录里
解压maver的软件
配置maven的环境变量 可以配置/etc/profile 全局的 我配置的是root用户的
vim /root/.bash_profile 在最后加以下几条
export PATH
M2_HOME=/newtouch/maven/apache-maven-3.5.2
export M2_HOME
PATH=$PATH:$M2_HOME/bin
export PATH
申明生效
source /root/.bash_profile
查看一下信息 也可以mvn -v
修改maven的配置文件制定maven的仓库
然后创建指定的目录
mkdir /newtouch/maven/m2
搭建nexus私服
在newtouch目录下创建nexus的目录并将之前移到maven目录先的nexus软件移过来
解压软件
启动nexus 报一下错误是没有指定用户
修改配置文件指定root用户
Vim /newtouch/nexus/nexus-2.12.0-01/bin/nexus(最好不要设为root)
就可以启动
在maven的配置文件中配置
Vim /newtouch/maven/apache-maven-3.5.2/conf/settings.xml
<settings>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central-snapshots</id>
<url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>central-releases</id>
<!-- url原为http://central,指向http://repos.d.xxx.com/nexus/content/groups/public 其中xxx一般为公司名--->
<url>http://localhost:8081/nexus/content/groups/public</url>
<!-- 表示可以从此仓库下载release版本 -->
<releases><enabled>true</enabled></releases>
<!-- 表示不可以从此仓库下载snapshot版本 -->
<snapshots><enabled>false</enabled></snapshots>
</repository>
</repositories>
<!-- 插件仓库 -->
<pluginRepositories>
<pluginRepository>
<id>central-snapshots</id>
<url>http://localhost:8081/nexus/content/groups/public-snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
<pluginRepository>
<id>central-releases</id>
<url>http://localhost:8081/nexus/content/groups/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
<servers>
<server>
<!--配置所有的releases版本构件部署Nexus的releases仓库中-->
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<!--配置所有的snapshot版本构件部署到Nexus的Snapshots仓库中-->
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
</profile>
<!-- 配置activeProfiles后,此处添加snapshots,可以使snapshots被搜索到。-->
</profiles>
<!--添加id,激活profile。-->
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
也可以安装好maven后不修改配置文件在要启动的用户下~/.m2/settings.xml(初始状态下该文件不存在),编辑上面内容就OK
浏览器属ip:8081/nexus 就可以默认用户:admin 密码:admin123
nexus和maven的安装与配置的更多相关文章
- Maven的安装、配置及使用入门
Maven的安装.配置及使用入门 本书代码下载 大家可以从我的网站下载本书的代码:http://www.juvenxu.com/mvn-in-action/,也可以通过我的网站与我取得联系,欢迎大家与 ...
- Maven(1)-安装和配置
Maven(1)-安装和配置 一.本机必须安装好Jdk 二 .maven下载 http://maven.apache.org/download.cgi ,下载后把maven-bin解压到自己的目录即可 ...
- 一.Maven的安装和配置整理
Maven的安装和配置 1.1安装 进入Maven官网的下载页面:http://maven.apache.org/download.cgi选择当前最新版本:" ...
- Java·Maven的安装与配置
阅文时长 | 0.58分钟 字数统计 | 937.6字符 主要内容 | 1.引言&背景 2.Maven的下载与安装 3.Maven全局配置 4.Settings.xml文件的配置 5.远程仓库 ...
- 1.Maven的安装及配置
1 Maven 介绍 Maven这个词可以翻译为“知识的积累”,也可以翻译为“专家”或“内行”.本书将介绍Maven这一跨平台的项目管理工具.作为Apache组织中的一个颇为成功的开源项目,Maven ...
- Maven的安装、配置及使用入门+maven安装报错:JAVA_HOME【申明:来源于网络】
Maven的安装.配置及使用入门+maven安装报错:JAVA_HOME[申明:来源于网络] Maven的安装.配置及使用入门:http://www.cnblogs.com/dcba1112/arch ...
- 【工具学习】——Maven的安装与配置
[含义] 什么是构建? 构建,英文build.构建包括编译.运行.生成文档.打包.部署等等工作内容,如果我们每天手工去干这些事情,那会浪费很多的时间.因此,构建管理工具应运而生. maven,作为项目 ...
- linux ---maven的安装和配置
linux下的maven的安装和配置:本人使用的是apache-maven-3.3.9-bin.tar.gz------安装maven的前提是JDK安装成功:java -version 测试一下--J ...
- Maven的安装与配置(eclipse,idea)
Maven的安装与配置 一.需要准备的东西 1. JDK 2. Maven程序包 3. Eclipse 4. Idea 二.下载与安装 1. 前往https://maven.apache.org/ ...
随机推荐
- Oracle Cursor用法总结
cursor分为三种,一是直接声明为cursor变量,二是首先声明类型再声明变量,三是声明为sys_refcursor. (1)直接声明 declare cursor emp_cur is sele ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(7) - Dataguard Flashback篇
1. 设置备库的闪回目录 show parameter db_recovery_file; NAME TYPE VALUE ------------------------------------ - ...
- JdbcTemplate查询返回JavaBean的几种方法
关于JdbcTemplate的官方描述如下: org.springframework.jdbc.core.JdbcTemplate 大约的讲,将JdbcTemplate返回的list结果集生成Java ...
- 【转】借助System.Linq.Dynamic, IQueryable根据排序字符串排序
在使用Entity Framework时,若有多个排序,需要OrderBy (OrderByDescending)再ThenBy (ThenByDescending) 假设需要根据Name升序排序,再 ...
- Vue 导入excel功能
html: <input type="file" @change="importf(this)" accept=".csv, applicati ...
- kali-rolling安装nessus 7并创建扫描任务教程
一.下载 下载页面:https://www.tenable.com/downloads/nessus 如果自己安装的kali是32位的则选择上边的32位版本下载 二.安装 直接用dpkg安装即可: d ...
- inode占用100%时硬盘无法写入文件故障处理
故障现象: 分区无法写入文件. 故障分析: 执行df -h命令发现空间占用不到50%,执行df -hi,发现某分区IUse%值为99%,说明innode已经用完,应该是某些目录下存在大量的小文件导致. ...
- jquery 操作table样式拖动参考
参考: http://blog.csdn.net/kdiller/article/details/6059727 http://www.jb51.net/article/59795.htm
- jdk8--stream并行流
stream的并行流要理解一个框架如下: 单线程,多线程和并行流对比 package com.atguigu.java8; import java.util.concurrent.ForkJoinPo ...
- UVALive - 6434 (贪心)
题目链接:https://vjudge.net/problem/UVALive-6434 题意:给你n个数字,要你把这n个数字分成m组,每一组的消耗值定义为改组最大值和最小值之差,要求这m组的消耗值总 ...