johndevs / gradle-vaadin-plugin

A Gradle plugin for building Vaadin applications
https://devsoap.com/tag/vaadin/
Apache License 2.0
120 stars 58 forks source link

Check ext.vaadinVersion before falling back to latest vaadin version #511

Closed mstahv closed 6 years ago

mstahv commented 6 years ago

With following build script, the theme gets resolved into 8.1.8 as where everything else properly to 8.3.3. Maybe some issue with bom handling.

buildscript {
    ext {
        springBootVersion = '2.0.0.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

plugins {
    id 'com.devsoap.plugin.vaadin' version '1.3.1'
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

ext {
    vaadinVersion = '8.3.3'
}

dependencies {
    compile('com.vaadin:vaadin-spring-boot-starter')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    vaadinCompile("org.vaadin.addon:v-leaflet:2.0.6")
}

dependencyManagement {
    imports {
        mavenBom "com.vaadin:vaadin-bom:${vaadinVersion}"
    }
}
johndevs commented 6 years ago

You need to replace

ext { vaadinVersion = '8.3.3' } 

with

vaadin { version = '8.3.3' }

So the plug-in knows about the correct version as well.

mstahv commented 6 years ago

The "ext style" is apparently what start.spring.io uses for a reason or another. Could it be possible to check if that is defined and fallback to that if nothing else is set?

johndevs commented 6 years ago

Currently it directly falls back to "latest" if not set. But sure, we could also check the ext property as well.