ぺーぺーSEのブログ

備忘録・メモ用サイト。

jar化する際に同梱されるファイルを除く設定の方法

<!-- Jar生成の設定 -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <!-- マニフェストファイルの設定例 -->
    <configuration>
    <archive>
        <addMavenDescriptor>false</addMavenDescriptor>
            <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
                <Build-Timestamp>${maven.build.timestamp.format}</Build-Timestamp>
                <Extension-Name>${project.name}</Extension-Name>
                <Built-By>OASIS</Built-By>
                <Specification-Title>${project.name}</Specification-Title>
                <Specification-Version>${project.version}</Specification-Version>
                <Specification-Vendor>XXX Corporation</Specification-Vendor>
                <Implementation-Title>${project.name}</Implementation-Title>
                <Implementation-Version>${project.version}</Implementation-Version>
                <Implementation-Vendor-Id>jp.xxx</Implementation-Vendor-Id>
                <Implementation-Vendor>XXX Corporation YYY Project</Implementation-Vendor>
            </manifestEntries>
        </archive>
        <!-- ファイルを除く設定 -->
        <excludes>
            <exclude>*.properties</exclude>
            <exclude>*/*.properties</exclude>
            <exclude>*.xml</exclude>
            <exclude>*/*.xml</exclude>
        </excludes>
    </configuration>
</plugin>