nexus3中央仓库改为阿里云/

参考:这里写链接内容 
找到中央仓库

然后修改成: 

http://maven.aliyun.com/nexus/content/groups/public/
 
  • 1

idea使用私服maven及对应配置

参考: 
这里写链接内容

首先,新建一个maven项目—自己新建吧。

然后, 

看到本机的maven 配置文件, 

打开来,然后: 
 
添加我们的maven私服及servers—用来发布类库的。

格式如下:

  1.  
    <?xml version="1.0" encoding="UTF-8"?>
  2.  
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  3.  
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.  
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  5.  
    <mirrors>
  6.  
    <!--内部maven-->
  7.  
    <mirror>
  8.  
    <id>central</id>
  9.  
    <mirrorOf>*</mirrorOf>
  10.  
    <name>Central Repository</name>
  11.  
    <url>http://你仓库的地址/repository/maven-public/</url>
  12.  
    </mirror>
  13.  
    <!-- 阿里云仓库 -->
  14.  
    <mirror>
  15.  
    <id>alimaven</id>
  16.  
    <mirrorOf>central</mirrorOf>
  17.  
    <name>aliyun maven</name>
  18.  
    <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
  19.  
    </mirror>
  20.  
     
  21.  
    <!-- 中央仓库1 -->
  22.  
    <mirror>
  23.  
    <id>repo1</id>
  24.  
    <mirrorOf>central</mirrorOf>
  25.  
    <name>Human Readable Name for this Mirror.</name>
  26.  
    <url>http://repo1.maven.org/maven2/</url>
  27.  
    </mirror>
  28.  
     
  29.  
    <!-- 中央仓库2 -->
  30.  
    <mirror>
  31.  
    <id>repo2</id>
  32.  
    <mirrorOf>central</mirrorOf>
  33.  
    <name>Human Readable Name for this Mirror.</name>
  34.  
    <url>http://repo2.maven.org/maven2/</url>
  35.  
    </mirror>
  36.  
    </mirrors>
  37.  
    <servers>
  38.  
    <server>
  39.  
    <id>nexus-releases</id>
  40.  
    <username>admin</username>
  41.  
    <password>你的密码</password>
  42.  
    </server>
  43.  
    <server>
  44.  
    <id>nexus-snapshots</id>
  45.  
    <username>admin</username>
  46.  
    <password>你的密码</password>
  47.  
    </server>
  48.  
    </servers>
  49.  
    </settings>

发布快照及正式版本

maven(15),快照与发布,RELEASE与SNAPSHOT

在pom.xml文件最后添加distributionManagement发布管理节点:

例如:

  1.  
    <distributionManagement>
  2.  
    <repository>
  3.  
    <id>nexus-releases</id>
  4.  
    <name>Nexus Release Repository</name>
  5.  
    <url>http://你的maven地址/repository/maven-releases/</url>
  6.  
    </repository>
  7.  
    <snapshotRepository>
  8.  
    <id>nexus-snapshots</id>
  9.  
    <name>Nexus Snapshot Repository</name>
  10.  
    <url>http://你的maven地址/repository/maven-snapshots/</url>
  11.  
    </snapshotRepository>
  12.  
    </distributionManagement>
  • 注意一下
  1.  
    <groupId>net.funfunle</groupId>
  2.  
    <artifactId>baselib</artifactId>
  3.  
    <!--<version>1.0-SNAPSHOT</version>-->
  4.  
    <version>1.0.1-RELEASE</version>

groupid这些,

  1.  
    <groupId>net.funfunle</groupId>
  2.  
    <artifactId>baselib</artifactId>
  3.  
    <!--<version>1.0-SNAPSHOT</version>-->
  4.  
    <version>1.0.1-RELEASE</version>

决定发布的是正式版本release还是快照snapshot的是

  1.  
    <!--<version>1.0-SNAPSHOT</version>-->
  2.  
    <version>1.0.1-RELEASE</version>

版本号及发布类型,有一点也需要注意,snapshot快照允许重复发布更新同一个版本,而release是不允许的,release每次发布版本号都要加的。

