Excluding packages from jars in maven assembly descriptor

好久不见. 提交于 2019-12-12 10:39:34

问题


I have the following syntax problem.

I have a jar file that is created from other unpacked jar files. I am trying to exclude some package from being in the the new jar file.

Here is my assembly descriptor

<assembly>
<id>gs-jar</id>
<formats>
    <format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>

<dependencySets>
    <dependencySet>
        <unpack>true</unpack>
        <scope>runtime</scope>
        <includes>
            <include>com.delver:shci-commons</include>
            <include>com.delver:shci-model</include>
            <include>com.delver:gigaspaces-persistence</include>
            <include>com.delver:gigaspaces-mirror</include>
            <include>com.delver:recommendation</include>
        </includes>
        <unpackOptions>
            <excludes>
                <exclude>
                    Ohio.Model*
                </exclude>
                <exclude>log4j.properties</exclude>
                <exclude>gslicense.xml</exclude>
            </excludes>
        </unpackOptions>
    </dependencySet>
</dependencySets>
</assembly>

As you see I am trying to excluded the package that starts with Ohio.Model , but somehow it get s included anyway.

Is there something wrong with the syntax ?


回答1:


Found it

            <exclude>
               **/Ohio/**
            </exclude>


来源:https://stackoverflow.com/questions/3013704/excluding-packages-from-jars-in-maven-assembly-descriptor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!