Maven 程序集解压
我最近需要在我的一个构建中使用 zip 文件。将正确的 *.zip 文件放入包中后,我需要在压缩整个包之前将其解包到程序集中。
需要对其进行压缩的原因是出于管理目的。我知道也可以简单地查看扩展目录。
请并谢谢你
I have recently need to use a zip file in one of my builds. Once I have place the proper *.zip file in the package, I need to unpackage it in the assembly, before the entire package is zipped.
The reason it need to be zipped is for management purposes. I know that could simply check out the expanded directory as well.
Please and thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的个人经验,这不能通过 Maven 程序集插件来完成。我认为现在唯一可用的选择是使用 Maven antrun 插件并执行 ant 解压缩任务。我认为在程序集插件中无法进行解压缩、解压等操作的原因是,它可能会导致一些不良用途,就像许多 ant 脚本中那样。
您可以在需要解压缩内容之前的阶段使用 antrun 插件执行解压缩。例如,如果您的程序集正在打包阶段运行,您可以将 antrun 脚本设置为在准备打包阶段运行。
Maven 开发社区一直在使用 war 插件进行覆盖,并取得了巨大成功。也许相同的功能可以应用于 Maven 程序集插件。可能是一个很好的增强请求。
I know from personal experience, this cannot be done with the Maven assembly plugin. I think the only option available right now is using the Maven antrun plugin and executing the ant unzip task. I think the reason that unzipping, untaring, etc. are not available in the assembly plugin is the fact that it could lead to some bad uses like it has in many ant scripts.
You could perform your unzipping with the antrun plugin in the phase right before you need the unzipped contents. For instance, if your assembly is running the in the package phase, you can set the antrun script to run in the prepare-package phase.
The Maven development community has been playing with overlays with the war plugin with great success. Maybe that same functionality could be applied to the maven assembly plugin. Might be a good enhancement request.