发布方式: 

在mavenproject点击发布deploy。

新项目中引用发布的类库

maven2获取最新版本方式。

这里写链接内容 
maven pom文件详解

maven3获取最新版本方式 
这里写链接内容

  1.  
    Now I know this topic is old, but reading the question and the OP supplied answer it seems the Maven Versions Plugin might have actually been a better answer to his question:
  2.  
     
  3.  
    In particular the following goals could be of use:
  4.  
     
  5.  
    versions:use-latest-versions searches the pom for all versions which have been a newer version and replaces them with the latest version.
  6.  
    versions:use-latest-releases searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the latest release version.
  7.  
    versions:update-properties updates properties defined in a project so that they correspond to the latest available version of specific dependencies. This can be useful if a suite of dependencies must all be locked to one version.
  8.  
    The following other goals are also provided:
  9.  
     
  10.  
    versions:display-dependency-updates scans a project's dependencies and produces a report of those dependencies which have newer versions available.
  11.  
    versions:display-plugin-updates scans a project's plugins and produces a report of those plugins which have newer versions available.
  12.  
    versions:update-parent updates the parent section of a project so that it references the newest available version. For example, if you use a corporate root POM, this goal can be helpful if you need to ensure you are using the latest version of the corporate root POM.
  13.  
    versions:update-child-modules updates the parent section of the child modules of a project so the version matches the version of the current project. For example, if you have an aggregator pom that is also the parent for the projects that it aggregates and the children and parent versions get out of sync, this mojo can help fix the versions of the child modules. (Note you may need to invoke Maven with the -N option in order to run this goal if your project is broken so badly that it cannot build because of the version mis-match).
  14.  
    versions:lock-snapshots searches the pom for all -SNAPSHOT versions and replaces them with the current timestamp version of that -SNAPSHOT, e.g. -20090327.172306-4
  15.  
    versions:unlock-snapshots searches the pom for all timestamp locked snapshot versions and replaces them with -SNAPSHOT.
  16.  
    versions:resolve-ranges finds dependencies using version ranges and resolves the range to the specific version being used.
  17.  
    versions:use-releases searches the pom for all -SNAPSHOT versions which have been released and replaces them with the corresponding release version.
  18.  
    versions:use-next-releases searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the next release version.
  19.  
    versions:use-next-versions searches the pom for all versions which have been a newer version and replaces them with the next version.
  20.  
    versions:commit removes the pom.xml.versionsBackup files. Forms one half of the built-in "Poor Man's SCM".
  21.  
    versions:revert restores the pom.xml files from the pom.xml.versionsBackup files. Forms one half of the built-in "Poor Man's SCM".
  22.  
    Just thought I'd include it for any future reference.

譬如:

