nexus私服主要是在项目和maven中央仓库中间做代理,一般在公司内网或者公司内部的一些私包,都需要这么个产品。下面主要是关于maven和nexus之间的一些配置

1、在pom中配置nexus私服

<!-- jar仓库 -->
<repositories>
<repository>
<id>nexus</id>
<name>nexusRep</name>
<url>http://xxx.74.97.19999:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<!-- 插件库 -->
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>nexusPlugin</name>
<url>http://xxx.74.97.19999:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<profile>
<id>jdk18</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>

2、在当前项目的pom文件做以上配置,仅仅在当前项目中生效,如果想在所有项目中生效,需要在maven的setting.xml文件中进行配置。

<profile>
<id>nexusProfile</id>
<activation>
<jdk>1.8</jdk>
</activation>
<repositories>
<repository>
<id>nexus</id>
<name>nexusRep</name>
<url>http://xxx.74.97.19999:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>nexusPlugin</name>
<url>http://xxx.74.97.19999:8081/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexusProfile</activeProfile>
</activeProfiles>

激活当前配置。

这样就可以使所有的项目都使用自己的nexus私服。但是你会发现还有小部分请求会到maven的中央工厂,解决方法就是配置mirror

<mirror>
<id>nexus</id>
<name>nexus</name>
<mirrorOf>*</mirrorOf>
<url>http://xxx.74.97.19999:8081/nexus/content/groups/public/</url>
</mirror>

这样限制住服务只能通过nexus私服去访问maven中央仓库,如果当前的nexus私服宕机了,那么项目是无法使用maven中央仓库数据的。

3、将项目发送到nexus私服中去

首先在pom中配置发布的地址

<distributionManagement>
<repository>
<id>nexus-rep</id>
<name>nexusRep</name>
<url>http://xxx.74.97.xxx:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snap</id>
<name>nexusSnap</name>
<url>http://xxx.74.97.xxx:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

发布项目还需要授权,这个需要在setting文件中配置

<server>
<id>nexus-rep</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>nexus-snap</id>
<username>deployment</username>
<password>deployment123</password>
</server>

执行mvn:deploy,即可发布。

【maven】之nexus常用的一些配置的更多相关文章

  1. maven 通过nexus创建工厂的配置

    访问中央工厂的地址:http://localhost:8081/nexus/index.html#welcome   admin.admin123 查找到自己配置的maven仓库的位置,编辑setti ...

  2. Maven 插件 maven-tomcat7-plugin - 常用命令及配置

    常用命令 tomcat7:deploy 说明:部署 WAR 到 Tomcat tomcat7:help 说明:查看插件帮助信息 tomcat7:run 说明:支行当前项目 配置 <project ...

  3. (三)Maven基本概念——常用插件的配置

    看注释———— pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http ...

  4. maven 之nexus仓库管理_私服配置

    1.下载nexus私服 下载地址:http://www.sonatype.org/downloads/nexus-latest.war 2.解压 解压以下压缩包 3.配置环境变量 *\nexus-2. ...

  5. Maven仓库Nexus的安装配置

    1.下载nexus,最新版本是nexus-2.8.0-05   参考文章 下载nexus-latest-bundle.zip文件后,并解压到  D:\nexus下 配置nexus的环境变量:先配置NE ...

  6. 配置maven访问nexus,配置项目pom.xml以发布maven项目到nexus中

    maven访问nexus有三种配置方法,分别为: 项目pom.xml,优先级最高: user的settings.xml,优先级中,未在pom.xml中配置repository标签,则使用这个配置: m ...

  7. 【Maven】Nexus配置和使用

    Nexus安装 nexus安装,可以参照:[Maven]Nexus(Maven仓库私服)下载与安装 Nexus简单说明 用途:指定私服的中央地址.将自己的Maven项目指定到私服地址.从私服下载中央库 ...

  8. 配置maven使用nexus

    本文简单介绍使用配置maven使用nexus仓库,在团队中使用nexus,避免每个人都从中央仓库去下载依赖,节省带宽,提高下载速度,同时也减少了中央仓库的压力 配置在maven中使用nexus很简单( ...

  9. Maven仓库管理-Nexus

    Maven仓库管理-Nexus @import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style& ...

随机推荐

  1. UI 增加文本

    1.直接在节点上增加VALUE NODE. 2.写GET,SET,I,P的相关实现 method GET_ZH12. DATA: lr_current TYPE REF TO if_bol_bo_pr ...

  2. windows10下安装mysql-8.0.15-winx64以及连接服务器过程中遇到的一些问题

    一.下载安装配置mysql-8.0.15 1.官网(https://dev.mysql.com/downloads/mysql/)下载zip包 2.解包到我的D:\mysql目录下 3.为mysql配 ...

  3. sql中的limit关键字

    转载于:https://blog.csdn.net/benweizhu/article/details/7892788 一.基本 SQL的limit语法的如以下形式 SELECT * FROM tab ...

  4. LL(1),LR(0),SLR(1),LR(1),LALR(1)的 联系与区别

    一:LR(0),SLR(1),规范LR(1),LALR(1)的关系     首先LL(1)分析法是自上而下的分析法.LR(0),LR(1),SLR(1),LALR(1)是自下而上的分析法.       ...

  5. 将SD卡的音频设置为手机铃声后删除,手机铃声没有恢复到默认的问题

    1. Android7.0,将存储卡中MP3设置为铃声,删除该MP3后,settings中的铃声没有变化,来电铃声也没有变化. 原因:android7.0的新特性 google 默认如此设计,在选择铃 ...

  6. ubuntu 安装 nvm 管理Node.js 以及vim 插件增强

    安装curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bashsource ~/.bashr ...

  7. Linux分区知识及企业场景分区76

    文件系统就相当于装修一样.这个硬盘拿过来了,分完区了,没有格式化. 没有格式化就相当于没有装修.[分区]不是必须的. 如果没有文件系统就不能放数据,文件系统可以理解为一个软件, 它的实现形式是软件,这 ...

  8. 导入maven项目导入依赖不会报错,但使用的jar会标红

    方法1: 1.通过编译找到报错的jar; 2.在 repository找到此jar,一般未下载完大小为1k我的是这样(); 3.删除未下载完全的jar,在项目上执行maven reimport会重新下 ...

  9. 【草稿】实验室新手HandBook

    PS:本文旨在给初入CV领域实验室的新手一个可供参考的学习列表,使得能够快速熟悉常用且必要的工具.

  10. 云南-第一个应用节点-ssh登录-卡顿的问题

    云南电信,从管理节点ssh连接到第一个应用节点,出现延迟卡顿的问题,解决方法:   systemctl restart systemd-logind.service   附: 操作系统类型: SLES ...