Luc Dewavrin's weblog

Maven Quick Tip: Adding a Local Dependency

| Comments

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:

1
2
3
4
5
6
7
8
9
<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 :

1
2
3
<properties>
      <weblogic.home>c:/bea/weblogic81</weblogic.home>
</properties>

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

1
2
3
4
5
6
7
8
9
10
<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.

Comments