rodm / gradle-teamcity-plugin

Gradle plugin for developing TeamCity plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Resolve fails with 'hostname in certificate didn't match'

rodm opened this issue · comments

Since switching to using https for the JetBrains Maven repository resolving the artifacts sometimes fails

:common:compileJava
:common:processResources UP-TO-DATE
:common:classes
:common:jar
:compileJava
FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.jetbrains.teamcity:server-api:8.1.5.
  Required by:
      :test-plugin:unspecified
   > Could not resolve org.jetbrains.teamcity:server-api:8.1.5.
      > Could not get resource 'https://download.jetbrains.com/teamcity-repository/org/jetbrains/teamcity/server-api/8.1.5/server-api-8.1.5.pom'.
         > Could not HEAD 'https://download.jetbrains.com/teamcity-repository/org/jetbrains/teamcity/server-api/8.1.5/server-api-8.1.5.pom'.
            > hostname in certificate didn't match: <download.jetbrains.com> != <www.jetbrains.com> OR <www.jetbrains.com> OR <jetbrains.com>

To work around this problem the default repositories added by the plugin can be disabled and replaced.

repositories {
    mavenCentral()
    maven {
        url = 'http://download.jetbrains.com/teamcity-repository'
    }
}

teamcity {
    defaultRepositories = false
}