【maven】之nexus常用的一些配置
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常用的一些配置的更多相关文章
- maven 通过nexus创建工厂的配置
访问中央工厂的地址:http://localhost:8081/nexus/index.html#welcome admin.admin123 查找到自己配置的maven仓库的位置,编辑setti ...
- Maven 插件 maven-tomcat7-plugin - 常用命令及配置
常用命令 tomcat7:deploy 说明:部署 WAR 到 Tomcat tomcat7:help 说明:查看插件帮助信息 tomcat7:run 说明:支行当前项目 配置 <project ...
- (三)Maven基本概念——常用插件的配置
看注释———— pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http ...
- maven 之nexus仓库管理_私服配置
1.下载nexus私服 下载地址:http://www.sonatype.org/downloads/nexus-latest.war 2.解压 解压以下压缩包 3.配置环境变量 *\nexus-2. ...
- Maven仓库Nexus的安装配置
1.下载nexus,最新版本是nexus-2.8.0-05 参考文章 下载nexus-latest-bundle.zip文件后,并解压到 D:\nexus下 配置nexus的环境变量:先配置NE ...
- 配置maven访问nexus,配置项目pom.xml以发布maven项目到nexus中
maven访问nexus有三种配置方法,分别为: 项目pom.xml,优先级最高: user的settings.xml,优先级中,未在pom.xml中配置repository标签,则使用这个配置: m ...
- 【Maven】Nexus配置和使用
Nexus安装 nexus安装,可以参照:[Maven]Nexus(Maven仓库私服)下载与安装 Nexus简单说明 用途:指定私服的中央地址.将自己的Maven项目指定到私服地址.从私服下载中央库 ...
- 配置maven使用nexus
本文简单介绍使用配置maven使用nexus仓库,在团队中使用nexus,避免每个人都从中央仓库去下载依赖,节省带宽,提高下载速度,同时也减少了中央仓库的压力 配置在maven中使用nexus很简单( ...
- Maven仓库管理-Nexus
Maven仓库管理-Nexus @import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style& ...
随机推荐
- edu30F. Forbidden Indices
题意:给你一个字符串s有一些位置被ban了,字符串t的价值是|t|*t在s中出现次数而且终点没有被ban.问你最大的价值是多少 题解:很明显t是s子串,建个sam,对于sam中每个位置,我们需要删除中 ...
- 92. Reverse Linked List II 反转链表 II
网址:https://leetcode.com/problems/reverse-linked-list-ii/ 核心部分:通过a.b.c三个变量之间的相互更新,不断反转部分链表 然后将反转部分左右两 ...
- js 数组的pop(),push(),shift(),unshift()方法小结
关于数组的一些操作方法小结: pop(),push(),shift(),unshift()四个方法都可改变数组的内容以及长度: 1.pop() :删除数组的最后一个元素,并返回被删除的这个元素的值: ...
- Oracle获取当前年、月、日的方法
Oracle获取当前年.月.日的方法 Oracle 获取当前年.月.日 1.//oracle中extract()函数从oracle 9i中引入,用于从一个date或者interval类型中截取到特定的 ...
- Mysql 监控脚本
cat mysql_status_output.py #coding=utf-8import jaydebeapiimport sysimport pymysqlimport osfrom prome ...
- 定义一个Collection接口类型的变量,引用一个Set集合的实现类,实现添加单个元素, 添加另一个集合,删除元素,判断集合中是否包含一个元素, 判断是否为空,清除集合, 返回集合里元素的个数等常用操作。
package com.lanxi.demo2; import java.util.HashSet; import java.util.Iterator; import java.util.Set; ...
- numpy.where() 用法详解
numpy.where (condition[, x, y]) numpy.where() 有两种用法: 1. np.where(condition, x, y) 满足条件(condition),输出 ...
- word转换成HTML 以及IE不兼容问题
public static bool WordToHtml(string wordFileName, string htmlFileName) { try { Object oMissing = Sy ...
- grep语法2
grep 参数 -n :显示行号-o :只显示匹配的内容-q :静默模式,没有任何输出,得用$?来判断执行成功没有,即有没有过滤到想要的内容 -l :如果匹配成功,则只将文件名打印出来,失败则 ...
- xpath提取到的中文乱码时的解决办法
βҳ转换为正常的中文: