手动部署到 Tomcat 时,我的 webapp 工作正常。我想在构建期间执行集成测试,并且我想使用 tomcat7-maven-plugin 来启动将部署 webapp 的嵌入式 tomcat。
中的配置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 正在启动,但随后出现错误:
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存在于战争文件中。将战争部署到独立 Tomcat 实例时,应用程序可以正常工作。
有什么想法会导致 Spring 找不到战争中存在的配置文件吗?