如何在maven中使用pom.xml解压缩任意文件

gal*_*lme 10 unzip maven

我在路径"C:\ ptc\Windchill_10.1\Windchill"中有一个zip文件.请任何人都可以告诉我如何使用maven解压缩此文件

Ser*_*gio 10

Maven有一个与Ant一起使用的插件.使用该插件,您可以创建Ant-Tasks,此任务是一系列xml指令,您可以(虚拟地)使用您需要的任何内容.

一段代码,您可以将其用作灵感:

<plugins>
   <plugin>
      <artifactId>maven-antrun-plugin</artifactId>
      <version>1.8</version>
      <executions>
         <execution>
            <phase>generate-resources</phase>
            <configuration>
               <tasks>
                  <echo message="unzipping file" />
                  <unzip src="output/inner.zip" dest="output/" />
               </tasks>
            </configuration>
            <goals>
               <goal>run</goal>
            </goals>
         </execution>
      </executions>
   </plugin>
</plugins>
Run Code Online (Sandbox Code Playgroud)

来源:https://ant.apache.org/manual/Tasks/unzip.html


Vis*_*ani 0

Maven 有一个名为 dependencyplugin 的插件,它可以帮助您处理工件,您可以在此处查看文档

如果您的要求是解压依赖项及其传递依赖项,请查看此处

您还可以查看此处提供的有问题的解决方案