通过命令行 (asadmin) 部署应用程序客户端

发布于 2024-12-03 11:41:33 字数 313 浏览 1 评论 0原文

是否有选项/参数可以使用 asadmin 命令部署启用 java-web-start 的应用程序客户端?我使用 GlassFish 3.1.1。

当我在 webgui 中部署它时,我有一个运行良好的 jar 文件

类型:“应用程序客户端”
Java-Web-Start [x]

我寻找这样的东西:

asadmin deploy --type application --property java-web-start-enabled=true /path/to/jar/file/myApp.jar

Is there an option/parameter to deploy an application client with java-web-start enabled with the asadmin command? I work with GlassFish 3.1.1.

I have a jar-file which works well, when I deploy it in the webgui

Type: "Application Client"
Java-Web-Start [x]

I look for something like this:

asadmin deploy --type application --property java-web-start-enabled=true /path/to/jar/file/myApp.jar

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

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

发布评论

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

评论(2

悍妇囚夫 2024-12-10 11:41:33

当 jar 文件签名时,部署在 glassfish 中的“应用程序客户端”只能通过 java-web-start 启动。因此,当我使用“glassfish Web 管理控制台”部署它时,jar 文件已签名并且一切按预期工作。当我通过脚本(例如 jenkins)部署它时,Web 启动参数不起作用并且文件未签名。结果:java web start 不起作用。

解决方案:我使用 Maven 插件对 jar 文件进行签名。为此,我首先必须将 Glassfish 证书导入密钥库

keytool -importkeystore -srckeystore "../../glassfish/domains/domain1/config/keystore.jks"  

带有“maven-jarsigner-plugin”插件的 pom 文件如下所示:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jarsigner-plugin</artifactId>
    <version>1.2</version>
    <configuration>
      <alias>s1as</alias>
      <storepass>changeit</storepass>
      <keypass>changeit</keypass>
    </configuration>
    <executions>
      <execution>
        <id>sign</id>
        <goals>
          <goal>sign</goal>
        </goals>
      </execution>
      <execution>
        <id>verify</id>
        <goals>
          <goal>verify</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

现在我可以使用 asadmin 部署脚本部署应用程序,而 java-web-start 是已启用!

An "Application Client" deployed in the glassfish can only started by java-web-start, when the jar-file is signed. So when I deploy it with the "glassfish web administration console", the jar-file is signed and everything works as expected. When I deploy it throught a script (for example jenkins), the web start parameter doesn't work and the files aren't signed. The result: java web start doesn't work.

Solution: I sign the jar file with a maven plugin. For that, I first had to import the Glassfish certificate into the keystore

keytool -importkeystore -srckeystore "../../glassfish/domains/domain1/config/keystore.jks"  

The pom-file with the "maven-jarsigner-plugin" plugin looks like:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jarsigner-plugin</artifactId>
    <version>1.2</version>
    <configuration>
      <alias>s1as</alias>
      <storepass>changeit</storepass>
      <keypass>changeit</keypass>
    </configuration>
    <executions>
      <execution>
        <id>sign</id>
        <goals>
          <goal>sign</goal>
        </goals>
      </execution>
      <execution>
        <id>verify</id>
        <goals>
          <goal>verify</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

Now I can deploy the application with a asadmin deployment script, and java-web-start is enabled!

水水月牙 2024-12-10 11:41:33

您编写的命令与您想要的命令非常接近...请参阅http://download.oracle.com/docs/cd/E18930_01/html/821-2433/deploy-1.html#scrolltoc

GlassFish 的应用程序客户端/Java Web Start 支持功能的首席工程师撰写了许多有关该功能的博客文章: http://blogs.oracle.com/quinn/

The command that you have written is very close to the command that you want... see http://download.oracle.com/docs/cd/E18930_01/html/821-2433/deploy-1.html#scrolltoc.

The lead engineer on the application client/Java Web Start support features of GlassFish has written a number of blog entries about the feature: http://blogs.oracle.com/quinn/

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