打包组件assembly之package.xml

本文详细解析了Maven部署配置的各个元素,包括如何指定编译后的文件格式为zip,如何排除源码文件,以及如何处理文件集和依赖集,确保maven编译打包后能符合运维自动化部署需求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

形如:

<assembly>
    <id>deploy</id>
    <formats>
        <format>zip</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <useProjectArtifact>true</useProjectArtifact>
            <outputDirectory>lib</outputDirectory>
            <includes>
                <include>*:jar:*</include>
            </includes>
            <excludes>
                <exclude>*:sources</exclude>
            </excludes>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}/wrapper/bin</directory>
            <outputDirectory>/bin</outputDirectory>
            <fileMode>755</fileMode>
            <includes>
                <include>wrapper</include>
                <include>service.sh</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.basedir}/wrapper/lib</directory>
            <outputDirectory>/lib</outputDirectory>
            <includes>
                <include>wrapper.jar</include>
                <include>libwrapper.so</include>
            </includes>
        </fileSet>
    </fileSets>
</assembly>

简单标签释义:

  1. deploy
    该标签内容首先不能为空,名称可任意定义,原则上就使用“deploy”,在 maven 编译打包后,其编译的包名会有“-deploy”的命名追加。


  2. zip

    该标签内容指定模块编译后的文件格式。原则上要求使用“zip”,在 maven 编译打包后,其编译的包会压缩成.zip 文件。

  3. false
    该处理是根据运维自动化部署的实际需要,必须设定该标签为“false”,在 maven 编译打包后,将不包含根级目录

转载于:https://www.cnblogs.com/hailongchen/p/9765588.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值