maven私服的搭建及jar包上传下载
2017-11-17 23:50
393 查看
私服就是公司私自使用的服务器
搭建私服的步骤
前提:必须有jdk和java_home环境变量.
1.下载私服软件
地址:https://www.sonatype.com/download-oss-sonatype
2.下载好后解压到一个非空的文件夹下
3.用管理员身份运行cmd.
4.复制新解压后nexus的bin目录路径
5.在cmd窗口中运行命令:[b]
[/b]
[b] (1)进入bin目录[/b]
[b]
[/b]
[b](2)执行nexus install进行安装.此时可以在服务中看到nexus服务.是已停止状态.[/b]
[b](3)还是在bin目录下运行nexusstart 启动该服务.[/b]
[b]6.私服管理[/b]
[b] 在...\nexus-2.14.5-02-bundle\nexus-2.14.5-02\conf目录下找到nexus.properties文件[/b]
[b]
[/b]
[b] [/b]
访问:http://localhost:8081/nexus ---->点击右上角“log in”[b]---->[b][b][b][b]输入username:admin 和Password:admin123登录[/b][/b][/b][/b][/b]
[b]7.利用maven下载jar包[/b]
[b][b] 在maven软件中把私服地址配置上.在settings.xml中找到profiles节点进行配置一下代码[/b][/b]
8.上传jar包
[b][b] (1)把自己的包传到私服里,需要配置账号,就是我们开始用的admin/admin123[/b][/b]
[b][b] (2)[b][b][b]在maven软件的配置文件settings.xml里找到server节点进行设置.[/b][/b][/b][/b][/b]
(3)在项目的父项目的pom.xml中增加上传的仓库地址
(4)运行deploy.
搭建私服的步骤
前提:必须有jdk和java_home环境变量.
1.下载私服软件
地址:https://www.sonatype.com/download-oss-sonatype
2.下载好后解压到一个非空的文件夹下
3.用管理员身份运行cmd.
4.复制新解压后nexus的bin目录路径
5.在cmd窗口中运行命令:[b]
[/b]
[b] (1)进入bin目录[/b]
[b]
[/b]
[b](2)执行nexus install进行安装.此时可以在服务中看到nexus服务.是已停止状态.[/b]
[b](3)还是在bin目录下运行nexusstart 启动该服务.[/b]
[b]6.私服管理[/b]
[b] 在...\nexus-2.14.5-02-bundle\nexus-2.14.5-02\conf目录下找到nexus.properties文件[/b]
[b]
[/b]
[b] [/b]
访问:http://localhost:8081/nexus ---->点击右上角“log in”[b]---->[b][b][b][b]输入username:admin 和Password:admin123登录[/b][/b][/b][/b][/b]
[b]7.利用maven下载jar包[/b]
[b][b] 在maven软件中把私服地址配置上.在settings.xml中找到profiles节点进行配置一下代码[/b][/b]
<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包
[b][b] (1)把自己的包传到私服里,需要配置账号,就是我们开始用的admin/admin123[/b][/b]
[b][b] (2)[b][b][b]在maven软件的配置文件settings.xml里找到server节点进行设置.[/b][/b][/b][/b][/b]
<!-- 设置发布时的用户名 --> <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.
相关文章推荐
- maven私服注意问题-nexus搭建maven私服及私服jar包上传和下载
- nexus搭建maven私服及私服jar包上传和下载
- Java 在Linux下使用nexus3搭建Maven私服并且使用Gradle进行jar包上传以及依赖下载
- nexus搭建maven私服及私服jar包上传和下载
- Maven(二)-- 搭建私服,上传jar
- maven私服搭建及批量上传jar
- Maven私服搭建 上传jar包
- 如何在电脑上搭建一个私服,实现maven项目的上传和下载?
- 如何在电脑上搭建一个私服,实现maven项目的上传和下载?
- Nexus搭建Maven私服上传与下载项目
- maven系列笔记(安装、下载jar、搭建私服)
- Maven 私服项目Jar包上传与下载
- 在本地环境搭建maven的nexus私服,但是有些jar下载不了或下载很慢,解决办法
- Maven : 将Jar安装到本地仓库和Jar上传到私服
- Maven基础配置—上传jar包到私服
- Maven : 将Jar安装到本地仓库和Jar上传到私服
- Maven : 将Jar安装到本地仓库和Jar上传到私服
- Maven : 将Jar安装到本地仓库和Jar上传到私服