防止maven建立耳朵两次

防止maven建立耳朵两次,maven,pom.xml,maven-ear-plugin,Maven,Pom.xml,Maven Ear Plugin,当使用构建我们的时,我可以看到在构建过程中,最终的EAR文件被创建、删除并重新从头创建。由于这是一个相当大的耳朵(有很多文件),我想防止它,因为: 它加快了建造过程 这将提高SSD的使用寿命 因此问题在于是否可以阻止第一个EAR文件创建(随后立即删除)(如果可以,如何阻止)? <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId

当使用构建我们的时,我可以看到在构建过程中,最终的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>
org.apache.maven.plugins
maven耳朵插件
${basedir}/src/main/application
APP-INF/lib
真的
造耳
包裹
耳朵

addDefaultImplementationEntries标记仅用于在MANIFEST.MF中获取更多实现细节,默认情况下,在构建项目时将自动生成清单。更多信息请点击此处:


由于你指定的阶段,你的耳朵似乎要长两次。您不需要覆盖executions bloc,只需删除它,它就会按照您的意愿工作。

您是对的,正如maven ear plugin页面上所述:“在pom.xml中配置ear插件时,您不需要在其中声明元素,因为它总是在ear项目的包阶段至少调用一次。”-因此,在我的情况下,触发了两次处决。。。