如果用普通用户安装就需要创建用户 属组例

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的安装与配置的更多相关文章

  1. Maven的安装、配置及使用入门

    Maven的安装.配置及使用入门 本书代码下载 大家可以从我的网站下载本书的代码:http://www.juvenxu.com/mvn-in-action/,也可以通过我的网站与我取得联系,欢迎大家与 ...

  2. Maven(1)-安装和配置

    Maven(1)-安装和配置 一.本机必须安装好Jdk 二 .maven下载 http://maven.apache.org/download.cgi ,下载后把maven-bin解压到自己的目录即可 ...

  3. 一.Maven的安装和配置整理

    Maven的安装和配置 1.1安装                 进入Maven官网的下载页面:http://maven.apache.org/download.cgi选择当前最新版本:" ...

  4. Java·Maven的安装与配置

    阅文时长 | 0.58分钟 字数统计 | 937.6字符 主要内容 | 1.引言&背景 2.Maven的下载与安装 3.Maven全局配置 4.Settings.xml文件的配置 5.远程仓库 ...

  5. 1.Maven的安装及配置

    1 Maven 介绍 Maven这个词可以翻译为“知识的积累”,也可以翻译为“专家”或“内行”.本书将介绍Maven这一跨平台的项目管理工具.作为Apache组织中的一个颇为成功的开源项目,Maven ...

  6. Maven的安装、配置及使用入门+maven安装报错:JAVA_HOME【申明:来源于网络】

    Maven的安装.配置及使用入门+maven安装报错:JAVA_HOME[申明:来源于网络] Maven的安装.配置及使用入门:http://www.cnblogs.com/dcba1112/arch ...

  7. 【工具学习】——Maven的安装与配置

    [含义] 什么是构建? 构建,英文build.构建包括编译.运行.生成文档.打包.部署等等工作内容,如果我们每天手工去干这些事情,那会浪费很多的时间.因此,构建管理工具应运而生. maven,作为项目 ...

  8. linux ---maven的安装和配置

    linux下的maven的安装和配置:本人使用的是apache-maven-3.3.9-bin.tar.gz------安装maven的前提是JDK安装成功:java -version 测试一下--J ...

  9. Maven的安装与配置(eclipse,idea)

    Maven的安装与配置   一.需要准备的东西 1. JDK 2. Maven程序包 3. Eclipse 4. Idea 二.下载与安装 1. 前往https://maven.apache.org/ ...

随机推荐

  1. windows 系统分布式版本控制 git 使用学习

    1. 在 Windows 上安装 Git 在Windows上使用Git,可以从Git官网直接下载安装程序,(网速慢的同学请移步国内镜像),然后按默认选项安装即可. 安装完成后,在开始菜单里找到“Git ...

  2. CentOS下安装mysql5.7和mysql8.x

    5.7和8.15版本亲测.centos版本为:CentOS-7-x86_64-Minimal-1810. 1.下载mysql57-community-release-el7-9.noarch.rpm. ...

  3. mac navicate 2013 - Lost connection to MySQL server at 'reading initial communication packet

    mac 本地mysql用navicate打开表时遇到如下错误: 2013 - Lost connection to MySQL server at 'reading initial communica ...

  4. Maven常见jar包依赖

    <!-- servlet --> <dependency> <groupId>javax.servlet</groupId> <artifactI ...

  5. 【Java算法】求质数的算法

    计算100以内的质数 1.质数:大于1的整数中,只能被自己和1整除的数为质数. 如果这个数,对比自己小1至2之间的数字,进行求余运算,结果都不等于0,则可以判断该数为质数. public class ...

  6. 内联函数inline的用法

    一.什么是内联函数 在C语言中,如果一些函数被频繁调用,不断地有函数入栈,即函数栈,会造成栈空间或栈内存的大量消耗.为了解决这个问题,特别的引入了inline修饰符,表示为内联函数.  栈空间就是指放 ...

  7. images

  8. tomcat 服务器线程问题

    http://blog.csdn.net/wtopps/article/details/71339295 http://blog.csdn.net/wtopps/article/details/713 ...

  9. oracle sqlserver mysql 通过sql查看表及字段注释

    oracle: SELECT A.TABLE_NAME,A.COMMENTS,B.COLUMN_NAME,B.COMMENTS FROM USER_TAB_COMMENTS A,USER_COL_CO ...

  10. iOS 统一配置

    1 .统一设置nav标题样式: - (void)_setNavigationTitle { NSDictionary *navigationParams = @{NSForegroundColorAt ...