我有一个项目,我需要重命名由Maven Assembly Plugin
其他所有其他完成后生成的最终输出文件(在编译/构建/组装过程中).
该Maven Assembly Plugin
是生成最终.zip
文件的基础上,项目的名称,我需要完全重新命名这final-version.oxt
.我正在尝试使用它maven-antrun-plugin
来重命名它,正如其他类似问题所指出的那样,但没有运气(我之前从未使用过Maven或Ant,所以也许我错过了一些东西).
这是该
项目的一部分pom.xml
.重命名部分似乎完全被忽略,因为我的home
文件夹中没有生成文件.
org.apache.maven.plugins maven-assembly-plugin 2.4 assembly package attached src/main/resources/META-INF/MANIFEST.MF src/main/assembly/ooo-jar.xml src/main/assembly/ooo.xml org.apache.maven.plugins maven-antrun-plugin deploy
Bruno Finger.. 14
一些修改使它工作,可能phase
是错误的,但使用
似乎使其工作:
org.apache.maven.plugins maven-antrun-plugin 1.7 install run
coderplus.. 9
这个问题已有将近一年的历史,但如果其他人面临类似的问题,这里有一个替代解决方案.
如果您正在寻找一种更为虔诚的方式,您可以使用
com.coderplus.maven.plugins copy-rename-maven-plugin 1.0.1 rename-file install rename ${project.build.outputDirectory}/libreofficeplugin-ooo.zip ${project.build.outputDirectory}/final-version.oxt
如果您想复制而不是重命名,请使用复制目标而不是重命名目标.
这个问题已有将近一年的历史,但如果其他人面临类似的问题,这里有一个替代解决方案.
如果您正在寻找一种更为虔诚的方式,您可以使用
<plugin> <groupId>com.coderplus.maven.plugins</groupId> <artifactId>copy-rename-maven-plugin</artifactId> <version>1.0.1</version> <executions> <execution> <id>rename-file</id> <phase>install</phase> <goals> <goal>rename</goal> </goals> <configuration> <sourceFile>${project.build.outputDirectory}/libreofficeplugin-ooo.zip</sourceFile> <destinationFile>${project.build.outputDirectory}/final-version.oxt</destinationFile> </configuration> </execution> </executions> </plugin>
如果您想复制而不是重命名,请使用复制目标而不是重命名目标.
一些修改使它工作,可能phase
是错误的,但使用<phase>install</phase>
似乎使其工作:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>install</phase> <configuration> <target> <copy file="${project.build.directory}/libreofficeplugin-ooo.zip" tofile="${project.build.directory}/final-version.oxt" /> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>