maven和jenkins區別,【jenkins】jenkins+maven+gitlab+testng,jenkins配置

 2023-10-21 阅读 26 评论 0

摘要:電腦版本:windows10企業版 maven和jenkins區別,? jenkins配置: gitlab webhook jenkins、1.general配置,這里的配置比較簡單,基本默認就可以了 2.源碼管理 ? 2.1填寫git地址,從你的gitlib項目里去找。不會的自行百度。 ? ?然后將git的公鑰

電腦版本:windows10企業版

maven和jenkins區別,?

jenkins配置

gitlab webhook jenkins、1.general配置,這里的配置比較簡單,基本默認就可以了

2.源碼管理

? 2.1填寫git地址,從你的gitlib項目里去找。不會的自行百度。

? ?然后將git的公鑰配置到gitlab里面【必須要配置,和后面jenkins里面的私鑰對應起來】

? ?2.2點擊添加按鈕,彈出下面的框,填寫git私鑰

?

?

? 2.3選擇master分支

?

?

?3.構建環境和構建觸發器,暫時省略,不配,點擊立即構建也可以跑起來

4.構建

clean install

5.構建后操作-->測試報告。我選的是allure report。

? 備注:先在插件里安裝allure report

?6.還需要和工程下的testng.xml文件關聯起來,我的是maven工程

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>ppwx</groupId><artifactId>autotest</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>test</name><url>http://maven.apache.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version></properties><dependencies><!--此處省略--></dependencies><build><finalName>Test</finalName><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><configuration><systemPropertyVariables><org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output></systemPropertyVariables><forkMode>once</forkMode><argLine>-Dfile.encoding=UTF-8</argLine><suiteXmlFiles><suiteXmlFile>./testng.xml</suiteXmlFile></suiteXmlFiles><workingDirectory>target/</workingDirectory></configuration></plugin></plugins></build></project>

?

配置完后,重啟jenkins,重啟電腦(比較保險,有時不重啟,不生效)  

?

然后我們來看看執行結果

?

如果allure report沒有生成,看一下全局設置里。把這里配置一下。

?

轉載于:https://www.cnblogs.com/Jourly/p/10469780.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/154627.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息