问题描述
我需要在使用maven-ear-plugin生成的EAR中添加2个XML文件.
I need to add 2 XML files inside an EAR generated with maven-ear-plugin.
不幸的是,我还没有找到将任意文件添加到EAR的方法.插件的文档,其内容为:"EAR插件支持以下工件: ejb,war,jar,ejb-client,rar,ejb3,par,sar,wsr和har".没有什么可添加常规文件的.
Unfortunately, I haven't seen a way to add an arbitrary file to an EAR; the documentation of the plugin which reads "The EAR plugin supports the following artifacts: ejb, war, jar, ejb-client, rar, ejb3, par, sar, wsr and har". There's nothing for adding a regular file.
org.apache.maven.plugins maven-ear-plugin 2.3.1 富 富 1.4 LIB $ {parent.groupId} 富网 /foo org.richfaces.framework richfaces-api 公地语言 公地语言
org.apache.maven.plugins maven-ear-plugin 2.3.1 foo foo 1.4 lib ${parent.groupId} foo-web /foo org.richfaces.framework richfaces-api commons-lang commons-lang
非常感谢.
推荐答案
在 maven-ear-plugin 2.4.2 ,您可以使用配置元素earSourceDirectory,earSourceExcludes和earSourceIncludes声明要包含在EAR中的额外文件.
In maven-ear-plugin 2.4.2 you can use config elements earSourceDirectory, earSourceExcludes and earSourceIncludes to declare extra files to include in the EAR.
默认情况下,您只需将这些文件放在$ {basedir}/src/main/application文件夹中即可.
By default you simply place those files to ${basedir}/src/main/application folder.
这篇关于Maven:如何使用maven-ear-plugin将文件添加到EAR内部的根目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!