问题描述
mvn compile 正常,但是 mvn package 或者 mvn install 打 war 包时都会报错;
报错异常
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project maven_02_ssm: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo ‘war’ in the plugin ‘org.apache.maven.plugins:maven-war-plugin:2.2’ due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
解决办法
解决办法是要在pom.xml文件下添加以下插件,才可以打包war包
打包jar包不添加也是没有问题的
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
&l