Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using a Maven Repository on Kenai

DZone's Guide to

Using a Maven Repository on Kenai

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

One of the missing things on Kenai is a Maven repository. I mean, an "official" Maven repository managed by Kenai staff. This doesn't mean you can't create your own repository on Kenai. Peter Mount explains ( part one, part two) how you can just create a Maven repository as a Subversion site - in his latter post, Peter shows how to automatically perform a deploy by using Hudson, with some script trickery.

But, thanks to the wagon-svn maven plugin, it is possible to do that directly with Maven. The plugin implements a Maven extension making it able to deploy to any Subversion-based repository (actually, it has been developed for Java.Net, that has got such a repository).

So, I've just created a Tidalwave project on Kenai, that I'll use for hosting some common facilities for all my projects, then I added a Subversion repository named "tidalwave~maven-repo". To deploy to that repository, a pom needs the following elements:

    <repositories>
<repository>
<id>maven2-repository.dev.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2</url>
<layout>default</layout>
</repository>
</repositories>

<distributionManagement>
<repository>
<id>maven2-repository.tidalwave.kenai.com</id>
<name>Tidalwave Maven Repository</name>
<url>svn:https://kenai.com/svn/tidalwave~maven-repo/2</url>
<uniqueVersion>false</uniqueVersion>
</repository>
</distributionManagement>

<build>

<extensions>
<extension>
<groupId>org.jvnet.wagon-svn</groupId>
<artifactId>wagon-svn</artifactId>
<version>1.8</version>
</extension>
</extensions>
...
<build>



The declaration of the Java.Net repository is used to find the wagon-svn plugin, that takes care of target repositories whose URL starts with svn:.

The first time you do a mvn deploy, the computer will ask for the username and password of the target repository; after you set once, they will be remembered in the Subversion preferences, so this thing will also work with Hudson.

You can check out a very small Maven project using my new brand Maven repository from here: https://kenai.com/svn/thesefoolishthings~svn/trunk/src - TheseFoolishThings is a collection of tiny libraries (mostly made by a single file) for functions that so far I used to copy & paste in different projects, and that now I'm refactoring.

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}