1

Maven でクリーン インストール ゴールを実行すると、私の spring-servlet.xml が戦争にコピーされません。それは正確には真実ではありません.MyApp.War/WEB-INF/Classes/spring-servlet.xmlにコピーします.MyApp.War/WEB-INF/

私の問題は Pom.xml の構成が悪いことに起因することがわかりました。いくつか試してみましたが、うまくいきませんでした:(

pom.xml :

<build>
    <resources>

        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>

        <resource>
            <directory>src/main/webapp/WEB-INF</directory>
            <filtering>true</filtering>
        </resource>


    </resources>



    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4.2</version>
            <configuration>
                <delimiters>
                    <delimiter>${*}</delimiter><!-- to keep the default behavior -->
                    <delimiter>@</delimiter><!-- to add Ant-like tokens style -->
                </delimiters>
            </configuration>
        </plugin>

        <!-- Définit le répertoire source de la webapp à la racine du projet et 
            avec comme nom le nom de l'artifact -->
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
                <warSourceDirectory>it-nouveauProjet</warSourceDirectory>
                <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
                <manifest>
                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                </manifest>
                <archive>
                    <manifestEntries>
                        <Specification-Title>${project.name}</Specification-Title>
                        <Specification-Version>${project.version}</Specification-Version>
                        <Implementation-Environment>${projet.environnement}</Implementation-Environment>
                        <buildNumber>${buildNumber}</buildNumber>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
                   </build>

私の web.xml は正しくコピーされます。私の spring-servlet.xml と webapp/WEB-INF/ フォルダーにある他のファイルにも同じことが必要ですが、maven war プラグインは webapp/WEB-INF/ のすべてのファイルをコピーします私の戦争のルートフォルダーに。

私は何か見落としてますか ?

4

0 に答える 0