码迷,mamicode.com
首页 > 其他好文 > 详细

maven项目打ZIP包

时间:2017-04-01 16:50:47      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:highlight   directory   out   depend   maven插件   sed   lib   log   for   

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包

标签:highlight   directory   out   depend   maven插件   sed   lib   log   for   

原文地址:http://www.cnblogs.com/tietazhan/p/6656598.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!