Nexus搭建Maven私有仓库
2017-02-08 15:17
513 查看
前言
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 集成
- CentOS 初体验十六:阿里云安装Nexus搭建Maven私有仓库
- Nexus 搭建maven 私有仓库
- Android的Nexus搭建Maven私有仓库
- Android业务组件化之Gradle和Sonatype Nexus搭建私有maven仓库
- [Sonatype Nexus]Ubuntu、Nexus搭建Maven私有仓库
- Nexus 私有仓库搭建与 Maven 集成
- 使用Nexus搭建Maven私有仓库
- Nexus搭建私有maven仓库
- 用nexus搭建自己的maven私有仓库
- Nexus 搭建maven 私有仓库
- Nexus搭建Maven私有仓库
- Nexus 搭建maven 私有仓库
- nexus的私服的搭建(maven私有仓库)
- 使用Gradle和Sonatype Nexus 搭建私有maven仓库
- 【Maven】搭建Nexus Maven私有仓库
- 用nexus搭建自己的maven私有仓库
- maven私服:用nexus搭建企业级私有仓库
- 使用Gradle和Sonatype Nexus 搭建私有maven仓库