v-leaflet and gradle

Hey folks,

got some problems regarding the addon v-leaflet and gradle :confused:
The following errors occur after
gradle vaadinRun
:

[ERROR]
 Errors in 'jar:file:/C:/Users/martin.nigbur/.gradle/caches/modules-2/files-2.1/org.vaadin.addon/v-leaflet/1.0.0-b7/6316a69b3dfb48948c0b60aaa4678daac39b34f2/v-leaflet-1.0.0-b7.jar!/org/vaadin/addon/leaflet/client/LeafletCircleConnector.java'
[ERROR]
 Line 73: No source code is available for type org.peimari.gleaflet.client.MouseOutListener; did you forget to inherit a required module?
[ERROR]
 Line 63: No source code is available for type org.peimari.gleaflet.client.MouseOverListener; did you forget to inherit a required module?
[ERROR]
 Line 38: No source code is available for type org.peimari.gleaflet.client.LatLng; did you forget to inherit a required module?
[ERROR]
 Line 48: No source code is available for type org.peimari.gleaflet.client.MouseEvent; did you forget to inherit a required module?

Iā€™m using the following build.gradle:

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

plugins {
id 'fi.jasoft.plugin.vaadin' version '1.0'
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'

jar {
baseName = 'sos'
version = '0.0.1-SNAPSHOT'
}

repositories {
mavenCentral()
maven {
url 'http://maven.vaadin.com/vaadin-addons'
}
}

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

dependencyManagement {
imports {
mavenBom "com.vaadin:vaadin-bom:7.7.3"
}
}

Any clues?

Hi Martin,

did you found out a solution to this problem? I am trying to do the same thing, but did not found anything till now. Thank you in advance for your info.

Best regards,
Adrian

Looks like gradle donā€™t seem to resolve the transitive g-leaflet dependency. Iā€™m a total disaster with gradle, but maybe adding that directly could help?

Hey,

i added the following, now its working.

task compileWidgetset << {
ant.java(classname:'com.google.gwt.dev.Compiler', failOnError: 'true', fork: 'true')
{
jvmarg(value: '-Xss1024k')
arg(line: '-logLevel INFO')
arg(line: '-war src/main/webapp/VAADIN/widgetsets')
arg(value: 'AppWidgetset')
classpath {
pathElement(location: 'src/main/resources')
pathElement(path: configurations.compile.asPath)
pathElement(path: configurations.compileWidgetset.asPath)
pathElement(path: configurations.provided.asPath)
}
}
}

war {
dependsOn compileWidgetset
archiveName = archivesBaseName + '.war'
manifest {
attributes 'Main-Class': 'com.test.main'
}
}

Hmm, the vaadin vaadin gradel plugin should do that automatically. You could maybe try with its latest version and without the above configuration. Let me know if it donā€™t yet work and weā€™ll ask the gradle expert directlye after taht.

Hi folks,
I tried this issue with the fi.jasoft.plugin.vaadin version 1.1.1 and 1.1.2 (latest).
I have the same problems as Martin.
If i try to run ā€œgradle vaadinRunā€ gradle canā€™t find the sources while doing ā€œvaadinCompileā€.

Hi,

Looks like v-leaflet is still not Vaadin 8 compatible and the Gradle Vaadin plugin will use Vaadin 8 by default (maybe Matti could quickly fix that in the addon :wink: ).

For now to make it work, you will need to tell the vaadin plugin to use vaadin 7. Here is a working gradle build file which you can adopt (
Note that you do not need to add the vaadin dependencies or boms yourself to your build, the plugin will do it for you!
).

plugins {
    id 'fi.jasoft.plugin.vaadin' version '1.1.2'
}

vaadin {
    version '7.+' // Use Vaadin 7 as v-leaflet is not yet compatible with Vaadin 8
}

dependencies {
    compile 'org.vaadin.addon:v-leaflet:+'
}

Same problem different plugin:

  • IntelliJ
  • Vaadin 7.+
  • Google Map Plugin

build.gradle:

// Tell Gradle to add Vaadin support
plugins {
id 'fi.jasoft.plugin.vaadin' version '1.1.2'
}

vaadin {
version '7.+' // Use Vaadin 7 as v-leaflet is not yet compatible with Vaadin 8
}

// Tell Gradle that we are working in idea
apply plugin: 'idea'
apply plugin: 'java'

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile group: 'com.vaadin.tapio', name: 'googlemaps', version: '1.3.4'
// https://mvnrepository.com/artifact/com.google.gwt.google-apis/gwt-ajaxloader
compile group: 'com.google.gwt.google-apis', name: 'gwt-ajaxloader', version: '1.1.0'
// https://mvnrepository.com/artifact/com.github.branflake2267/gwt-maps-api
compile group: 'com.github.branflake2267', name: 'gwt-maps-api', version: '3.10.0-alpha-7'
}

output:

Line 69: No source code is available for type com.google.gwt.maps.client.overlays.InfoWindowOptions; did you forget to inherit a required module?
Line 73: No source code is available for type com.google.gwt.maps.client.overlays.Marker; did you forget to inherit a required module?
Line 56: No source code is available for type com.google.gwt.maps.client.overlays.InfoWindow; did you forget to inherit a required module?
Line 69: No source code is available for type com.google.gwt.maps.client.MapWidget; did you forget to inherit a required module?
Line 58: No source code is available for type com.google.gwt.maps.client.events.closeclick.CloseClickMapHandler; did you forget to inherit a required module?

Started with:

  • vaadinCreateProject
  • added dependencies
  • vaadinUpdateWidgetset
  • vaadinRun

am i doing something totally wrong?