一切OK,則沒有錯誤日志。在Build History中可以看到測試結果,有沒有錯誤。
7.Email發送設置
在Manage Jenkins->Configure System->Email Notification中,設置SMTP發送的基本信息,點擊Advanced,可以填寫用戶名和密碼。還有一個測試按鈕可以用來發送測試設置是否正確。
同時在Test項目中的Building Settings打勾選中E-mail
Notification,點擊右邊的問號,會出現幫助文檔,說明在四種情況下會發送email,填寫接受email的地址,然后故意將client代碼
修改到不能編譯通過。然后點擊Build now按鈕測試一下。果然收到email.
8.檢查代碼更新并編譯
可以通過Poll SCM來設置定時檢查編譯功能
比如*/5 * * * * 就是每隔5分鐘檢查一次,如果git倉庫中有更新,則執行build操作。
9.使用Maven私服加快下載速度
如我這篇文章所述,用私服可以避免下載過慢問題,也可以繞過公司內部外網限制問題。
買粉絲://blog.csdn.買粉絲/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>買粉絲://S1:8081/nexus/買粉絲ntent/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>買粉絲://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>買粉絲://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測試一下,打開買粉絲nsole output,看看命令行輸出結果,如果發現從S1下載jar包,就正確。和不用私服的比較了一下,節省了1分多鐘.