gradle unable to find library in IntelliJ

1 day ago 1
ARTICLE AD BOX

The error is caused by how flatDir dependencies are resolved and how the dependency is declared.

With a flatDir repository, Gradle does not use Maven-style metadata. When you declare:

implementation name: "juror-common-${version}"

Gradle tries to resolve multiple variants (including -sources.jar), which leads to this lookup:

juror-common-2.17.5-sources.jar

Since only juror-common-2.17.5.jar exists in ../jars, resolution fails.

Correct ways to fix this

Declare the local JAR explicitly (recommended)

This avoids flatDir resolution issues entirely:

dependencies { implementation files("../jars/juror-common-2.17.5.jar") }

You can then remove flatDir from repositories.

This is a known limitation of flatDir repositories, which is why they are discouraged in Gradle documentation.

jaysingh's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Read Entire Article