如何使用Maven部署具有依赖项jar的Applet并对其进行签名? [英] How to deploy Applet with dependencies jar using maven and sign it?

查看:292
本文介绍了如何使用Maven部署具有依赖项jar的Applet并对其进行签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我如何用小程序创建一个带有小程序的jar文件,这取决于其他的jars,是否可以将一个小程序作为小程序,以及如何对其进行签名?

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 sign it?

推荐答案

如果您希望类依赖性出现在一个jar文件中,则应使用程序集插件

If you would like your classes and the dependencies to appear in one jar file, you should use either the assembly plugin or the one-jar plugin before the jarsigner. I have the following working setup with the assembly plugin, it will produce the normal (signed) jar and a ${artifactId}-${version}-jar-with-dependencies.jar (also signed).

            <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.2-beta-5</version>
            <configuration>
                <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                </descriptorRefs>
                <archive>
                    <index>true</index>
                    <manifest>
                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                    </manifest>
                </archive>
            </configuration>
            <executions>
                <execution>
                    <id>make-my-applet-jar</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <version>1.2</version>
            <executions>
                <execution>
                    <id>sign</id>
                    <goals>
                        <goal>sign</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <keystore>keystore</keystore>
                <alias>keyalias</alias>
                <storepass>storepass</storepass>
                <keypass>keypass</keypass>
            </configuration>
        </plugin>

这篇关于如何使用Maven部署具有依赖项jar的Applet并对其进行签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