pom引入
<plugin>分块打包模式--> <groupId>org.apache.maven.pluginsgroupId> <artifactId>maven-assembly-pluginartifactId> <version>2.4.1version> <executions> <execution> <id>make-assemblyid> 绑定到package生命周期 --> <phase>packagephase> <goals> 只运行一次 --> <goal>singlegoal> goals> execution> executions> <configuration> 配置描述符文件 --> <descriptor>src/main/assembly/assembly.xmldescriptor> 也可以使用Maven预配置的描述符jar-with-dependencies--> configuration> plugin>
配置文件assembly.xml
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> <id>assemblyid> <formats> <format>dirformat> tar.gz--> formats> <includeBaseDirectory>falseincludeBaseDirectory> <dependencySets> <dependencySet> <outputDirectory>/liboutputDirectory> dependencySet> dependencySets> <fileSets> <fileSet> <directory>src/main/assembly/scriptsdirectory> <outputDirectory>binoutputDirectory> <fileMode>0755fileMode> <filtered>truefiltered> fileSet> <fileSet> <directory>src/main/resourcesdirectory> <outputDirectory>configoutputDirectory> fileSet> <fileSet> <directory>src/main/webappdirectory> <outputDirectory>runtimeoutputDirectory> fileSet> fileSets>assembly>
maven下点击package,则会在target/wx-api-assembly下生成lib和config目录
好处是更新只需要更新对于的jar包即可
启动方式:https://www.cnblogs.com/zenghansen/p/12795962.html