maven打包web项目为zip
Posted junmail
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven打包web项目为zip相关的知识,希望对你有一定的参考价值。
1、pom.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>$project.version</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>$project.basedir\\target\\$project.artifactId</directory>
<outputDirectory>\\$project.artifactId</outputDirectory>
</fileSet>
<fileSet>
<directory>$project.basedir\\src\\main</directory>
<includes>
<include>scripts</include>
<include>manual</include>
</includes>
<outputDirectory>\\</outputDirectory>
</fileSet>
</fileSets>
</assembly>
2、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>$project.version</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>$project.basedir\\target\\$project.artifactId</directory>
<outputDirectory>\\$project.artifactId</outputDirectory>
</fileSet>
<fileSet>
<directory>$project.basedir\\src\\main</directory>
<includes>
<include>scripts</include>
<include>manual</include>
</includes>
<outputDirectory>\\</outputDirectory>
</fileSet>
</fileSets>
</assembly>
以上是关于maven打包web项目为zip的主要内容,如果未能解决你的问题,请参考以下文章
Spring Boot项目使用maven-assembly-plugin根据不同环境打包成tar.gz或者zip