diff --git a/plugin/src/main/kotlin/dev/aga/gradle/versioncatalogs/service/PublishedArtifactResolver.kt b/plugin/src/main/kotlin/dev/aga/gradle/versioncatalogs/service/PublishedArtifactResolver.kt index 18b33bc..b7ebffb 100644 --- a/plugin/src/main/kotlin/dev/aga/gradle/versioncatalogs/service/PublishedArtifactResolver.kt +++ b/plugin/src/main/kotlin/dev/aga/gradle/versioncatalogs/service/PublishedArtifactResolver.kt @@ -2,7 +2,6 @@ package dev.aga.gradle.versioncatalogs.service import dev.aga.gradle.versioncatalogs.exception.ResolutionException import java.io.File -import java.util.concurrent.atomic.AtomicInteger import java.util.function.Supplier import org.apache.maven.model.Dependency import org.gradle.api.artifacts.Configuration @@ -44,13 +43,7 @@ class PublishedArtifactResolver( } private fun createConfiguration(): Configuration { - val config = - drs.configurationContainer.create( - "incomingConfiguration${configurationCount.incrementAndGet()}", - ) - - return config.apply { - resolutionStrategy.activateDependencyLocking() + return drs.configurationContainer.detachedConfiguration().apply { attributes { attribute( Category.CATEGORY_ATTRIBUTE, @@ -61,8 +54,4 @@ class PublishedArtifactResolver( isCanBeConsumed = false } } - - companion object { - private val configurationCount = AtomicInteger(0) - } } diff --git a/plugin/src/test/kotlin/dev/aga/gradle/versioncatalogs/service/MockGradleDependencyResolver.kt b/plugin/src/test/kotlin/dev/aga/gradle/versioncatalogs/service/MockGradleDependencyResolver.kt index cacf65d..de44c8a 100644 --- a/plugin/src/test/kotlin/dev/aga/gradle/versioncatalogs/service/MockGradleDependencyResolver.kt +++ b/plugin/src/test/kotlin/dev/aga/gradle/versioncatalogs/service/MockGradleDependencyResolver.kt @@ -34,7 +34,7 @@ class MockGradleDependencyResolver(val rootDir: Path) : DependencyResolver { } private val configurationContainer = - mock { on { create(any()) } doReturn configuration } + mock { on { detachedConfiguration() } doReturn configuration } private val drs = mock {