1.在pom.xml文件中配置需要发布的工厂

如果想把项目发布到nexus中,需要在pom.xml中配置releases和snapshots版本发布的具体repository

<distributionManagement>
<!-- 两个ID必须与setting.xml中的<server><id>nexus-releases</id></server>保持一致-->
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://localhost:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://localhost:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

2.给用户授权,让其有权发布项目

在Maven的conf中的setting.xml文件中,找到servers标签,添加相应的用户。进行授权
这里的id需要和pom.xml中的id一样

<servers>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>

这里配置的是admin用户,因为admin是管理员用户。是有权限发布的。

假如你配置的是deploy用户,需要给deploy用户授权。

3.发布到nexus中

使用mvn:deploy 命令发布到nexus中
发布成功后,可以在repositories中的releases或者snapshots中看到刚刚发布的项目

1.Nexus安装与配置

2.Nexus更新索引

3.发布Maven项目到nexus中

4.按项目类型分配不同的nexus工厂来发布不同的项目

3.发布Maven项目到nexus中的更多相关文章

  1. 配置maven访问nexus,配置项目pom.xml以发布maven项目到nexus中

    maven访问nexus有三种配置方法,分别为: 项目pom.xml,优先级最高: user的settings.xml,优先级中,未在pom.xml中配置repository标签,则使用这个配置: m ...

  2. 让maven项目使用nexus作为远程仓库

    让maven项目使用nexus作为远程仓库有两种方式,第一种是在项目的pom.xml中进行更改,让单个项目使用nexus仓库:另一种是通过修改maven的配置文件settings.xml进行更改,让所 ...

  3. Maven项目使用Nexus作为远程仓库的settings.xml配置

    Maven项目使用Nexus作为远程仓库的settings.xml配置(转) 在自己电脑C:\Users\hanmm\.m2\下的setting.xml. 1.服务器配置 <server> ...

  4. Tomcat发布Maven项目遇到异常:java.lang.OutOfMemoryError: PermGen space

    前言: 本问题出现在tomcat 7发布 web3.0Maven项目的时候出现. 问题阐述: 异常:java.lang.OutOfMemoryError:PermGen space 解决如下: 1.  ...

  5. 发布Maven项目 nexus

    1.在pom.xml文件中配置需要发布的工厂 如果想把项目发布到nexus中,需要在pom.xml中配置releases和snapshots版本发布的具体repository <distribu ...

  6. ava Maven项目之Nexus私服搭建和版本管理应用

    目录: Nexus介绍 环境.软件准备 Nexus服务搭建 Java Maven项目版本管理应用 FAQ 1.Nexus介绍 Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维 ...

  7. Java Maven项目之Nexus私服搭建和版本管理应用

    转载自:https://cloud.tencent.com/developer/article/1010603 1.Nexus介绍 Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓 ...

  8. Eclipse发布Maven项目到远程服务器

    pom.xml中的配置依赖有两种: 一.tomcat-maven.plugin <plugin> <groupId>org.codehaus.mojo</groupId& ...

  9. 配置Jenkins 实现自动发布maven项目至weblogic(svn+maven+weblogic12c)

    Jenkins安装完成之后,需要我们对其配置,然后才可以实现自动部署项目. 前提 防火墙开放weblogic的7001端口 Linux(CentOS):firewall-cmd --zone=publ ...

随机推荐

  1. ios工程中ARC与非ARC的混合

    ARC与非ARC在一个项目中同时使用, 1,选择项目中的Targets,选中你所要操作的Target,2,选Build Phases,在其中Complie Sources中选择需要ARC的文件双击,并 ...

  2. 《View Programming Guide for iOS》之frame、bounds和center之间的关系

    The frame property contains the frame rectangle, which specifies the size and location of the view i ...

  3. Tips about Object-oriented programming

    1, Return subinterface For example, we have a parent interface: public interface A<T extends A< ...

  4. C#泛型(二)

    <1>.泛型方法 以前文章说到用一个泛型类 SortHelper 来做一个冒泡排序的处理,下面回顾一下之前的代码: public class SortHelper<T> whe ...

  5. 谷歌、火狐浏览器gift图片缓存后不显示动态效果

    <script> $(function(){ $('.center img').prop("src","images/service/01.gif" ...

  6. 【题解】【BST】【Leetcode】Unique Binary Search Trees

    Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For examp ...

  7. 阅读学术论文的心得体会from小木虫

    我们搞科研的很重要的一个环节就是文献的阅读!关于如何阅读文献?读什么,怎么读?结合我自己的体会,我想这里的关键在于要让我们通过这种方式的学习,学会看懂作者的思想.思路和科学方法,从中学习论文作者发现问 ...

  8. iOS学习笔记---C语言第四天

    //⽣生成2个数组,每个数组都有10个元素,元素取值范围20-40之间,数组对应元素相 加,放到另外⼀一个数组中 #import <Foundation/Foundation.h> int ...

  9. centos6.4搭建knowlededgeroot-1.0.4知识库平台

    知识库平台选择 http://www.oschina.net/project/tag/320/pkm 最近接到一个任务,要求搭建一个用于部门内部业务知识规范管理和共享的平台,目的是把部门内的FAQ知识 ...

  10. numpy之sum

    Definition : sum(a, axis=None, dtype=None, out=None, keepdims=False) axis: None or int or tuple of i ...