【发布时间】:2017-02-20 20:56:40
【问题描述】:
我只需要一个 myEar.ear 文件作为我的 maven 构建的输出。
我不想要 dir myEar(爆炸耳朵版本)。
明确地说,这是我的构建输出:
20/02/2017 11:37 <DIR> myEar
20/02/2017 11:37 7.985.535 myEar.ear
我只想要 myEar.ear。
谢谢。
这是我耳朵的 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>
<name>myEar</name>
<description>myEar</description>
<groupId>com.foo</groupId>
<artifactId>myEar</artifactId>
<version>1.0</version>
<packaging>ear</packaging>
<parent>
</parent>
<properties>
</properties>
<dependencies>
(...)
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<generatedDescriptorLocation>${basedir}/src/main/application/META-INF</generatedDescriptorLocation>
<modules>
<webModule>
<groupId>com.foo</groupId>
<artifactId>myWeb</artifactId>
<contextRoot>/myWeb</contextRoot>
</webModule>
<webModule>
<groupId>com.foo</groupId>
<artifactId>myWS</artifactId>
<contextRoot>/</contextRoot>
</webModule>
</modules>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
</configuration>
</plugin>
</plugins>
<directory>${basedir}/../target/diraliases/EARHOMEDIR1036</directory>
<finalName>myEar</finalName>
</build>
</project>
【问题讨论】:
-
为什么要配置
<directory>${basedir}/..?在当前模块之外?你检查过myEAR文件夹里面的内容吗? -
说来话长……我需要倾听该目录的信息,才能抱怨我公司的变更管理。无论如何 .ear 和文件夹具有相同的内容。