The Artima Developer Community
Sponsored Link

Java Buzz Forum
Using a lib directory with Maven

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Nick Lothian

Posts: 397
Nickname: nicklothia
Registered: Jun, 2003

Nick Lothian is Java Developer & Team Leader
Using a lib directory with Maven Posted: Mar 16, 2005 2:13 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Nick Lothian.
Original Post: Using a lib directory with Maven
Feed Title: BadMagicNumber
Feed URL: http://feeds.feedburner.com/Badmagicnumber
Feed Description: Java, Development and Me
Latest Java Buzz Posts
Latest Java Buzz Posts by Nick Lothian
Latest Posts From BadMagicNumber

Advertisement

People seem unaware that it is pretty easy to use a lib directory in Maven builds. Many ant builds use structures like below:


+---lib
+---src
    +---conf
    +---java
    +---test
I find this a useful layout, especially if you have jars that do not exist in the main Maven repository.

In Maven, you might have a dependency declared like this:


<dependency>
	<id>cas</id>
	<artifactId>cas</artifactId>
</dependency>
In your projects.properties file you can override the location of each jars like this:

maven.jar.override=on
maven.jar.cas=lib/cas-2.0.12.jar
You need to add an entry for each jar you want to override the location of. I haven't figured out how to make it work for all the alternate types of dependency declarations, though.

Obviously this (like too many things in Maven) is something that should be a lot easier than it is. I think that the project.xml should be able to specify a build-repository that is checked before the local repository, since that would make self-contained builds a lot easier. In the mean time, this is a useful measure that I've found useful.

Read: Using a lib directory with Maven

Topic: Move the code to the data Previous Topic   Next Topic Topic: Sidekick J2ME sdk release

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use