我使用带有m2e和m2e-wtp插件的Eclipse Kepler .
我需要自定义我的EAR模块的部署程序集,因为我在Weblogic文件上使用过滤,所以我想使用 /target/m2e-wtp/ear-resources 下生成的文件而不是 /src/main/application 下的文件 .

为了做到这一点,我删除了部署程序集选项卡的 /src/main/application 作为源 .

但是,如果我在EAR项目上右键单击Maven / Update Project,则m2e(或m2e-wtp?)插件会再次在部署程序集选项卡中添加 /src/main/application 目录 .

有没有办法让插件部署配置不被插件覆盖?

如果可能有帮助,我会把我的EAR模块的 pom.xml .

问候,

燕姿

我的Pom.xml:

<artifactId>projetx-sph-ear</artifactId>
<packaging>ear</packaging>
<name>projetx-sph-ear</name>
<description></description>

<!-- Projet parent -->
<parent>
    <artifactId>projetx-sph-parent</artifactId>
    <groupId>fr.sihm.eand</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>

<!-- Dépendances -->
<dependencies>
    <!-- EJB -->
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>projetx-sph-ejb</artifactId>
        <version>${project.version}</version>
        <classifier>${envClassifier}</classifier>
        <type>ejb</type>
        <!--<classifier>${envClassifier}</classifier> -->
    </dependency>

    <!-- WAR -->
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>projetx-sph-web</artifactId>
        <version>${project.version}</version>
        <classifier>${envClassifier}</classifier>
        <type>war</type>
        <!--<classifier>${envClassifier}</classifier> -->
    </dependency>
</dependencies>

<!-- Paramètres de build -->
<build>
    <resources>
        <resource>
            <directory>src/main/application</directory>
            <includes>
                <include>**/*.xml</include>
                <include>**/*.properties</include>
            </includes>
            <filtering>true</filtering>
        </resource>
    </resources>
    <pluginManagement>
        <plugins>
            <!-- Packaging de l'EAR -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <version>6</version>
                    <defaultLibBundleDir>lib</defaultLibBundleDir>
                    <filtering>true</filtering>
                    <classifier>${envClassifier}</classifier>

                    <modules>
                        <ejbModule>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>projetx-sph-ejb</artifactId>
                            <bundleFileName>projetx-sph-ejb.jar</bundleFileName>
                        </ejbModule>
                        <webModule>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>projetx-sph-web</artifactId>
                            <bundleFileName>projetx-sph-gui.war</bundleFileName>
                            <contextRoot>/projetx</contextRoot>
                        </webModule>
                    </modules>
                    <!-- Paramètres de l'archive -->
                    <archive>
                        <!--Ne génère pas le répertoire META-INF/maven/ -->
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <!-- N'ajoute pas de classpath dans le manifest -->
                            <addClasspath>false</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>