简体   繁体   English

从maven汇编描述符中的jar中排除包

[英]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. 我有一个从其他解压缩的jar文件创建的jar文件。 I am trying to exclude some package from being in the the new jar file. 我试图将一些包排除在新的jar文件中。

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. 如你所见,我试图排除以Ohio.Model开头的软件包,但无论如何它都包括在内。

Is there something wrong with the syntax ? 语法有问题吗?

Found it 找到了

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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