Search code examples
javagradleintellij-ideadependenciesvaadin

Java Dependency Bad Gateway 502 - fi.jasoft.plugin.vaadin 1.0.1 is missing


Inherited a project and am trying to run the build.gradle but the dependency is no long on maven... and I have googled and can't find any other active repos. There's a vaadin-spring 1.0.1 but I don't know if that's the same thing. Any body else run into this issue?


buildscript {
    repositories {
        //jcenter()
        mavenCentral()
        maven {
            url "https://plugins.gradle.org/m2/"
        }

    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE")
        classpath('fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1')

    }
}

apply plugin: "fi.jasoft.plugin.vaadin"

The error:

Could not get resource 'http://dl.bintray.com/johndevs/maven/fi/jasoft/plugin/gradle-vaadin-plugin/1.0.1/gradle-vaadin-plugin-1.0.1.jar'.
         > Could not HEAD 'http://dl.bintray.com/johndevs/maven/fi/jasoft/plugin/gradle-vaadin-plugin/1.0.1/gradle-vaadin-plugin-1.0.1.jar'. Received status code 502 from server: Bad Gateway

I tried to do a > build gradle and got the error. I have also tried importing a cache on a teammate that has it working but it does not recognize the cache I have imported by replacing my ~/.gradle with my teammates files


Solution

  • It looks like you've added a dependency on the wrong Maven coordinates.

    Looking in the Gradle Plugin Portal I can see that the dependency should be classpath("fi.jasoft.plugin:gradle-vaadin-plugin:1.0.1")

    buildscript {
      repositories {
        mavenCentral()
        maven {
          url "https://plugins.gradle.org/m2/"
        }
      }
      dependencies {
        // wrong coordinates:
        // classpath('fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1') 
        // correct coordinates:
        classpath("fi.jasoft.plugin:gradle-vaadin-plugin:1.0.1")
      }
    }
    

    The coordinates you had used, fi.jasoft.plugin.vaadin:fi.jasoft.plugin.vaadin.gradle.plugin:1.0.1, do actually exist in the Gradle Plugin Portal Maven repo, but there's no JAR. Why is this?

    The reason for this is that Gradle plugins require a marker artifact, so that Gradle can identify plugins using an ID in the plugins block DSL.

    For this reason, I recommend you replace using the buildscript {} block to define plugins, and instead use the new plugins {} block.

    plugins {
      id "fi.jasoft.plugin.vaadin" version "1.0.1"
    }