美文网首页我爱编程
assembly插件的使用

assembly插件的使用

作者: 何何与呵呵呵 | 来源:发表于2018-06-21 19:56 被阅读0次

1.pom文件

      <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <appendAssemblyId>false</appendAssemblyId>
                <finalName>CSPInstructionService</finalName>
                <descriptors>
                    <descriptor>assembly.xml</descriptor>
                </descriptors>
            </configuration>
            <executions>
                <execution>
                    <id>package</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

2.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>release</id>
<includeBaseDirectory>true</includeBaseDirectory>

<formats>
    <format>tar.gz</format>
    <format>dir</format>
</formats>
<fileSets>
    <fileSet>
        <outputDirectory>/bin</outputDirectory>
        <directory>${basedir}/profiles/${profile.id}/bin</directory>
    </fileSet>
    <fileSet>
        <outputDirectory>bin</outputDirectory>
        <directoryMode>0755</directoryMode>
        <directory>${basedir}/shell</directory>
    </fileSet>
    <fileSet>
        <outputDirectory>/conf</outputDirectory>
        <directory>${basedir}/profiles/${profile.id}/conf</directory>
    </fileSet>
    <fileSet>
        <outputDirectory>conf</outputDirectory>
        <directory>${basedir}/src/main/resources</directory>
    </fileSet>
</fileSets>
<dependencySets>
    <dependencySet>
        <scope>system</scope>
        <outputDirectory>lib</outputDirectory>
    </dependencySet>
    <dependencySet>
        <outputDirectory>lib</outputDirectory>
    </dependencySet>
</dependencySets>
</assembly>

相关文章

网友评论

    本文标题:assembly插件的使用

    本文链接:https://www.haomeiwen.com/subject/tqicyftx.html