1

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.

4

4 回答 4

1

第一:Web Start 可以解决您的问题。这是 maven 插件的文档

第二:确保你

  1. 像这样创建一个密钥库:

    keytool -genkey -alias timefinder -keystore timefinder.jks

  2. 像这样创建一个 jnlp 模板

  3. 以我的pom.xml底部为例

  4. 并通过以下方式调用 Maven:

    mvn 安装 webstart:jnlp

优点:

  • 它会为你做一切
  • 它可以为你创建 pack200 文件(极度压缩的 jars)
  • 如果您在下载服务器上安装了 servlet,它将为您按需处理下载。在这里了解更多信息

缺点:

另一种分发选项可能是一个罐子

于 2009-12-19T15:05:20.953 回答
1

看起来这对于Java Web Start来说是一个完美的案例,特别是因为您已经在考虑将依赖关系保留在网络服务器上。不知道Maven有没有WS插件;我记得为 Maven 1 编写代码来完成这项工作。

如果您想查看 WebStart 的实际效果,我推荐 FindBugs 演示页面: http: //findbugs.sourceforge.net/demo.html——您将在第二段中看到一个链接。

于 2009-12-01T13:03:41.663 回答
0

我不知道做你描述的第一件事的行家方式(这并不意味着没有什么)。

作为替代方案,我会使用IzPack(这确实是一个很棒的软件)和IzPack Maven 插件来生成跨平台安装程序并将其安装/部署到 maven 存储库。

编辑:也许看看高级功能调用Web Installers。我认为它不会完全解决您的问题(仅下载更新/重新安装之间更改的内容)。

于 2009-12-01T00:41:26.617 回答
0

您可以使用Maven 版本插件来检查和/或更新依赖项的版本。

于 2009-12-03T01:58:08.293 回答