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

Unpack goal does not fail build when destination could not be created and unpacks to current working directory instead

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 3.0.1
    • Component/s: unpack
    • Labels:
      None
    • Flags:
      Patch

      Description

      The unpack goal attempts to create the outputDirectory using File.mkdirs() if it does not exist. If this attempt fails for example due to not having write permission to the parent directory of outputDirectory then unfortunately the build reports that it succeeded and moreover unpacks the artifact to the current working directory.

      Attached is a example project in mdep-bug.zip that does not fail to build on mvn clean install on linux/unix despite the outputDirectory being on the root of the file system that would not normally be writeable by a non-root user. Additionally the artifacts are unpacked into the mdep-bug directory!

      Attached also is a patch to fix the behaviour and to unit test it.

      1. mdep-bug-patch
        3 kB
        Dave Moten
      2. mdep-bug.zip
        1 kB
        Dave Moten

        Activity

        Hide
        michael-o Michael Osipov added a comment -

        Fixed with r1791617.

        Show
        michael-o Michael Osipov added a comment - Fixed with r1791617 .
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Jenkins build maven-plugins #8923 (See https://builds.apache.org/job/maven-plugins/8923/)
        MDEP-428 Unpack goal does not fail build when destination could not be created and unpacks to current working directory instead

        Submitted-by: Dave Moten <davidmoten@gmail.com> (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1791617)

        • (edit) maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/AbstractDependencyMojo.java
        • (edit) maven-dependency-plugin/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestUnpackMojo.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Jenkins build maven-plugins #8923 (See https://builds.apache.org/job/maven-plugins/8923/ ) MDEP-428 Unpack goal does not fail build when destination could not be created and unpacks to current working directory instead Submitted-by: Dave Moten <davidmoten@gmail.com> (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1791617 ) (edit) maven-dependency-plugin/src/main/java/org/apache/maven/plugins/dependency/AbstractDependencyMojo.java (edit) maven-dependency-plugin/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestUnpackMojo.java

          People

          • Assignee:
            michael-o Michael Osipov
            Reporter:
            davidmoten Dave Moten
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development