我正在尝试使用此配置与Tomcat7嵌入式插件进行工作集成测试:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>29360</port>
<systemProperties>
<logback.configurationFile>${project.build.testOutputDirectory}/logback-test.xml</logback.configurationFile>
<psw.config>${project.build.testOutputDirectory}</psw.config>
<spring.profiles.active>test-e2e</spring.profiles.active>
</systemProperties>
</configuration>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>run-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-war-only</goal>
</goals>
<configuration>
<fork>true</fork>
</configuration>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但是当关闭发生时,我一直有这个错误:引起:java.lang.ClassNotFoundException:org.apache.catalina.core.ContainerBase $ StopChild
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:49.618s
[INFO] Finished at: Sun Dec 22 07:58:06 CET 2013
[INFO] Final Memory: 163M/259M
[INFO] ------------------------------------------------------------------------
ERROR: IllegalAccessException for stop method in class org.apache.tomcat.maven.plugin.tomcat7.run.ExtendedTomcat …Run Code Online (Sandbox Code Playgroud)