Nexus:未找到Gradle插件org.unbroken-dome.test-sets

时间:2018-09-04 18:34:00

标签: gradle build.gradle

我们有一个私人Nexus,除了此gradle插件外,我们正在获取所有东西。

plugins {
    id 'org.unbroken-dome.test-sets' version '1.2.0'
}

setting.gradle

pluginManagement {
  resolutionStrategy {
      eachPlugin {
         if (requested.id.namespace == 'org.unbroken-dome.gradle-plugins') {
          useModule('org.unbroken-dome.gradle-plugins:gradle-testsets-plugin:1.5.0')
        }
      }
  }
  repositories {
        maven {
            url 'http://someurl.com/repository/MavenRepoGroup/'
            credentials {
                username 'username'
                password 'password'
            }
        }
    }
}

每当我尝试构建时,都会出现以下错误:

* What went wrong:
Plugin [id: 'org.unbroken-dome.test-sets', version: '1.2.0', apply: false] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- maven(http://someurl.com/repository/MavenRepoGroup/) (Could not resolve plugin artifact 'org.unbroken-dome.test-sets:org.unbroken-dome.test-sets.gradle.plugin:1.2.0')

2 个答案:

答案 0 :(得分:0)

问题在于,通过在repositories中配置自定义settings.gradle,您已经覆盖了默认值。尝试像添加它一样

pluginManagement {
    repositories {
        gradlePluginPortal()
        maven {
            url 'http://someurl.com/repository/MavenRepoGroup/'
            credentials {
                username 'username'
                password 'password'
            }
        }
    }
    …
}

答案 1 :(得分:0)

看起来useModule条件与插件ID不一致。 您有:if (requested.id.namespace == 'org.unbroken-dome.gradle-plugins')id 'org.unbroken-dome.test-sets'org.unbroken-dome.之后的部分不同。