Skip to content

Allow Specifying Include/Exclude Dependencies #10

@alzimmermsft

Description

@alzimmermsft

Add a configuration, either include or exclude or both, which allow configuring which dependencies will trigger the plugin to fail build.

For example, I have a POM with two dependencies:

Project

<dependencies>
  <dependency>
    <groupId>groupA</groupId>
    <artifactId>artifactA</artifactId>
    <version>1</version>
  <dependency>

  <dependency>
    <groupId>groupB</groupId>
    <artifactId>artifactB</artifactId>
    <version>2</version>
  <dependency>
</dependencies>

Artifact A

<dependencies>
  <dependency>
    <groupId>commonGroup</groupId>
    <artifactId>commonArtifact</artifactId>
    <version>1</version>
  </dependency>
  <dependency>
    <groupId>uncommonGroupA</groupId>
    <artifactId>uncommonArtifactA</artifactId>
    <version>1</version>
  </dependency>
</dependencies>

Artifact B

<dependencies>
  <dependency>
    <groupId>commonGroup</groupId>
    <artifactId>commonArtifact</artifactId>
    <version>2</version>
  </dependency>
  <dependency>
    <groupId>uncommonGroupB</groupId>
    <artifactId>uncommonArtifactB</artifactId>
    <version>2</version>
  </dependency>
</dependencies>

The requested configuration would take the form such as:

Inclusion

This configuration would fail the build for the project as commonGroup:commonArtifact resolves to different versions for each dependency.

<includes>
  <include>commonGroup:commonArtifact</include>
</includes>

Exclusion

This configuration would pass the build even though commonGroup:commonArtifact resolves to different versions for each dependency it is marked to be ignored.

<excludes>
  <exclude>commonGroup:commonArtifact</exclude>
</excludes>

By default all artifacts should be included in failing the build. If both inclusion and exclusion is support it should be determined which takes precedence if both include the same artifact identifier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions