frazman
frazman

Reputation: 33213

specifying dependency in maven

I have a jar file present in location

/path/to/foo2011020.jar

I am importing this jar as

import org.foo.FOOException;
import org.foo.FOOObject;

How do i specify this in my maven build file??

Is there any good tutorial for learning maven. Will there be two instances in build file I have tried various permutations and combinations but it is just not working. I bet this is something fairly straightforward.

Any pointers.. Thanks

Upvotes: 0

Views: 37

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240860

if you don't want to publish the jar to some private/public nexus and you just want to have it on your disk then use <system> scoped dependency

for example:

<project>
  ...
  <dependencies>
    <dependency>
      <groupId>your.group.id</groupId>
      <artifactId>your-artifact.id</artifactId>
      <version>your.version</version>
      <scope>system</scope>
      <systemPath>/path/to/foo2011020.jar</systemPath>
    </dependency>
  </dependencies>
  ...
</project>

Upvotes: 3

Related Questions