I preperated patch that replaces repositories
sections of project to local Artifactory cache and
fill it with data by:
$ gradle build --refresh-dependencies
Having this should allow me to build project at home without direct connection to intranet.
Unfortunately Gradle v2.13 failed even on public artifact:
$ gradle build --stacktrace ... FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':testCompileClasspath'. > Could not find spring-integration-core.jar (org.springframework.integration:spring-integration-core:4.1.3.RELEASE). Searched in the following locations: http://localhost:8081/artifactory/jcenter/org/springframework/integration/spring-integration-core/4.1.3.RELEASE/spring-integration-core-4.1.3.RELEASE.jar * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':testCompileClasspath'. at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.wrapException(ErrorHandlingConfigurationResolver.java:70) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver.access$000(ErrorHandlingConfigurationResolver.java:33) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingConfigurationResolver$ErrorHandlingResolvedConfiguration.getFiles(ErrorHandlingConfigurationResolver.java:199) .. Caused by: org.gradle.internal.resolve.ArtifactNotFoundException: Could not find spring-integration-core.jar (org.springframework.integration:spring-integration-core:4.1.3.RELEASE). Searched in the following locations: http://localhost:8081/artifactory/jcenter/org/springframework/integration/spring-integration-core/4.1.3.RELEASE/spring-integration-core-4.1.3.RELEASE.jar at org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult.notFound(DefaultBuildableArtifactResolveResult.java:38) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifactFromCache(CachingModuleComponentRepository.java:260) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$LocateInCacheRepositoryAccess.resolveArtifact(CachingModuleComponentRepository.java:244) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleComponentRepositoryAccess.resolveArtifact(BaseModuleComponentRepositoryAccess.java:54) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedModuleComponentRepository$CachedAccess.resolveArtifact(InMemoryCachedModuleComponentRepository.java:82) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingModuleComponentRepository$ErrorHandlingModuleComponentRepositoryAccess.resolveArtifact(ErrorHandlingModuleComponentRepository.java:116) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainArtifactResolver.resolveArtifact(RepositoryChainArtifactResolver.java:63)
Actually spring-integration-core-4.1.3.RELEASE.jar
is present in Artifactory cache:
bash# curl --head http://localhost:8081/artifactory/jcenter/org/springframework/integration/spring-integration-core/4.1.3.RELEASE/spring-integration-core-4.1.3.RELEASE.jar HTTP/1.1 200 OK Server: Artifactory/5.1.0 ...
After switching project build to Gradle 3.3 problem disappeared.
It seems that Gradle made some assumption about repository. So I refreshed Gradle cache by running
build with --refresh-dependencies
:
$ gradle build --refresh-dependencies
and problem went away!