简体   繁体   English

maven-remote-resources-plugin vs maven-resources-plugin

[英]maven-remote-resources-plugin vs maven-resources-plugin

I am creating a multi module maven project and want to keep resources (property files, json) in a separate module.我正在创建一个多模块 maven 项目,并希望将资源(属性文件、json)保存在一个单独的模块中。 Now to import this resource module in other modules, I have two option - either to use maven-resources-plugin or to use maven-remote-resources-plugin.现在要在其他模块中导入这个资源模块,我有两个选择 - 使用 maven-resources-plugin 或使用 maven-remote-resources-plugin。 I already have working code wrt maven-resources-plugin but while searching in internet I found post only on maven-remote-resources-plugin which made me question if I am following maven standards on resources use.我已经有了与 maven-resources-plugin 相关的工作代码,但是在互联网上搜索时,我发现仅在 maven-remote-resources-plugin 上发帖,这让我怀疑我是否遵循了 maven 资源使用标准。 And is it worth to move from maven-resources-plugin to maven-remote-resources-plugin?从 maven-resources-plugin 迁移到 maven-remote-resources-plugin 是否值得? Any pointers with respect to this is appreciated.任何与此相关的指针表示赞赏。

"...want to keep resources (property files, json) in a separate module" “...想要将资源(属性文件,json)保存在一个单独的模块中”

  1. You can use Maven Remote Resources Plugin Of course to bundle your resources in a single JAR that can be used across.您可以使用Maven 远程资源插件当然可以将您的资源捆绑在一个可以跨平台使用的 JAR 中。

    This plugin is used to retrieve JARs of resources from remote repositories, process those resources, and incorporate them into JARs you build with Maven.该插件用于从远程存储库检索资源的 JAR,处理这些资源,并将它们合并到您使用 Maven 构建的 JAR 中。 A very common use-case is the need to package certain resources in a consistent way across your organization: at Apache it is required that every JAR produced contains a copy of the Apache license and a notice file that references all used software in a given project.一个非常常见的用例是需要在整个组织中以一致的方式打包某些资源:在 Apache 中,要求生成的每个 JAR 都包含一份 Apache 许可证副本和一个通知文件,该文件引用给定项目中所有使用的软件.

  2. Maven Resource Plugin has its own usage of copying resources within modules when you don't have them located in the default maven path and want to use them explicitly. Maven Resource Plugin有自己的用法,可以在模块内复制资源,当您没有将它们放在默认的 maven 路径中并希望显式使用它们时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM