Features.xml picked up instead of .jar during dependency resolution

When gradle (4.10.2) resolves dependency org.apache.activemq:activemq-karaf, it picks up activemq-karaf-[VER]-features.xml instead of the jar file. Don’t know if it should be like this, but never saw this for any other dependency.
As a result, jar build task fails because it tried to read this xml as a zip.

Am I doing something wrong? Is there anything what can be done to avoid this behaviour?

Here is related info from the log file:


02:27:03.316 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve org.apache.activemq:activemq-karaf:5.15.6' completed
02:27:03.209 [INFO] [org.gradle.api.Script] Overriding dependency org.apache.activemq:activemq-karaf version 5.14.5 --> 5.15.6
02:27:03.222 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve org.apache.activemq:activemq-karaf:5.15.6' started
02:27:03.223 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Attempting to resolve component for org.apache.activemq:activemq-karaf:5.15.6 using repositories [flatDir, MavenRepo, flatDir2, maven, maven2, maven3, maven4]
02:27:03.224 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/home/maxb/project-build/build-gradle-repository/activemq-karaf-5.15.6-features.xml
02:27:03.224 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading file:/home/maxb/project-build/build-gradle-repository/activemq-karaf-features.xml
02:27:03.225 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'org.apache.activemq:activemq-karaf:5.15.6' in repository 'flatDir'.
02:27:03.229 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording absence of module descriptor in cache: org.apache.activemq:activemq-karaf:5.15.6 [changing = false]
02:27:03.229 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Cached meta-data for module must be refreshed: will perform fresh resolve of 'org.apache.activemq:activemq-karaf:5.15.6' in 'MavenRepo'
02:27:03.229 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom
02:27:03.229 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom
02:27:03.233 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Metadata of [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom' started
02:27:03.233 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource metadata: [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom
02:27:03.233 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP HEAD: [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom
02:27:03.238 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request HEAD /maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom HTTP/1.1
02:27:03.245 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Metadata of [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom'
02:27:03.248 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Metadata of [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom' completed
02:27:03.248 [INFO] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Cached resource [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6.pom is up-to-date (lastModified: Tue Sep 04 11:50:31 UTC 2018).
02:27:03.305 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] Metadata file found for module 'org.apache.activemq:activemq-karaf:5.15.6' in repository 'MavenRepo'.
02:27:03.313 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetadataCache] Recording module descriptor in cache: org.apache.activemq:activemq-karaf:5.15.6 [changing = false]
02:27:03.316 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Using org.apache.activemq:activemq-karaf:5.15.6 from Maven repository 'MavenRepo'
02:27:03.316 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Resolve org.apache.activemq:activemq-karaf:5.15.6'
02:27:09.461 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder] Visiting configuration org.apache.activemq:activemq-karaf:5.15.6(runtime).
02:27:09.549 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder] Submitting 4 metadata files to resolve in parallel for org.apache.activemq:activemq-karaf:5.15.6(runtime)
02:27:10.545 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match org.apache.activemq:activemq-karaf:5.15.6 from candidates [org.apache.activemq:activemq-karaf:5.15.6] for {org.gradle.usage=java-api}
02:27:10.562 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)' started
02:27:10.562 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml
02:27:10.563 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml
02:27:10.563 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Metadata of [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml' started
02:27:10.563 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource metadata: [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml
02:27:10.563 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP HEAD: [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml
02:27:10.568 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request HEAD /maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml HTTP/1.1
02:27:10.578 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Metadata of [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml'
02:27:10.578 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Metadata of [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml' completed
02:27:10.578 [INFO] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Cached resource [https->]repo.maven.apache.org/maven2/org/apache/activemq/activemq-karaf/5.15.6/activemq-karaf-5.15.6-features.xml is up-to-date (lastModified: Tue Sep 04 11:50:32 UTC 2018).
02:27:10.581 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Downloaded artifact 'activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)' from resolver: MavenRepo
02:27:10.582 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Resolve activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)'
02:27:10.582 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)' completed
02:27:11.222 [INFO] [org.gradle.api.Script] Overriding dependency org.apache.activemq:activemq-karaf version 5.14.5 --> 5.15.6
02:27:11.223 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Attempting to resolve component for org.apache.activemq:activemq-karaf:5.15.6 using repositories [flatDir, MavenRepo, flatDir2, maven, maven2, maven3, maven4]
02:27:11.223 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Detected non-existence of module 'org.apache.activemq:activemq-karaf:5.15.6' in resolver cache 'flatDir'
02:27:11.223 [DEBUG] [org.gradle.api.internal.afrtifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Using cached module metadata for module 'org.apache.activemq:activemq-karaf:5.15.6' in 'MavenRepo'
02:27:11.223 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver] Using org.apache.activemq:activemq-karaf:5.15.6 from Maven repository 'MavenRepo'
02:27:11.235 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder] Visiting configuration org.apache.activemq:activemq-karaf:5.15.6(runtime).
02:27:11.268 [DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match org.apache.activemq:activemq-karaf:5.15.6 from candidates [org.apache.activemq:activemq-karaf:5.15.6] for {}
02:27:11.277 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)' started
02:27:11.277 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Found artifact 'activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)' in resolver cache: /home/maxb/.gradle/caches/modules-2/files-2.1/org.apache.activemq/activemq-karaf/5.15.6/7c1c4fc28d94b8ccc49868c6172269209dff0dbe/activemq-karaf-5.15.6-features.xml
02:27:11.278 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Resolve activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)'
02:27:11.278 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Resolve activemq-karaf-features.xml (org.apache.activemq:activemq-karaf:5.15.6)' completed

And the error:
03:16:58.353 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
03:16:58.353 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
03:16:58.353 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
03:16:58.353 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Failed to capture fingerprint of input files for task ':impl:jar' property 'rootSpec$2$1' during up-to-date check.
03:16:58.353 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.util.zip.ZipException: The JAR/ZIP file (/home/maxb/.gradle/caches/modules-2/files-2.1/org.apache.activemq/activemq-karaf/5.14.5/a8f3bfaf140a49b40d3cb1941f02ffa20f6d83ca/activemq-karaf-5.14.5-features.xml) seems corrupted, error: error in opening zip file
0

Impossible to answer if you are doing something wrong without seeing the totality or relevant parts of the project build file.
But this behavior is definitely not the expected one, assuming the dependency is declared without attributes / special handling.