Martin Todorov created MASSEMBLY-830:
----------------------------------------

             Summary: Cannot handle relocated artifacts
                 Key: MASSEMBLY-830
                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-830
             Project: Maven Assembly Plugin
          Issue Type: Bug
          Components: dependencySet
    Affects Versions: 2.6
         Environment: $ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
2015-11-10T16:41:47+00:00)
Maven home: C:\java\apache\maven-3.3.9
Java version: 1.8.0_92, vendor: Oracle Corporation
Java home: C:\java\jdk1.8.0_92\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

            Reporter: Martin Todorov
            Priority: Blocker


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:

{code}
[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]
{code}

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:
{code}
<?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> 
{code}

Please, advise!
Many thanks in advance!




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to