Tuesday, June 28, 2011

Gradle Build to create POM

Any Java/java-compatible language compile these days is going to want to create a POM file - POM's to install locally, POM's to upload remotely, a POM for all seasons.

For Groovy SPARQL, I wanted to create a simple POM, so folks could add dependencies to their project and start using it.  I'm using the latest and greatest Gradle to build the project, and wanted to simply add 'apply plugin' to get a POM created.  Unfortunately that errored out with a missing group Id.  This wasn't surprising, since it wasn't clear if gradle was going to somehow extract a groupId automatically or if you would specify it.

The Gradle docs have the example, but it's down at example 36.8, and since it doesn't show groupId, it didn't jump out as obvious as this was the correct way to do it.  So here it is, a quick gist on how to get a simple gradle artifact into POM format and installed.

This created a ./build/poms/default-pom.xml with correct groupId, artifactId, and dependencies (properly scoped).

No comments:

Post a Comment