4

I am new to Maven and I want to add SSJ library to dependencies in a maven project, I tried adding this in the POM.xml:

  <dependency>
        <groupId>ca.umontreal.iro</groupId>
        <artifactId>ssj</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

but eclipse is giving this error: Missing artifact ca.umontreal.iro:ssj-2.5

It seems that it's not found in the repository.. I have the jar file, how can I add it to dependencies? if possible. If not, what would be the alternative to include this jar in the project?

Sami
  • 7,797
  • 18
  • 45
  • 69

2 Answers2

6

you can either install jar manually into local repository http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html or set the file storage path to dependency like

<dependency>
    <groupId>com.3dpaty</groupId>
    <artifactId>abc</artifactId>
    <version>0.0.3</version>
    <scope>system</scope>
    <systemPath>lib/3party.jar</systemPath>
</dependency>
Hard Worker
  • 995
  • 11
  • 33
Andrey Borisov
  • 3,160
  • 18
  • 18
5

You'll need to add the jar to your maven local repository.

mvn install:install-file -Dfile=/path/to/ssj.jar -DgroupId=ca.umontreal.iro -DartifactId=ssj -Dversion=2.5 -Dpackaging=jar

(Change /path/to/ssj.jar to the path of the the file in your computer)

This will make it possible for Maven to resolve this JAR from the local repository using the dependency defined above, when you are building your application.

Rajesh J Advani
  • 5,585
  • 2
  • 23
  • 35