maven私服的搭建及jar包上传下载
来源:互联网 发布:ubuntu复制文件到win 编辑:程序博客网 时间:2024/06/05 15:29
私服就是公司私自使用的服务器
搭建私服的步骤
前提:必须有jdk和java_home环境变量.
1.下载私服软件
地址:https://www.sonatype.com/download-oss-sonatype
2.下载好后解压到一个非空的文件夹下
3.用管理员身份运行cmd.
4.复制新解压后nexus的bin目录路径
5.在cmd窗口中运行命令:
(1)进入bin目录
(2)执行nexus install进行安装.此时可以在服务中看到nexus服务.是已停止状态.
(3)还是在bin目录下运行nexusstart 启动该服务.
6.私服管理
在...\nexus-2.14.5-02-bundle\nexus-2.14.5-02\conf目录下找到nexus.properties文件
访问:http://localhost:8081/nexus ---->点击右上角“log in”---->输入username:admin 和Password:admin123登录
7.利用maven下载jar包
在maven软件中把私服地址配置上.在settings.xml中找到profiles节点进行配置一下代码
<profiles> <profile> <id>dev</id> <repositories> <repository> <!--仓库id,可以配置多个仓库要保证id不重复--> <id>nexus</id> <!--仓库地址,也就是我们私服的仓库组地址--> <url>http://localhost:8081/nexus/content/groups/public/</url> <!--是否下载releases版本的jar--> <releases> <enabled>true</enabled> </releases> <!--是否下载snapshots版本的jar--> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <!--插件仓库,maven运行时的命令依赖的插件jar包,也从私服下载--> <pluginRepository> <id>public</id> <url>http://localhost:8081/nexus/content/groups/public/</url> </pluginRepository> </pluginRepositories> </profile> </profiles>
8.上传jar包
(1)把自己的包传到私服里,需要配置账号,就是我们开始用的admin/admin123
(2)在maven软件的配置文件settings.xml里找到server节点进行设置.
<!-- 设置发布时的用户名 --> <servers><!-- releases和snapshots表示是上传到正式仓库还是开发仓库 --><server><id>releases</id><username>admin</username><password>admin123</password></server><server><id>snapshots</id><username>admin</username><password>admin123</password> </server> </servers>
(3)在项目的父项目的pom.xml中增加上传的仓库地址
<!-- 依赖包发布到私服,将开发的包上传到宿主仓库 --><distributionManagement><!-- 上传到宿主仓库的releases --><repository><id>releases</id><name>Internal Releases</name><url>http://localhost:8081/nexus/content/repositories/releases/</url></repository><!-- 上传到宿主仓库的snapshots --><snapshotRepository><id>snapshots</id><name>Internal Snapshots</name><url>http://localhost:8081/nexus/content/repositories/snapshots/</url></snapshotRepository></distributionManagement>
(4)运行deploy.
阅读全文
0 0
- maven私服的搭建及jar包上传下载
- nexus搭建maven私服及私服jar包上传和下载
- 文件上传下载及自己封装jar包
- 批量上传 Jar 包到 Maven 私服的工具
- 使用Nexus搭建Maven私服托管Android aar或jar包
- Maven聚合、Maven仓库jar包以及Spring+MyBatis+JUnit+Maven整合测试的搭建过程
- maven jar包上传私服
- Maven私服上传 jar包
- MAVEN 私服推送本地jar包
- maven打可执行jar包及依赖jar包
- ss2h的jar包作用和冲突及环境搭建
- 搜索maven的jar包
- maven项目打jar包及本地化
- jar包及maven仓库配置
- jspSmartUploat实现文件的上传下载以及jar包下载
- 编写ftp上传下载时需要的jar包
- maven打jar包时添加依赖的jar包
- pom.xml--SSM框架搭建时利用Maven导入所需要的jar包
- JS中的while循环
- 【量化小讲堂-Python&Pandas系列19】10年400倍策略分享(附视频逐行代码讲解)
- 关于pkg-config与LD_LIBRARY_PATH与/etc/ld.so.conf文件的区别与作用
- 游戏制作2——游戏策划与小结
- Unity Line Collider
- maven私服的搭建及jar包上传下载
- springmvc配置文件:springmvc-servlet.xml
- ACM中的图中关于最短路径的dijistra算法和bellman_ford算法
- 一名前端工程师的自学之路,Js篇(11-17更新)
- Code Forces 589G Hiring(树状数组)
- 学习到的处理最大子矩阵问题运用枚举的思路
- Celery-4.1 用户指南: Canvas-设计工作流
- JAVA常用算法之冒泡、选择、快速
- 线程示例