availability: January 2017
Maven, the final frontier... This is one of these beasts that can really give you some fun time: some would say, it's merely a build tool. But sometimes the complexity and syntax and dependencies makes me think this is like a profession apart.
I'm writing this blogpost for my own documentation purposes but it might prove you useful.
The task I was facing was to:
I got most information from Can I add jars to maven 2 build classpath without installing them?
The trick seems to be to create a directory inside your java project that can act as a maven repo that you can refer to based upon the project ${basedir} variable.
<% codify(:shell) do %>
$ cd my-project
$ mkdir my-repo
$ mvn org.apache.maven.plugins:maven-install-plugin:2.3.1:install-file -Dfile=/Users/patrick/cooljar.jar -DgroupId=be.jedi -DartifactId=cooljar -Dversion=1.5.1 -Dpackaging=jar -DlocalRepositoryPath=pwd
/my-repo
<% end %>
Now you can add this part to your maven pom file: <% codify(:xml) do %>
Also have a look at A maven friendly pattern for storing dependencies in version control for an alternative.
The document I used to figure out this combination where:
I struggled with the combination of the two and finally found the answer in this Stack Overflow post on the exact problem I had
It seems that depending on the versions of the archiver and Assembly plugin you have to move things around in the maven config file. And if you're on jdk 1.6 you need extra options. The following worked for me:
<% codify(:xml) do %>