0

当使用maven构建我们的EAR时,我可以看到在构建过程中,最终的 EAR 文件被创建、删除并再次从头开始创建。由于它是一个相当大的 EAR(有很多文件),我想防止这种情况发生,因为:

  • 它加快了构建过程
  • 它将提高 SSD 的使用寿命

所以问题是是否可以阻止第一个 EAR 文件创建(之后立即删除)(如果可以,如何阻止)?

<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-ear-plugin</artifactId>
    <configuration>
        <earSourceDirectory>${basedir}/src/main/application</earSourceDirectory>
        <defaultLibBundleDir>APP-INF/lib</defaultLibBundleDir>  
        <archive>
            <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
        </archive>  
        <modules>
            <!-- some modules -->
        </modules>
    </configuration>
    <executions>
        <execution>
            <id>build-ear</id>
            <phase>package</phase>
            <goals>
                <goal>ear</goal>
            </goals>
        </execution>
    </executions>
</plugin>
4

1 回答 1

2

addDefaultImplementationEntries 标记仅用于在 MANIFEST.MF 中获取更多实现细节,默认情况下,MANIFEST 将在您构建项目时自动生成。更多信息在这里:http ://maven.apache.org/shared/maven-archiver/examples/manifest.html

由于您指定的阶段,您的耳朵似乎增加了两次。您不需要覆盖执行块,只需将其删除,它就会按您的意愿工作。

于 2013-11-18T12:40:02.290 回答