[GRADLE-1940] Unresolved dependencies when project A depends on project B and A does not have a reference to the repository used by B Created: 18/Nov/11  Updated: 07/Feb/17  Resolved: 07/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-5
Fix Version/s: None

Type: Bug
Reporter: Mauro Molinari Assignee: Unassigned
Resolution: Duplicate Votes: 3

Attachments: Zip Archive STS-2190.zip    
Issue Links:
Duplicated by GRADLE-698 Automatically add the repository loca... Resolved


Consider the attached multiproject.

Project A depends on B
B depends on a JAR and has a reference to a flatDir repository containing that JAR.
When you run "gradle build" you get:

:B:processResources UP-TO-DATE
:: problems summary ::
                module not found: #glazedlists;1.8.0


                ::          UNRESOLVED DEPENDENCIES         ::


                :: #glazedlists;1.8.0: not found


FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':A:compile':
    - unresolved dependency: #glazedlists;1.8.0: not found
Cause: not found

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.


Total time: 13.694 secs

To solve it, open project A build.gradle, uncomment the "repositories" part and retry. The error disappears. (note: other compile-time errors show then, but this is normal, because the test case is a little dumb).

However, I don't think the "repositories" definition in A should be mandatory... After all, A does not have any dependencies on external JARs, it has just a transitive dependency on that JAR caused by its dependency on project B.

This problem was originally reported to STS-Gradle integration as https://issuetracker.springsource.com/browse/STS-2190, however it turned out it is not a problem with STS.

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Mauro Molinari [ 15/Nov/16 ]

This is still easily reproducible with a recent Gradle build (3.1 for instance).

Comment by Eric Wendelin [ 07/Feb/17 ]

Migrated to https://github.com/gradle/gradle/issues/1352 — please add any relevant details or votes there.

Generated at Wed Jun 30 12:08:27 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.