【发布时间】:2019-03-29 19:22:20
【问题描述】:
我遇到了一个奇怪的错误,我想在 Gradle 中使用 nebula.release 插件。我通过以下两种方式都成功添加了它:
plugins {
id 'nebula.release' version '6.3.5'
}
和
dependencies {
classpath 'com.netflix.nebula:nebula-release-plugin:6.3.4'
}
apply plugin: 'nebula.release'
但是,无论如何,当我为spring-cloud-contracts 添加以下类路径行时:
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:2.1.0.RELEASE"
它给了我以下错误:
An exception occurred applying plugin request [id: 'nebula.release', version: '6.3.5']
> Failed to apply plugin [id 'nebula.release']
> No signature of method: org.eclipse.jgit.internal.storage.file.FileRepository.getRef() is applicable for argument types: (java.lang.String) values: [HEAD]
Possible solutions: getAt(java.lang.String), getFS(), grep(), exactRef(java.lang.String), findRef(java.lang.String), getAllRefs()
我完全不确定为什么添加这个依赖项会破坏这么多东西,任何帮助都会很棒!
【问题讨论】:
-
你很可能在 gradle / groovy 版本中存在不匹配。你用的是哪个版本的 gradle?
-
@MarcinGrzejszczak 实际上和我一样。我正在使用 gradle 5.1; nebula.release 插件在 6.3.3 版本中;和 2.2.4.RELEASE 版本中的 spring cloud 合约插件
-
您有可以上传的样本吗?
-
@MarcinGrzejszczak 当然。使用 github 管道在此 repo 中复制它:github.com/athlan/spring-cloud-contract-nebula-example
-
终于解决了。已发布该问题的答案。
标签: spring-boot spring-cloud-contract netflix-nebula-plugins