Maven使用nexus配置,SNAPSHOT版本介绍及发布jar到nexus

Maven Setting.xml配置



D:\java\mavenRepos







releases
deployment
cykj


snapshots
deployment
cykj






nexusSnapashots
http://192.168.2.18:8081/nexus/content/groups/public/
public-snapshots
always


nexusMirror
local repos
http://192.168.2.18:8081/nexus/content/groups/public/
*





nexusRepository



nexusSnapashots
nexus-snapshots
http://192.168.2.18:8081/nexus/content/groups/public/

false


true

default
always


nexusMirror
nexus-snapshots
http://192.168.2.18:8081/nexus/content/groups/public/

true


false

default
always





nexusMirror
nexus mirror
http://192.168.2.18:8081/nexus/content/groups/public/

true


false
always
warn  







nexusRepository

关于发布到nexus仓库中,使用mvn deploy命令

eclipse中配置run configuration中加入deploy参数,如图


发布项目到nexus上在pom.xml中加入


		
			releases
			Nexus Releases Repository
			http://192.168.2.18:8081/nexus/content/repositories/releases/
		
		
			snapshots
			Nexus Snapshots Repository
			false
			legacy
			http://192.168.2.18:8081/nexus/content/repositories/snapshots/
		
	
注意id与setting中server的id保持一致
server中配置的用户名密码为nexus中的用户id和密码,注意是id不是name,否则报错,当时也是被坑了个first blood出来..

关于SNAPSHOT版本简单介绍一下

如pom.xml中配置1.0.0-SNAPSHOT

表示快照版本,版本虽为1.0.0,但是每次都会使用最新的版本,参考nexus仓库截图,每次提交都会产生不同的版本号


关于发布到nexus仓库中,使用mvn deploy命令

eclipse中配置run configuration中加入deploy参数,如图

你可能感兴趣的:(maven)