【发布时间】:2019-06-03 06:50:10
【问题描述】:
我有一个用目标war构建的maven spring web(3.2.*)项目,我想用tomcat在intellij idea中调试它(web:war exploded artifact),但是web应用程序总是无法加载,
[ERROR]..|上下文初始化失败 java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.getEnvironment()Lorg/springframework/core/env/ConfigurableEnvironment; 在 org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:404)
因为在某些 pom 依赖项中,它们引用了较低版本的 spring(3.0.7),我可以使用 maven-war-plugin(2.3):packagingExcludes 在 ware 中排除它们,但是如何在 web:war 中排除它们爆炸.
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<packagingExcludes>
WEB-INF/lib/org.springframework.core-3.0.7.RELEASE.jar,
// others springframework jars
</packagingExcludes>
</configuration>
</plugin>
【问题讨论】:
标签: spring maven tomcat intellij-idea war