Dependency search for Maven repository causing errors after upgrade to Gradle 4.6

We have recently upgraded two larger builds to Gradle 4.6. Since then our builds started to run into spurious errors (about 1 out of 10 builds) when trying to find dependencies from our internal Artifactory repository, which is configured to behave as a Maven repository. That used to work for years without ever seeing errors like the following:

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':foo-war:runtimeClasspath'.
> Could not resolve org.webjars.bower:marked:[0.3.1,0.4).
  Required by:
      project :foo-war > project :foo-web > org.webjars.bower:angular-marked:1.2.2
   > Failed to list versions for org.webjars.bower:marked.
      > Could not list versions using Ivy pattern 'https://blah/artifactory/main/[organisation]/[module]/ivy-[revision].xml'.
         > Could not get resource 'https://blah/artifactory/main/org.webjars.bower/marked/'.
            > Could not GET 'https://blah/artifactory/main/org.webjars.bower/marked/'.
               > Read timed out

Why is Gradle even trying to find an Ivy descriptor if the repository in question is configured as a Maven repository (repositories { maven { url "..." credentials { ... } } })?

Did you just bump Gradle to 4.6 or did you also start leveraging some of the new features it introduced?
Asking in order to work on isolating what could be the exact source of the issue.

Yes, we have also started to use the new JUnit 5 facilities. We’ve added the following:

dependencies
{
	// ...
	testCompile 'org.junit.jupiter:junit-jupiter-api:5.1.0'
	testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
	testRuntime 'org.junit.vintage:junit-vintage-engine:5.1.0'
}
test
{
	useJUnitPlatform()
}

Other than that nothing has been changed.

Two more details of our build architecture in case that helps to trace down the problem:

  • We use only our internal Artifactory repository; i.e., there is no jcenter(), mavenCentral(), or any other repository declaration made.
  • The repository is declared in a Gradle init script (.gradle/init.gradle) as shown below (data removed for privacy reasons).
allprojects
{
	buildscript
	{
		repositories
		{
			maven
			{
				url "..."
				credentials
				{
					username "..."
					password "..."
				}
			}
		}
	}

	repositories
	{
		maven
		{
			url "..."
			credentials
			{
				username "..."
				password "..."
			}
		}
	} 
	// ...
}

Thanks for the added information. It is indeed strange that we end up querying a maven repo with an Ivy pattern.
Will try to get some time into finding a code path that could explain that.

If you manage to setup a minimal project that reproduces the issue, please share it.