Eclipse Maven WTP插件在切换配置文件时不刷新资源

Eclipse Maven WTP插件在切换配置文件时不刷新资源,eclipse,maven,eclipse-wtp,maven-eclipse-plugin,Eclipse,Maven,Eclipse Wtp,Maven Eclipse Plugin,我正在使用EclipseJuno和Maven WTP插件开发一个web应用程序。这个应用程序有一个标题图像,我还有两个Maven配置文件。这些配置文件允许更改标题图像,因为它们指向图像所在的不同目录。这就是它们的配置方式: <profile> <id>local</id> <properties> <imagen.cabecera.dir>src/main/resources/styles/headers

我正在使用EclipseJuno和Maven WTP插件开发一个web应用程序。这个应用程序有一个标题图像,我还有两个Maven配置文件。这些配置文件允许更改标题图像,因为它们指向图像所在的不同目录。这就是它们的配置方式:

<profile>
    <id>local</id>
    <properties>
        <imagen.cabecera.dir>src/main/resources/styles/headers/example1</imagen.cabecera.dir>
    </properties>
</profile>

<profile>
    <id>local2</id>
    <properties>
        <imagen.cabecera.dir>src/main/resources/styles/headers/example2</imagen.cabecera.dir>
    </properties>
</profile>

有人知道吗?

您可能需要通过以下方式更新Maven项目配置:

右键单击项目->Maven->更新项目


MavenEclipseWTP插件正在从webapp目录获取要部署的数据。线索是,在执行
mvn clean install
时没有清理此目录,因为Maven只清理目标目录。诀窍是我也将要更新的资源

<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>2.5</version>
    <configuration>
        <filesets>
            <fileset>
                <directory>src/main/webapp/images</directory>
                <includes>
                    <include>cabecera.jpg</include>
                </includes>
            </fileset>
        </filesets>
    </configuration>
</plugin>

maven清洁插件
2.5
src/main/webapp/images
cabecera.jpg
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <executions>
        <execution>
            <id>copy-resources</id>
            <phase>process-resources</phase>
            <goals>
                <goal>copy-resources</goal>
            </goals>
            <configuration>
                <outputDirectory>${project.build.directory}</outputDirectory>
                <resources>
                    <resource>
                        <directory>${imagen.cabecera.dir}</directory>
                        <includes>
                            <include>cabecera.jpg</include>
                        </includes>
                        <targetPath>${project.build.directory}/header</targetPath>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <executions>
        <execution>
            <id>default-war</id>
            <configuration>
                <webResources>
                    <resource>
                        <directory>${project.build.directory}/header</directory>
                        <includes>
                            <include>cabecera.jpg</include>
                        </includes>
                        <targetPath>/images</targetPath>
                    </resource>
                </webResources>
            </configuration>
        </execution>
    </executions>
</plugin>
<plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>2.5</version>
    <configuration>
        <filesets>
            <fileset>
                <directory>src/main/webapp/images</directory>
                <includes>
                    <include>cabecera.jpg</include>
                </includes>
            </fileset>
        </filesets>
    </configuration>
</plugin>