我正在使用以下由亚特兰蒂斯团队创建并不再维护的jgitflow-maven-plugin。每当我试图在Jenkins作业中执行release时,我都会得到以下错误:
Caused by: org.eclipse.jgit.errors.PackProtocolException: invalid advertisement of <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">插件是这样导入的:
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m5.1</version>
</plugin>它在pom.xml中配置如下:
<scm>
<url>https://myOwnRepo.com/test</url>
<connection>scm:git:https://myOwnRepo.com/test.git</connection>
<developerConnection>scm:git:https://myOwnRepo.com/test.git</developerConnection>
<tag>HEAD</tag>
</scm><configuration>
<flowInitContext>
<masterBranchName>master</masterBranchName>
<developBranchName>dev</developBranchName>
<versionTagPrefix>v</versionTagPrefix>
</flowInitContext>
<pushFeatures>true</pushFeatures>
<pushHotfixes>true</pushHotfixes>
<username>myRepoUser</username>
<password>myRepoPassword</password>
<allowUntracked>true</allowUntracked>
</configuration><executions>
<execution>
<id>release</id>
<goals>
<goal>release-start</goal>
<goal>release-finish</goal>
</goals>
<configuration>
<scmCommentPrefix>[RELEASE]</scmCommentPrefix>
</configuration>
</execution>
<execution>
<id>feature</id>
<goals>
<goal>feature-start</goal>
<goal>feature-finish</goal>
</goals>
<configuration>
<allowSnapshots>true</allowSnapshots>
<scmCommentPrefix>[FEATURE]</scmCommentPrefix>
</configuration>
</execution>
<execution>
<id>hotfix</id>
<goals>
<goal>hotfix-start</goal>
<goal>hotfix-finish</goal>
</goals>
<configuration>
<scmCommentPrefix>[HOTFIX]</scmCommentPrefix>
</configuration>
</execution>
</executions>我还尝试更改以下依赖项的版本:
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.sshagent</artifactId>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.jsch</artifactId>
<groupId>com.jcraft</groupId>
<artifactId>jsch.agentproxy.usocket-jna</artifactId>该项目位于使用行参数设置的代理后面。它是按照scm的要求使用https克隆的。另外,为了连接,它使用的是令牌而不是密码。
在我的本地机器上,一切似乎都正常工作,与Jenkins作业的唯一区别似乎是所使用的代理。
发布于 2019-08-06 16:08:52
显然,导致jenkins作业错误行为的问题是代理(正如预期的那样)。
Jenkins实例运行在代理后面。当maven-jgitflow-plugin试图到达git时,它将得到403页作为回购的响应。
在更改代理后,这个错误消失了,插件也开始工作了。
https://stackoverflow.com/questions/57310584
复制相似问题