Maven War Plugin - 从另一个 jar 添加外部资源
如果我想从另一个 jar 中提取资源,比如图像或 XML 文件,这可能吗?我会使用 Maven Assembly Plugin 或 War Plugin 来执行此操作吗?我希望它最终出现在 WAR 文件中。
沃尔特
If I wanted to pull out a resource from another jar, say an image or XML file, is that possible? Would I use the Maven Assembly Plugin or the War Plugin to do this? I want it to end up in a WAR file.
Walter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 war 模块中使用 Dependency 插件并绑定
dependency:unpack
目标是generate-resources
阶段。查看解压特定工件示例。You could use the Dependency plugin in your war module and bind the
dependency:unpack
goal to thegenerate-resources
phase. Check the Unpacking specific artifacts example.我想从 artefactory 中提取一些资源用于其他项目,我们需要 2 个插件 maven-dependency-plugin 来提取,maven-clean-plugin 来清理项目。调用第一个插件执行目标依赖项:unpack。
上面的用法在 this 中有解释文章。
I want to extract some resource form artefactory to used in other proyect, we need 2 plugins maven-dependency-plugin to extract and maven-clean-plugin to clean proyect. call first plugin execute the goal dependency:unpack.
The usage of the above is explained in this article.