首页 > 代码库 > maven项目打ZIP包
maven项目打ZIP包
Maven插件配置:
<!-- ZIP打包 --> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptors> <descriptor>assembly/assembly.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>assemble-zip</id> <goals> <goal>single</goal> </goals> <phase>package</phase> </execution> </executions> </plugin>
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>distribution</id> <formats> <format>zip</format> </formats> <fileSets> <fileSet> <directory>${project.basedir}/src/main/resources</directory> <outputDirectory>/etc/</outputDirectory> </fileSet> <fileSet> <directory>${project.basedir}/sbin</directory> <outputDirectory>/sbin</outputDirectory> <lineEnding>unix</lineEnding> </fileSet> </fileSets> <dependencySets> <dependencySet> <useProjectArtifact>true</useProjectArtifact> <outputDirectory>lib</outputDirectory> <!-- 将scope为runtime的依赖包打包到lib目录下。 --> <scope>runtime</scope> </dependencySet> </dependencySets> </assembly>
maven项目打ZIP包
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。