将ear解压缩并复制到本地目录

时间:2012-09-14 04:27:55

标签: maven-2 maven-plugin ear

我需要解压缩ear archive并使用maven将其复制到本地目录,是否有maven插件可以执行此操作?我使用maven上传插件来复制文件,但无法解压缩。请帮忙......

2 个答案:

答案 0 :(得分:0)

你试过maven ear插件吗?

http://maven.apache.org/plugins/maven-ear-plugin/

我猜这会将内容爆炸到目标目录。请仔细阅读示例

或者 maven依赖插件也可以提供帮助。

http://maven.apache.org/plugins/maven-dependency-plugin/usage.html

答案 1 :(得分:0)

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.8</version> <executions> <execution> <id>unpack</id> <phase>clean</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>A</groupId> <artifactId>ear</artifactId> <version>version</version> <type>ear</type> <overWrite>false</overWrite> <outputDirectory>${project.build.directory}/ear</outputDirectory> <excludes>**/*.jar</excludes>
</artifactItem> </artifactItems> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>true</overWriteSnapshots> </configuration> </execution> </executions> </plugin>