在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 如下图:

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

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

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

便OK!

相关文章:

  • 2021-12-24
  • 2021-10-02
  • 2021-06-20
  • 2021-08-25
  • 2022-12-23
  • 2021-07-03
  • 2021-05-18
猜你喜欢
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案