[英]Tomcat download issue in Cargo Container in Jenkins
我在 Jenkins 中遇到以下錯誤(我正在使用帶有 tomcat 的貨物插件進行集成測試)。
[2021-07-20T09:46:47.790Z] [ERROR] 無法在項目 demo-prj-rest-test 上執行目標 org.codehaus.cargo:cargo-maven2-plugin:1.7.9:start (start-server) :目標org.codehaus.cargo的執行啟動服務器:cargo-maven2-plugin:1.7.9:啟動失敗:無法下載[https://repo.maven.apache.org/maven2/org/apache/tomcat/ tomcat/8.0.42/tomcat-8.0.42.zip]: java.net.ConnectException: Connection timed out (Connection timed out) -> [Help 1]
以下是我的貨物插件:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.7.9</version>
<configuration>
<container>
<timeout>600000</timeout>
<containerId>tomcat8x</containerId>
<type>installed</type>
<zipUrlInstaller>
<url>https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat/8.0.42/tomcat-8.0.42.zip</url>
<downloadDir>${project.build.directory}/downloads</downloadDir>
<extractDir>${project.build.directory}/extracts</extractDir>
</zipUrlInstaller>
<output>${project.build.directory}/cargo-container.log</output>
<log>${project.build.directory}/cargo.log</log>
</container>
<deployables>
<deployable>
<groupId>com.example</groupId>
<artifactId>demo-prj-war</artifactId>
<type>war</type>
<location>${project.build.directory}/demo-prj-war</location>
<properties>
<context>demo-prj-war</context>
</properties>
</deployable>
</deployables>
<configuration>
<type>standalone</type>
<home>${project.build.directory}/tomcat8x/container</home>
<configfiles>
<configfile>
<file>${project.basedir}/src/test/resources/war-dependencies/context.xml</file>
<todir>conf/</todir>
<tofile>context.xml</tofile>
</configfile>
</configfiles>
<properties>
<cargo.servlet.port>9090</cargo.servlet.port>
<cargo.logging>high</cargo.logging>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<id>start-server</id>
<goals>
<goal>start</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
<execution>
<id>stop-server</id>
<goals>
<goal>stop</goal>
</goals>
<phase>post-integration-test</phase>
</execution>
</executions>
</plugin>
這在本地 maven 構建中完美運行,所有集成測試在貨物 tomcat 中成功運行,但在 Jenkins 構建中面臨上述問題。
一周后,我們找到了這個問題的根本原因。 插件配置沒有任何問題。 問題出在 Jenkins 方面(一個內存問題,其中貨物中的 tomcat 服務剛剛關閉並且不返回任何有用的錯誤消息)。
解決方案:- 我們切換到不同的 Maven 管道。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.