解决maven web项目Cannot detect Web Project version. Please specify version of Web Project through...的错误

来源:互联网 发布:dns的端口号是 编辑:程序博客网 时间:2024/05/21 20:27

创建maven web工程之后会出现如下的错误,在pom.xml文件头部 有以下的错误
Cannot detect Web Project version. Please specify version of Web Project through configuration property of war plugin. E.g.: maven- war-plugin 3.0

解决方法如下:
在pom.xml文件中加入:

<build>          <plugins>              <plugin>                  <artifactId>maven-compiler-plugin</artifactId>                  <configuration>                      <source>1.7</source>                      <target>1.7</target>                  </configuration>              </plugin>              <plugin>                  <artifactId>maven-war-plugin</artifactId>                  <version>2.4</version>                  <configuration>                      <version>3.0</version>                  </configuration>              </plugin>          </plugins>          <finalName>webserver</finalName>      </build>  

那是因为项目未指定maven war编译插件的错误
转载出处:http://blog.csdn.net/enson16855/article/details/19704355

阅读全文
0 0
原创粉丝点击