Skip to content

Don't allow people to get around BanCircularDependencies by excluding themselves. (was MOJO-2060) #2

@pmv

Description

@pmv

Right now BanCircularDependencies is easy to circumvent by excluding yourself from the dependency tree.
Example:

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.my.groupid</groupId>
    <artifactId>some-artifactid</artifactId>
    <version>1.6.1</version>
    <dependencies>
        <dependency>
            <groupId>com.my.groupid</groupId>
            <artifactId>circularartifact</artifactId>
            <version>1.1.1</version>
            <exclusions>
                <exclusion>
                    <groupId>com.my.groupid</groupId>
                    <artifactId>some-artifactid</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</project>

I propose a property 'checkExclusions' that can stop people from doing this. It would check exclusions in the pom and fail if they match that project's groupId and artifactId.

I will open a pull request shortly

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions