maven 打zip包并包含bin和docs文件夹
程序员文章站
2022-03-15 12:35:54
...
maven插件:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/resources/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
assembly.xml
<assembly>
<id>package</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.parent.basedir}/bin</directory>
<outputDirectory>\bin</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.parent.basedir}/db</directory>
<outputDirectory>\db</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.parent.basedir}/docs</directory>
<outputDirectory>\docs</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.parent.basedir}</directory>
<outputDirectory>\</outputDirectory>
<includes>
<include>readme.md</include>
<include>release-notes</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>\</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
上一篇: html+php+c 实现web关灯
下一篇: singleton pattern