0

I would like to add external java libraries to a Maven project using intellij. I followed previous discussions in stackoverflow but none of those work for me. I added jar files to the libraries and source code can detect them but when I try to compile my project (mvn package), it gives me "cannot find symbol" error.

Adib Rastegarnia
  • 355
  • 5
  • 14

1 Answers1

0

if you want to add external jar you can use system scope . Like:

<dependency>
    <artifactId>..</artifactId>
    <groupId>..</groupId>
    <scope>system</scope>
    <systemPath>${basedir}/lib/dependency.jar</systemPath>
</dependency>

its not suggested but you can also install your jar in the repository.

 mvn install:install-file \
   -Dfile=<path-to-file> \
   -DgroupId=<group-id> \
   -DartifactId=<artifact-id> \
   -Dversion=<version> \
   -Dpackaging=<packaging> \
   -DgeneratePom=true
ikarayel
  • 2,214
  • 16
  • 22