jenkins插件开发之maven国内镜像配置

jenkins插件开发官网指导demo:

https://jenkins.io/doc/developer/tutorial/create/

安装完maven环境,按照Jenkins知道在命令行输入

mvn -U archetype:generate -Dfilter=io.jenkins.archetypes:

实际上这个命令会在Generating project in Interactive mode阶段卡很久,把命令换成debug模式:

mvn -U -X archetype:generate -Dfilter=io.jenkins.archetypes:

可发现卡在这里

Searching for remote catalog: http://repo.maven.apache.org/maven2/archetype-catalog.xml

 网上指导说手动访问这个地址,另存archetype-catalog.xml到本地,实测会说-Dfilter=io.jenkins.archetypes:不匹配,结果生成一个空工程

解决方法:换成国内镜像,在maven安装目录conf/settings.xml里加上:

    
      repo.jenkins-ci.org
      https://repo.jenkins-ci.org/public/
      m.g.o-public
    
	
	
		alimaven
		central
		aliyun maven
		http://maven.aliyun.com/nexus/content/repositories/central/
	
	
	
	
		repo1
		central
		Human Readable Name for this Mirror.
		http://repo1.maven.org/maven2/
	
	
	
	
		repo2
		central
		Human Readable Name for this Mirror.
		http://repo2.maven.org/maven2/
	

 

你可能感兴趣的:(持续集成)