Update gradle to use ivy 2.3.0


(Devon Miller) #1

I tried to figure how to raise an enhancement request but I could not. I would like to propose updating ivy to 2.3.0 in the next gradle release. The 2.3.0 release has some eclipse/osgi resolvers that are new and would help with some eclipse plugin builds. This would not replacing maven tycho but its a step to help make it easier to build eclipse-based products using gradle. There may have been some api changes though:

//
// test ivy and eclipse update site resolution
//
apply plugin: "java"
  repositories {
  add(new org.apache.ivy.osgi.updatesite.UpdateSiteResolver(url: 'http://download.eclipse.org/releases/kepler'))
}
  dependencies {
  compile "org.eclipse.pde:3.8.100"
}
  task doit << {
     println "Compile dependencies:"
    configurations.compile.each { println it}
}
  // Dependency resolution forced when its iterated on
defaultTasks ":doit"

I did a straight jar replacement of the 2.2.0 ivy to 2.3.0 to see if would mysteriously work :slight_smile:

Caused by: java.lang.AbstractMethodError: org.gradle.api.internal.artifacts.repositories.cachemanager.DownloadingRepositoryCacheManager.downloadRepositoryResource(Lorg/apache/ivy/plugins/repository/Resource;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/apache/ivy/core/cache/CacheResourceOptions;Lorg/apache/ivy/plugins/repository/Repository;)Lorg/apache/ivy/core/report/ArtifactDownloadReport;
        at org.apache.ivy.osgi.updatesite.UpdateSiteLoader.readJarOrXml(UpdateSiteLoader.java:149)
        at org.apache.ivy.osgi.updatesite.UpdateSiteLoader.readComposite(UpdateSiteLoader.java:127)
        at org.apache.ivy.osgi.updatesite.UpdateSiteLoader.populateP2Descriptor(UpdateSiteLoader.java:110)
        at org.apache.ivy.osgi.updatesite.UpdateSiteLoader.loadP2(UpdateSiteLoader.java:100)
        at org.apache.ivy.osgi.updatesite.UpdateSiteLoader.load(UpdateSiteLoader.java:80)
        at org.apache.ivy.osgi.updatesite.UpdateSiteResolver.init(UpdateSiteResolver.java:63)
        at org.apache.ivy.osgi.repo.AbstractOSGiResolver.ensureInit(AbstractOSGiResolver.java:108)
        at org.apache.ivy.osgi.repo.AbstractOSGiResolver.getRepoDescriptor(AbstractOSGiResolver.java:115)
        at org.apache.ivy.osgi.repo.AbstractOSGiResolver.findIvyFileRef(AbstractOSGiResolver.java:132)
        at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:228)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.IvyDependencyResolverAdapter.getDependency(IvyDependencyResolverAdapter.java:48)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CacheLockingModuleVersionRepository$1.run(CacheLockingModuleVersionRepository.java:45)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)
        at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:232)
        at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
        at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.longRunningOperation(DefaultCacheLockingManager.java:49)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CacheLockingModuleVersionRepository.getDependency(CacheLockingModuleVersionRepository.java:43)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleVersionRepository.getDependency(CachingModuleVersionRepository.java:83)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.IvyContextualiser$1.invoke(IvyContextualiser.java:44)
        at com.sun.proxy.$Proxy39.getDependency(Unknown Source)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain$RepositoryResolveState.resolve(UserResolverChain.java:180)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain.findLatestModule(UserResolverChain.java:92)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain.findLatestModule(UserResolverChain.java:75)
        at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain.resolve(UserResolverChain.java:50)
        ... 90 more
    BUILD FAILED

(Luke Daley) #2

This looks like there are some backwards incompatible binary changes, which effectively makes it impossible for us to upgrade (due to our backwards compatibility restrictions).

We are trying to move away from Ivy, which is another reason we are unlikely to invest in this.

A better long term strategy would be to implement native Gradle “resolvers” (i.e. the equivalent of) for this functionality. Would you be interested in working with us on this?