我使用 Maven Tomcat 插件运行 Maven 目标“全新安装”:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>TomcatServer</server>
<failOnError>false</failOnError>
<path>/spring-training</path>
<fork>true</fork>
</configuration>
<executions>
<execution>
<id>01-start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>02-stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
并得到错误:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logBeanFactoryPostProcessor' defined in URL [jar:file:/D:/projects/MainSpringProject/SpringSubProject/General/target/General-1.0-SNAPSHOT.jar!/com/springproject/ioc/LogBeanFactoryPostProcessor.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: warning no match for this type name: com.noveogroup.springtrainig.service.ApplicationService [Xlint:invalidAbsoluteTypeName]
如果我运行 maven“clean package”并手动部署到 tomcat 中,我会注意你没有错误!,但是当我与 tomcat-maven-plugin 相同时,我得到了这样的错误。可能是什么问题?