How do I add local jar files (not yet part of the Maven repository) directly in my project\'s library sources?
Another interesting case is when you want to have in your project private maven jars. You may want to keep the capabilities of Maven to resolve transitive dependencies. The solution is fairly easy.
Add the following lines in your pom.xml file
${pom.basedir}/libs/
local-maven-repository
file://${local.repository.folder}
true
true
Open the .m2/repository folder and copy the directory structure of the project you want to import into the libs folder.
E.g. suppose you want to import the dependency
com.mycompany.myproject
myproject
1.2.3
Just go on .m2/repository and you will see the following folder
com/mycompany/myproject/1.2.3
Copy everything in your libs folder (again, including the folders under .m2/repository) and you are done.