部署nexus,完成局域网maven仓库布置。
2017-11-03 15:00
387 查看
为什么要搭建nexus私服,有些公司不能访问外网。那就有必要在局域网里找一个能访问外网权限的机器。搭建nexus私服,开发人员能连到这台私服上,通过这个私服访问远程仓库。
1.下载安装包nexus-2.14.5-02,下载地址:http://www.sonatype.org/nexus/go
2.打开目录E:\MAVEN\nexus-2.14.5-02-bundle\nexus-2.14.5-02\bin\jsw,我使用的是
3.在文件夹windows-x86-64下面有以下的文件,
先启动start-nexus
再安装install-nexus
如果不想用了就
先停止stop-nexus
再卸载uninstall-nexus
4.访问http://localhost:8081/nexus,右上角有个Login in,默认用户名:admin 密码是admin123
把Repository下面的所有仓库的属性 Download Remote Indexes设置成true
5. maven的配置文件settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository-->
<localRepository>E:\MAVEN\mvn_repo</localRepository>
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<!--
指定所有的jar都会在配置的nexus镜像中进行下载
只要mirrorOf中的工厂需要下载jar,都会自动来找该镜像。如果镜像地址有,就下载下来。
若镜像地址没有,mirrorOf中的工厂也不会到中央资源库下载,而是由镜像去下载。这是推荐做法。
若镜像下载不到,就下载失败。
-->
<mirror>
<id>UFindNexus</id>
<mirrorOf>*</mirrorOf>
<url>http://127.0.0.1:8081/nexus/content/groups/public/</url
>
</mirror>
</mirrors>
<profiles>
<profile>
<id>UFindNexus</id>
<!--仓库地址-->
<repositories>
<repository>
<id>UFindNexus</id>
<url>http://127.0.0.1:8081/nexus/content/groups/public</url
>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
<!--插件地址-->
<pluginRepositories>
<pluginRepository>
<id>UFindNexus</id>
<url>http://127.0.0.1:8081/nexus/content/groups/public</url
>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!--生效-->
<activeProfiles>
<activeProfile>UFindNexus</activeProfile>
</activeProfiles>
</settings>
1.下载安装包nexus-2.14.5-02,下载地址:http://www.sonatype.org/nexus/go
2.打开目录E:\MAVEN\nexus-2.14.5-02-bundle\nexus-2.14.5-02\bin\jsw,我使用的是
3.在文件夹windows-x86-64下面有以下的文件,
先启动start-nexus
再安装install-nexus
如果不想用了就
先停止stop-nexus
再卸载uninstall-nexus
4.访问http://localhost:8081/nexus,右上角有个Login in,默认用户名:admin 密码是admin123
把Repository下面的所有仓库的属性 Download Remote Indexes设置成true
5. maven的配置文件settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- localRepository
| The path to the local repository maven will use to store artifacts.
|
| Default: ${user.home}/.m2/repository-->
<localRepository>E:\MAVEN\mvn_repo</localRepository>
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<!--
指定所有的jar都会在配置的nexus镜像中进行下载
只要mirrorOf中的工厂需要下载jar,都会自动来找该镜像。如果镜像地址有,就下载下来。
若镜像地址没有,mirrorOf中的工厂也不会到中央资源库下载,而是由镜像去下载。这是推荐做法。
若镜像下载不到,就下载失败。
-->
<mirror>
<id>UFindNexus</id>
<mirrorOf>*</mirrorOf>
<url>http://127.0.0.1:8081/nexus/content/groups/public/</url
>
</mirror>
</mirrors>
<profiles>
<profile>
<id>UFindNexus</id>
<!--仓库地址-->
<repositories>
<repository>
<id>UFindNexus</id>
<url>http://127.0.0.1:8081/nexus/content/groups/public</url
>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</repository>
</repositories>
<!--插件地址-->
<pluginRepositories>
<pluginRepository>
<id>UFindNexus</id>
<url>http://127.0.0.1:8081/nexus/content/groups/public</url
>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!--生效-->
<activeProfiles>
<activeProfile>UFindNexus</activeProfile>
</activeProfiles>
</settings>
相关文章推荐
- Maven学习 (四) 使用Nexus搭建Maven私服 为什么要搭建nexus私服,原因很简单,有些公司都不提供外网给项目组人员,因此就不能使用maven访问远程的仓库地址,所以很有必要在局域网里找
- Maven私有仓库-使用docker部署Nexus
- Nexus 部署Maven私服仓库
- 自动化部署之Maven的私有仓库Nexus
- Maven deploy部署jar到远程私服仓库
- Maven仓库-Nexus环境搭建及简单介绍
- Maven环境下搭建Nexus本地仓库
- Nexus创建本地Maven仓库(Maven私服)
- Maven的使用,Nexus建立本地仓库以及Eclipse导入Maven项目(二): 安装篇
- maven仓库--私服(Nexus的配置使用)
- Android业务组件化之Gradle和Sonatype Nexus搭建私有maven仓库
- Nexus创建本地Maven仓库(Maven私服)
- 使用Nexus管理maven仓库,setting文件理解
- Linux环境下Maven仓库的搭建(nexus)及Mavan的简单使用
- Linux下搭建maven-nexus私服仓库
- Maven仓库管理-Nexus(转帖后加强版)
- 使用Nexus搭建Maven本地仓库
- 部署Jar包到远程Maven仓库
- maven(14)-nexus仓库基本用法
- 手动更新maven私有仓库nexus的索引文件