My webapp is working properly when manually deployed to Tomcat. I want to perform integration tests during build and I want to use tomcat7-maven-plugin to start embedded tomcat to which webapp will be deployed.
Configuration in pom.xml
:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<path>/${name}</path>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
Tomcat is starting but then error appears:
org.springframework.beans.factory.BeanInitializationException:
Could not load properties; nested exception is java.io.FileNotFoundException:
Could not open ServletContext resource [/WEB-INF/conf/configuration.properties]
/WEB-INF/conf/configuration.properties
is present in war file. Application works correctly when war is deployed to standalone Tomcat instance.
Any ideas what can cause that Spring cannot find configuration file, which is present in war?