How to add a local JAR file to a Maven project (manual installation and system scope)
Hi everyone! I'm new to Java and Maven, and I have a problem. In my project, I need to use a library that is not in the Maven Central repository — it's an old JAR file from a third-party developer (let's call it `my-lib-1.0.jar`). I downloaded it to the `lib/` folder inside the project.\n\nI tried to add it to `pom.xml` the way I usually add dependencies from Maven Central:\n\n```xml\n\n com.example \n my-lib \n 1.0 \n \n```\n\nBut when building, Maven gives an error: "Missing artifact com.example:my-lib:jar:1.0". I understand that Maven doesn't know where to find this file.\n\nTell me how to properly connect a local JAR so that it gets into the classpath during compilation and into the final JAR/WAR? Do I need to install it somewhere?
No answers yet.
Log in to leave an answer
Blogs