You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a KMM library in which I define two publications aar and framework. I declare that these two publications should be published by artifactory plugin. The artifactoryPublish task publishes these two publications and additionally publishes .module metadata about publications which are not listed in defaults block.
We used the plugin version 4.33.1 and it worked. It started to happen after migration to 5.2.0.
Current behavior
The :library module is kotlin multiplatform library. According to this article kotlin multiplatform plugin along with maven-publish plugin creates publications for each target.
Configuration of artifactory plugin in root build.gradle.kts
configure<ArtifactoryPluginConvention> {
val artifactoryContextUrl:String by rootProject
val artifactoryKeyRelease:String by rootProject
publish {
contextUrl = artifactoryContextUrl
repository {
repoKey = artifactoryKeyRelease
username =System.getenv("ARTIFACTORY_LOGIN")
password =System.getenv("ARTIFACTORY_PASSWORD")
}
defaults {
publications("aar", "framework")
setPublishIvy(false)
setProperties(mapOf("q.os" to "kmm", "dev.team" to "xxx"))
}
}
}
Declaration of publications that should be published by the artifactory task.
publishing {
val libraryVersion:String by rootProject
val artifactoryGroupId:String by rootProject
val artifactoryArtifactId:String by rootProject
val artifactoryArtifactIdIos:String by rootProject
publications {
register<MavenPublication>("aar") {
groupId = artifactoryGroupId
version = libraryVersion
artifactId = artifactoryArtifactId
artifact("$buildDir/outputs/aar/library-release.aar")
pom.withXml {
val dependencies = asNode().appendNode("dependencies")
val common = configurations.commonMainImplementation.get().allDependencies
val android = configurations.implementation.get().allDependencies
(common + android).forEach {
dependencies.appendNode("dependency").apply {
appendNode("groupId", it.group)
appendNode("artifactId", it.name)
appendNode("version", it.version)
}
}
}
}
register<MavenPublication>("framework") {
groupId = artifactoryGroupId
version = libraryVersion
artifactId = artifactoryArtifactIdIos
artifact("$buildDir/faktory/zip/frameworkarchive.zip")
}
}
}
The artifactoryPublish task publishes publications framework, aar and module info about publications defined in KMM. Module info shouldn't be deployed. See enclosed build log.
I believe that the issue is in PublicationExtractor in extractModuleInfo. There is a filter on GenerateModuleMetadata tasks with respect to publications. I think there should be included a filter for declared publications. I debugged extractModuleInfo and found out that KMM publication tasks are not filtered out. See screenshot below.
Describe the bug
I have a KMM library in which I define two publications
aar
andframework
. I declare that these two publications should be published by artifactory plugin. The artifactoryPublish task publishes these two publications and additionally publishes .module metadata about publications which are not listed in defaults block.We used the plugin version 4.33.1 and it worked. It started to happen after migration to 5.2.0.
Current behavior
The
:library
module is kotlin multiplatform library. According to this article kotlin multiplatform plugin along with maven-publish plugin creates publications for each target.Configuration of artifactory plugin in root build.gradle.kts
Declaration of publications that should be published by the artifactory task.
The artifactoryPublish task publishes publications
framework
,aar
and module info about publications defined in KMM. Module info shouldn't be deployed. See enclosed build log.I believe that the issue is in
PublicationExtractor
inextractModuleInfo
. There is a filter onGenerateModuleMetadata
tasks with respect to publications. I think there should be included a filter for declared publications. I debuggedextractModuleInfo
and found out that KMM publication tasks are not filtered out. See screenshot below.Publications named androidRelease, iosArm64, iosSimulatorArm64, iosX64, kotlinMultiplatform are filtered.
Reproduction steps
Expected behavior
I expect that only declared artifacts along with their POM (or other metadata) are published to artifactory.
Artifactory Gradle plugin version
5.2.0
Operating system type and version
macOs 14.3.1 (23D60)
JFrog Artifactory version
No response
Gradle version
8.2.2 / 8.3.0
The text was updated successfully, but these errors were encountered: