【问题标题】:Adding cloud-contracts dependency breaks nebula.release plugin添加 cloud-contracts 依赖会破坏 nebula.release 插件
【发布时间】: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


【解决方案1】:

尝试将您的 Nebula 插件升级到更高版本,例如 15.1.0。

示例项目:https://github.com/athlan/spring-cloud-contract-nebula-example

详细说明:

Spring Cloud Contract 发布了较新版本的 jgit 库(与您引用的 nebula 版本相比),其中上述方法已被弃用,并且在较新版本中最终被删除。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-08-05
    • 2015-12-17
    • 1970-01-01
    • 1970-01-01
    • 2019-10-26
    • 1970-01-01
    • 2019-12-29
    相关资源
    最近更新 更多