How to deploy Applet with dependencies jar using maven and sign it?

前端 未结 2 892
无人及你
无人及你 2020-12-29 12:28

Can someone show me how pom file should look like to create a jar file with applet which depends from some other jars is it possible to have one jar as applet, and how to si

2条回答
  •  长发绾君心
    2020-12-29 12:35

    This is sample pom for applet with dependency on other (signed) jar. Code of your applet module will be packaged into jar and signed using test key.

    
      
        parent
        com.example
        0.1
      
      4.0.0
      com.example
      applet
      0.1-SNAPSHOT
      jar
      com.example.applet
      
        ${artifactId}-${version}
        
          
            org.apache.maven.plugins
            maven-jarsigner-plugin
            
              
                
                  sign
                
                package
                
                  src/main/keystore/signing-jar.keystore
                  applet
                  applet
                  applet
                
              
            
          
        
      
      
        
          com.example
          other
          0.4
        
      
    
    

    This is sample shell script to create key store (place and run it where your pom file is located):

    #!/bin/sh
    KEYSTORE=src/main/keystore/signing-jar.keystore
    keytool -genkey -alias applet -keystore $KEYSTORE -storepass applet -keypass applet -dname "CN=developer, OU=group 3, O=com.example, L=Somewhere, ST=Germany, C=DE"
    keytool -selfcert -alias applet -keystore $KEYSTORE -storepass applet -keypass applet
    

    After mvn package you will have your signed com.example.applet-0.1-SNAPSHOT.jar. Place it together with your dependency (com.example.other-0.4.jar) in your web-application.

提交回复
热议问题