mstahv / v-leaflet

Leaflet add-on for Vaadin
Other
43 stars 38 forks source link

Vaadin Gradle Compile failing #187

Closed lucasmontec closed 5 years ago

lucasmontec commented 6 years ago

Everything was working until: :vaadinCompileErrors 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

Seems leaftlet uses jackson annotation and that is breaking at the clientside compile time. Something like it. I don't think its v-leaflet fault, but I can't find what is causing this...

lucasmontec commented 6 years ago

using gradle:

` repositories { mavenCentral() jcenter() maven { url "http://download.osgeo.org/webdav/geotools/" } maven { url = "http://maven.vaadin.com/vaadin-addons" } }

dependencies {
//VAADIN ADDONS
vaadinCompile  'org.peimari:g-leaflet:+' //For v-leaflet
implementation 'org.vaadin.addon:v-leaflet:+' //For analytics

//UTILS
//implementation group: 'org.reflections', name: 'reflections', version: '0.9.11'
vaadinCompile  'com.fasterxml.jackson.core:jackson-core'
vaadinCompile  'com.fasterxml.jackson.core:jackson-annotations'
vaadinCompile  'com.fasterxml.jackson.core:jackson-databind'
}

`

lucasmontec commented 6 years ago

Completely deleting my widget set broke my app. Downloading my old widgetset from git and placing it at the correct path seems to have worked.

[Edit] Still broken: :processResources :classes :vaadinClassPathJar UP-TO-DATE :vaadinCompileErrors 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

lucasmontec commented 5 years ago

Adding jackson to vaadin compile didn't work also. vaadinCompile 'com.fasterxml.jackson.core:jackson-core:2.9.7' vaadinCompile 'com.fasterxml.jackson.core:jackson-annotations:2.9.7'

lucasmontec commented 5 years ago

Adding all jackons dependencies to vaadinCompile didn't work:

vaadinCompile 'com.fasterxml.jackson.core:jackson-databind:2.9.7' vaadinCompile 'com.fasterxml.jackson.core:jackson-core:2.9.7' vaadinCompile '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

lucasmontec commented 5 years ago

My entire Gradle build file is attached: gradle.build.debug.txt

The project is a spring boot vaadin 8 project.

mstahv commented 5 years ago

@johndevs, any idea what might be the issue here?

lucasmontec commented 5 years ago

Running gradle 4.6.


Gradle 4.6

Build time: 2018-02-28 13:36:36 UTC Revision: 8fa6ce7945b640e6168488e4417f9bb96e4ab46c

Groovy: 2.4.12 Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017 JVM: 1.8.0_181 (Oracle Corporation 25.181-b13) OS: Windows 10 10.0 amd64

johndevs commented 5 years ago

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:+'  

You need to add it to both configurations so it pulls in the transitive dependencies to both classpaths.

lucasmontec commented 5 years ago

@johndevs

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:+'  

You need to add it to both configurations so it pulls in the transitive dependencies to both classpaths.

Just did that and it didn't work. Same error:

Task :vaadinClassPathJar 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 Task :vaadinCompile FAILED With:

vaadinCompile 'org.peimari:g-leaflet:+' //For v-leaflet // 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:+'

mstahv commented 5 years ago

@lucasmontec I tried, with my very very limited Gradle skills and I was able to make v-leaflet work fine with plain servlet project. There was some struggle, but I guess that was because of my limited Gradle skills. My build file for the test was simply this (and all worked just fine with a functional war file):

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

dependencies {
    vaadinCompile 'org.vaadin.addon:v-leaflet:2.0.9'
}

I don't know how Gradle users resolve/investigate their conflicts so I don't have too many good tips how to resolve the the issue. Does the attached project work for you?

Archive.zip

lucasmontec commented 5 years ago

For some divine reason it worked. I removed the g-leaflet dependency, and added only the v-leaflet one. I had tried such before but for some reason it only worked now. I'm using the following config:

vaadinCompile 'org.vaadin.addon:v-leaflet:2.0.9' compile 'org.vaadin.addon:v-leaflet:2.0.9' //NECESSARY TO RUN IN ECLIPSE, adds the dependency to the eclipse classpath config

I had to add the compile directive to run within eclipse, the jar works without it. I have figured that there is a dependencies command for gradle that shows dependencies and transient dependencies. It was quite nice to use.

I really don't know why it wasn't compiling before. I think I may have updated something that fixed it. Anyway, thanks for the support and for the awesome addon!