Shan
01/06/2022, 7:20 PMpublishing {
publications.withType<MavenPublication> {
artifactId = "custom-name"
configureMavenPom(project)
signing { if (isRelease) sign(this@withType) }
}
}
This will create a publication with the right name for the artifact but appears to be causing a bug when actually trying to use it. Someone is having the same issue here: https://stackoverflow.com/questions/70489135/unable-to-use-published-kmp-library-due-[…]o-error-detecting-cycle-in-external-va/70490150?noredirect=1
So my IDE can detect the dependency that I published (above), but Gradle cannot seem to resolve it. The actual error message:
Detecting cycle in external variants for :
my.dependency:dependency:version: //<---- the one i published (above)
- my.other.project:other:version
Dependency resolution has ignored the cycle to produce a result. It is recommended to resolve the cycle by upgrading one or more dependencies.
hfhbd
01/06/2022, 7:29 PMShan
01/06/2022, 7:33 PMhfhbd
01/06/2022, 7:39 PMrootProject.name = 'myproject'
too for a single module project.Osman Saral
01/07/2022, 12:42 PMOsman Saral
01/07/2022, 12:42 PMShan
01/07/2022, 7:49 PMOsman Saral
01/07/2022, 8:14 PMOsman Saral
01/07/2022, 8:26 PMconfigureMavenPom
do?Shan
01/08/2022, 12:55 AMfun MavenPublication.configureMavenPom(project: Project) {
version = project.version.toString()
pom {
name.set(project.name)
description.set(Info.pomDescription)
url.set(Info.projectUrl)
licenses {
license {
name.set(Info.pomLicense)
url.set(Info.pomLicenseUrl)
}
}
developers {
developer {
email.set(Info.projectDevEmail)
}
}
organization {
name.set(Info.pomOrg)
}
scm {
connection.set(Info.projectCloneUrl)
url.set(Info.projectUrl)
}
}
}
I use this in multiple projects so just abstracted it out.
setMavenRepositories()
is a function which sets my repo to my Space repository w/ credentials for publishing, not using Artifactory, sorry!Shan
01/08/2022, 12:56 AMfun PublishingExtension.setMavenRepositories() {
repositories {
maven {
url = URI("my repo url")
credentials {
username = System.getenv("space client user")
password = System.getenv("space client pw")
}
}
}
}
Shan
01/08/2022, 12:57 AM