2

I have a spring-vaadin project using vaadin addons and a gradle configuration. Adding V-Leaflet to my project worked the first time, but later it broke and the widgetset never compiled again. The compilation fails reporting it can't find jackson:

:vaadinPluginVersionCheck SKIPPED
:compileJava
:vaadinUpdateWidgetset
:processResources UP-TO-DATE
:classes
:vaadinClassPathJar UP-TO-DATE
:vaadinCompile

Errors in 'org/vaadin/addon/leaflet/shared/Point.java'
Line 37: JsonValue cannot be resolved to a type
Line 3: The import com.fasterxml cannot be resolved
Aborting compile due to errors in some input files
 FAILED

Here is the relevant section in the gradle dependencies section:

compile 'com.fasterxml.jackson.core:jackson-core:2.9.7'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.7'
vaadinCompile  'org.peimari:g-leaflet:+' //For v-leaflet
compile  'org.vaadin.addon:v-leaflet:+' //For map fields

I have already tried using vaadinCompile, compile and implementation for all of them.

  • One possibility is that you have two different versions of Jackson in your class path, and hence class loader cannot determine which JsonValue to use. Typically I am checking the dependency tree in this kind of case and excluding the unwanted transitive dependency, see https://discuss.gradle.org/t/how-do-i-exclude-specific-transitive-dependencies-of-something-i-depend-on/17991 – Tatu Lund Nov 25 '18 at 08:04
  • I have tested that but there is no conflict with the available jackson. The vaading gradle plugin developer tried to help me also, with: Have you tried adding the addon on the vaadidnCompile classpath? So it would look like this. // Add addon + its transitive dependencies to GWT compile classpath vaadinCompile 'org.vaadin.addon:v-leaflet:+' // Add addon + its transitive dependencies to Java compile classpath compile 'org.vaadin.addon:v-leaflet:+' But it didn't work. – Lucas Montenegro Carvalhaes Nov 29 '18 at 21:16

1 Answers1

1

I have solved this.

I don't know exactly what happened but I solved it by updating everything and removing direct access to transitive dependencies within the vaadinCompile step.

The final gradle script is:

vaadinCompile 'org.vaadin.addon:v-leaflet:2.0.9'
compile 'org.vaadin.addon:v-leaflet:2.0.9'

Only adding the vaadinCompile part solved the issue for the jar and running from gradle, but I had to add the compile directive also, so that eclipse could find v-leaflet classes on the classpath.

ollitietavainen
  • 3,900
  • 13
  • 30