Wednesday, April 24, 2013

using a local Ivy repository with gradle

How to use Groovy Grape to populate a local Ivy repository:

@echo off
REM this batch file executes Groovy Grape install to populate the repository

REM given the group, module, and version as commandline parameters
REM files are cached in REPO\.groovy\grapes

set GROOVY_HOME=C:\tools\groovy-2.0.5

set REPO=C:\tools\repo

%GROOVY_HOME%\bin\grape --verbose -Duser.home=%REPO% install %* 


Then use the following in a gradle build to access the repository: 

repositories {
   ivy {
      ivyPattern "C:/tools/repo/[organization]/[module]/ivy-[revision].xml"
      artifactPattern "C:/tools/repo/[organization]/[module]/jars/[module]-[revision].jar"
   }
}  

No comments:

Post a Comment