You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a simple gradle project with 2 repositories (mavenLocal(), mavenCentral()), gradle sometimes fails to find dependencies with the following error:
Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find jboss-annotations-api_1.2_spec-1.0.2.Final.jar (org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.2.Final).
Searched in the following locations:
file:/home/g/.m2/repository/org/jboss/spec/javax/annotation/jboss-annotations-api_1.2_spec/1.0.2.Final/jboss-annotations-api_1.2_spec-1.0.2.Final.jar
It appears that the folder exists my local repository but for some reason (due to other builds), only the pom file has been resolved.
If I clean my maven local repository, the next execution will be ok.
Expected Behavior
Gradle should not fail and try to resolved that dependency using the next repository.
Current Behavior
Gradle fail to resolve the dependency and build fail. If I clean my maven repository then the resolution is ok.
Steps to Reproduce
Create a simple gradle project
remove a jar from a dependency in your local maven repository
try to build the project
Your Environment
Java 11
Gradle 6.8.3
The text was updated successfully, but these errors were encountered:
Using mavenLocal() as repository is not safe/stable as it may be modified by other tools like Maven while you run a build. What you describe is a broken publication in a repository where the pom exists, but the Jar is missing. Gradle does not just jump over these as the assumption is that repositories are not broken. The solution for this is to fix the corresponding publication in the repository.
Note that if you remove mavenLocal() as repository, Gradle will still check your .m2 folder for Jars that were already downloaded there (effectively using is as a cache).
In a simple gradle project with 2 repositories (
mavenLocal()
,mavenCentral()
), gradle sometimes fails to find dependencies with the following error:It appears that the folder exists my local repository but for some reason (due to other builds), only the
pom
file has been resolved.If I clean my maven local repository, the next execution will be ok.
Expected Behavior
Gradle should not fail and try to resolved that dependency using the next repository.
Current Behavior
Gradle fail to resolve the dependency and build fail. If I clean my maven repository then the resolution is ok.
Steps to Reproduce
Your Environment
The text was updated successfully, but these errors were encountered: