maven-assembly-plugin icon indicating copy to clipboard operation
maven-assembly-plugin copied to clipboard

[MASSEMBLY-830] Cannot handle relocated artifacts

Open jira-importer opened this issue 9 years ago • 1 comments

Martin Todorov opened MASSEMBLY-830 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 <exclusion/> for this artifact in the dependency which requires it.
  • A direct dependency (as the very first <dependency/>) 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:

<?xml version="1.0" encoding="UTF-8"?> 
<project xsi:schemaLocation=" http://maven.apache.org/POM/4.0.0  http://maven.apache.org/xsd/maven-4.0.0.xsd " xmlns=" http://maven.apache.org/POM/4.0.0 " 
    xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"> 
  <modelVersion>4.0.0</modelVersion> 
  <groupId>com.foo</groupId> 
  <artifactId>bar</artifactId> 
  <distributionManagement> 
    <relocation> 
      <classifier>b</classifier> 
      <version>1.5</version> 
    </relocation> 
  </distributionManagement> 
</project> 

Please, advise! Many thanks in advance!


Affects: 2.6

Issue Links:

  • MASSEMBLY-923 NPE when axis:axis-ant:1.4 is part of dependencySet ("is duplicated by")

1 votes, 2 watchers

jira-importer avatar Sep 21 '16 17:09 jira-importer