You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/05/04 21:10:00 UTC
[jira] [Commented] (MNG-5600) Dependency management import should support exclusions.
[ https://issues.apache.org/jira/browse/MNG-5600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17531946#comment-17531946 ]
ASF GitHub Bot commented on MNG-5600:
-------------------------------------
djohle commented on PR #295:
URL: https://github.com/apache/maven/pull/295#issuecomment-1117940950
Not to be a "me 2" here, but I ran into this issue today. But I figured I would at least comment to show my support of including this change.
I was centralizing some repeatedly used dependencies in a multi-module project via dependencyManagement in the parent POM. These dependencies came with some excludes (fortunately the same one in each usage), so I put those in the parent as well. Was quite surprised that building my application resulted in 2x the size of the final package and a complete failure to function at all (there is a reason I do these exclusions!). To work around this I had to re-add the exclusions to each of the relevant modules.
Like the previous comment...I can totally understand if there are reasons for blockage, but those are not apparent. Looking back to the beginning, this enhancement/fix is over 4 years old now! Kind of sucks to see an already-solved issues be ignored like this.
> Dependency management import should support exclusions.
> -------------------------------------------------------
>
> Key: MNG-5600
> URL: https://issues.apache.org/jira/browse/MNG-5600
> Project: Maven
> Issue Type: Improvement
> Components: Dependencies
> Reporter: Radai Rosenblatt
> Priority: Major
> Fix For: 4.0.x-candidate
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> suppose i have a multi-module project that uses spring, and so have this in dependency-managements in a parent pom:
> {code:xml}
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-framework-bom</artifactId>
> <version>${org.springframework.version}</version>
> <type>pom</type>
> <scope>import</scope>
> </dependency>
> {code}
> spring artifacts (or at least a lot of them) have a dependency on commons-logging. right now, if i want to exclude commons-logging i have to add an exclusion to every spring dependency in every module of my project, which is actually more XML overall than giving up on using the bom dependency altogether and listing all spring dependencies with excludes once in the parent dependency management.
> I'd like to be able to do this:
> {code:xml}
> <dependency>
> <groupId>org.springframework</groupId>
> <artifactId>spring-framework-bom</artifactId>
> <version>${org.springframework.version}</version>
> <type>pom</type>
> <scope>import</scope>
> <exclusions>
> <exclusion>
> <artifactId>commons-logging</artifactId>
> <groupId>commons-logging</groupId>
> </exclusion>
> </exclusions>
> </dependency>
> {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)