You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Wei Lin (Jira)" <ji...@apache.org> on 2020/04/23 16:31:00 UTC

[jira] [Updated] (MNG-6896) Failsafe cannot resolve local dependency in a multi-module build

     [ https://issues.apache.org/jira/browse/MNG-6896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Wei Lin updated MNG-6896:
-------------------------
    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|[https://gist.github.com/wlnirvana/cdabc9495eb7dd0e03fc19e75146192c]], 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}}

  was:
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}}


> Failsafe cannot resolve local dependency in a multi-module build
> ----------------------------------------------------------------
>
>                 Key: MNG-6896
>                 URL: https://issues.apache.org/jira/browse/MNG-6896
>             Project: Maven
>          Issue Type: Bug
>          Components: Bootstrap &amp; Build
>    Affects Versions: 3.6.3
>         Environment: macOS 10.13.6
> OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
>            Reporter: Wei Lin
>            Priority: Major
>
> 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|[https://gist.github.com/wlnirvana/cdabc9495eb7dd0e03fc19e75146192c]], 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}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)