jakarta-eedeploymentglassfish-3application-clientasadmin

Deploy Application Client by command line (asadmin)


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

Solution

  • 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!