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

mvn dependency:unpack via CLI generates ${project.basedir} folder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • unpack
    • None
    • * Maven 3.5.3
      * CLI
      * macOS and CentOS

    Description

      Steps to reproduce

      1. Get a sample dependency first

      mvn dependency:get -DgroupId=org.apache.ant -DartifactId=ant -Dversion=1.8.3 -Dpackaging=jar
      

      2. Delete the file ~/.m2/repository/org/apache/ant/ant/1.8.3/_remote.repositories
      3. Unpack the dependency somewhere

      cd /tmp
      mkdir unpack
      mvn dependency:unpack -Dartifact=org.apache.ant:ant:1.8.3:jar -DoutputDirectory=./unpack
      

      4. Observe that ${project.basedir} was created

      $ ls -l /tmp/unpack
      
      total 0
      ... ${project.basedir}
      ... unpack
      

      Note Step 2 is only necessary because of getting the dependency, this wouldn't have to be done if it had been installed. This doesn't affect whether the bug occurs or not.

      Workarounds

      The closest would be to use mvn dependency:copy and then unpack manually through a subsequent command. Interestingly this shows that the bug doesn't affect mvn dependency:copy.


      Similar/related issues (their fixes don't apply here):

      Attachments

        Activity

          People

            Unassigned Unassigned
            mksd Dimitri R
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: