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

Failsafe cannot resolve local dependency in a multi-module build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.6.3
    • None
    • Bootstrap & Build
    • None
    • macOS 10.13.6

      OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)

    Description

      In a multimodule build, if a module depends on another module, failsafe reports error "Could not resolve dependencies"

      I have created [a self-extracting python script, with a sample project encoded in the script to reproduce the issue. After downloading the script (sss.py), the project can be populated as follows:

      $ python3 sss.py
      Extract project to /var/folders/c9/42x7_bq13kx5ms99j0w7_k3h0000gn/T/tmpbia95v4y ? ([Y/n]):
      Project extracted successfully!

      Then one should be able to reproduce the issue as follows:

      $ cd /var/folders/c9/42x7_bq13kx5ms99j0w7_k3h0000gn/T/tmpbia95v4y

      $ rm -rf ~/.m2/repository/org/test/dependency

      $ mvn failsafe:integration-test
      [INFO] Scanning for projects...
      ...
      [ERROR] Failed to execute goal on project app: Could not resolve dependencies for project org.test:app:jar:1.0-SNAPSHOT: Could not find artifact org.test:dependency:jar:1.0-SNAPSHOT -> [Help 1]
      ...

      To work around the error, the dependency has to be installed to the local repo, as shown below:

      $ mvn --pl dependency install

      $ mvn failsafe:integration-test

      Attachments

        Activity

          People

            Unassigned Unassigned
            wlnirvana Wei Lin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: