platform
platform copied to clipboard
Cannot use alpha versions of the Gradle plugin
When trying to use the 20.0.0.alpha7 version of the Gradle plugin (only available at http://tools.vaadin.com/nexus/content/repositories/vaadin-prereleases/com/vaadin/vaadin-gradle-plugin/ ) by using the following in build.gradle:
plugins {
id 'com.vaadin' version '20.0.0.alpha7'
}
Gradle fails with:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/mavi/work/my/vok/karibu10-helloworld-application/build.gradle.kts' line: 5
* What went wrong:
Plugin [id: 'com.vaadin', version: '20.0.0.alpha7'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.vaadin:com.vaadin.gradle.plugin:20.0.0.alpha7')
Searched in the following repositories:
maven(https://maven.vaadin.com/vaadin-prereleases)
Gradle Central Plugin Repository
That leads me to believe that Gradle looks up the plugin with the com.vaadin.gradle.plugin artifact ID, while currently we publish the plugin as vaadin-gradle-plugin (the group ID seems to be correct).
Steps to reproduce
- git clone https://github.com/mvysny/karibu10-helloworld-application
- Check out the
masterbranch - Modify the plugin version to 20.0.0.alpha7
- Run
./gradlew
The plugin from the pre-release repository needs to be defined as:
buildscript {
dependencies {
classpath group: 'com.vaadin',
name: 'vaadin-gradle-plugin',
version: '20.0.0.alpha7'
}
}
plugins {
id 'war'
id 'org.gretty' version '3.0.3'
}
apply plugin: 'com.vaadin'
As described in the documentation: https://vaadin.com/docs/latest/guide/start/gradle/#pre-release
Gotcha, that should work well. However, I think it would be a better dev UX if a pre-release versions of the plugin would work with exactly the same code snippet as the release plugin does:
plugins {
id 'com.vaadin' version '20.0.0.alpha7'
}
That will allow the developer to upgrade to the newest release plugin version quickly.
I don't think it possible as the plugins searches for com.vaadin:com.vaadin.gradle.plugin:20.0.0.alpha7 where as the pre-releases version is com.vaadin:vaadin-gradle-plugin:20.0.0.alpha7 I guess gradle plugin portal does some renaming on request?
At least I can't find any way of getting it to work by defining only a plugins.id
I was thinking about renaming the Maven module from vaadin-gradle-pluginto com.vaadin.gradle.plugin - that should do the trick :+1: