apache / apache/maven

[MNG-8097] Validate that each dependency->type is a type registered in an artifact handler

Open
#10,785 8 comments 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
21h 11m
Merged PRs (30d)
312

Description

**[Konrad Windszus](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=kwin)** opened **[MNG-8097](https://issues.apache.org/jira/browse/MNG-8097?redirect=false)** and commented

Currently often the dependency's type is being set to the extension and the resolution is lenient, i.e. if there is no artifact handler defining the value given in `dependency->type` resolution transparently uses the type as extension.
That can potentially lead to two issues:

1. Resolution might fail with surprising error messages like

```
Could not resolve dependencies for project ....: The following artifacts could not be resolved: : Could not transfer artifact ::: from/to ...
```

This is an issue for all types not defined by Maven Core itself, e.g. for https://jackrabbit.apache.org/filevault-package-maven-plugin/index.html which registers an artifact handler for type `content-package` with extension `zip`.
2. The information `addedToClasspath`, `includesDependencies` and `classifier` from the artifact handler is not evaluated

Compare with https://maven.apache.org/repositories/artifacts.html#but-where-do-i-set-artifact-extension

---

**Remote Links:**
- [GitHub Pull Request #529
](https://github.com/apache/maven-site/pull/529)

Contributor guide

Open the contributing guide

Research direction

Start by tracing how dependency-type values are resolved and how artifact handlers are registered in Maven core; the issue does not name specific files or tests. Compare the behavior with the Maven artifact documentation and verify that unregistered types fail clearly while registered handler metadata is honored.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.