Is there an example of gradle with ivy svn repository?

I’m just trying to see if I can use Gradle to replace an ant build integrated with Ivy and a Subversion repository. Any examples of how to get Gradle pull dependencies from svn (with or without Ivy) would be appreciated!

Any examples of how to get Gradle pull dependencies from svn (with or without Ivy) would be appreciated!

What exactly do you mean by that? Pull dependencies from an SVN working copy? Pull them from an SVN repository accessible over HTTP? In what ways would this be different from accessing a file/HTTP repository without SVN involved?

It’s svn via https, with userid/password params required.

Ivy repositories in the Gradle user guide explains how to access (password protected) Ivy repositories.

I’m assuming Dean got this to work and therefore there were no other posts to this question.

However, I’m running into issues and any help will be appreciated.

I’m on Gradle 1.8 and I have a local Ivy repository and one in SVN. Prior to upgrade to Gradle 1.8, I was using the add(FileSystemResolver) and add(SvnResolver) respectively.

After seeing the deprecated warnings for add, I’ve attempted to use the ivy DSL, however, for the Ivy via svn repository, I’m seeing this error:

A problem occurred evaluating root project 'myproject-ws-trunk'.
> Could not resolve all dependencies for configuration ':compileCopy'.
   > Could not resolve com.mycompany:my-api:5.2.+.
                Required by:
                                                              com.mycompany:myproject-ws-trunk:unspecified
                     > Could not list versions using Ivy pattern 'https://<mysvnrepository>/svn/ctsvn/ivy/repository/[organisation]/[module]/[revision]/ivy.xml'.
         > Unable to parse Http directory listing
                                                                                                                    > Unsupported ContentType text/xml for DirectoryListing

Stack trace is below: Caused by: org.gradle.api.internal.resource.ResourceException: Could not list versions using Ivy pattern ‘https:///svn/ctsvn/ivy/repository/[organisation]/[module]/[revision]/ivy.xml’.

at org.gradle.api.internal.artifacts.repositories.resolver.ResourceVersionLister$1.visit(ResourceVersionLister.java:60)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.listVersionsForAllPatterns(ExternalResourceResolver.java:316)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.findDynamicResourceUsingPatterns(ExternalResourceResolver.java:307)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.findResourceUsingPatterns(ExternalResourceResolver.java:283)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.findIvyFileRef(ExternalResourceResolver.java:254)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.getDependency(ExternalResourceResolver.java:155)

at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.getDependency(ExternalResourceResolver.java:148)

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:214)

at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:276)

at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)

at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.longRunningOperation(DefaultCacheLockingManager.java:50)

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:87)

at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.CachedRepository.getDependency(CachedRepository.java:54)

at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain$RepositoryResolveState.resolve(UserResolverChain.java:183)

at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain.findLatestModule(UserResolverChain.java:97)

at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain.findLatestModule(UserResolverChain.java:80)

at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserResolverChain.resolve(UserResolverChain.java:55)

… 95 more Caused by: org.gradle.api.internal.resource.ResourceException: Unable to parse Http directory listing

at org.gradle.api.internal.externalresource.transport.http.HttpResourceLister$1.transform(HttpResourceLister.java:57)

at org.gradle.api.internal.externalresource.transport.http.HttpResourceLister$1.transform(HttpResourceLister.java:49)

at org.gradle.api.internal.externalresource.AbstractExternalResource.withContent(AbstractExternalResource.java:60)

at org.gradle.api.internal.externalresource.transport.http.HttpResourceLister.list(HttpResourceLister.java:49)

at org.gradle.api.internal.externalresource.transport.DefaultExternalResourceRepository.list(DefaultExternalResourceRepository.java:119)

at org.gradle.api.internal.artifacts.repositories.resolver.ResourceVersionLister$1.listAll(ResourceVersionLister.java:145)

at org.gradle.api.internal.artifacts.repositories.resolver.ResourceVersionLister$1.listRevisionToken(ResourceVersionLister.java:73)

at org.gradle.api.internal.artifacts.repositories.resolver.ResourceVersionLister$1.visit(ResourceVersionLister.java:53)

… 114 more Caused by: org.gradle.api.internal.resource.ResourceException: Unsupported ContentType text/xml for DirectoryListing

at org.gradle.api.internal.externalresource.transport.http.ApacheDirectoryListingParser.parse(ApacheDirectoryListingParser.java:45)

at org.gradle.api.internal.externalresource.transport.http.HttpResourceLister$1.transform(HttpResourceLister.java:54)

… 121 more

Forgot to add the relevant portion of the gradle script:

ivy {
      name "local"
      ivyPattern "${USER_HOME}/.build/local/[organisation]/[module]/[revision]/ivy.xml"
      artifactPattern "${USER_HOME}/.build/local/[organisation]/[module]/[revision]/[artifact](-[classifier])-[revision].[ext]"
   }
     ivy {
      name "ivysvn"
      url "https://<mysvnrepository>/svn/ctsvn/ivy/repository"
      layout "pattern", {
         ivy "[organisation]/[module]/[revision]/ivy.xml"
         artifact "[organisation]/[module]/[revision]/[artifact](-[classifier])-[revision].[ext]"
      }
      credentials {
         username 'jsmith'
         password 'mypassword'
      }
   }

Could you please raise a new forum issue for this. One important piece of information is what webserver is actually serving up the repository content: Gradle depends on the webserver directory listing, and in this case it appears to be XML instead of a standard HTML page.

If you raise a new forum topic, we can easily link it to a Jira issue.

Thanks. I’ve created a new “Problem” at http://gsfn.us/t/4awew. I’ve also added the web server details there.