deepmedia / deepmedia/MavenDeployer

Cannot add sources and javadoc to gradlePluginPublication

Open
#25 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
89
Forks
7
PR merge metrics
No merged PRs in 30d

Description

I get this error when trying to add sources and docs to the publication
```
Execution failed for task ':publishCentralPortalPluginMavenClonePublicationToCentralPortalStorageRepository'.
> Failed to publish publication 'centralPortalPluginMavenClone' to repository 'centralPortalStorage'
> Invalid publication 'centralPortalPluginMavenClone': multiple artifacts with the identical extension and classifier ('jar.asc', 'sources').
```

Config file is as follows
```kotlin
@file:Suppress("UnstableApiUsage")

gradlePlugin {
website = "xxx"
vcsUrl = "xxx"
plugins {
create("xxx") {
// ...
}
}
}

tasks {
register("javadocJar") {
from(dokkatooGeneratePublicationHtml)
archiveClassifier = "javadoc"
}
whenTaskAdded {
// Needed to bypass missing task dependency declarations of the MavenDeployer
if (name.contains("CentralPortal", ignoreCase = true) || name.contains("Github", ignoreCase = true)) {
dependsOn("javadocJar", "sourcesJar", "jar")
}
}
}

deployer {
content {
gradlePluginComponents {
sources(
artifact = tasks.named("sourcesJar"),
builtBy = tasks.named("sourcesJar"),
)
docs(
artifact = tasks.named("javadocJar"),
builtBy = tasks.named("javadocJar"),
)
}
}
}
```

Any workarounds until the fix is released?

P.S. Publishing with empty source and javadoc jars work just fine (default configuration of `gradlePluginComponents`).

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with the shown Gradle Kotlin DSL, focusing on gradlePluginComponents.sources/docs and the CentralPortal/GitHub task wiring. Done means publishing with non-empty sources and Javadoc artifacts succeeds without duplicate extension and classifier errors; verify against the described publication task.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system, release
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.