Это должно дать вам рабочую сборку:
plugins {
// the Gradle plugin which provides the “dependencyManagement” block
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
// add Java build functionality to be able to follow the Vaadin guide
id 'java'
}
dependencyManagement {
imports {
// the Maven BOM which contains a coherent set of module versions
// for Vaadin dependencies
mavenBom 'com.vaadin:vaadin-bom:10.0.11'
}
}
repositories {
// find dependency modules on Maven Central
mavenCentral()
}
dependencies {
// the dependency module you need according to the Vaadin with
// Spring Boot guide; the version of the module is taken from the
// imported BOM; transitive dependencies are automatically taken
// care of by Gradle (just as with Maven)
compile 'com.vaadin:vaadin-spring-boot-starter'
}
Запустите ./gradlew dependencies --configuration compileClasspath
, чтобы убедиться, что все зависимости доступны на вашем пути к классам компиляции Java.
Отредактировано для ответа на вопрос в комментариях: действительно, импорт спецификации приводит к несколько другому набору зависимостей, чем был бы использован без него. Вы можете увидеть разницу зависимостей так:
./gradlew dependencies --configuration compileClasspath > with-BOM.txt
- Удалите блок
dependencyManagement
и добавьте версию к одиночной зависимости: compile 'com.vaadin:vaadin-spring-boot-starter:10.0.11'
./gradlew dependencies --configuration compileClasspath > without-BOM.txt
diff -u with-BOM.txt without-BOM.txt
Вы можете увидеть небольшие отличия, такие как org.webjars.bowergithub.webcomponents:webcomponentsjs:1.2.6
при использовании спецификации и версии 1.2.2
без нее. Причину этого можно найти в спецификации , где определена версия 1.2.6
, и где авторы также упоминают причину этого: «транзитивные зависимости webjar, определенные здесь для повторяемых сборок»