apache / apache/maven

[MNG-7949] Dependency management import should support explicit inclusion

Open
#8,968 0 comments 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Jeff Maxwell](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jeff.maxwell)** opened **[MNG-7949](https://issues.apache.org/jira/browse/MNG-7949?redirect=false)** and commented

There are many cases where a project will publish a bom that has a mix of that project's artifacts and 3rd party ones.

While the exclusion feature is an improvement in scenarios where one wants to limit the dependencies to just those owned by the project the exclusion list can be quite large and would require updating whenever the project adds another 3rd party dependency.

Explicit inclusions would avoid both of those issues.

Example:

Suppose we wanted to exclude all non-spring dependencies from `org.springframework.boot:spring-boot-dependencies` with `exclusions` a reasonable attempt, one that would retain clarity, would take 172 lines with `includes` it would take 12.

```java
     
        org.springframework.boot
        spring-boot-dependencies
        ${spring-boot.version}
        pom
        import
       
         
            ch*
         
         
            co*
         
         
            io.*
         
         
            jakarta*
         
         
            javax*
         
         
            jaxen*
         
         
            junit*
         
         
            net*
         
         
            nz*
         
         
            org.apache*
         
         
            org.aspectj*
         
         
            org.assertj*
         
         
            org.awaitility*
         
         
            org.cache2k*
         
         
            org.codehaus.janino*
         
         
            org.crac*
         
         
            org.eclipse*
         
         
            org.ehcache*
         
         
            org.elasticsearch.client*
         
         
            org.firebirdsql.jdbc*
         
         
            org.flywaydb*
         
         
            org.freemarker*
         
         
            org.glassfish*
         
         
            org.hamcrest*
         
         
            org.hibernate*
         
         
            org.hsqldb*
         
         
            org.infinispan*
         
         
            org.influxdb*
         
         
            org.jboss.logging*
         
         
            org.jdom*
         
         
            org.jetbrains*
         
         
            org.jooq*
         
         
            org.junit*
         
         
            org.liquibase*
         
         
            org.mariadb*
         
         
            org.messaginghub*
         
         
            org.mockito*
         
         
            org.mongodb*
         
         
            org.neo4j.driver*
         
         
            org.postgresql*
         
         
            org.projectlombok*
         
         
            org.quartz-scheduler*
         
         
            org.reactivestreams*
         
         
            org.seleniumhq.selenium*
         
         
            org.skyscreamer*
         
         
            org.slf4j*
         
         
            org.testcontainers*
         
         
            org.thymeleaf*
         
         
            org.webjars*
         
         
            org.xerial*
         
         
            org.xmlunit*
         
         
            org.yaml*
         
         
            redis.clients*
         
         
            wsdl4j*
         
       
     
```

vs:

```java
     
        org.springframework.boot
        spring-boot-dependencies
        ${spring-boot.version}
        pom
        import
       
         
            org.springframework*
         
       
     
```

 

---
No further details from [MNG-7949](https://issues.apache.org/jira/browse/MNG-7949?redirect=false)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.