Maven quick tip: adding a local dependency

Well after almost 6 months of silence, here’s a maven quick tipif you need to add a dependency on a library without adding ityour local maven repository.Define the dependency scope as system and the path to your library:

<dependency>
<groupid>weblogic</groupid>
<artifactid>weblogic</artifactid>
<version>8.1.4</version>
<scope>system</scope>
<systempath>
${weblogic.home}/server/lib/weblogic.jar
</systempath>
</dependency>

Then, either declare the weblogic.home property in your pom :

<properties>
<weblogic.home>c:/bea/weblogic81</weblogic.home>
</properties>

or add it to your settings.xml file by adding it to a default profile:

<profile>
<id>dev</id>
<properties>
<weblogic.home>C:/bea/weblogic81</weblogic.home>
</properties>
</profile>
<activeprofiles>
<activeprofile>dev</activeprofile>
</activeprofiles>

I am not yet fully committed to maven but it really shines for kickstartingJ2EE projects with artifacts and easily downloadable dependencies libraries.