将maven项目发布到私服
1、局域网私服
首先保证已经安装配置好了局域网的私服(具体私服的搭建可以查看相关资料)
私服页面访问地址:http://192.168.0.110:8081/nexus,使用admin登录,默认的用户名和密码是:admin/admin123
2、项目的仓库部署配置
1)pom文件中插件配置
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
2)pom文件中私服仓库配置
<distributionManagement>
<repository>
<id>thirdparty</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/thirdparty/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
10 </distributionManagement>
Release版本和Snapshot版本对应的仓库URL,可以在私服的web页面上查看(本文的Release版本都发布到3rd party仓库下面)
View/Repositories -> Repositories -> Repositories Path
3、Maven的settings配置文件
1)配置Servers(项目pom文件中<distributionManagement>标签里面的id要与这里面的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>
<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
2)配置Mirror镜像,配置指向私服
<mirrors>
<mirror>
<id>nexus</id>
<name>internal nexus repository</name>
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
3)配置仓库描述
<profile>
<id>dev</id>
<repositories>
<repository>
<id>nexus-releases</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/releases/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>nexus-snapshots</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/snapshots/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>central</id>
<name>Central</name>
<url>http://192.168.0.110:8081/nexus/content/repositories/central/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>thirdparty</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/thirdparty/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
4、工程项目发布
1)执行发布命令
mvn clean deploy
2)发布成功之后,可以在页面上查看到刚刚发布的jar包
View/Repositories -> Repositories -> 3rd party -> Browse Index
将maven项目发布到私服的更多相关文章
- maven项目如何从私服nexus中下载依赖包
maven项目如何从私服nexus中下载依赖包 解决方法: 1.打开maven的config目录中settings.xml文件 2.在<profile></profiles> ...
- Maven入门指南⑥:将项目发布到私服
1 . 修改私服中仓库的部署策略 Release版本的项目应该发布到Releases仓库中,对应的,Snapshot版本应该发布到Snapshots仓库中.Maven根据pom.xml文件中版本号&l ...
- Maven入门指南12:将项目发布到私服
1 . 修改私服中仓库的部署策略 Release版本的项目应该发布到Releases仓库中,对应的,Snapshot版本应该发布到Snapshots仓库中.Maven根据pom.xml文件中版本号&l ...
- maven项目发布不成功的问题
MyEclipes 里面有好多的项目,有些项目是插件有些是组件, 就是有些项目是被依赖的项目,有些事项目的主体,被依赖的项目需要打成jar 包放在maven的中央仓库里面,也是所说的maven的 ...
- ava Maven项目之Nexus私服搭建和版本管理应用
目录: Nexus介绍 环境.软件准备 Nexus服务搭建 Java Maven项目版本管理应用 FAQ 1.Nexus介绍 Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维 ...
- Java Maven项目之Nexus私服搭建和版本管理应用
转载自:https://cloud.tencent.com/developer/article/1010603 1.Nexus介绍 Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓 ...
- maven项目发布到Tomcat丢失jar包
昨天看了一篇tomcat设置的文章,说要把第一个勾上,这样不需要更新到tomcat. 一启动tomcat就发现丢包.后来在网上看了许多文章,说要update maeven项目,然后你就会发现启动过程 ...
- maven项目发布到tomcat后没有lib目录解决方案
maven项目放入tomcat中时,总是报错,而且这些jar都是真实存在的,错误如下: maven eclipse tomcat java.lang.ClassNotFoundException: o ...
- maven项目发布到tomcat的错误
Could not publish to the server. java.lang.IndexOutOfBoundsException "Updating status for Tomca ...
随机推荐
- BZOJ2659算不出的算式不正经题解
题目链接 https://www.lydsy.com/JudgeOnline/problem.php?id=2659 分析 难得做到此类打表题目,不觉回想到NOIp2017考场上的SB经历 这道题看到 ...
- js弹窗返回值详解(window.open方式)
今天在改公司一个老系统时,碰到了window.open()的这个语法.虽然这个方法有点老,不太用了.所以有点不清楚父级弹框如何获取子级页面返回的值.为了解决这个问题,上网搜了一下.原作者参考网址:ht ...
- 解决docker pull 速度慢问题
解决docker pull 速度慢问题 将docker镜像源修改为国内的: 在 /etc/docker/daemon.json 文件中添加以下参数(没有该文件则新建): { "registr ...
- git 多账户添加ssh秘钥
生成秘钥的步骤: ssh-keygen -t rsa -C "xxxx@qq.com" 添加秘钥 在不同的域中添加相同的秘钥是没有问题的,比如 github.com / code. ...
- python之时间日期calendar
calendar是与日历相关的模块,calendar模块文件里定义了很多类型,主要有Calendar,TextCalendar以及HTMLCalendar类型.其中,Calendar是TextCale ...
- 关于php的发展前景
php7 宣称速度比php5.6快两倍,宣称要打破一切旧规则 2015年,php 7.0发布 2016年,php 7.1发布 2017年,php 7.2发布 2018年,php 7.3发布 2019年 ...
- 【转】sscanf函数用法实例
sscanf() - 从一个字符串中读进与指定格式相符的数据. 函数原型: Int sscanf( string str, string fmt, mixed var1, mixed var2 . ...
- 九,configMap及secret的基本使用
目录 制定容器配置的方式 configMap(存储数据为明文,敏感数据慎用) 创建configMap的几种方式 命令行创建和测试configMap实例 创建一个Pod 挂载测试 通过指定文件创建con ...
- Hadoop_06_Hadoop的HDFS的概念和特性
1.HDFS的概念和特性 1.1. 首先,它是一个文件系统,用于存储文件,通过统一的命名空间——目录树来定位文件 1.2. 它是分布式的,由很多服务器联合起来实现其功能,集群中的服务器有各自的角色:重 ...
- shell脚本基础和grep文本处理工具企业应用2
shell脚本编程: 编程语言的分类: 根据运行方式 编译运行:源代码-->编译器(编译)-->程序文件 优 ...