简体   繁体   中英

Excluding packages from jars in maven assembly descriptor

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 ?

Found it

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM