I need to know if having a Maven project, I can import external (*.jar)’s without generating a Maven dependency (POM), just importing them in the project build path.
I’m finding troubles trying to run the project when it asks me for other dependencies that I’m no able to find in the web, and I have checked that those dependencies are not necessary because I checked my code and the (*.jar)’s in a project which doesn’t use Maven and it works (without the necessity of importing that libs).
Disclaimer: the following is only applicable when working in an environment where multiple people will share the same project. If you’re on your own then all that has been suggested is just fine.
I’m not fond of system dependencies or doing local imports; in both cases you’re still managing dependencies per machine and that is a burden Maven should be taking away from you.
If you really have a dependency that cannot be found in any online Maven repository, I would rather take the hard but more dependable route and that is to install a local Nexus server, which you can then also setup as a nice mirror for Maven central and the JBoss Nexus so clients don’t have to keep downloading dependencies off of the internet. That way you have a single machine where all your Maven dependencies are maintained, which makes it nice and controllable. Plus your Nexus is more readily available; an external Maven source may go down or become unavailable should your internet connection drop.
You can then install your jars in the Nexus (in a local repository called ‘third-party’ is a common strategy I have seen used in the companies I have worked for so far) and your Maven clients, if properly told that your Nexus server is a mirror, can reference the third-party Maven dependencies as if they are coming from an online one.