如何使用maven部署带有依赖jar的Applet并对其进行签名?
有人可以告诉我 pom 文件应该是什么样子来创建一个带有小程序的 jar 文件,该文件依赖于其他一些 jar 是否可以将一个 jar 作为小程序,以及如何对其进行签名?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您希望您的类和依赖项出现在一个jar文件中,您应该使用程序集插件 或 one-jar 插件位于 jarsigner 之前。我对程序集插件进行了以下工作设置,它将生成正常的(签名的)jar 和 ${artifactId}-${version}-jar-with-dependency.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).
这是小程序的示例 pom,依赖于其他(签名的)jar。您的小程序模块的代码将被打包到 jar 中并使用测试密钥进行签名。
这是创建密钥存储的示例 shell 脚本(将其放置在 pom 文件所在的位置并运行):
mvn 打包后,您将拥有签名的 com.example.applet-0.1-SNAPSHOT.jar。将其与您的依赖项 (com.example.other-0.4.jar) 一起放入您的 Web 应用程序中。
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.
This is sample shell script to create key store (place and run it where your pom file is located):
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.