栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

从单个Maven项目构建EAR

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

从单个Maven项目构建EAR

您将需要3 pom,这是一个工作示例;

pom 1是父母

<?xml version="1.0" encoding="UTF-8"?><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.greg</groupId>  <artifactId>ear-example</artifactId>  <version>1.0-SNAPSHOT</version>  <packaging>pom</packaging>  <name>ear-example</name>  <modules>    <module>example-jar</module>    <module>example-ear</module>  </modules></project>

pom 2是罐子或战争

<?xml version="1.0"?><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  <modelVersion>4.0.0</modelVersion>  <parent>    <groupId>com.greg</groupId>    <artifactId>ear-example</artifactId>    <version>1.0-SNAPSHOT</version>  </parent>  <artifactId>example-jar</artifactId>  <packaging>jar</packaging>  <name>com.greg</name>  <url>http://maven.apache.org</url>  <properties>    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  </properties>  <dependencies>    <dependency>      <groupId>junit</groupId>      <artifactId>junit</artifactId>      <version>3.8.1</version>      <scope>test</scope>    </dependency>  </dependencies></project>

pom 3是依赖于jar / war的耳朵

<?xml version="1.0"?><project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  <modelVersion>4.0.0</modelVersion>  <parent>    <groupId>com.greg</groupId>    <artifactId>ear-example</artifactId>    <version>1.0-SNAPSHOT</version>  </parent>  <artifactId>example-ear</artifactId>  <packaging>ear</packaging>  <dependencies>    <dependency>      <groupId>com.greg</groupId>      <artifactId>example-jar</artifactId>      <version>${project.version}</version>    </dependency>  </dependencies>  <build>   <plugins>     <plugin>        <artifactId>maven-ear-plugin</artifactId>        <version>2.10.1</version>        <configuration>        </configuration>      </plugin>    </plugins>  </build></project>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/497442.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号