下载安装

下载地址

改动默认端口:

home\conf\nexus.properties

# Sonatype Nexus
# ==============
# This is the most basic configuration of Nexus. # Jetty section
application-port=9080
application-host=0.0.0.0
nexus-webapp=${bundleBasedir}/nexus
nexus-webapp-context-path=/nexus # Nexus section
nexus-work=${bundleBasedir}/../sonatype-work/nexus
runtime=${bundleBasedir}/nexus/WEB-INF

安装与启动

home\bin\nexus.bat

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd29iZW5kaWFua3Vu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />

登录

http://localhost:9080/nexus

用户名、密码:admin/admin123

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd29iZW5kaWFua3Vu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />

仓库说明

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd29iZW5kaWFua3Vu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />

索引:

有些远程仓库拥有索引。下载其索引后,即使没有缓存远程仓库的jar包,我们也能够在本地搜索jar包的信息

手动更新索引

下载索引包

停止服务

删除 nexus-2.0.3-bundle\sonatype-work\nexus\indexer\central-ctx 下的索引

将下载索引包的全部内容拷贝到 nexus-2.0.3-bundle\sonatype-work\nexus\indexer\central-ctx ,重新启动服务且又一次登陆

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd29iZW5kaWFua3Vu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />

查看索引

搜索服务

设置镜像

  <mirrors>
<mirror>
<id>mirrorId</id>
<mirrorOf>*</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://localhost:9080/nexus/content/groups/public/</url>
</mirror>
</mirrors>

当设置 mirrorOf 为 "*" 时,pom.xml中仓库是能够不用配置了

项目中增加新的依赖,将从私服中下载

		<dependency>
<groupId>com.demo.test</groupId>
<artifactId>test-b</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

项目部署及远程仓库认证

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.demo.test</groupId>
<artifactId>test-c</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <name>test-c</name>
<url>http://maven.apache.org</url> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency> <dependency>
<groupId>com.demo.test</groupId>
<artifactId>test-a</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency> <dependency>
<groupId>com.demo.test</groupId>
<artifactId>test-d</artifactId>
<version>0.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.demo.test</groupId>
<artifactId>test-b</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency> <dependency>
<groupId>abbot</groupId>
<artifactId>abbot</artifactId>
<version>0.12.3</version>
</dependency>
</dependencies> <!-- 部署 -->
<distributionManagement>
<!-- 公布版布置仓库 -->
<repository>
<id>test-c release</id>
<name>Test-c Release</name>
<url>http://localhost:9080/nexus/content/repositories/releases/</url>
</repository>
<!-- 快照版布置仓库 -->
<snapshotRepository>
<id>test-c snapshot</id>
<name>Test-c Snapshot</name>
<url>http://localhost:9080/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement> </project>

部署配置

	<!-- 部署 -->
<distributionManagement>
<!-- 公布版布置仓库 -->
<repository>
<id>test-c release</id>
<name>Test-c Release</name>
<url>http://localhost:9080/nexus/content/repositories/releases/</url>
</repository>
<!-- 快照版布置仓库 -->
<snapshotRepository>
<id>test-c snapshot</id>
<name>Test-c Snapshot</name>
<url>http://localhost:9080/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

仓库认证

settings.xml

	<servers>
<server>
<id>test-c release</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>test-c snapshot</id>
<username>deployment</username>
<password>deployment123</password>
</server>
</servers>

执行命令

mvn clean deploy

登录私服查看结果

快照版本号:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd29iZW5kaWFua3Vu/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />

