From 3f0deb766ef3af77e226d7a731e55922ac0c039a Mon Sep 17 00:00:00 2001 From: Dmitry Baev Date: Tue, 26 May 2026 22:18:23 +0100 Subject: [PATCH] fix publish --- README.md | 2 +- allure-jupiter-assert/README.MD | 2 +- allure-jupiter-assert/build.gradle.kts | 11 +++++ allure-jupiter/build.gradle.kts | 12 +++++- build.gradle.kts | 59 +++++++++++++++++++++++--- 5 files changed, 77 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fd415585..2c6f44a1 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ - 🚀 Documentation — https://allurereport.org/docs/junit5/ - 📚 Example project — https://github.com/allure-examples?q=topic%3Ajunit5 - ✅ Generate a project in 10 seconds via Allure Start - https://allurereport.org/start/ -- 🧩 Use `io.qameta.allure:allure-jupiter` for new setups. `allure-junit5` remains available as a deprecated compatibility alias during migration. +- 🧩 Use `io.qameta.allure:allure-jupiter` for new setups. `allure-junit5` remains available as a deprecated relocation coordinate during migration. ## Cucumber JVM diff --git a/allure-jupiter-assert/README.MD b/allure-jupiter-assert/README.MD index 1705bcae..c468960a 100644 --- a/allure-jupiter-assert/README.MD +++ b/allure-jupiter-assert/README.MD @@ -1,6 +1,6 @@ Adding Jupiter assert may lead to java.lang.OutOfMemoryError: Java heap space -The primary artifact is now `allure-jupiter-assert`. `allure-junit5-assert` remains available as a deprecated compatibility alias during the transition. +The primary artifact is now `allure-jupiter-assert`. `allure-junit5-assert` remains available as a deprecated relocation coordinate during the transition. Having a huge class path may lead to OOM, because AspectJ processes all the classes. [Link to documentation](https://www.eclipse.org/aspectj/doc/released/devguide/ltw.html) diff --git a/allure-jupiter-assert/build.gradle.kts b/allure-jupiter-assert/build.gradle.kts index 230fb503..b0c9d6dd 100644 --- a/allure-jupiter-assert/build.gradle.kts +++ b/allure-jupiter-assert/build.gradle.kts @@ -28,6 +28,17 @@ publishing { publications { create("legacyJunit5Assert") { artifactId = "allure-junit5-assert" + pom { + packaging = "pom" + distributionManagement { + relocation { + groupId.set(project.group.toString()) + artifactId.set("allure-jupiter-assert") + version.set(project.version.toString()) + message.set("allure-junit5-assert has been renamed to allure-jupiter-assert.") + } + } + } } } } diff --git a/allure-jupiter/build.gradle.kts b/allure-jupiter/build.gradle.kts index dd603387..5d66deaf 100644 --- a/allure-jupiter/build.gradle.kts +++ b/allure-jupiter/build.gradle.kts @@ -45,7 +45,17 @@ publishing { } create("legacyJunit5") { artifactId = "allure-junit5" - artifact(spiOffJar) + pom { + packaging = "pom" + distributionManagement { + relocation { + groupId.set(project.group.toString()) + artifactId.set("allure-jupiter") + version.set(project.version.toString()) + message.set("allure-junit5 has been renamed to allure-jupiter.") + } + } + } } } } diff --git a/build.gradle.kts b/build.gradle.kts index 8ac9619b..89433e24 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -398,14 +398,18 @@ configure(libs) { } configure(standardJavaLibs) { - publishing.publications.withType().configureEach { + publishing.publications.named("maven") { from(components["java"]) } } val verifyJupiterCompatibilityBridge by tasks.registering { dependsOn( - ":allure-bom:generatePomFileForMavenPublication" + ":allure-bom:generatePomFileForMavenPublication", + ":allure-jupiter:generatePomFileForMavenPublication", + ":allure-jupiter:generatePomFileForLegacyJunit5Publication", + ":allure-jupiter-assert:generatePomFileForMavenPublication", + ":allure-jupiter-assert:generatePomFileForLegacyJunit5AssertPublication" ) doLast { @@ -422,7 +426,7 @@ val verifyJupiterCompatibilityBridge by tasks.registering { "Expected :allure-jupiter to publish the primary allure-jupiter coordinate." } check("allure-junit5" in jupiterArtifactIds) { - "Expected :allure-jupiter to publish the legacy allure-junit5 alias." + "Expected :allure-jupiter to publish the legacy allure-junit5 relocation." } val jupiterAssertArtifactIds = publicationArtifactIds(":allure-jupiter-assert") @@ -430,7 +434,7 @@ val verifyJupiterCompatibilityBridge by tasks.registering { "Expected :allure-jupiter-assert to publish the primary allure-jupiter-assert coordinate." } check("allure-junit5-assert" in jupiterAssertArtifactIds) { - "Expected :allure-jupiter-assert to publish the legacy allure-junit5-assert alias." + "Expected :allure-jupiter-assert to publish the legacy allure-junit5-assert relocation." } val bomPom = project(":allure-bom") @@ -441,17 +445,60 @@ val verifyJupiterCompatibilityBridge by tasks.registering { .asFile .readText() + fun publicationPom(projectPath: String, publicationName: String): String = + project(projectPath) + .layout + .buildDirectory + .file("publications/$publicationName/pom-default.xml") + .get() + .asFile + .readText() + check("allure-jupiter" in bomPom) { "Expected allure-bom to manage allure-jupiter." } check("allure-junit5" in bomPom) { - "Expected allure-bom to manage the legacy allure-junit5 alias." + "Expected allure-bom to manage the legacy allure-junit5 relocation." } check("allure-jupiter-assert" in bomPom) { "Expected allure-bom to manage allure-jupiter-assert." } check("allure-junit5-assert" in bomPom) { - "Expected allure-bom to manage the legacy allure-junit5-assert alias." + "Expected allure-bom to manage the legacy allure-junit5-assert relocation." + } + + val legacyJunit5Pom = publicationPom(":allure-jupiter", "legacyJunit5") + check("allure-junit5" in legacyJunit5Pom) { + "Expected the legacy allure-junit5 publication to keep the old artifact id." + } + check("" in legacyJunit5Pom) { + "Expected the legacy allure-junit5 publication to be a relocation POM." + } + check("pom" in legacyJunit5Pom) { + "Expected the legacy allure-junit5 relocation to use pom packaging." + } + check("" !in legacyJunit5Pom) { + "Expected the legacy allure-junit5 relocation POM to avoid publishing dependencies." + } + check("allure-jupiter" in legacyJunit5Pom) { + "Expected the legacy allure-junit5 publication to relocate to allure-jupiter." + } + + val legacyJunit5AssertPom = publicationPom(":allure-jupiter-assert", "legacyJunit5Assert") + check("allure-junit5-assert" in legacyJunit5AssertPom) { + "Expected the legacy allure-junit5-assert publication to keep the old artifact id." + } + check("" in legacyJunit5AssertPom) { + "Expected the legacy allure-junit5-assert publication to be a relocation POM." + } + check("pom" in legacyJunit5AssertPom) { + "Expected the legacy allure-junit5-assert relocation to use pom packaging." + } + check("" !in legacyJunit5AssertPom) { + "Expected the legacy allure-junit5-assert relocation POM to avoid publishing dependencies." + } + check("allure-jupiter-assert" in legacyJunit5AssertPom) { + "Expected the legacy allure-junit5-assert publication to relocate to allure-jupiter-assert." } } }