首页 > Web开发 > 详细

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

时间:2017-07-19 13:06:43      阅读:325      评论:0      收藏:0      [点我收藏+]

前面已经聊了创建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...的错误

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!