apache / apache/maven

[MNG-6299] Allow plugins to contribute resolved dependencies

Open
#7,570 2 comments 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Romain Manni-Bucau](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=romain.manni-bucau)** opened **[MNG-6299](https://issues.apache.org/jira/browse/MNG-6299?redirect=false)** and commented

Today maven uses resolvedArtifacts as the base for the "available" artifacts for plugins.

It would be very fancy and smooth to be able to enrich this list in a plugin for next plugins.

Today the workaround using gmavenplus-plugin is to use reflection to modify this list but this is not satisfying.

For info is here the kind of code which is usable:

```
def addArtifact = { project, art ->
def f = project.class.getDeclaredField('resolvedArtifacts')
if (!f.accessible) {
f.accessible = true
}
f.get(pj).add(art)
}
```

The high level goal is to be able, for a particular project, to resolve in a custom manner some artifacts and attach them to the project without having to develop a custom repository layout or maven extension (outside the final project).

---
No further details from [MNG-6299](https://issues.apache.org/jira/browse/MNG-6299?redirect=false)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.