mstahv / v-leaflet-heat

This is Leaflet.heat addon to v-leaflet Vaadin add-on.
Other
1 stars 2 forks source link

Dependency Issues #9

Open myungsunscott opened 6 years ago

myungsunscott commented 6 years ago

Looks like a cool addon and I'm keen to start experimenting with it, but I'm getting some build errors when I add the dependency:

A problem occurred evaluating root project '**********'.
> Could not resolve all files for configuration ':runtime'.
   > Could not find jai_core.jar (javax.media:jai_core:1.1.3).
     Searched in the following locations:
         https://repo1.maven.org/maven2/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar

Do you guys know anything about this issue?

myungsunscott commented 6 years ago

@dve @fluorumlabs @mstahv

Do any of you guys have a work around for this?

I still can't get it to compile even.

dve commented 6 years ago

I have not tried, but my guess would be updateing the geotools version. I will try later

myungsunscott commented 6 years ago

@dve Thanks for checking.

I should mention that I've been using gradle when the jai_core.jar issue surfaces.

I just tried making a fresh Vaadin project using Maven and added the v-leaflet-heat addon and it built successfully.

The relevant gradle lines that fail:

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

dependencies {
    compile 'org.vaadin.addon:v-leaflet:2.0.4'
    compile 'org.vaadin.addon:v-leaflet-heat:1.0'
}

The relevant maven lines that succeed:

<repositories>
   <repository>
      <id>vaadin-addons</id>
      <url>http://maven.vaadin.com/vaadin-addons</url>
   </repository>
</repositories>

<dependencies>
   <dependency>
      <groupId>org.vaadin.addon</groupId>
      <artifactId>v-leaflet-heat</artifactId>
      <version>1.0</version>
   </dependency>
</dependencies>
dve commented 6 years ago

I've no idea how gradle solves repositories but the relevant jar is not located in maven-central, but in the osgeo repo which is added in the v-leaflet-heat pom.

http://download.osgeo.org/webdav/geotools/javax/media/jai_core/1.1.3/

myungsunscott commented 6 years ago

@dve okay, must be a problem with Gradle.

I can add the jai_core-1.1.3.jar from another repository if it's added as a dependency directly in my own project's build.gradle file. But, when the jar is a dependency of a dependency (v-leaflet-heat in this case), then Gradle is failing to look in the repository where v-leaflet-heat's POM is pointing (http://download.osgeo.org/webdav/geotools/javax/media/jai_core/1.1.3/). Instead, Gradle continues to look in maven central (https://repo1.maven.org/maven2/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar), which fails because jai_core-1.1.3.jar is not there.

I'm a bit stuck ... at least I understand the problem now, but don't know how to go about finding a solution.

Does anyone else?

mstahv commented 6 years ago

This sure seems to be a missing feature in Gradle. Couldn't you just add the osgeo.org repository directly to your projects configuration?

lucasmontec commented 6 years ago

I'm having the same issue. Can't get it to work on Gradle no matter what. I have even solved the issue with 'javax.media.jai:com.springsource.javax.media.jai.core:1.1.3', but it doesn't compile.

This solves the jai problem: implementation ('org.vaadin.addon:v-leaflet-heat:1.0') { // exclude invalid dependency exclude group: 'javax.media', module: 'jai_core' }

If I set v-leaflet-heat to implementation (gradle's new compile directive), it doesn't show up on the GWT classpath. If I set it to vaadinCompile, then it throws reflection errors (because there is no reflection packages in GWT).

lucasmontec commented 6 years ago

Issues when using the vaadinCompile directive:

:vaadinCompileErrors in 'javax/validation/ParameterNameProvider.java' Line 34: No source code is available for type java.lang.reflect.Constructor<T>; did you forget to inherit a required module? Line 44: No source code is available for type java.lang.reflect.Method; did you forget to inherit a required module? Tracing compile failure path for type 'javax.validation.executable.ExecutableValidator' Errors in 'javax/validation/executable/ExecutableValidator.java' Line 43: No source code is available for type java.lang.reflect.Method; did you forget to inherit a required module? Line 84: No source code is available for type java.lang.reflect.Constructor<T>; did you forget to inherit a required module? Tracing compile failure path for type 'javax.validation.ClockProvider' Errors in 'javax/validation/ClockProvider.java' Line 34: No source code is available for type java.time.Clock; did you forget to inherit a required module? Aborting compile due to errors in some input files

myungsunscott commented 6 years ago

@lucasmontec I was able to get it to work with Gradle eventually.

A few lines from my build file:

...
repositories {
    ...
    maven { url 'http://repository.springsource.com/maven/bundles/external' }
    ...
}
...
dependencies {
   ...
    compile 'javax.media.jai:com.springsource.javax.media.jai.core:1.1.3'
    compile ('org.vaadin.addon:v-leaflet-heat:1.0') {
        exclude group: 'javax.media', module: 'jai_core'
        exclude group: 'javax.validation', module: 'validation-api'
        exclude group: 'org.slf4j', module: 'slf4j-simple'
    }
   ...
}
...

I hope this helps!

lucasmontec commented 6 years ago

@myungsunscott Thanks!!! I`ll try it out tomorrow! Thanks for the setup effort!