Reputation: 433
I am running Eclipse Juno with Tomcat 7 on Windows 7 platform.
When I build my project with Maven the web.xml is correctly derived. I go into in eclipse and refresh and check my target\web.xml and so far so good. I run the Tomcat server and everything is as normal.
As soon as I restart Eclipse the web.xml is back to the placeholder version and I have to build from Maven again and refresh the sources before running Tomcat.
I have exactly the same set up on Ubuntu and this doesn't happen.
Under Project Facets I am using Dynamic Web Module 3.0.
=======
<artifactId>nordicedge</artifactId>
<packaging>war</packaging>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>kivadmin2_logic</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>kivUpdater</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.directwebremoting</groupId>
<artifactId>dwr</artifactId>
<version>3.0.M1</version>
</dependency>
<dependency>
<groupId>rome</groupId>
<artifactId>rome</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>se.nordicedge</groupId>
<artifactId>neim</artifactId>
<version>4.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>se.nordicedge</groupId>
<artifactId>neutil</artifactId>
<version>4.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webXml>${project.build.directory}/web.xml</webXml>
<warSourceExcludes>**/DSEditor.properties,**/META-INF/context.xml</warSourceExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<includes>
<include>web.xml</include>
</includes>
<filtering>true</filtering>
<targetPath>${project.build.directory}</targetPath>
</resource>
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF/NEIDMgmt</directory>
<includes>
<include>DSEditor.properties</include>
</includes>
<filtering>true</filtering>
<targetPath>${project.build.directory}/nordicedge/WEB-INF/NEIDMgmt</targetPath>
</resource>
<resource>
<directory>${basedir}/src/main/webapp/META-INF</directory>
<includes>
<include>context.xml</include>
</includes>
<filtering>true</filtering>
<targetPath>${project.build.directory}/nordicedge/META-INF</targetPath>
</resource>
</resources>
</build>
Upvotes: 1
Views: 939
Reputation: 31651
If you're using m2e-wtp, first of all check you're in the latest version, means 0.17. After that, for resource filterings make use of Maven War plugin in order to filter them in standard build phase:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<filtering>true</filtering>
<directory>src/main/webapp</directory>
<includes>
<include>**/*.xhtml</include>
<include>**/*.xml</include>
</includes>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
<targetPath>WEB-INF/classes</targetPath>
</resource>
</webResources>
</configuration>
</plugin>
Upvotes: 1