apache / apache/maven-assembly-plugin
[MASSEMBLY-830] Cannot handle relocated artifacts
- Dominant language
- Java
- Stars
- 110
- Forks
- 75
- Avg merge
- 12h 54m
- Merged PRs (30d)
- 10
Description
**[Martin Todorov](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=carlspring)** opened **[MASSEMBLY-830](https://issues.apache.org/jira/browse/MASSEMBLY-830?redirect=false)** and commented
When one of the transitive dependencies is relocated, the `maven-assembly-plugin` doesn't follow the relocation and check the POM of the relocated artifact, but uses the actual POM artifact that declares the relocation. Since this POM doesn't define a version for the artifact, the build fails with:
```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single (make-assembly) on project blah: Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:2.6:single failed: For artifact {com.foo:bar:null:jar}: The version cannot be empty. -> [Help 1]
```
As this is a transitive dependency of a third-party library, we have no control over it and have attempted to define:
* An `` for this artifact in the dependency which requires it.
* A direct dependency (as the very first ``) to the relocated artifact (which has a version defined in the `pom.xml`).
Unfortunately, neither of these helped.
This is the POM with the relocation:
```
4.0.0
com.foo
bar
b
1.5
```
Please, advise!
Many thanks in advance!
---
**Affects:** 2.6
**Issue Links:**
- [MASSEMBLY-923](https://issues.apache.org/jira/browse/MASSEMBLY-923) NPE when axis:axis-ant:1.4 is part of dependencySet
(_**"is duplicated by"**_)
1 votes, 2 watchers
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the maven-assembly-plugin:single goal and the dependencySet handling described in the report. Reproduce the failure using a transitive dependency whose POM contains distributionManagement/relocation, then trace which POM supplies the missing version. Done means relocated artifacts are resolved using the relocated artifact's version without the reported build failure.
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
- Needs clarification
- Newbie friendliness
- 35/100