项目构建之maven篇:5.仓库及nexus创建私服-2的更多相关文章

  1. 项目构建之maven篇:2.HelloWorld项目构建过程

    文件结构说明: 项目构建生命周期: 清理 编译 測试 打包 执行 部署 清理与编译 hello\pom.xml POM:Project Object Model,项目对象模型 pom.xml与ant的 ...

  2. 项目构建之maven篇:6.生命周期与插件

    项目生命周期 清理 初始化 编译 測试 打包 部署 三套生命周期 1.clean pre-clean 运行一些须要在clean之前完毕的工作 clean 移除全部上一次构建生成的文件 post-cle ...

  3. 项目构建之maven篇:1.环境搭建

    maven下载: 下载地址 环境变量设置 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvd29iZW5kaWFua3Vu/font/5a6L5L2T/fon ...

  4. 项目构建之maven篇:3.m2eclipse使用

    m2eclipse的安装 略 设置maven文件夹 设置用户个性化的maven配置 导入mavenproject 源码下载 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkb ...

  5. Java项目工程化之项目构建工具Maven

    欢迎查看Java开发之上帝之眼系列教程,如果您正在为Java后端庞大的体系所困扰,如果您正在为各种繁出不穷的技术和各种框架所迷茫,那么本系列文章将带您窥探Java庞大的体系.本系列教程希望您能站在上帝 ...

  6. 07 Maven 使用Nexus创建私服

    7. Maven 使用Nexus创建私服 私服不是 Maven 的核心概念,它仅仅是一种衍生出来的特殊的 Maven 仓库.通过建立自己的私服,就可以降低中央仓库负荷.节省外网带宽.加速 Maven ...

  7. 项目构建工具maven的使用方法

    最近在开发javaweb项目中有用到maven,以前并不是很了解,于是学习了一些相关内容,记之共享. 本篇内容在Windows环境下实施,JDK版本使用的1.7.0_79. 一.maven是什么? 简 ...

  8. 走进JavaWeb技术世界12:从手动编译打包到项目构建工具Maven

    小李的Build之路(上) 转自: 刘欣 码农翻身 2016-07-10 摘要:手工Build的烦恼要不是为了和女朋友留在一个城市,小李肯定去北上广奋斗去了.现在他只能留在这个2.5线城市,进入这家软 ...

  9. java项目构建工具Maven

    一.java-maven常用命令 mvn archetype:create 创建Maven项目 mvn compile 编译源代码 mvn deploy 发布项目 mvn test-compile 编 ...

随机推荐

  1. Dll重定向(尚存否?)

    windows核心编程(第五版)的20.6节介绍了Dll重定向. 0x01  Dll重定向简介 产生Dll重定向原因: 应用程序 a.exe 依赖动态链接库 compoent.dll 1.0 版本.但 ...

  2. 对FPGA的时钟资源理解(更新中)

    7系列FPGA中包含了多达24个CMT(时钟管理单元)(实际上V7常见只有20个),MMCM和PLL均为时钟综合器,对外部输入时钟.内部时钟进行处理,生成需要的低抖动时钟.PLL是MMCM的功能子集, ...

  3. mabatis学习(四)----解决字段名与实体类属性名不同的冲突

    在项目开发中,数据库中的字段名不一定和实体类的类名完全相同(当然大小写忽略),那么就可以在sql映射文件中解决此问题 一.创建需要的数据库和表 编写sql脚本,在navicat for mysql中执 ...

  4. 全栈框架mk-js

    今天听朋友说,才知道原来还有全栈框架这么一说. 厉害了. meteor EggBorn.js mk-js cordova 记录下,后面研究研究.

  5. PCP项目立项

    1.需求分析 现如今已经进入互联网时代,无论是工作还好娱乐都已经离不开互联网,与此同时,网络相关的问题也时不时的侵扰着我们,这需要我们具有一定网络相关知识来解决相关问题,而这时,一款工作便利,免费的网 ...

  6. Linux 配置selenium + webdriver 环境

    1.ubuntu 自带了python, 可以打开终端输入python 回车后如果显示版本信息就说明已经安装 2.安装安装python setup tools apt-get install pytho ...

  7. <Dr.Elephant><How to tune ur application>

    Why Dr.Elephant? Most of Hadoop optimization tools out there, but they are focused on simplifying th ...

  8. 引用google字体

    1.很简单直接   @import url(http://fonts.font.im/css?family=Shadows+Into+Light);  引入页面即可 2. 使用:  font-fami ...

  9. SpringBoot Maven项目 Helloworld 测试

    SpringBoot 化繁为简,简化配置 SpringBoot官方:http://projects.spring.io/spring-boot/SpringBoot使用介绍:http://blog.c ...

  10. Python学习笔记第十九周

    目录: 一.路由系统URL 1.Django请求生命周期 2.创建Django project 3.配置 4.编写程序 二.视图 三.模板 四.ORM操作 内容: 一.URL 1.Django请求生命 ...