How can I merge resource files in a Maven assembly?

前端 未结 5 982
闹比i
闹比i 2020-12-06 10:09

I\'m using Maven and its assembly plugin to build a distribution package of my project like this:

  • one project assembles a basic runtime (based on Felix), with
5条回答
  •  借酒劲吻你
    2020-12-06 10:57

    I don't know of a robust solution to this problem. But a bit of looking around shows that somebody has created a plugin to merge properties files. By the look of it you need to tell it which files to merge, which is a good thing as you don't want this applied willy nilly.

    Assuming you have used dependency-unpack to unpack the zip to a known location, it would be a case of configuring the plugin to merge each pair of properties files and specify the appropriate target location.

    You could extend the plugin to handle XML by using something like xmlmerge from EL4J, as described in this Javaworld article.

提交回复
热议问题