老李分享:持续集成学好jenkins之Git和Maven配置 2
2016-01-19 17:31
543 查看
8.检查代码更新并编译
可以通过Poll SCM来设置定时检查编译功能
比如*/5 * * * * 就是每隔5分钟检查一次,如果git仓库中有更新,则执行build操作。
9.使用Maven私服加快下载速度
参阅:http://blog.csdn.net/sheismylife/article/details/7209722
Jenkins的.m2目录路径在:/var/lib/jenkins/.m2/
先清空所有jar包,后创建settings.xml文件,编辑内容如下:
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://S1:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
现在点击build now测试一下,打开console output,看看命令行输出结果,如果发现从S1下载jar包,就正确。和不用私服的比较了一下,节省了1分多钟.
可以通过Poll SCM来设置定时检查编译功能
比如*/5 * * * * 就是每隔5分钟检查一次,如果git仓库中有更新,则执行build操作。
9.使用Maven私服加快下载速度
参阅:http://blog.csdn.net/sheismylife/article/details/7209722
Jenkins的.m2目录路径在:/var/lib/jenkins/.m2/
先清空所有jar包,后创建settings.xml文件,编辑内容如下:
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://S1:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
现在点击build now测试一下,打开console output,看看命令行输出结果,如果发现从S1下载jar包,就正确。和不用私服的比较了一下,节省了1分多钟.
相关文章推荐
- HTML5的WebSocket(待补)
- Xapian:检索
- linux系统下Oracle表空间扩展
- box-sizing属性的使用方法
- Map-Reduce实现Join 算法(mapreduce侧连接 maponly 连接 map bloomfilter reduce连接) (join二)
- 【LEETCODE】48-Rotate Image [Python]
- iOS 设置视图半透明而子控件不透明
- Centos7修改profile错误导致命令行不能用,情况的解救方案
- What floating point types are available in .NET?
- ajax cache enable and ajax concurrency!
- 老李分享:持续集成学好jenkins之Git和Maven配置 1
- C#如何加载程序运行目录外的程序集
- 68. Text Justification
- java后台框架 springmvc mybatis oracle 和 mysql数据库
- 学习笔记------数据结构(C语言版)栈的顺序存储
- 【Storm入门指南】第二章 入门实例
- app跳转到微信指定公众号
- iOS:实现图片的无限轮播(二)---之使用第三方库SDCycleScrollView
- 博客园利用Word发布博客功能[其他博客也可以如此使用]
- 网络篇-NSURLSession介绍