打包组件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>

简单标签释义:


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


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


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

猜你喜欢

转载自www.cnblogs.com/hailongchen/p/9765588.html