Include following into pom.xml

<build>
<sourceDirectory>src</sourceDirectory>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources-one</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!– this is important –>
<overwrite>true</overwrite>
<!– this as well (target/ was missing) –>
<outputDirectory>./src/main/java/</outputDirectory>
<resources>
<resource>
<directory>../src/</directory>
</resource>
</resources>
</configuration>
</execution>

<execution>
<id>copy-resources-two</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>./src/main/webapp/</outputDirectory>
<resources>
<resource>
<directory>../WebContent/</directory>
</resource>
</resources>
</configuration>
</execution>

<!–<execution> <id>copy-resources-three</id> <phase>validate</phase>
<goals> <goal>copy-resources</goal> </goals> <configuration> <overwrite>true</overwrite>
<outputDirectory>${basedir}/conf</outputDirectory> <resources> <resource>
<directory>../conf</directory> </resource> </resources> </configuration>
</execution> –>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>WEB-INF/lib/*.jar </packagingExcludes>
<webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
<warName>jbosscache</warName>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
</configuration>
</plugin>

</plugins>
</build>

Advertisements