直接上图:
父工程pom.xml配置:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.action</groupId>
<artifactId>Maven-Collection</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>maven-dao</module>
<module>maven-service</module>
<module>maven-web</module>
</modules>
<build>
<plugins>
<!-- 编译插件配置 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
<!-- tomcat插件配置 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<!-- 配置端口号,80是http默认端口号可以省去不写 -->
<port>80</port>
<path>/</path>
<!-- http://localhost:80 -->
</configuration>
</plugin>
</plugins>
</build>
</project>
最后导入servlet.api强制更新项目,maven>>run as>>maven build>>输入配置的地址出现index.jsp视图即可成功.
附一个中央仓库下载jar包的setting设置:
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<mirrorOf>central</mirrorOf>
</mirror>