idea使用maven私服的更多相关文章

  1. maven私服搭建

    一.软件安装 地址:http://www.sonatype.org/nexus/thank-you-for-downloading/?dl=tgz 解压: 启动: >> nexus sta ...

  2. maven私服搭建(centOS6.5)

    maven的好处和私服的应用本文不赘述,私服搭建如下: MAVEN 私服搭建(centOS 6.5 环境) 1.  准备环境,搭建centOS6.5系统环境,略 2.  准备对应的软件包如下: A. ...

  3. Centos 基础开发环境搭建之Maven私服nexus

    hmaster 安装nexus及启动方式 /usr/local/nexus-2.6.3-01/bin ./nexus status Centos 基础开发环境搭建之Maven私服nexus . 软件  ...

  4. 搭建Maven私服-续

    前几天搭建了Maven私服,但是想在外网访问只能通过ip地址,因为公司用的不是固定ip所以,ip地址每次不一样,都要先打开极路由查看一下当前ip才能用,更恶心的是,代码check out只能一次,下次 ...

  5. 搭建Maven私服

    最近从SVN下载的代码,在本地构建时出现了诸多问题,部分依赖下载超时,就想起在局域网搭建Maven私服,废话不说了,在测试服务器上建的已经成功,就随便找台机子再练习一遍顺道写个日志.1.前往http: ...

  6. Maven私服Nexus3.x环境构建操作记录

    Maven介绍Apache Maven是一个创新的软件项目管理和综合工具.Maven提供了一个基于项目对象模型(POM)文件的新概念来管理项目的构建,可以从一个中心资料片管理项目构建,报告和文件.Ma ...

  7. Maven学习 (四) 使用Nexus搭建Maven私服

    为什么要搭建nexus私服,原因很简单,有些公司都不提供外网给项目组人员,因此就不能使用maven访问远程的仓库地址,所以很有必要在局域网里找一台有外网权限的机器,搭建nexus私服,然后开发人员连到 ...

  8. Maven-004-使用 Nexus 搭建 maven 私服

    从去年至今,自己一直在学习自动化测试工具,想利用自动化工具尽可能的将重复的.关键的.耗时耗力的工作实现自动化,减轻日常测试工作,提升测试效率.在学习的过程中,将 maven 作为了项目开发管理工具,进 ...

  9. 使用Nexus创建Maven私服

    Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维护和外部仓库的访问.利用Nexus你可以只在一个地方就能够完全控制访问和部署在你所维护仓库中的每个Artifact.Nexus ...

  10. SONATYPE NEXUS搭建MAVEN私服

    1.为什么使用Nexus如果没有私服,我们所需的所有构件都需要通过maven的中央仓库和第三方的Maven仓库下载到本地,而一个团队中的所有人都重复的从maven仓库下载构件无疑加大了仓库的负载和浪费 ...

随机推荐

  1. javascript reduce 前端交互 总计

    sum(){ return this.products.reduce((total,next)=>{ return total + next.price * next.aumout},0) } ...

  2. 最基础的分类算法-k近邻算法 kNN简介及Jupyter基础实现及Python实现

    k-Nearest Neighbors简介 对于该图来说,x轴对应的是肿瘤的大小,y轴对应的是时间,蓝色样本表示恶性肿瘤,红色样本表示良性肿瘤,我们先假设k=3,这个k先不考虑怎么得到,先假设这个k是 ...

  3. python3 excel基本操作及格式设置

    #encoding=utf-8 ''' excel基本操作整理 ''' #openpyxl 版本2.5.4 from openpyxl import * import datetime as dt f ...

  4. 个性化召回算法实践(四)——ContentBased算法

    ContentBased算法的思想非常简单:根据用户过去喜欢的物品(本文统称为 item),为用户推荐和他过去喜欢的物品相似的物品.而关键就在于这里的物品相似性的度量,这才是算法运用过程中的核心. C ...

  5. SATB的标记问题解决之道与G1垃圾收集模式系统详解及最佳实践

    继续接着上一次https://www.cnblogs.com/webor2006/p/11148282.html的理论学习,上一次学习到了这: 接着继续: SATB详解: 对于三色算法在concurr ...

  6. 《ABCD组》第六次作业:团队项目系统设计改进与详细设计

    <ABCD组>第六次作业:团队项目系统设计改进与详细设计 项目 内容 这个作业属于哪个课程 http://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 ht ...

  7. Cache 和 Buffer 的区别在哪里

    Cache和Buffer是两个不同的概念,简单的说,Cache是加速“读”,而buffer是缓冲“写”,前者解决读的问题,保存从磁盘上读出的数据,后者是解决写的问题,保存即将要写入到磁盘上的数据.在很 ...

  8. Selenium常用API的使用java语言之17-文件上传

    对于通过input标签实现的上传功能,可以将其看作是一个输入框,即通过sendKeys()指定本地文件路径的方式实现文件上传. 创建upfile.html文件,代码如下: <html> & ...

  9. ubuntu下卸载旧Mysql并安装新Mysql(升级)

    由于从apt-get下安装的Mysql不是最新版的,所以,需要升级.先卸载,再安装. 1.卸载 先看mysql是否在运行: netstat -tap | grep mysql 然后 sudo apt- ...

  10. 系统空闲时间 解决 GetLastInputInfo 负数问题

    using System;using System.Collections.Generic;using System.Linq;using System.Runtime.InteropServices ...