<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>standalone-package</id>
    <formats>
        <format>zip</format>
    </formats>

    <includeBaseDirectory>false</includeBaseDirectory>

    <fileSets>
        <!--
        0755->即用户具有读/写/执行权限，组用户和其它用户具有读写权限；
        0644->即用户具有读写权限，组用户和其它用户具有只读权限；
        -->
        <!-- 将assemblies/bin目录下的所有文件输出到打包后的bin目录中 -->
        <fileSet>
            <directory>${project.parent.basedir}/iot-starter/src/main/bin</directory>
            <outputDirectory>/bin</outputDirectory>
            <includes>
                <include>**/*.bat</include>
                <include>**/*.sh</include>
            </includes>
            <fileMode>0755</fileMode>
            <!--如果是脚本，一定要改为unix.如果是在windows上面编码，会出现dos编写问题-->
            <lineEnding>unix</lineEnding>
            <filtered>true</filtered><!-- 是否进行属性替换 -->
        </fileSet>

        <!-- 将/iot-standalone/src/main/resources下配置文件打包到config目录 -->
        <fileSet>
            <directory>${project.parent.basedir}/iot-starter/src/main/resources</directory>
            <outputDirectory>/config</outputDirectory>
            <includes>
                <include>**/*.xml</include>
                <include>**/*.properties</include>
                <include>**/*.yml</include>
            </includes>
            <filtered>true</filtered><!-- 是否进行属性替换 -->
        </fileSet>

        <!-- 将项目启动jar打包到lib目录中 -->
        <fileSet>
            <directory>target</directory>
            <outputDirectory>lib</outputDirectory>
            <includes>
                <include>*.jar</include>
            </includes>
        </fileSet>

        <!-- 将项目说明文档打包到docs目录中 -->
        <fileSet>
            <directory>${project.parent.basedir}</directory>
            <outputDirectory>docs</outputDirectory>
            <includes>
                <include>*.md</include>
            </includes>
            <fileMode>0644</fileMode>
        </fileSet>

        <!--将初始化数据打包到data目录-->
        <fileSet>
            <directory>${project.parent.basedir}/data/components</directory>
            <outputDirectory>data/components</outputDirectory>
            <includes>
                <include>**/*</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.parent.basedir}/data/converters</directory>
            <outputDirectory>data/converters</outputDirectory>
            <includes>
                <include>**/*</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.parent.basedir}/data/init</directory>
            <outputDirectory>data/init</outputDirectory>
            <includes>
                <include>**/*</include>
            </includes>
        </fileSet>

    </fileSets>
</assembly>