打包组件assembly之package.xml


形如:

<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>

简单标签释义:

<id>deploy</id>

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

<formats>
    <format>zip</format>
</formats>

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

<includeBaseDirectory>false</includeBaseDirectory>

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM