在ubuntu下使用maven搭建web项目,需要用到tomcat服务器来运行。所以需要“项目——右键——配置——Maven Project Facets——勾选Dynamic Web Module
但会出现提示Dynamic Web Module 3.0 requires Java 1.6 or newer。开始是以为我的jdk的问题,但jdk确实没有问题,是1.7的版本。
解决方法:
在pom.xml的<build><build>之间加入一段配置内容
<build>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</build>
就可以解决如上问题。
Ubuntu 14.04.1中安装Maven:http://www.linuxdiyf.com/linux/9265.html
修复Maven项目默认文件夹的Maven Plugin开发:http://www.linuxdiyf.com/linux/10350.html