在Maven下删除生成的Netbeans平台应用程序的modules / ext文件夹

时间:2013-04-26 12:25:09

标签: maven netbeans

我有一个Netbeans平台应用程序,它是用Maven构建的。

我想编辑pom.xml,以便在生成zip之前删除生成的文件夹“modules / ext”(包含所有外部库)(nbm:standalone-zip goal)

我试过了:

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
                <!--remove the module/ext directory-->
                <execution>
                    <id>rmExt</id>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>/bin/rm</executable>
                        <workingDirectory />
                        <arguments>
                            <argument>-rf</argument>
                            <argument>${project.build.directory}/myapp/myapp/modules/ext</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
</plugin>

我尝试更改目标,但文件夹未删除,然后包含在zip中。

你有什么想法吗?

谢谢

1 个答案:

答案 0 :(得分:0)

如果您使用的是Maven 3,则可以使用-X运行mvn并查看插件执行的顺序。在rmExt执行之前,zip执行是否可以运行?也许将'rmExt`执行绑定到早期阶段(例如prepare-package)会有所帮助。

我建议使用Maven clean plugin's清洁目标而不是maven exec。如果进行更改,请务必将excludeDefaultDirectories设置为true。

相关问题