码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2017-07-19 14:22:23      阅读:931      评论:0      收藏:0      [点我收藏+]

标签:csdn   tail   文件中   div   3.0   blog   copyto   please   那是   

前面已经聊了创建maven web工程,但是问题来了,创建maven web工程之后会出现如下的错误,在pom.xml文件头部 有以下的错误

 

[plain] view plain copy
 
 print?
  1. Cannot detect Web Project version. Please specify version of Web Project through <version> configuration property of war plugin. E.g.: <plugin> <artifactId>maven-  
  2.  war-plugin</artifactId> <configuration> <version>3.0</version> </configuration> </plugin>  


解决方法如下:

 

在pom.xml文件中加入:

 

[html] view plain copy
 
 print?
  1. <build>  
  2.         <plugins>  
  3.             <plugin>  
  4.                 <artifactId>maven-compiler-plugin</artifactId>  
  5.                 <configuration>  
  6.                     <source>1.7</source>  
  7.                     <target>1.7</target>  
  8.                 </configuration>  
  9.             </plugin>  
  10.             <plugin>  
  11.                 <artifactId>maven-war-plugin</artifactId>  
  12.                 <version>2.4</version>  
  13.                 <configuration>  
  14.                     <version>3.0</version>  
  15.                 </configuration>  
  16.             </plugin>  
  17.         </plugins>  
  18.         <finalName>webserver</finalName>  
  19.     </build>  

那是因为项目未指定maven war编译插件的错误

最后  maven - update project

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

标签:csdn   tail   文件中   div   3.0   blog   copyto   please   那是   

原文地址:http://www.cnblogs.com/Bruce3555/p/7204996.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!