2 août 2014

Grails Offline mode with Maven dependency resolution

Developing with Grails 2.3.5, the maven dependency resolution is almost perfectly integrated.
It depends on the aether core engine to resolve dependencies.

A problem arises when working on offline mode, without any way to check for artifacts repositories.
The application in development runs and gets stuck on "|Configuring classpath" step... for minutes until the application finally starts!
Unfortunately, the configuration grails.offline.mode=true doesn't work with maven resolution, only with the legacy "ivy" dependency resolution.

So here is the trick, after trying loads of configurations failing (-Dsun.net.client.defaultReadTimeout, -Dsun.net.client.defaultConnectTimeout), I ended up adding the following parameters to the JVM :

-Daether.connector.connectTimeout=500 -Daether.connector.requestTimeout=500

Configuring faster timeouts, I can't even notice a latency during application boot :)

Productivity is back !

0 commentaires:

Enregistrer un commentaire

Fourni par Blogger.