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. 使用nginx作为webservice接口代理

    通常情况下,企业并不会直接开放系统接口给到外网,并且在企业内部同样有SOA或者ESB这样的接口统一管理的工具. 那么,大多数情况下,如果需要与外部系统,如云系统,或者其他企业的系统做接口时采取的方式如 ...

  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. Python字符编码的发展、cmd寻找路径

    字符编码的发展: ASCII(American Standard Code for Information Interchange,美国标准信息交换代码)是基于拉丁字母的一套电脑编码系统,主要用于显示 ...

  4. day35-python 操作memcache一

    memcache简介 Memcached是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象减少读取数据库的次数,从而提高动态.数据库驱动网站的速度. ...

  5. python全局变量

    定义函数里面的叫局部变量,出了函数外面就不能用了 局部变量函数被调用时,他的变量才生效 局部变量定义在内存里面,用完就会被释放,全局变量不会释放 当有相同名的局部变量和全局变量,函数会先找自己的变量, ...

  6. vuex实现原理

    一.Store的层次结构 Store,负责管理整个数据访问.修改等: 提高API: State,数据结构: 所有的getters.mutations,全部都注册到store里:结构大概是: { 'xx ...

  7. 进程管理02 通过PEB枚举进程所有模块

    0x01  结构探究 先在win7 x86下通过windbg来探究通过peb来得到进程模块的步骤: 命令!process 0 0 exeplorer.exe 先获取到explorer.exe的EPRO ...

  8. delete 与 delete []

    /* Module: delete与delete[]的区别.cpp Notices: Copyright (c) 2017 Landy Tan */ #include <iostream> ...

  9. wpf UI 布局

    1.Grid *号代表百分比,也可以使用固定值,需要预先设置 有几行几列 以及宽度和高度 ,在表格中的控件需要 表明自己所在第几行 第几列 2.StackPanel 重点需要设置 排列方向 水平还是垂 ...

  10. Python 事件

    from multiprocessing import Process,Event e = Event() #创建事件对象,这个对象的初识状态为False print('e的状态是:',e.is_se ...