Maven2 is driving me crazy during the experimentation / quick and dirty mock-up phase of development.
I have a pom.xml
file that defines the dependencies for the web-app framework I want to use, and I can quickly generate starter projects from that file. However, sometimes I want to link to a 3rd party library that doesn't already have a pom.xml
file defined, so rather than create the pom.xml
file for the 3rd party lib by hand and install it, and add the dependency to my pom.xml
, I would just like to tell Maven: "In addition to my defined dependencies, include any jars that are in /lib
too."
It seems like this ought to be simple, but if it is, I am missing something.
Any pointers on how to do this are greatly appreciated. Short of that, if there is a simple way to point maven to a /lib
directory and easily create a pom.xml
with all the enclosed jars mapped to a single dependency which I could then name / install and link to in one fell swoop would also suffice.
Maven install plugin has command line usage to install a jar into the local repository, POM is optional but you will have to specify the GroupId, ArtifactId, Version and Packaging (all the POM stuff).
A strange solution I found:
using Eclipse
cheers, Balint
This is how we add or install a local jar
i gave some default groupId and artifactId because they are mandatory :)
This doesn't answer how to add them to your POM, and may be a no brainer, but would just adding the lib dir to your classpath work? I know that is what I do when I need an external jar that I don't want to add to my Maven repos.
Hope this helps.
You really ought to get a framework in place via a repository and identifying your dependencies up front. Using the system scope is a common mistake people use, because they "don't care about the dependency management." The trouble is that doing this you end up with a perverted maven build that will not show maven in a normal condition. You would be better off following an approach like this.