1、修改pom文件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<mainClass>com.hfai.HfAiCloudApplication</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>./</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
<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>
2、编写assembly.xml
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>package</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<dependencySets>
<dependencySet>
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<excludes>
<exclude>
${groupId}:${artifactId}
</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>src/main/resources/bin</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>/**.yml</include>
</includes>
<excludes>
<exclude>logback.xml</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
</fileSets>
</assembly>
3、重新用maven打包即可生成 zip包
分享到:
相关推荐
Spring Boot项目使用maven-assembly-plugin根据不同环境打包成tar.gz或者zip
主要介绍了Springboot基于assembly的服务化打包方案及springboot项目的几种常见的部署方式,本文主要针对第二种部署方式提供一种更加友好的打包方案,需要的朋友可以参考下
Assembly打包maven项目的执行脚本和配置文件
NULL 博文链接:https://byx5185.iteye.com/blog/739822
主要介绍了Springboot如何基于assembly服务化实现打包,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
项目常用的组件化架构方案 (https://blog.csdn.net/u010302765/article/details/101015212)
maven项目、springboot项目使用assembly插件打包,实现项目可配置化、生成系统日志、jar文件与项目分离,并生成windows与linux环境下启动、停止等操作的脚本文件。
assembly插件根据不同环境打包成tar.gz或者zip 将spring boot项目中的配置文件提取到外部config目录中 将spring boot项目中的启动jar包移动到boot目录中 将spring boot项目中的第三方依赖jar包移动到外部lib目录中 ...
主要介绍了maven插件assembly使用及springboot启动脚本start.sh和停止脚本 stop.sh的相关资料,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
sorting numbers in 8086 assembly.zip
c# UnloadNet_Assembly.zipc#
TestNg6.9.10版本包,下载之后进行解压可以放在Eclipse的dropins包中,重启eclipse,即可看到testng
IDLE_windows_assembly_zip_源码.rar
计算机软件-编程源码-pb11呼叫assembly.zip
● 打包成指定格式分发包,支持各种主流的格式如zip、tar.gz、jar和war等,具体打包哪些文件是高度可控的。 ● 能够自定义包含/排除指定的目录或文件。 并附上了学习过程中应注意的细节,以及遇到的问题及解决方法...
标签:assembly-2.1.6-deployable.zip,assembly,2.1.6,deployable.zip包下载,依赖包
assembly idle program
C to Go Assembly
maven-assembly 自定义打包方式,可以将工程打包为tar或其他格式,里面保留着配置文件的目录
springboot+jsp+mybatis+多数据库配置+assembly配置 linux下XX.tar.gz文件和win下.jar文件方式运行 web部署只需 启动程序./boot.sh start终止运行./boot.sh stop 无需安装容器