Maven装配包括所有罐子但只有一个(排除不起作用)

时间:2021-12-26 14:47:27

I am trying to do exactly that: https://*.com/a/1793017/789656

我正在努力做到这一点:https://*.com/a/1793017/789656

However, in my case I want some jars not being put in the lib folder. I tried to add

但是,在我的情况下,我想要一些罐子没有放在lib文件夹中。我试着补充一下

<excludes>
  <exclude>special*.jar</exclude>
</excludes>

But it doesn't do the trick, because as stated here

但它没有做到这一点,因为如此处所述

Include patterns take precedence over exclude patterns

包含模式优先于排除模式

How do I have to configure the assembly to achieve what I want?

我如何配置程序集以实现我想要的?

2 个解决方案

#1


0  

HAve you tried adding an includes section:

您是否尝试添加包含部分:

        <includes>
            <include>**</include>
        </includes>

Before your excludes?

在你被排除之前?

#2


0  

Set that dependency's scope to provided. That should do the trick, if it's a direct dependency of your project. If it's not, then try to explicitly add it as a dependency of your assembly and still set it to scope:provided.

将该依赖项的范围设置为已提供。如果它是您项目的直接依赖,那应该可以解决问题。如果不是,那么尝试将其显式添加为程序集的依赖项,并将其设置为范围:提供。

#1


0  

HAve you tried adding an includes section:

您是否尝试添加包含部分:

        <includes>
            <include>**</include>
        </includes>

Before your excludes?

在你被排除之前?

#2


0  

Set that dependency's scope to provided. That should do the trick, if it's a direct dependency of your project. If it's not, then try to explicitly add it as a dependency of your assembly and still set it to scope:provided.

将该依赖项的范围设置为已提供。如果它是您项目的直接依赖,那应该可以解决问题。如果不是,那么尝试将其显式添加为程序集的依赖项,并将其设置为范围:提供。