Skip to content

Update Maven Publish Plugin #902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Verify artifact contents
shell: bash
run: |
zipfile=$(ls -1 plugin-build/build/distributions | grep -v "PluginMarker")
zipfile=$(ls -1 plugin-build/build/distributions | grep -v "PluginMarker" | grep -v ".tar")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romtsn seems there is now an additional .tar artifact which is built since we call assemble which assembles everything. i just filtered it out here.

filename=${zipfile/\.zip/}
unzip plugin-build/build/distributions/$filename.zip -d /tmp
find /tmp/$filename | grep "pom-default.xml"
Expand Down
4 changes: 1 addition & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ dokka = { id = "org.jetbrains.dokka", version = "1.8.10" }
spotless = { id = "com.diffplug.spotless", version = "7.0.0" }
groovyGradlePlugin = { id = "dev.gradleplugins.groovy-gradle-plugin", version = "1.2" }
shadow = { id = "com.github.johnrengelman.shadow", version = "7.1.2" }
# do not upgrade `mavenPublish` to 0.18.0, it does not generate the pom-default.xml and module.json under
# build/publications/maven
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.17.0" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.27.0" }
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
buildConfig = { id = "com.github.gmazzo.buildconfig", version = "4.2.0" }
Expand Down
13 changes: 2 additions & 11 deletions plugin-build/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import com.vanniktech.maven.publish.MavenPublishPluginExtension
import io.sentry.android.gradle.internal.ASMifyTask
import io.sentry.android.gradle.internal.BootstrapAndroidSdk
import java.io.FileInputStream
Expand All @@ -14,7 +13,7 @@ plugins {
id("distribution")
alias(libs.plugins.dokka)
id("java-gradle-plugin")
alias(libs.plugins.mavenPublish) apply false
alias(libs.plugins.mavenPublish)
alias(libs.plugins.spotless)
// we need this plugin in order to include .aar dependencies into a pure java project, which the
// gradle plugin is
Expand Down Expand Up @@ -226,7 +225,7 @@ distributions {
main {
contents {
from("build${sep}libs")
from("build${sep}publications${sep}maven")
from("build${sep}publications${sep}pluginMaven")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@romtsn figured it out. we were grabbing the maven publication from the wrong folder and that wrong folder was removed in the update.

}
}
create("sentryPluginMarker") {
Expand All @@ -240,14 +239,6 @@ distributions {
}
}

apply { plugin("com.vanniktech.maven.publish") }

val publish = extensions.getByType(MavenPublishPluginExtension::class.java)

// signing is done when uploading files to MC
// via gpg:sign-and-deploy-file (release.kts)
publish.releaseSigningEnabled = false

tasks.named("distZip") {
dependsOn("publishToMavenLocal")
onlyIf { inputs.sourceFiles.isEmpty.not().also { require(it) { "No distribution to zip." } } }
Expand Down
2 changes: 2 additions & 0 deletions plugin-build/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ POM_LICENCE_URL=https://github.com/getsentry/sentry-android-gradle-plugin/blob/m
POM_DEVELOPER_ID=getsentry
POM_DEVELOPER_NAME=Sentry Team and Contributors
POM_DEVELOPER_URL=https://github.com/getsentry/

RELEASE_SIGNING_ENABLED=false
7 changes: 0 additions & 7 deletions sentry-kotlin-compiler-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ distributions {
}
}

val publish =
extensions.getByType(com.vanniktech.maven.publish.MavenPublishPluginExtension::class.java)

// signing is done when uploading files to MC
// via gpg:sign-and-deploy-file (release.kts)
publish.releaseSigningEnabled = false

tasks.named("distZip") {
dependsOn("publishToMavenLocal")
onlyIf { inputs.sourceFiles.isEmpty.not().also { require(it) { "No distribution to zip." } } }
Expand Down
2 changes: 2 additions & 0 deletions sentry-kotlin-compiler-plugin/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ POM_LICENCE_URL=https://github.com/getsentry/sentry-android-gradle-plugin/blob/m
POM_DEVELOPER_ID=getsentry
POM_DEVELOPER_NAME=Sentry Team and Contributors
POM_DEVELOPER_URL=https://github.com/getsentry/

RELEASE_SIGNING_ENABLED=false
Loading