Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6198

mvn script fails to locate .mvn directory when pom location specified with -f

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5.0-alpha-1, 3.5.0-beta-1
    • Fix Version/s: 3.5.0
    • Component/s: core
    • Labels:
      None

      Description

      Steps to reproduce

      $ mkdir apache
      $ cd apache
      $ git clone https://git-wip-us.apache.org/repos/asf/maven.git
      $ mkdir .mvn
      $ cd .mvn
      $ echo -DskipTests > maven.config
      $ cd ../maven
      $ mvn install # notice tests are skipped
      $ cd ../..
      $ mvn install -f apache/maven/pom.xml # notice tests not skipped (bug)
      $ cd apache
      $ mvn install -f maven/pom.xml # notice tests are skipped (accident)
      

      The issue is that we do not search for the .mvn folder from the directory specified from -f rather from the current working directory

        Issue Links

          Activity

          Hide
          hboutemy Hervé Boutemy added a comment -

          ok, found why th eexisting IT did not fail: if .mvn directory is in the same directory than -f pom.xml, it is correctly detected (by accident: if .mvn is not found, default value is the directory from pom.xml)
          the failure happens if .mvn has to be found in a parent directory, since as you pointed out, the search does not start from pom.xml directory but from current dir...

          I'll improve MNG-5889 IT

          Show
          hboutemy Hervé Boutemy added a comment - ok, found why th eexisting IT did not fail: if .mvn directory is in the same directory than -f pom.xml , it is correctly detected (by accident: if .mvn is not found, default value is the directory from pom.xml ) the failure happens if .mvn has to be found in a parent directory, since as you pointed out, the search does not start from pom.xml directory but from current dir... I'll improve MNG-5889 IT
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-3.x #1587 (See https://builds.apache.org/job/maven-3.x/1587/)
          MNG-6198 Use the directory specified by -f for searching with 'mvn' (stephen.alan.connolly: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=87cf1eeb7d2506e192da77f7d5b286fae2b20314)

          • (edit) apache-maven/src/bin/mvn
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-3.x #1587 (See https://builds.apache.org/job/maven-3.x/1587/ ) MNG-6198 Use the directory specified by -f for searching with 'mvn' (stephen.alan.connolly: http://git-wip-us.apache.org/repos/asf/?p=maven.git&a=commit&h=87cf1eeb7d2506e192da77f7d5b286fae2b20314 ) (edit) apache-maven/src/bin/mvn
          Hide
          stephenc Stephen Connolly added a comment -

          87cf1eeb7d2506e192da77f7d5b286fae2b20314

          Show
          stephenc Stephen Connolly added a comment - 87cf1eeb7d2506e192da77f7d5b286fae2b20314
          Show
          hboutemy Hervé Boutemy added a comment - no, there is an IT, I wrote it: http://maven.apache.org/core-its/core-it-suite/xref-test/org/apache/maven/it/MavenITmng5889CoreExtensionsTest.html
          Hide
          stephenc Stephen Connolly added a comment -

          Herv? BOUTEMY the reason is that there is no integration test for MNG-5889!

          Show
          stephenc Stephen Connolly added a comment - Herv? BOUTEMY the reason is that there is no integration test for MNG-5889 !
          Hide
          stephenc Stephen Connolly added a comment -

          Yep I have been trying to get an IT that will catch this issue and prevent it in future

          Show
          stephenc Stephen Connolly added a comment - Yep I have been trying to get an IT that will catch this issue and prevent it in future
          Hide
          hboutemy Hervé Boutemy added a comment - - edited

          how is it possible that MNG-5889 IT did not detect the issue?
          is the IT missing something?

          IMHO, fixing the bug is something, but getting a good IT is even more important, or at least as much...

          Show
          hboutemy Hervé Boutemy added a comment - - edited how is it possible that MNG-5889 IT did not detect the issue? is the IT missing something? IMHO, fixing the bug is something, but getting a good IT is even more important, or at least as much...
          Hide
          stephenc Stephen Connolly added a comment -

          Does not seem to affect mvn.cmd from my analysis

          Show
          stephenc Stephen Connolly added a comment - Does not seem to affect mvn.cmd from my analysis

            People

            • Assignee:
              stephenc Stephen Connolly
              Reporter:
              stephenc Stephen Connolly
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development