创建Maven工程时,Cannot detect Web Project version

在myeclipse中创建maven项目的时候,有时候会出现如下错误:

Cannot detect Web Project version. Please specify version of Web Project through Maven project property <webVersion>.  E.g.: <properties> <webVersion>3.0</webVersion> </properties>
解决办法:

在对应的出错的 pom.xml 文件中添加如下代码:

<build>
      <plugins>
          <plugin>
              <artifactId>maven-war-plugin</artifactId>
              <configuration>
                  <version>3.0</version>
              </configuration>
          </plugin>
      </plugins>
  </build>

但是好多人发现加上以上代码后,仍然会报错,解决方法如下:

右键项目——>Maven——>Update Project 如下图:

然后选择你所更改的 pom 文件所在的项目,或者全选全部更新即可消除红色叉号,如下图:

便OK!

猜你喜欢

转载自www.cnblogs.com/xiaohu666/p/11020145.html
今日推荐