使用Nexus(3.7.1)建立Maven仓库私服
2018-01-23 22:27
309 查看
1、在Nexus的bin目录下shift+右键-打开命令窗口,输入nexus /run (或者使用nexus /start)开启nexus服务
(直接打开nexus.exe无法启动)
服务启动完成后效果如下
2、登录nuxes服务器,默认地址和端口为http://localhost:8081/
点击sign in 登录。默认的用户名和密码为admin/ admin123
点击配置图标(齿轮),点击Repositories可以以查看当前的仓库配置,我们这里使用默认配置。
3、配置maven的settting.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>F:\maven\repository</localRepository>
<pluginGroups></pluginGroups>
<proxies></proxies>
<!--server中添加nexus的用户名和密码-->
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!--mirror中添加nexus的访问路径-->
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/repository/maven-public/</url>
4000
</mirror>
</mirrors>
<!--profile中添加nexus的两个仓库设置-->
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>maven-public</id>
<url>http://localhost:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-public</id>
<url>http://localhost:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!--是能nexus的profile-->
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
4、设置maven项目的pom.xml文件
在添加
<distributionManagement>
<repository>
<id>nexus</id>
<name>Releases</name>
<url>http://localhost:8081/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Snapshot</name>
<url>http://localhost:8081/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
5、下载的jar默认保存路径为nexus-3.7.1-02-win64\nexus-3.7.1-02\system,完成以上步骤后可以通过这里查看是否已下载jar包,或者在web界面查看
(直接打开nexus.exe无法启动)
服务启动完成后效果如下
2、登录nuxes服务器,默认地址和端口为http://localhost:8081/
点击sign in 登录。默认的用户名和密码为admin/ admin123
点击配置图标(齿轮),点击Repositories可以以查看当前的仓库配置,我们这里使用默认配置。
3、配置maven的settting.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>F:\maven\repository</localRepository>
<pluginGroups></pluginGroups>
<proxies></proxies>
<!--server中添加nexus的用户名和密码-->
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<!--mirror中添加nexus的访问路径-->
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/repository/maven-public/</url>
4000
</mirror>
</mirrors>
<!--profile中添加nexus的两个仓库设置-->
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>maven-public</id>
<url>http://localhost:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>maven-public</id>
<url>http://localhost:8081/repository/maven-public/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<!--是能nexus的profile-->
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
4、设置maven项目的pom.xml文件
在添加
<distributionManagement>
<repository>
<id>nexus</id>
<name>Releases</name>
<url>http://localhost:8081/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Snapshot</name>
<url>http://localhost:8081/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
5、下载的jar默认保存路径为nexus-3.7.1-02-win64\nexus-3.7.1-02\system,完成以上步骤后可以通过这里查看是否已下载jar包,或者在web界面查看
相关文章推荐
- maven仓库--私服(Nexus的配置使用)
- maven仓库--私服(Nexus的配置使用)
- Maven的使用,Nexus建立本地仓库以及Eclipse导入Maven项目(四): 实战篇
- maven仓库--私服(Nexus的配置使用)
- maven仓库--私服(Nexus的配置使用)
- maven仓库--私服(Nexus的配置使用)
- nexus(Maven仓库私服)的安装、配置、使用和仓库迁移
- 使用nexus搭建maven仓库(本地私服)
- 使用nexus建立maven私服
- maven仓库--私服(Nexus的配置使用)
- maven仓库--私服(Nexus的配置使用)
- maven仓库--私服(Nexus的配置使用)
- maven仓库--私服(Nexus的配置使用)
- maven仓库--私服(Nexus的配置使用)
- maven上传私有jar包到本地私服仓库,私服使用nexus repository manager 3.3
- 上传jar到私服的两种方式From POM和GAV Parameters。使用Nexus管理Maven仓库时,上传带依赖的第三方jar.
- nexus建立maven仓库私服及Snapshots、release的版本管理
- maven仓库--私服(Nexus的配置使用)
- Linux下使用nexus搭建maven仓库私服
- 使用nexus搭建maven仓库(本地私服)