0

I've installed my jar in my local repo as said in maven docs :

mvn install:install-file
  -Dfile=<path-to-file>
  -DgroupId=<dans>
  -DartifactId=<dans-lib>
  -Dversion=<1.0.0>
  -Dpackaging=<jar>
  -DgeneratePom=true

I can see in my /home/.m2/repository that the location is created and in the dans/dans-lib/1.0.0 there is my jar file. Unfortunately when I'm trying to add maven dependency in my pom.xml

<dependency>
     <groupId>dans</groupId
     <artifactId>dans-lib</artifactId>
     <version>1.0.0</version>
</dependency>

I got error Dependency dans:dans-lib not found. I've got no idea what might be the problem

mario
  • 186
  • 3
  • 16

1 Answers1

1

First solution is to add local repo to pom.xml something like this

<repositories>
    <repository>
        <id>local-maven-repo</id>
        <url>file:///${project.basedir}/local-maven-repo</url>
    </repository>
 </repositories>

2nd solution woudld be to load jar file

<dependency>
 <groupId>dans</groupId
 <artifactId>dans-lib</artifactId>
 <version>1.0.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/src/main/resources/Name_Your_JAR.jar</systemPath>
</dependency>
SinisaT90
  • 92
  • 2