google / guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.

Home Page:https://github.com/google/guice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gradle tries to find no_aop jar for version 5.1.0 even though classifier noaop is not specified anywhere

Discordia opened this issue · comments

I'm updating a java project from version 11 to 17 that depends on guice. It was using version 4.3.x before and now I updated that to version 5.1.0 since fix for java 17 was in 5.0.1. But then gradle fails with this message:

Could not resolve all files for configuration ':MyProjectName:runtimeClasspath'.

Could not find guice-5.1.0-no_aop.jar (com.google.inject:guice:5.1.0).
Searched in the following locations:
https://internal.nexus.domain.com/repository/maven-public/com/google/inject/guice/5.1.0/guice-5.1.0-no_aop.jar

As I understand the aop jar was removed in version 5.0.0/5.0.1 so I am not sure why it's trying to find it?

Also, we do not specify the classifier noaop anywhere.

I'd recommend checking transitive dependencies in case it's being brought in indirectly: https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html

Thanks, I did fix it by upgrading some dependency that also looked like it depended on guice. But I still do not understand how this can happen.

It would be one thing if it tried to find 4.x.x-no_aop.jar because of an old transitive dependency. But now it tried to fetch 5.1.0-no_aop.jar, that one does not exist and should not be mentioned in any pom.xml? Or am I missing something?

It's probably Gradle aligning dependency versions - it sees you're using 5.1.0 and sees a transitive dependency using 4.x.x-no_aop.jar and tries to align that transitive dependency to 5.1.0-no_aop.jar. It only finds out that file doesn't exist when it goes to download it, at which point the safest approach is to fail the build and let you resolve the conflict.

Thanks for the help, I will close this issue.