如何使用 Maven 安装 JCE Unlimited Strength 策略文件?
我的一些代码需要 JCE 无限强度策略文件。我想将此依赖项添加到 Maven Pom 文件中,以便我团队中的其他开发人员不必单独将其应用到他们的系统中。
我意识到最终部署到的系统需要手动安装 JCE 文件。这只是一个开发解决方案。
我以为我们会将策略文件添加到我们的存储库中,并且 Maven 将能够处理安装,但令我惊讶的是我找不到其他人这样做(并在博客中介绍它)。
Some code I have requires the JCE unlimited Strength Policy Files. I'd like to add this dependency into the Maven Pom file so the other developers on my team don't have to individually each apply this to their systems.
I realize that the systems this is eventually deployed to will need to have the JCE files manually installed. This is a development solution only.
I was thinking that we would add the policy files to our repository and maven would be able to handle installation, but I am surprised that I can't find anyone else doing this (and blogging about it.).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在谷歌搜索策略 JAR 的 Maven 依赖项时找到了答案,并意识到它是特定于 JRE 安装的,因此将其作为 Maven 构建的一部分修复仅适用于开发人员,并且仅当您有权访问 /jre/lib/security 文件夹时。对我来说,以下代码 hack 效果更好(将其作为应用程序执行的首要任务之一调用):
I've found that answer, when googling for Maven dependencies for policy JARs and realized that it's JRE installation specific, thus fixing this as part of Maven build will work only for developers and only when you have rights to /jre/lib/security folder. For me the following code hack works much better (invoke this as one of the very first things your application does):
Java 8 安全黑客
Java 8 security hack
您可以尝试以下操作:
zip
?) JCE 无限强度策略文件。zip
依赖项安装到您的公司存储库。dependency:unpack
目标是将创建的依赖项解压到${java.home}/jre/lib/security
作为构建的一部分,例如在initialize
期间(请参阅 解压特定工件)。You could maybe try this:
zip
?) the JCE unlimited strength policy files.zip
dependency.dependency:unpack
goal to unpack the created dependency to${java.home}/jre/lib/security
as part of your build, e.g. duringinitialize
(see Unpacking specific artifacts).