Skip to content

[MENFORCER-424] Maven enforcer rule which checks that all dependencies in dependencyManagement don't have an explicit scope set #542

Closed

Description

@jira-importer

Konrad Windszus opened MENFORCER-424 and commented

Setting the scope in the dependencyManagement is an anti-pattern and may lead to surprising results during classpath creation. Compare also with the discussion in apache/maven-apache-parent#63 (comment).

I propose to add a new rule with name banDependencyManagementScope.

Probably scope import should be accepted though, because it is a special case.


Issue Links:

Remote Links:

Backported to: 3.2.0

Activity

  1. jira-importer commented on Jun 26, 2022

    @jira-importer
    Author

    Slawomir Jaranowski commented

    One case when I use scope in dependencyManagement is when I want to change scope for transitive dependency.

  2. jira-importer commented on Jun 27, 2022

    @jira-importer
    Author

    Konrad Windszus commented

    Right, so probably such a rule needs a way to allow certain dependencies to have their scope managed. But what about the rule in general, would you accept a PR for adding it to the standard rules?

  3. jira-importer commented on Jun 27, 2022

    @jira-importer
    Author

    Slawomir Jaranowski commented

    For me ok.

  4. jira-importer commented on Jul 1, 2022

    @jira-importer
    Author

    Konrad Windszus commented

    I provided a PR in #169. sjaranowski Do you have time to review?

  5. jira-importer commented on Jul 29, 2022

    @jira-importer
    Author

    Slawomir Jaranowski commented

    we have many build-in rules for dependency management, so I think we can add one more
     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions