Nexus搭建Maven私有仓库
来源:互联网 发布:赣州教育软件代理 编辑:程序博客网 时间:2024/05/01 20:21
前言
Nexus Repository Manager is a Java application that requires a Java Runtime Environment. When you run Nexus Repository Manager, you are running a server application with a web-based user interface. The application itself runs with the Eclipse Jetty servlet container and Apache Karaf OSGi-container.
此次搭建是在Windows平台上操作的,搭建之前需要先安装JDK。
1.下载
最新版是nexus-3.2.0-01-win64.zip,可以从官网下载。
2.注册服务
运行以下命令,注册为服务。 nexus.exe /install Nexus Service
配置成功。
3.启动服务
4.访问
5.登录
用户名:admin;
密码:admin123
没有Maven相关的jar包。
6.使用
使用maven-public仓库
maven配置
C:\Users\Administrator\.m2\settings.xml
中添加以下配置
<mirror> <!--This sends everything else to /public --> <id>nexus</id> <mirrorOf>central</mirrorOf> <url>http://localhost:8081/repository/maven-public/</url> </mirror>
package
在工程目录下,运行命令:mvn clean package
开始从私服下载jar包,快了很多。
私服中增加的jar包。
deploy
用IntelliJ IDEA,远程部署jar到私服。
1. settings.xml
配置用户名和密码
一定要是C:\Users\用户名\.m2\settings.xml
下面的settings.xml,IDEA在deploy的时候会在这个路径下面查找远程私服的用户名和密码。
<server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server>
2. pom.xml
文件配置
<distributionManagement> <snapshotRepository> <id>snapshots</id> <url>http://localhost:8081/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement>
3. deploy
运行命令mvn clean -Dmaven.test.skip=true deploy
4. 成功
依赖使用
项目使用上传到私服的jar,运行命令mvn clean package
更多命令可以参考官方文档。
- Nexus 搭建maven 私有仓库
- Nexus搭建Maven私有仓库
- Nexus搭建Maven私有仓库
- Nexus搭建私有maven仓库
- Nexus 搭建maven 私有仓库
- 【Maven】搭建Nexus Maven私有仓库
- 使用Nexus搭建Maven私有仓库
- centos使用nexus搭建私有maven仓库
- Nexus 私有仓库搭建与 Maven 集成
- [Sonatype Nexus]Ubuntu、Nexus搭建Maven私有仓库
- 用nexus搭建自己的maven私有仓库
- maven私服:用nexus搭建企业级私有仓库
- maven私有仓库搭建之sonatype nexus篇
- 使用Gradle和Sonatype Nexus 搭建私有maven仓库
- maven私有仓库搭建之sonatype nexus篇
- 使用Gradle和Sonatype Nexus 搭建私有maven仓库
- Android的Nexus搭建Maven私有仓库与使用
- nexus的私服的搭建(maven私有仓库)
- 视频云直播中的关键帧技术探秘
- okhttp3缓存实践
- Spark经典案例7-非结构数据处理
- [Direct2D1.1教程] Direct2D特效概览
- java Split如何去除一个空格和多个空格
- Nexus搭建Maven私有仓库
- 无聊的一天
- http连接池
- js闭包的理解
- EditText自动获取焦点并弹出输入法
- Action层, Service层 ,modle层 和 Dao层的功能区分
- NDK-JNI实战教程(二) JNI官方中文资料
- Map.Entry详解
- EditText的属性介绍