我需要使用 maven 解压缩任意 tar.gz 文件(不是 Artifact )。我使用了以下插件,但它将 tar.gz 文件的所有内容解压缩到其他一些 .tar 文件中。我需要将所有内容放到特定文件夹而不是其他 tar 文件中。请建议我还能做什么。
这是我的 pom.xml 模块:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>prepare</id>
<phase>validate</phase>
<configuration>
<tasks>
<echo message="prepare phase" />
<gunzip src="../gui/src/CelGui/target/cel-gui.tar.gz"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
最佳答案
在 gunzip 之后使用 untar 命令将为您完成任务。
<untar src="xyz.tar.gz" compression="gzip" dest="<desitination_folder>"/>
在此之后如果需要使用删除命令删除您的 tar 文件
关于maven - 在 maven 中解压任意 tar.gz 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33732544/