This is an automated email from the ASF dual-hosted git repository.

snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new e5356ad51 Publish/pom: don't include test-fixtures dependencies as 
runtime (#3085)
e5356ad51 is described below

commit e5356ad512236661745f15550e15410afd129243
Author: Robert Stupp <[email protected]>
AuthorDate: Fri Nov 21 10:02:38 2025 +0100

    Publish/pom: don't include test-fixtures dependencies as runtime (#3085)
    
    The list of dependencies in pom's includes the api/runtime elements of the 
test-fixtures, which is not what should be published, as it "pulls up" deps 
like junit, mockito and assertj as Maven runtime scope dependencies.
    This change fixes this.
---
 .../src/main/kotlin/publishing/PublishingHelperPlugin.kt    | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt 
b/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
index 359db21e8..bc3c6e7ba 100644
--- a/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
+++ b/build-logic/src/main/kotlin/publishing/PublishingHelperPlugin.kt
@@ -20,6 +20,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
 import javax.inject.Inject
 import org.gradle.api.Plugin
 import org.gradle.api.Project
+import org.gradle.api.component.AdhocComponentWithVariants
 import org.gradle.api.component.SoftwareComponentFactory
 import org.gradle.api.publish.PublishingExtension
 import org.gradle.api.publish.maven.MavenPublication
@@ -125,7 +126,17 @@ constructor(private val softwareComponentFactory: 
SoftwareComponentFactory) : Pl
                 if (project.plugins.hasPlugin(ShadowPlugin::class.java)) {
                   configureShadowPublishing(project, mavenPublication, 
softwareComponentFactory)
                 } else {
-                  from(components.firstOrNull { c -> c.name == "javaPlatform" 
|| c.name == "java" })
+                  val component =
+                    components.firstOrNull { c -> c.name == "javaPlatform" || 
c.name == "java" }
+                  if (component is AdhocComponentWithVariants) {
+                    listOf("testFixturesApiElements", 
"testFixturesRuntimeElements").forEach { cfg
+                      ->
+                      configurations.findByName(cfg)?.apply {
+                        component.addVariantsFromConfiguration(this) { skip() }
+                      }
+                    }
+                  }
+                  from(component)
                 }
 
                 suppressPomMetadataWarningsFor("testFixturesApiElements")

Reply via email to