本文介绍了添加.mf&在Maven构建的EAR中的META-INF目录下的.xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有任意的.xml& .mf文件,我必须添加在耳朵本身的META-INF文件夹中。构建是使用maven2.2.1完成的。只需在$ {basedir} / src / main / application / META-INF /下添加这些文件就行了,但是这并不符合我的需求。还有另一种方法做这样的事情吗?我试过:

 < build> 
<资源>
< resource>
<目录> G:/ WS / vermeg / ear2 / XML's< / directory>
< targetPath> META-INF< / targetPath>
< / resource>
< /资源>
< / build>

但是这并不会将我的xml文件添加到EAR本身。



我也试过:

 < configuration> 
< earSourceDirectory> G:\WS\vermeg\ear2\XML's\< / earSourceDirectory>
...
< / configuration>

这个命令将我的文件添加到耳朵里,但不是在EAR里面的META-INF里(myEar .ear / META-INF)。



欢迎任何帮助,而且会很棒。 Thnx。

nacef,

解决方案

尝试使用资源插件这里描述:


I have arbitrary .xml & .mf files that i have to add in the META-INF folder inside the ear itself. Build is done using maven2.2.1. Simply adding those files under ${basedir}/src/main/application/META-INF/ works fine, but it doesn't fit my needs. Is there another way to do such thing? I tried:

<build>
<resources>
        <resource>
            <directory>G:/WS/vermeg/ear2/XML's</directory>
            <targetPath>META-INF</targetPath>
        </resource>
    </resources>
</build>

but this doesn't add my xml files under the EAR itself.

I also tried:

<configuration>
            <earSourceDirectory>G:\WS\vermeg\ear2\XML's\</earSourceDirectory>
...
</configuration>

this commands add my files inside the ear, but NOT in the META-INF inside the EAR (myEar.ear/META-INF).

Any help is welcome, and would be great. Thnx.

nacef,

解决方案

Try using the resources plugin as described here: http://maven.apache.org/plugins/maven-resources-plugin/examples/copy-resources.html

这篇关于添加.mf&amp;在Maven构建的EAR中的META-INF目录下的.xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 14:29