在构建我们的 ear maven 我可以看到在构建过程中,再次创建,删除并创建了最终的EAR文件。由于它是一个非常巨大的耳朵(有很多文件),我想防止这一点,因为:

  • 它加速了建筑过程
  • 它将改善SSD的寿命

所以问题是可以防止第一个耳朵创建(之后立即删除)(如果是的话)?

<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>
.

有帮助吗?

解决方案

addDefaultImplementententRies标记只能在Manifest.mf中获取更多的实现细节,默认情况下,您将在构建项目时自动生成清单。更多信息在这里: http://maven.apache.org/shared/maven-Archiver / examples / manifest.html

并且您的耳朵似乎构建了两次由于您指定的阶段。您不需要覆盖执行集团,只需删除它,它将根据需要工作。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top