1

How to add my own jar file in maven project. When I try to add by using build path it's not recognizing classes in my jar file.

is there any specific way of doing it ?

user3191903
  • 237
  • 2
  • 6
  • 14

2 Answers2

2

Either you can use system scope and provide path OR you can install your custom jar to your local maven repository

mvn install:install-file -Dfile=/path/to/your.jar -DgroupId=com.your.group.id 
-DartifactId=your-custom-artifact-id -Dversion=some-version -Dpackaging=jar

and/or maven repository which is shared across developers

jmj
  • 237,923
  • 42
  • 401
  • 438
2

This link http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html shows how to use maven import to add your own jars to your maven repository

mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
    -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>
Scary Wombat
  • 44,617
  • 6
  • 35
  • 64