Posts in category maven

Robotlegs Fork: Getting Maven with It

I recently forked Robotlegs (on github) because I wanted to be able to build Robotlegs using Maven. Currently, Robotlegs uses Ant to build, test, generate asdoc's, etc. However, in my day-to-day projects I'm using Maven...in fact I don't even have Ant setup (which only takes 30 seconds once you download the ZIP).

In the next few days I expect to be done configuring the pom.xml at which point I'll submit a "pull request". This will allow one of the main people behind Robotlegs to decide if they want to pull it into the main Robotlegs source tree.

Using Local Maven Repository with Gradle

Gradle is capable of using Maven to find artifacts, including your own local maven repository.

To get this working I had to put the following stuff in my build.gradle.

usePlugin 'maven'  // Maven plugin to install artifact in local Maven repo.

def localMavenRepo = new File('c:/work/.m2/repository').toURL().toString()

repositories {
    // Use local Maven repo location. We don't need this if we only want to install
    // an artifact, but we do need it if we want to use dependencies from the local
    // repository.
    mavenRepo urls: localMavenRepo
    
}

dependencies {
    compile 'com.itextpdf:itextpdf:5.0.0'
    groovy 'org.codehaus.groovy:groovy:1.6.7'  // group:name:version is a nice shortcut notation for dependencies.
    testCompile 'junit:junit:4.7'
}
blog comments powered by Disqus