Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-264

Dependency is copied from original source directory instead of .m2 using maven 3

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.2
    • copy
    • None
    • SUSE 9 Linux, OpenJDK 1.6.0 build 11.0-b17, Maven 3.0-beta-1

    Description

      Using Maven 2.2.1, the maven-dependency-plugin copy goal always copied the artifacts from the local .m2, which meant that they kept their full name (ex: ccad-moda-1.0.0-SNAPSHOT-system-help.pdf). Using Maven 3.0-beta-1, this is no longer always the case. If I build just the assembly sub-module, then it copies the artifact from the local .m2 and maintains the name. If I build the whole project, which includes building the module that produces the artifact being copied, then Maven 3 skips going to the local .m2 and instead goes back to the original source of the artifact and copies it from there. This results in a copied file with the short name (ex: system-help.pdf).

      Here are some lines from the build logs to show the difference.

      Maven 2.2.1
      ===========
      [INFO] Configured Artifact: com.ccadllc.test1:ccad-moda:system-help:1.0.0-SNAPSHOT:pdf
      [DEBUG] Skipping disabled repository central
      [DEBUG] ccad-moda: using locally installed snapshot
      [INFO] Copying /home/jzuidema/.m2/repository/com/ccadllc/test1/ccad-moda/1.0.0-SNAPSHOT/ccad-moda-1.0.0-SNAPSHOT-system-help.pdf to /extra1/export/home/jzuidema/tmp2/test1/assembly/target/pdfs/ccad-moda-1.0.0-SNAPSHOT-system-help.pdf

      Maven 3.0-beta-1
      ================
      [INFO] Configured Artifact: com.ccadllc.test1:ccad-moda:system-help:1.0.0-SNAPSHOT:pdf
      [INFO] Copying /extra1/export/home/jzuidema/tmp2/test1/moda/system-help.pdf to /extra1/export/home/jzuidema/tmp2/test1/assembly/target/pdfs/system-help.pdf

      Attached is an example project with the build logs from a maven 2.2.1 and a 3.0-beta-1 run of "mvn -X clean install" at the top level of the project.

      Attachments

        1. mavenDepsCopyExample.tar
          380 kB
          Jake Zuidema

        Activity

          People

            Unassigned Unassigned
            jzuidema Jake Zuidema
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: