使用 dir<format>dir</format>
获取解压后的目录
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>path/to/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
程序集.xml
<?xml version="1.0" encoding="GBK"?>
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1">
<id></id>
<baseDirectory>${project.artifactId}-${project.version}-default/</baseDirectory>
<formats>
<format>dir</format>
</formats>
<fileSets>
<fileSet>
<directory>../../path/to/${project.artifactId}-${project.version}-default/</directory>
<outputDirectory></outputDirectory>
<includes>
<include>**/**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
使用 antrun 复制到 dest 目录
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase> ... choose after assembly </phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<copy todir="/tmp/xx" >
<fileset dir="target/${project.build.finalName}"/>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>