Maven
  1. Maven
  2. MNG-4574

[regression] invoker:install uses wrong local repo path when settings.xml contains wildcard mirror

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0-alpha-6
    • Fix Version/s: 3.0-alpha-7
    • Component/s: None
    • Labels:
      None
    • Environment:
      MacOS 10.6.2 with Maven 3.0-alpha6
    • Complexity:
      Intermediate
    • Number of attachments :
      8

      Description

      I'm coding on an archetype project (http://github.com/sonatype/sonatype-archetype) and am using the install goal of Invoker 1.5. If I use an alternate repo with the <localRepositoryUrl>, the archetype JAR is not copied into the local repo location. If I use Maven 2.2.1, the resource is copied into the localRepositoryUrl location with no problem.

      I've commented out the <install> and <localRepositoryUrl> tags in the committed version so that it passes when built with Maven 3.0-alpha-6.

      File:
      http://github.com/sonatype/sonatype-archetype/blob/master/archetype-archetypes/quickstart/pom.xml

      To reproduce this.
      1) Download Maven 3.0-alpha-6
      2) Set it to be your active maven version
      3) git clone git@github.com:sonatype/sonatype-archetype.git
      4) Hijack and uncomment the <goal>install</goal> and <localRepositoryPath>$

      {project.build.directory}

      /it/repo</localRepositoryPath> in the file archetype-archetypes/quickstart/pom.xml
      5) build the entire source tree with "mvn install"
      5) It will fail with the following error:

      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [INFO] BUILD FAILURE
      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [INFO] Total time: 15.576s
      [INFO] [INFO] Finished at: Mon Feb 15 19:49:33 MST 2010
      [INFO] [INFO] Final Memory: 6M/80M
      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.sonatype.maven.archetype:quickstart:0.8.4-SNAPSHOT) -> [Help 1]
      [INFO] [ERROR]
      [INFO] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [INFO] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [INFO] [ERROR]
      [INFO] [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [INFO] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
      [INFO] ..FAILED (16.8 s)
      [INFO] The build exited with code 1. See /Users/mccm06/Documents/Code/OpenSourceContribs/sonatype-archetype_git/archetype-archetypes/quickstart/target/it/projects/quickstart/build.log for details.
      [INFO] -------------------------------------------------
      [INFO] Build Summary:
      [INFO] Passed: 0, Failed: 1, Errors: 0, Skipped: 0
      [INFO] -------------------------------------------------
      [ERROR] The following builds failed:
      [ERROR] * quickstart
      [INFO] -------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 21.310s
      [INFO] Finished at: Mon Feb 15 19:49:34 MST 2010
      [INFO] Final Memory: 8M/80M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-invoker-plugin:1.5:run (integration-test) on project quickstart: 1 build failed. -> [Help 1]

      1. Maven2MainBuild.log
        162 kB
        Matthew McCullough
      2. Maven2Success_build.log
        19 kB
        Matthew McCullough
      3. Maven2Success_BUILD-quickstart.xml
        0.1 kB
        Matthew McCullough
      4. Maven3Failure_build.log
        18 kB
        Matthew McCullough
      5. Maven3Failure_BUILD-quickstart.xml
        0.3 kB
        Matthew McCullough
      6. Maven3MainBuild.log
        182 kB
        Matthew McCullough
      7. settings.xml
        3 kB
        Matthew McCullough

        Issue Links

          Activity

          Hide
          Benjamin Bentmann added a comment -

          Alternatively, debug this on your own machine by checking out the 3.0-alpha-6 tag into the IDE and set breakpoints at MavenArtifactRepository.java:77 (URL -> basedir conversion) and DefaultArtifactInstaller.java:74 ff. (artifact path calculation).

          Show
          Benjamin Bentmann added a comment - Alternatively, debug this on your own machine by checking out the 3.0-alpha-6 tag into the IDE and set breakpoints at MavenArtifactRepository.java:77 (URL -> basedir conversion) and DefaultArtifactInstaller.java:74 ff. (artifact path calculation).
          Hide
          Matthew McCullough added a comment -

          Worked on Windows. Still fails on Mac. I'll set the breakpoint on Mac and see what I can see...

          Show
          Matthew McCullough added a comment - Worked on Windows. Still fails on Mac. I'll set the breakpoint on Mac and see what I can see...
          Hide
          Matthew McCullough added a comment -

          Aha! I was able to reproduce it. It is affected by my settings.xml file, which I am attaching. If I have NO settings.xml file, it works fine, even on a Mac. If I use the attached settings.xml file, it fails as previously described. Can you reopen it?

          Show
          Matthew McCullough added a comment - Aha! I was able to reproduce it. It is affected by my settings.xml file, which I am attaching. If I have NO settings.xml file, it works fine, even on a Mac. If I use the attached settings.xml file, it fails as previously described. Can you reopen it?
          Hide
          Matthew McCullough added a comment -

          If I remove the <profiles> and <mirrors> section of the attached POM, then the failure goes away. If I add those sections back, it fails as previously described.

          Show
          Matthew McCullough added a comment - If I remove the <profiles> and <mirrors> section of the attached POM, then the failure goes away. If I add those sections back, it fails as previously described.
          Hide
          Benjamin Bentmann added a comment -

          Fixed in r917315.

          Show
          Benjamin Bentmann added a comment - Fixed in r917315 .

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Matthew McCullough
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: