In ant, it’s pretty easy to use the ant task get to download something for you. Apparently it’s not something most maven users do (probably because they end up doing something like an ant=run). Even though maven has in-built web communications (this is how it often is found downloading the interweb), it wasn’t easy finding out how to download something not in a maven repository (without having to deploy artefacts into a maven repository which I understand is the “maven way”).
Anyway, after sometime, here’s the plugin configuration I used to do the download. Note that we’re using Maven 2.1.0 (and it could have changed in the latest version).
The following plugin will download
artifact.jar from the web directory
http://host/pathToArtifact and drop it into a folder called
target/downloadedFiles. This does this at the start of the maven lifecycle (note the phase it is attached to below).
Some limitations is that it won’t fail if it can download some of the artifacts and not others.
One of the many issues I had (have) with Maven is finding out how to use an appropriate plugin. The site documentation is normally pretty obscure, and examples are sparse. One of the activites we needed to do recently is to turn our war artifact into something that would run standalone. I’d normally use something like jetty for this but I didn’t find a way to easy bundle jetty and refer to the war within the same classpath (and still have things work).
Another tool I stumbled across was winstone (Hudson uses this beast). Wrapping this up seemed pretty easy enough. Note that the configuration below is used to start a war that won’t have dynamic JSP compilation. If you do, you can add a
useJasper=true configuration and add the appropriate maven dependencies for jasper to ensure they’re available.
The result of this plugin will effectively build an executable jar, that you simply start up.
Need to add these dependencies:
Given that your project is a war package as well
You will find this artifact built in your standard