I have used this command to push my jar to maven repository.(created jar using mvn clean install)
mvn install:install-file -Dfile=abc-model-1.0-SNAPSHOT.jar -DgroupId=com.abc -DartifactId=abc-model -Dversion=1.0-SNAPSHOT -Dpackaging=jar -DgeneratePom=true
After successfully adding the jar to local mvn repository I have added the following as the dependency where I am going to use it.
<dependency>
<groupId>com.abc</groupId>
<artifactId>abc-model</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
But I am unable to access packages inside the jar. And also it is not in the External Libraries also. I have some model classes that I am trying to do is use those in a different project.
mvn clean verify. - J Fabian Meiermvn clean installwithout error, then all necessary libraries are there. It might be that Eclipse or IntelliJ don't show them, but that is another story. - J Fabian Meier