[GRADLE-2395] JAI dependency can't be find through maven Created: 19/Jul/12  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0
Fix Version/s: None

Type: Bug
Reporter: fx thoorens Assignee: Unassigned
Resolution: Won't Fix Votes: 1


 Description   

this script does not work:

apply plugin: 'java'

repositories {
    flatDir {
        dir 'lib'
    }
    mavenCentral()
}
dependencies {
    compile group: 'javax.media', name: 'jai_core', version: '1.1.3'
}

I have jai_core-1.1.3.jar in the lib/ folder

I get the error

Artifact 'javax.media:jai_core:1.1.3@jar' not found

However when i comment out mavenCentral() it works

The reason i think:
the pom actually exists but not the jar in maven because of licensing issue that prevents from its distribution. In maven, you have to download it manually and put it in your local cache.

The reason it is a blocker:
Here the simple workaround is to remove maven repository, but when jai_core is actually a sub-dependency from another lib, you are stuck, because gradle will never look into the flatDir

The solution would be to look in declared flatDir when a jar is not found (event if the pom is found) in the maven repository.

Hope it is clear enough!



 Comments   
Comment by fx thoorens [ 19/Jul/12 ]

here the pom for jai_core in maven: http://search.maven.org/#artifactdetails%7Cjavax.media%7Cjai_core%7C1.1.3%7Cjar
look how they forward you to a downloadUrl (which is by the way wrong!) and not pointing to any jar...

Comment by fx thoorens [ 19/Jul/12 ]

found a work around: put this repository BEFORE mavenCentral():
maven

{ url 'http://download.osgeo.org/webdav/geotools/' }

in this case we can move this issue from blocker to major

Comment by Nikolaus Krismer [ 22/Jul/15 ]

This solution only works if you have the jai_core-1.1.3.jar in the lib folder (at least for me... tested with gradle 2.5)
One would expect that the jar get downloaded from the OsGeo repository, since it is available in this repo (which is not the case for mavenCentral.. there are only a pom and a javadoc file).

I could only solve the problem by adding following repository

maven {
    url 'https://repo.gradle.org/gradle/plugins-releases'
}

and by using this dependency for jai_core

compile 'javax.media.jai:com.springsource.javax.media.jai.core:1.1.3'

Although this is a acceptable workaround for me, I'd really like to now, thy adding the OSGeo repo before mavenCentral does not work if the jai_core-1.1.4.jar is not in a local flatDir repo.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:20:45 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.