环境:  eclipse 、maven、nexus。

1、配置setting.xml文件

  1.1、配置本地仓库位置:文件中,存在节点 “localRepository”,默认是注释,也就是本地仓库使用默认地址“Default: ~/.m2/repository”,一般为系统C盘"C:\Users\Administrator\m2",修改本地仓库位置,<localRepository>你想设置的任意目录</localRepository>

  1.2、配置远程服务器连接认证信息,即节点 “server”,一般配置: 

    <server>
<!-- 此处id设置,与pom中distributionManagement中repository元素的id相匹配 -->
<id>releases</id>
    <!--认证用户名 -->
<username>admin</username>
    <!--认证密码-->
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>

  1.3、profile环境配置,此配置可以配置多种信息,如repositories、pluginRepositories、properties等,并可以选择激活的配置信息。

<profile>
<id>jdk-1.7</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.7</jdk>
</activation>
<properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
  </properties>
</profile>

<profile>
  <id>repo</id>
  <activation>
    <activeByDefault>false</activeByDefault>
    <jdk>1.7</jdk>
  </activation>
  <repositories>
    <!--私有库配置-->
    <repository>
      <!--私有库id -->
      <id>nexus</id>
      <!--私有库地址-->
      <url>http://ip:port/nexus/content/groups/public /</url>
      <!--私有库是否支持releases版本-->
      <releases>
        <enabled>true</enabled>
      </releases>
      <!--私有库是否支持snapshots版本-->
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <!--插件库配置,具体含义私有库配置-->
    <pluginRepository>
      <id>nexus</id>
      <url>http://ip:port/nexus/content/groups/public /</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
</profile>

  <!--激活profile -->
  <activeProfiles>
    <!--根据profile的id标签值激活指定的内容-->
    <activeProfile>repo</activeProfile>
  </activeProfiles>

  1.4、项目中pom文件配置 

  <distributionManagement>
<repository>
<id>releases</id>
<name>Internal Releases</name>
<url>http://ip:port/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Internal Snapshots</name>
<url>http://ip:port/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

至此,基本配置完成,在后续的项目deploy过程中,如果项目pom中,version标识类似 “0.0.1-SNAPSHOT”则会部署到私服的snapshots快照版本库,而不带“SNAPSHOT”标识的,则会发布到releases正式库中。

  问题:nexus同版本多次deploy到私服的话,默认是 “Disable Redeploy”-不允许重复,此时需要修改为 “Allow Redeploy”,如图

  

ps:maven插件配置(未完待续。。。) 

maven私服的项目使用配置的更多相关文章

  1. maven私服nexus3.9安装配置

    maven私服nexus3.9安装配置 私服介绍 私服是指私有服务器,是架设在局域网的一种特殊的远程仓库,目的是代理远程仓库及部署第三方构建.有了私服之后,当 Maven 需要下载构件时,直接请求私服 ...

  2. 使用eclipse和maven创建activiti项目基础配置

    项目组最近的项目使用到了activiti工作流,到处查找了一些资料后,初步完成任务.但是我所做的事只是在搭好的环境中调用接口和方法操作,因此自己尝试着也从搭建环境入手,以下是成功实现以后的记录. 实现 ...

  3. IDEA用maven创建springMVC项目和配置

    工具准备:IDEA2016.3 Java jdk 1.8 1.DEA创建项目 新建一个maven project,并且选择webapp原型.  然后点击next  这里的GroupId和Artifac ...

  4. IDEA用maven创建springMVC项目和配置(XML配置和Java配置)

    1.DEA创建项目 新建一个maven project,并且选择webapp原型. 然后点击next 这里的GroupId和ArtifactID随意填写,但是ArtifactID最好和你的项目一名一样 ...

  5. ideal环境maven自动下载项目依赖配置

    开篇序言 最近在使用ideal软件对springboot进行开发研究,中间遇到的环境和创建springboot遇到的问题真是玲琅满目,但是遇到问题就要克服这是万年不变的真理. 该文档会后续不断的补充, ...

  6. maven 私服的setting.xml配置

    <?xml version="1.0" encoding="UTF-8"?> 2 <settings xmlns="http://m ...

  7. 配置maven从自己的私服下载jar包nexus、maven私服仓库(二)

    配置maven项目从私服下载jar包 pom文件配置从maven私服下载jar包 settings文件配置从maven私服下载jar包 (方便自己关键字搜索,所以多写了几行o(* ̄︶ ̄*)o) 今天自 ...

  8. maven私服配置

    1.maven私服setting.xml的配置 <?xml version="1.0" encoding="UTF-8"?> <setting ...

  9. [Gradle系列]Gradle发布module库到jCenter, 并构建自己的企业Maven私服

    Tamic 作者: http://blog.csdn.net/sk719887916/article/details/53224544 前言 andorid开发者经常会看到xx公司发布了xx项目,xx ...

随机推荐

  1. ES6——字符串

    1.多了两个方法       1)startsWith       2)endsWith 2.模板字符串(`..`)—— 方便字符串连接   `反单引号        1)可以直接把表达式塞进去 &a ...

  2. 公私钥,数字证书,https

    1.密钥对,在非对称加密技术中,有两种密钥,分为私钥和公钥,私钥是密钥对所有者持有,不可公布,公钥是密钥对持有者公布给他人的. 2.公钥,公钥用来给数据加密,用公钥加密的数据只能使用私钥解密. 3.私 ...

  3. 动态规划之数字三角形(POJ1163)

    在下面的数字三角形中寻找一条从顶部到底边的路径,使得路径上所经过的数字之和最大.路径上的每一步都只能往左下或 右下走.只需要求出这个最大和即可,不必给出具体路径. 既然求目标问题是根据查表得来的,自然 ...

  4. BZOJ2839 集合计数 二项式反演

    题目传送门 https://lydsy.com/JudgeOnline/problem.php?id=2839 题解 二项式反演板子题. 类似于一般的容斥,我们发现恰好 \(k\) 个不怎么好求,但是 ...

  5. 前端每日实战:65# 视频演示如何用纯 CSS 创作一个摇摇晃晃的 loader

    效果预览 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览.https://codepen.io/comehope/pen/oyJvpe 可交互视频 此视频是可以 ...

  6. springmvc中拦截器配置格式

    对于springmvc,有两种方式配置拦截器. 一是实现HandlerInterceptor接口,如 public class MyInterceptor1 implements HandlerInt ...

  7. kill命令的几种信号

    1 HUP: hangup 2 INIT: 相当于 Ctrl + c 9 KILL 15 TERM: Terminate (kill 的默认信号) 18 CONT: Continue (从STOP信号 ...

  8. Yii2.0基础框架

    前言:最近在用php写一个项目的接口,所以需要学习一下Yii的框架,也在这里记录一下. 整体结构 ssets文件夹:assets的作用是方便模块化,插件化的,一般来说出于安全原因不允许通过url访问p ...

  9. Bootstrap的本地引入

    今天用前端框架时选择了Bootstrap,然后东西都下好了本地就是引入不进去. 查了一下发现必须jquery要在BootStrap之前引入,然后我更改了引入顺序,发现还是不行 <script s ...

  10. Vue响应式原理的实现-面试必问

    Vue2的数据响应式原理 1.什么是defineProperty? defineProperty是设置对象属性,利用属性里的set和get实现了响应式双向绑定: 语法:Object.definePro ...