1

I have a Gradle project that uses Spring Boot + Vaadin. The Gradle plugins for Spring Boot and Vaadin configured as follows:

buildscript {
    ext {
        springBootVersion = '1.3.7.RELEASE'
    }
    ...
    dependencies {
        classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
        classpath "fi.jasoft.plugin:gradle-vaadin-plugin:0.11.1"
    }
}

The Vaadin version is specified as follows:

vaadin {
    version '7.6.8'
    widgetset 'com.vaadin.DefaultWidgetSet'
}

Vaadin dependencies are specified as follows:

dependencies {
    compile 'com.vaadin:vaadin-spring-boot-starter:1.0.0'
    compile 'com.vaadin:vaadin-server:${vaadin.version}'
    compile 'com.vaadin:vaadin-client:${vaadin.version}'
    ...
}

This works fine, but as soon as I change the Spring Boot version to

       springBootVersion = '1.4.0.RELEASE'

then I get the error:

Illegal character in path at index 89: https://oss.sonatype.org/content/repositories/vaadin-snapshots/com/vaadin/vaadin-server/${vaadin.version}/vaadin-server-${vaadin.version}.pom

Update

Groovy (which Gradle uses) supports String interpolation only when using double quotes (") so changing the Vaadin dependencies to

dependencies {
    compile "com.vaadin:vaadin-spring-boot-starter:1.0.0"
    compile "com.vaadin:vaadin-server:${vaadin.version}"
    compile "com.vaadin:vaadin-client:${vaadin.version}"
    ...
}

fixes it. Now the real question is why the single quotes work fine if I downgrade Spring Boot to 1.3.7-RELEASE.

herman
  • 11,740
  • 5
  • 47
  • 58
  • I'm no gradle expert, but at a quick glance it looks like it's not substituting the `${vaadin.version}` in the `compile 'com.vaadin:vaadin-server:${vaadin.version}'`. Can you try replacing the [single quote (`'`) with double quotes (`"`)](http://stackoverflow.com/questions/6761498/whats-the-difference-of-strings-within-single-or-double-quotes-in-groovy)? That worked for me locally with a quick test. Otherwise can you share the whole build file? – Morfic Aug 02 '16 at 13:55
  • In the mean time I figured this out as well: it works indeed with double quotes. But it also works with single quotes with the older Spring Boot version... no clue how the two are related. – herman Aug 02 '16 at 14:00
  • Hmm just a wild thought, perhaps the deps were already in the local repo so it would not need to redownload them until you switched to the newer boot version?! Weird anyhow... – Morfic Aug 02 '16 at 14:10
  • With local repo you mean the Gradle cache? I don't think that's the issue: I upgraded to a newer Vaadin version only recently, so at that point it had to download that newer version and that went fine. Also, changing the Spring Boot version doesn't change the Vaadin version. – herman Aug 02 '16 at 14:29
  • Like I said, I'm not a gradle expert so I'm usure about terminology and functionality, but I assumed it may have a local repo/cache where it downloads the artifacts like maven does. Can you share the whole build file or a similar [sscce](http://sscce.org) to reproduce this? I'm asking because locally I get the same error no matter what version I use and I'm rather curious about the behaviour. – Morfic Aug 02 '16 at 15:53
  • Unfortunately I'm not allowed to share the whole build file. But good to know that you get the error with older Spring Boot versions as well, that means that it's probably a coincidence and not directly related to Spring Boot. – herman Aug 02 '16 at 16:24

1 Answers1

0

If you are using a recent Spring Boot version you should upgrade your Gradle Vaadin plugin. Recent versions of the plugin has much better support for Spring Boot.

Here is a guide to get you started https://github.com/johndevs/gradle-vaadin-plugin/wiki/Creating-a-Spring-Boot-Project

John
  • 880
  • 7
  • 11