gavioto
gavioto

Reputation: 1745

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

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.

Upvotes: 27

Views: 23059

Answers (5)

jdsthlm
jdsthlm

Reputation: 61

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")

Upvotes: 1

elect
elect

Reputation: 7190

For Gradle users:

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

Upvotes: 10

gavioto
gavioto

Reputation: 1745

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.

Upvotes: 33

A. Baena
A. Baena

Reputation: 131

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

Upvotes: 3

user1712200
user1712200

Reputation: 349

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.

Upvotes: 6

Related Questions