I get an error downloading javax.media.jai_core:1.1.3 from maven central

21k views Asked by At

I get an error downloading javax.media.jai_core:1.1.3 from maven central.

The error is:

download failed: javax.media#jai_core;1.1.3!jai_core.jar

using play compiler.

5

There are 5 answers

2
gavioto On BEST ANSWER

The problem at this moment is that maven-central doesn't have the .jar, which is a dependency from geotoolkit

Sample of maven repo content

If you need it, you could use the next public repositories:

https://maven.geotoolkit.org (jai-core is here)

https://repo.osgeo.org/repository/release/

Make sure geotoolkit-repo is before Maven Central, so that it resolves before Central which misses the jar.

0
jdsthlm On

Solution for gradle with kotlin dsl (8.4)

Below changes in file build.gradle.kts

Add jboss repository in repository section

 maven {
    url = uri("https://repository.jboss.org")
 }

Exclude from dependencies using jai_core

implementation("org.geotools:gt-shapefile:30.0") {
    exclude("javax.media", "jai_core")
}
implementation("org.geotools:gt-swing:30.0") {
    exclude("javax.media", "jai_core")
}

Add dependency on jai.core that exists in jboss maven repository

implementation("javax.media:jai-core:1.1.3")
1
A. Baena On

I was having a similar problem, trying to add icepdf to my pom for a project. What worked for me was adding this exclusion inside de dependency tag:

<exclusions>
    <exclusion>
        <groupId>javax.media</groupId>
        <artifactId>jai-core</artifactId>
    </exclusion>
</exclusions>

Here is the link to the answer that helped me, hoping it helps some other people having this same issue:

https://stackoverflow.com/a/48248739/10428307

2
user1712200 On

And move the http://download.osgeo.org/webdav/geotools repo to the first position in your repo list. Otherwise it will probably still give you that error.

1
elect On

For Gradle users:

    mavenCentral().content {
        excludeModule("javax.media", "jai_core")
    }