简体   繁体   中英

Excluding a directory in a maven dependency

For one of my Spring-boot projects, i am using Spring Security. I use multiple sub directories, but csrf is not one of them. NexusIQ reports an issue with the classes from the csrf directory. I can waive the issue since i am not using it and the problem would be solved, but i am wondering if there is another way to exclude this folder from being in the dependency. A way to 'exclude' this directory from being downloaded in the first place.

Using the exclude tag i can exclude underlying dependencies, but i can't figure out how to use it on a folder. Is this possible?

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-web</artifactId>
    <version>5.4.5</version>
</dependency>

spring-security-web 的文件夹结构

No.

You can either take the whole dependency or leave it.

The only way around this would be to compile the dependency yourself from source or to create a patched version of it by manipulating it.

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