How to untargz files using maven?

痴心易碎 提交于 2019-12-22 10:27:59

问题


Using maven, I download some Chef cookbooks.

Received files are in the .tgz format, and I want to unpack them. How can I do that ? Is there any useful plugin ?


回答1:


From what I know, .tgz can be unpack via two commands:

   gzip -d file.tgz
   tar xvf file.tar

So you can use maven-antrun-plugin to execute these two tasks:

   <gunzip src="tools.tgz"/>
   <untar src="tools.tar" dest="${tools.home}"/>

Ant task reference: gunzip and untar




回答2:


I would suggest to use the truezip-maven-plugin to handle such archives.



来源:https://stackoverflow.com/questions/14519146/how-to-untargz-files-using-maven

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!