Mark Derricutt's Disturbing Thoughts

My Top Tags

                                       

My Jaiku

The Taste of the Day

Thursday, 24 July 2008 10:28 A GMT+12

War of Ages – The Deception of Strongholds

Wednesday, 23 July 2008 5:41 P GMT+12

"L" is not a code smell

Wednesday, 23 July 2008 8:54 A GMT+12

Meshuggah – Sum

Tuesday, 22 July 2008 4:37 P GMT+12

Dates: Relative or Absolute?

Tuesday, 22 July 2008 8:19 A GMT+12

HTTP errors - a set on Flickr

Monday, 21 July 2008 5:37 P GMT+12

Daylight Dies – Last Alone

Monday, 21 July 2008 3:59 P GMT+12

How I Got Started in Software Development

Sunday, 20 July 2008 6:06 P GMT+12

Soilent Green – In The Same Breath

Sunday, 20 July 2008 3:40 P GMT+12

Search Box

 

Using embedded repositories to ease Maven migrations

posted Sunday, 20 January 2008

For awhile I've been wanting to explore migrating our build platform from Apache Ant to Apache Maven and taking advantage of dependency management, the release plugin, and a standardized build process.

One problem I always seem to hit whenever I start to look at mavenizing things - library X version Y that we use is not in the standard repository. The simple solution is to just install the file to my local repository, or a standalone repository for the company to use - the former works great "for me", and the later requires some infrastructure setup (nothing major, but more than my lazy experimenter mind can currently be bothered with).

However, an insanely simple, blindingly obvious solution came to mind - convert/refactor your ./libs directory structure into a repository and declare thus:

<repositories>
  <repository>
    <id>local.3rd.party</id>
    <name>Local 3rd Party repo</name>
    <url>file://${basedir}/repo/</url>
  </repository>
</repositories>

By adding this to your maven pom.xml your simply declaring a local repository thats checked out with your code. Not only can you now easily use maven with your existing libraries, you're ./lib directory is now structured rather than a flat jar dump that often gets slapped into the source tree.

As we're using subversion, we could easily extend this with Subversion's Externals and keep the jars separate from your projects source and share them over multiple projects, or better yet - we could just use Maven's wagon-scm plugin and simply use the subversion repository as a maven repository.

tags:      

links: digg this    del.icio.us    technorati    reddit