Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Specifying Include/Exclude Dependencies #10

Open
alzimmermsft opened this issue Jun 1, 2020 · 0 comments
Open

Allow Specifying Include/Exclude Dependencies #10

alzimmermsft opened this issue Jun 1, 2020 · 0 comments

Comments

@alzimmermsft
Copy link
Collaborator

alzimmermsft commented Jun 1, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant