使用 Maven 构建 Java Web Start 应用程序

发布于 2024-12-25 01:00:02 字数 625 浏览 6 评论 0原文

我对几乎所有相关事物都很陌生,但想使用 Maven 构建 Java Web Start 应用程序。我还需要重新打包特定的 .jar (commons-httpclient-3.1.jar),否则它不会使用 JarSigner 进行签名(在我用 google 搜索时,这似乎是一个常见问题)。也许我可以使用 这个 Maven插件,但我什至不知道如何设置Maven存储库。

我(可能)需要:

  • 设置 Maven 存储库以便能够使用上述插件,
  • 使用该插件配置 jnlp 构建,
  • 使用我们开发的三个 .jar(已使用 Maven 构建)并与依赖项(例如 slf4j-api-1.6.1.jar、spring-security-core-3.0.7.RELEASE.jar 和其他十几个),
  • 还解压并重新打包特定的 .jar (使用 jar.exe 重新打包,而不是 zip,因为它不起作用)。

我更喜欢示例而不是大量文档的链接。 :) 提前致谢!

I'm new to almost all related things, but would like to build a Java Web Start application using Maven. I also need to repack a specific .jar (commons-httpclient-3.1.jar), or it won't sign with JarSigner (looks to be a common problem when I googled). Perhaps I could use this Maven plugin, but I don't even know how to setup the Maven repository.

I (might) need to:

  • set up the Maven repository to be able to use the above plugin,
  • configure the jnlp build using the plugin,
  • take use of three .jars that we have developed (already built using Maven) and install along with the dependencies (such as slf4j-api-1.6.1.jar, spring-security-core-3.0.7.RELEASE.jar and a dozen or so others),
  • also unpack and repack a specific .jar (repack using jar.exe, not zip since it doesn't work).

I much prefer examples to links to big chunks of documentation. :) Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妄断弥空 2025-01-01 01:00:03

您现在可能已经明白了这一点,但是插件存储库是通过 pom 中的单独配置引用到正常安装存储库的。

例如,

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Maven Plugin Repository</name>
      <url>http://repo1.maven.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>

请参阅此处 http://maven.apache.org/guides/简介/introduction-to-the-pom.html

You've probably figured this out by now, but plugin repositories are referenced with a separate configuration in your pom to the normal installation repositories.

e.g.

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Maven Plugin Repository</name>
      <url>http://repo1.maven.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>

See here http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

好菇凉咱不稀罕他 2025-01-01 01:00:02

你可以使用 maven web start 插件

或者你可以 使用里面的 jnlp 文件(手动创建)

您甚至可以创建一个 servlet,它将创建一个 jnlp(包含诸如获取某个 lib 目录中的所有 jar 之类的内容)并动态返回到客户端。

该插件应该在maven存储库中,但我从未检查过......

you can use a maven plugin for web start

Alternatively you can generate a war with the jnlp file inside (created manually)

You can even create a servlet that will create a jnlp (with stuff like get all jars in some lib directory) and return dynamically to the client.

The plugin should be in the maven repository, but I've never checked it...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文