Maven 私有库和本地的安装与配置(一)

一:Maven 私有库和本地的安装

1、下载最新的【Nexus】,地址:https://www.sonatype.com/download-oss-sonatype ;

2、下载:nexus-2.14.3-02-bundle.zip;

3、解压后进入,..\nexus-2.14.3-02-bundle\nexus-2.14.3-02\bin\jsw  文件夹中选择对应的操作系统;



4、这里选择  console-nexus.bat 启动服务;
5、在浏览器中输入: http://localhost:8081/nexus ,可以查看启动是否正常;


6、登陆用户账号/密码: admin/admin123;

7、至此所以nexus的安装就已经完毕。



二:Maven 私有库和本地的配置

1、邮箱配置


2、用户邮箱配置,可用于找回密码;


3、设置代理proxy可以进行远程下载资源;




三:Maven 私有库和本地的配置

1、配置文件,settings_zuk.xml,内容如下: 

1.1  ,注意其中点:

<localRepository>C:\Users\lenovo\.m2\repository</localRepository>
1.2 ,命名
<id>zuk</id>

1.3 ,这个要在上图的 【Public Repositories】的仓库路径。

<url>http://localhost:8081/nexus/content/groups/public/</url>

1.4 ,激活 

<activeProfile>zuk</activeProfile>

1.5,配置

<?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>C:\Users\lenovo\.m2\repository</localRepository>
	<interactiveMode>true</interactiveMode>
    <offline>false</offline>
    <pluginGroups>
        <pluginGroup>org.mortbay.jetty</pluginGroup>
        <pluginGroup>org.jenkins-ci.tools</pluginGroup>
    </pluginGroups>
	
	<!--配置权限,使用默认用户-->
	<servers>
		<server>
			<id>nexus-releases</id>
			<username>deployment</username>
			<password>deployment123</password>
		</server>
		<server> 
			<id>nexus-snapshots</id>
			<username>deployment</username>
			<password>deployment123</password>
		</server>
	</servers>

    <mirrors>

    </mirrors>

	<profiles>
		<profile>
		   <id>zuk</id>
			    <activation>
                    <activeByDefault>false</activeByDefault>
                    <jdk>1.6</jdk>
                </activation>
			    <repositories>
					<!-- 私有库地址-->
				    <repository>
						<id>nexus</id>
						<url>http://localhost:8081/nexus/content/groups/public/</url>
						<releases>
							<enabled>true</enabled>
						</releases>
						<snapshots>
							<enabled>true</enabled>
						</snapshots>
					</repository>
				</repositories>      
				<pluginRepositories>
					<!--插件库地址-->
					<pluginRepository>
						<id>nexus</id>
						<url>http://localhost:8081/nexus/content/groups/public/</url>
						<releases>
							<enabled>true</enabled>
						</releases>
						<snapshots>
							<enabled>true</enabled>
					   </snapshots>
					</pluginRepository>
				</pluginRepositories>
			</profile>
	</profiles>
	
	<!--激活profile-->
	<activeProfiles>
		<activeProfile>zuk</activeProfile>
	</activeProfiles>
	
</settings>

1.6,eclipse中配置路径:window-》preferences-》maven-》user setting,如下图:












  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值