Marko Bauhardt wrote:
Hi,
i want to build a project with snapshot jars. the repo where the jars are located is inside a vpn. If the vpn connection is lost, then we cant build the projects, because ivy does not build changing artifacts in offline modus (i think). the docu from ivy does not document a cache resolver http://ant.apache.org/ivy/history/trunk/settings/resolvers.html. so my question is how i can define a local cache resolver which is pointed to my gradle cache repo.

i want to use the local cache resolver not by default. for example "gradle compile -Doffline"

This lines works for me but i think this is not a perfect solution....

...
if(System.getProperty("offline") != null) {
        classpathResolvers.add(new FileSystemResolver()) {
            name = 'my-local-cache-repository'
addIvyPattern("$gradleUserHome/cache/[organisation]/[module]/ivys/ivy-[revision].xml") addArtifactPattern("$gradleUserHome/cache/[organisation]/[module]/[type]s/[artifact]-[revision].[type]")
        }
    }
...

Exists a other solution?


Not really. Perhaps you could try the ivy mailing list?

Gradle doesn't do anything special to solve this problem. It probably could tweak the ivy configuration when in offline mode, so that your build does not have to. Could you raise a JIRA issue for this?

In case the vpn is lost and i build with offline option everything looks good. but if i'm connected to the vpn again and i build without "offline" option i'm getting the warning message

    unknown resolver my-local-cache-repository

but the build is successfull. i can avoid this message by deleting the build-resolver with executing "gradle compile -r"


Marko


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to