views:

269

answers:

4

I'm moving my project to Maven and eventually OSGi. I currently distribute the project is a large Zip file with all the dependencies. Although my projects code is only 20% of the total package I have to redistribute all the dependency. With smaller independent modules this may be even less.

Looking here on stack overflow it seems that to keep my current plan the maven-assembly-plugin should do the trick.

I was considering having a base installer that would look at a XML manifest, then collect all the libraries that needed to be updated. This would mean that libraries that change occasionally would be downloaded less often. This also makes since for something like OSGi plugins (which could have independent release schedules). In essence I want my software to look and manage individual libraries, and download on demand (based on the manifest).

I was wondering if there is a "maven way" of generating this Manifest and publishing all the libraries to a website? I believe the deploy life-cycle would do the second step.

As an alternative, is there a OpenSource Java library that does this type of deployment? I don't want to embed Maven or something larger with the distributed code. The application is not for coders, the simpler the better, and the smaller the installer the better.

A: 

I don't know a maven way to do the first thing you are describing (which doesn't mean there is nothing for this).

As an alternative, I'd use IzPack (which is really a great piece of sotware) and the IzPack Maven Plugin to generate a cross-platform installer and install/deploy it to a maven repository.

EDIT: Maybe have a look at the advanced feature call Web Installers. I don't think it will solve entirely your problem though (downloading only what changed between updates/reinstall).

Pascal Thivent
I have looked into that to build the base installer. The idea is that this installer will pick the rest of the libraries from the project site (via the manifest).
Thomas
A: 

It seems like this is a perfect case for Java Web Start, particularly since you're already thinking of keeping the dependencies on a webserver. I don't know if Maven has a WS plugin; I remember writing code for Maven 1 to do the job.

If you'd like to see WebStart in action, I recommend the FindBugs demo page: http://findbugs.sourceforge.net/demo.html -- you'll see a link in the second paragraph.

kdgregory
A: 

You can use Maven versions plugin to check and/or update versions of dependencies.

Eugene Kuleshov
A: 

First: Web Start could solve your problem. And here is the documentation for the maven plugin.

Second: Be sure that you

  1. create a keystore like this:

    keytool -genkey -alias timefinder -keystore timefinder.jks

  2. Create a jnlp template like this

  3. look at the bottom of my pom.xml for an example

  4. and call maven via:

    mvn install webstart:jnlp

Advantages:

  • it will do all for you
  • it can create pack200 files for you (extremly compressed jars)
  • it will handle download on demand for you if you have a servlet installed on the download server. Here for more information

Disadvantages:

Another distribution option might be one jar

Karussell