完成例子:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>STUDY_EAR</groupId>
<artifactId> STUDY_EAR </artifactId>
<packaging>ear</packaging>
<version>1.0-SNAPSHOT</version>
<description></description>
<dependencies>
<
dependency
>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>STUDY_EAR</groupId>
<artifactId> STUDY_EAR </artifactId>
<packaging>ear</packaging>
<version>1.0-SNAPSHOT</version>
<description></description>
<dependencies>
< groupId > com.newegg.lab </ groupId >
< artifactId > MemberWeb </ artifactId >
< version > 0.1-SNAPSHOT </ version >
< type > war </ type >
</ dependency >
< dependency >
< groupId > com.newegg.lab </ groupId >
< artifactId > frontWeb </ artifactId >
< version > 0.1-SNAPSHOT </ version >
< type > war </ type >
</ dependency >
一、新建项目
新建一个空的Maven Project项目 (选择 quick 就可以)
二、放入pom.xml 内容如上
三、运行
1> 先运行: mvn ear: generate-application-xml 生成 application.xml文件
2> 再运行:mvn ear:ear
四、ear包打好