apache / apache/maven-enforcer

Add rule to ban dependencies with specific version qualifiers

Open
#938 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
161
Forks
180
Avg merge
1d 20m
Merged PRs (30d)
8

Description

### New feature, improvement proposal

I would like to request a new enforcer rule (or enhancement to existing rules) that can ban dependencies based on version qualifiers/suffixes, independent of the specific version number.

Current Limitation:

The BannedDependencies rule currently cannot match version qualifiers flexibly. I attempted the following configuration:
```


a.b.c*:*:*-a*
a.b.c*:*:*-m*
a.b.c*:*:*-rc*

```
However, based on the [ArtifactMatcher implementation](https://github.com/apache/maven-enforcer/blob/enforcer-3.6.1/enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils/ArtifactMatcher.java#L154), the version field does not support wildcard matching for qualifiers in this way.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the BannedDependencies rule and the ArtifactMatcher implementation at enforcer-rules/src/main/java/org/apache/maven/enforcer/rules/utils/ArtifactMatcher.java#L154. Trace how the version field is matched, then determine how qualifier patterns such as -a*, -m*, and -rc* should work independently of the version number. Done means the rule or matcher reliably applies those exclusions across matching dependency versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.