Skip to content

Jagger distribution adds jackson-mapper-asl-1.0.1.jar into the /lib directory #841

@amikryukov

Description

@amikryukov

Issue

If the User uses jackson-mapper-asl in his code (f.e. custom invoker), he ends up with 2 versions of jackson-mapper-asl in the /lib directory.

How To Reproduce

create a project

$ mvn archetype:generate -DarchetypeGroupId=com.griddynamics.jagger -DarchetypeArtifactId=jagger-archetype-java-builders -DarchetypeVersion=2.0 -DarchetypeRepository=https://nexus.griddynamics.net/nexus/content/repositories/jagger-releases/

add a dependency in to the pom

./artifact/pom.xml:

  <dependency>

       <groupId>org.codehaus.jackson</groupId>

       <artifactId>jackson-mapper-asl</artifactId>

       <version>1.9.13</version>

  </dependency>

build the project

$ mvn clean install

see multiple versions of the artifact appears in /lib directory

$ ls -A1 ./artifact/target/artifact-1.0-SNAPSHOT-full/lib/ | grep jackson-mapper
jackson-mapper-asl-1.0.1.jar
jackson-mapper-asl-1.9.13.jar

Expected:
User version is used as it is closer to the maven root.
Actual:
User and Jagger versions are present in final lib.

Temporary workaround

Use "unpackOptions" for the Jagger distribution module in assembly-config.xml
i.e.

    <dependencySet>

        <outputDirectory>/</outputDirectory>

        <includes>

            <include>com.griddynamics.jagger:jagger-distribution:zip:full</include>

        </includes>

        <unpack>true</unpack>

        <unpackOptions>

            <excludes>

                <exclude>**/jackson-mapper-asl-1.0.1*</exclude>

            </excludes>

        </unpackOptions>

    </dependencySet>

RCA

The reason for such behavior is that jagger uses zip in assembly-config.xml to get all dependencies(jars) and resources needed for the execution.
So maven does not know how to compare artifacts from zip, and artifacts from users pom.xml

jackson-mapper-asl-1.0.1 comes from one of the Hadoop dependencies.

Possible Solutions

It will be great to change the build process in a way, that maven can help with dependencies. f.e. copy dependencies not with 'zip', but with 'pom' package.

In this case, User can introduce different plugins to detect duplicate dependencies :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions