我有一個(gè) web 應(yīng)用程序 (TestWeb) 和多個(gè) java 依賴項(xiàng)項(xiàng)目 (TestCommon、TestModule)。我能夠使用 maven 構(gòu)建所有 3 個(gè)項(xiàng)目。它已經(jīng)從中創(chuàng)建了 war 文件和 jar 文件。我需要使用 Maven 創(chuàng)建 .ear 文件。我怎樣才能創(chuàng)造耳朵并建造它們?測(cè)試網(wǎng)/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>TestWeb</groupId> <artifactId>TestWeb</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <build> <sourceDirectory>src</sourceDirectory> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.4</version> <configuration> <warSourceDirectory>WebContent</warSourceDirectory> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>TestCommon</groupId> <artifactId>TestCommon</artifactId> <version>0.0.1-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>TestModule</groupId> <artifactId>TestModule</artifactId> <version>0.0.1-SNAPSHOT</version> <scope>compile</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> </dependencies></project>
1 回答

叮當(dāng)貓咪
TA貢獻(xiàn)1776條經(jīng)驗(yàn) 獲得超12個(gè)贊
使用<packaging>ear</packaging>
而不是<packaging>war</packaging>
。
添加回答
舉報(bào)
0/150
提交
取消