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

Unpacking primary artifact from sibling module uses repository rather than reactor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0-alpha-4
    • None
    • unpack
    • None

    Description

      Running dependency:unpack referencing a project in the reactor has the following output which shows it is scanning for repository artifacts rather than the artifact in the reactor:

      [INFO] [dependency:unpack \{execution: unpack-tests}]
      [INFO] Configured Artifact: com.example.app:app-acceptance-test:2.6-SNAPSHOT:jar
      [INFO] snapshot com.example.app:app-acceptance-test:2.6-SNAPSHOT: checking for updates from snapshots
      [INFO] snapshot com.example.app:app-acceptance-test:2.6-SNAPSHOT: checking for updates from m1-repo
      Downloading: http://m2proxy:8081/artifactory/repo/com/example/app/app-acceptance-test/2.6-SNAPSHOT/app-acceptance-test-2.6-20070829.025709-409.jar
      9125K downloaded
      [INFO] Expanding: /Users/mryall/.m2/repository/com/example/app/app-acceptance-test/2.6-SNAPSHOT/app-acceptance-test-2.6-SNAPSHOT.jar into /Users/mryall/src/example/app/app-webapp/target/it-classes

      To explain the scenario: to build reusable acceptance tests, I have the following sub-modules of my project:

      • app-core (jar)
      • app-acceptance-tests (jar)
      • app-webapp (war)

      The acceptance tests are packaged this way for further use in testing, and also run against the webapp in the integration-test phase. This is where the problem arises.

      Running 'mvn clean integration-test' does the following relevant tasks:

      • in the app-acceptance-test module, compiles and packages a JAR of tests
      • in the app-webapp module, uses the dependency:unpack goal to extract the tests into target/it-classes in the pre-integration-test phase, and test:test to run them in the integration test phase.

      I don't think this is caused by the snapshot version, because the release plugin also fails because it is unable to find the 2.6 version when it runs 'mvn clean verify'. There, it scans all the repositories for the acceptance test artifact before failing with the usual error:

      [INFO] Failed to resolve artifact.

      GroupId: com.example.app
      ArtifactId: app-acceptance-test
      Version: 2.6

      Reason: Unable to download the artifact from any repository

      Maven details:

      $ mvn -version
      Maven version: 2.0.7
      Java version: 1.4.2_12
      OS name: "mac os x" version: "10.4.10" arch: "i386"
      

      Attachments

        Issue Links

          Activity

            People

              brianf Brian E Fox
              matt@atlassian.com Matt Ryall
              Votes:
              5 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: