In the course of an assignment for a client I’ve been giving Artifactory a good going-over. Artifactory is a Maven repository and mirror and is pretty cool and easy to set up – just drop the WAR file into a running Tomcat instance. On my Mac I ran it under Tomcat 6.0.18 with Java 5, and on my personal Linux box (Ubuntu) I ran it with Tomcat 5.5 and Java 6. All is pretty sweet and it is fairly trivial to get Maven set up to use it. It’s just a matter of overriding the ‘central’ repository in your ~/.m2/settings.xml to point to you new local copy – by default it mirrors several useful repositories as well as the default one. Adding security (such as public read-only access and username/password for deployment of artefacts) takes only a few minutes on top of that.
In the course of all this testing though I thought it best to use it in something like real anger with the Maven release plugin rather than my rather artificial usage scenario I was building up between my two development machines.
As a result of all that I’ve released a version of my Monetary library, money-is-money. The version is 0.15 and the Maven repository for it can be found at http://modular.autonomous.org:80/artifactory-2.0.5/libs-releases-local
If you want to check the source code out with SVN out the release is at http://crazymcphee.net/svn/money/tags/money-is-money-0.15 and the latest trunk at http://crazymcphee.net/svn/money/trunk (which at the time of writing is the same as the release of course, except it generates 0.16-SNAPSHOT).
To include it into your Maven POM you’ll have to add my respository to a profile in your settings.xml:
<repositories>
<repository>
<id>crazy-mcphee</id>
<url>http://modular.autonomous.org:80/artifactory-2.0.5/libs-releases-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
At which point you can include the dependency in your pom.xml for your project:
<dependency>
<groupId>org.autonomous</groupId>
<artifactId>money-is-money</artifactId>
<version>0.15</version>
</dependency>
After that Maven should fetch the artifact from my repository automatically for you. Money-Is-Money is deliberately designed to void any external dependencies on anything other than Java libs, except for JUnit which only matters if you want to build from source. For more information please see this post.
One Trackback/Pingback
[...] money-is-money into my own Maven repository gave the impetus to me to clean up the actual code base of the library. There are now a grand total [...]