工作笔记(一): maven私服搭建以及使用

1.下载并解压mavennexus.




2.配置maven的环境变量

JAVA_HOME=C:\Program Files\Java\jdk1.6.0_33

MAVEN_HOME=F:\maven and nexus\apache-maven-3.0.4

PATH=%MAVEN_HOME%\bin

测试是否装好maven,可在命令行下执行mvn –v


 

3.启动nexus管理maven,nexus目录下的console-nexus.bat启动

或者先注册为windows服务install-nexus.bat,

然后启动服务start-nexus.bat


4.启动后url: http://localhost:8081/nexus

默认用户名密码:admin/admin123

Views/Repositories-->Repositories里进行配置

将需要用到的repositoryDownloadRemote Indexes 设置为true;

如我们这边设置了Central, ApacheSnapshots,


推荐一个proxyrepository: ibiblio

url: http://mirrors.ibiblio.org/maven/

 


Repair update index

 


eclipse maven2插件下载
http://m2eclipse.sonatype.org/sites/m2e



插件装好后设置如下:


 


setting.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:\repo</localRepository>
	<servers>
		<server>
			<id>nexus-snapshots</id>
			<username>deployment</username>
			<password>deployment</password>
		</server>
	</servers>
	<mirrors>
		<mirror>
			<id>nexus</id>
			<name>internal nexus repository</name>
			<url>http://localhost:8081/nexus/content/groups/public/</url>
			<mirrorOf>*</mirrorOf>
		</mirror>
	</mirrors>
</settings>


设定完毕,用eclipse新建一个maven工程:




如果我们需要添加log4j的jar 包,可以在nexus中搜索log4j,选择所需的版本后,在右下方会有dependency的配置信息,


 
copy到工程中的pom中,则会自动下载jar到项目依赖中。





以上就是集成环境的搭建.... 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值