From 58bf2480c3793f6256870608f53cd085eace54bf Mon Sep 17 00:00:00 2001 From: Per Nyfelt Date: Thu, 5 Nov 2026 20:27:27 +0100 Subject: [PATCH 1/5] Default combined bundle to -mega-bundle.zip Name the combined-release ZIP after the root project (e.g. jmlx-mega-bundle.zip) instead of the generic bundle.zip, so the artifact and Central Portal deployment name are descriptive. Bump version to 2.6.0-SNAPSHOT and document the change. --- README.md | 2 +- combined-releases.md | 3 ++- gradle.properties | 2 +- release.md | 6 ++++++ .../release/ModuleReleaseConfigurer.groovy | 2 +- .../plugin/release/ModuleReleaseTest.groovy | 18 +++++++++--------- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8475c52..526738d 100644 --- a/README.md +++ b/README.md @@ -242,7 +242,7 @@ nexusReleasePlugin { Run `./gradlew releaseAllPlan` first and review the selection, then `./gradlew bundleAll` to check, sign, and bundle it, and `./gradlew releaseAll` to upload. The ZIP defaults to -`build/releaseAll/bundle.zip`. Dependencies on omitted siblings must already be released. +`build/releaseAll/-mega-bundle.zip` (e.g. `build/releaseAll/jmlx-mega-bundle.zip`). Dependencies on omitted siblings must already be released. No BOM, Maven settings helper, candidate JSON, or custom staging tasks are needed. Embedded or compile-only internal projects can be declared explicitly with `unpublishedProjectDependencies`; see the guide for its publication-metadata requirements. diff --git a/combined-releases.md b/combined-releases.md index b9bf046..f0bbf47 100644 --- a/combined-releases.md +++ b/combined-releases.md @@ -119,7 +119,8 @@ work when the plan contains no selected static Maven components. Defaults in module mode are the root project as `sourceDirectory` and these paths under the root build directory: `releaseAll/manifest.json`, `releaseAll/staging`, -`releaseAll/bundle.zip`, `releaseAll/bundle-receipt.json`, and `releaseAll/deployment.json`. +`releaseAll/-mega-bundle.zip`, `releaseAll/bundle-receipt.json`, +and `releaseAll/deployment.json`. The existing shared properties override these conventions. Repository/Portal URLs and credentials use the shared conventions below. Configure module selection and opt-outs in the root build script. Both lists are finalized after all projects are evaluated in default diff --git a/gradle.properties b/gradle.properties index dbb969a..042043d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group=se.alipsa.gradle -version=2.5.1 +version=2.6.0-SNAPSHOT org.gradle.configuration-cache=true org.gradle.parallel=true org.gradle.caching=true diff --git a/release.md b/release.md index 92a01e3..7c84da9 100644 --- a/release.md +++ b/release.md @@ -1,5 +1,11 @@ # Release history +## Ver 2.6.0 (in progress) +- Change the default combined-release bundle name from `bundle.zip` to + `-mega-bundle.zip` (e.g. `jmlx-mega-bundle.zip`), which is + also used as the Central Portal deployment name. Override with + `combinedRelease { bundleFile = ... }` as before. + ## Ver 2.5.1, 2026-11-05 - Fix #11: use fixed, timezone-independent timestamps for all combined ZIP entries; document per-run receipt hashes and signing limits. - Fix #12: order manifest consumers after `releaseAllPlan` when scheduled together. Reject changed selections before bundling stale staging files, and reject resolved task graphs containing both planning and upload before any tasks run so the saved manifest can be reviewed. Preserve separate initial planning and status-only resume. diff --git a/src/main/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseConfigurer.groovy b/src/main/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseConfigurer.groovy index 725aa62..853490d 100644 --- a/src/main/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseConfigurer.groovy +++ b/src/main/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseConfigurer.groovy @@ -29,7 +29,7 @@ final class ModuleReleaseConfigurer { extension.sourceDirectory.convention(project.layout.projectDirectory) extension.manifestFile.convention(project.layout.buildDirectory.file('releaseAll/manifest.json')) extension.stagingDirectory.convention(project.layout.buildDirectory.dir('releaseAll/staging')) - extension.bundleFile.convention(project.layout.buildDirectory.file('releaseAll/bundle.zip')) + extension.bundleFile.convention(project.layout.buildDirectory.file("releaseAll/${project.name}-mega-bundle.zip")) extension.receiptFile.convention(project.layout.buildDirectory.file('releaseAll/bundle-receipt.json')) extension.recordFile.convention(project.layout.buildDirectory.file('releaseAll/deployment.json')) // Under configure-on-demand, projects must be evaluated here, outside lazy task diff --git a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy index c84c71c..c3ea965 100644 --- a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy +++ b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy @@ -92,14 +92,14 @@ publishing.publications.maven.pom.withXml { if (!disableMetadata) { def failed = runner('bundleAll').buildAndFail() assertTrue(failed.output.contains("Unpublished project dependency ':core' is still referenced by Gradle Module Metadata")) - assertFalse(new File(root, 'build/releaseAll/bundle.zip').exists()) + assertFalse(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip').exists()) } else { run('bundleAll') new ZipFile(new File(root, 'build/releaseAll/staging/example/api-artifact/1.0/api-artifact-1.0.jar')).withCloseable { jar -> assertNotNull(jar.getEntry('Core.class')) assertNotNull(jar.getEntry('Api.class')) } - assertTrue(new File(root, 'build/releaseAll/bundle.zip').isFile()) + assertTrue(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip').isFile()) } } } @@ -212,7 +212,7 @@ if (gradle.startParameter.taskNames == ['help']) { Map publication = ReleaseManifest.read(new File(root, 'build/releaseAll/manifest.json')).selected.first() assertFalse(publication.files.any { it.endsWith('.module') }) run('bundleAll') - new ZipFile(new File(root, 'build/releaseAll/bundle.zip')).withCloseable { zip -> + new ZipFile(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip')).withCloseable { zip -> assertFalse(zip.entries().any { it.name.contains('.module') }) } } @@ -241,7 +241,7 @@ if (gradle.startParameter.taskNames == ['help']) { assertNull(bundle.task(':unused:signMavenPublication')) assertNull(bundle.task(':unused:check')) assertNull(bundle.task(':releaseAllPrepareMaven')) - File zip = new File(root, 'build/releaseAll/bundle.zip') + File zip = new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip') Set entries = new ZipFile(zip).withCloseable { it.entries().collect { it.name } as Set } Set expected = [] as Set ['api-artifact', 'core-artifact'].each { String name -> @@ -266,7 +266,7 @@ if (gradle.startParameter.taskNames == ['help']) { // Request consumers first to prove ordering is independent of CLI order. def result = run(':bundleAll', ':releaseAllPrepareMaven', ':releaseAllPlan') assertNotNull(result.task(':core:signMavenPublication')) - assertTrue(new File(root, 'build/releaseAll/bundle.zip').isFile()) + assertTrue(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip').isFile()) List tasks = result.tasks*.path [':releaseAllSigningCheck', ':releaseAllGuard', ':releaseAllPrepareMaven', ':bundleAll'].each { assertTrue(tasks.indexOf(':releaseAllPlan') < tasks.indexOf(it)) @@ -292,7 +292,7 @@ if (gradle.startParameter.taskNames == ['help']) { build.text = build.text.replace("modules = [':core']", "modules = [':api', ':core']") new File(root, 'api/src/main/java/Api.java').text = '/** Updated. */ public class Api { public int value() { return 42; } }' commit() - File zip = new File(root, 'build/releaseAll/bundle.zip') + File zip = new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip') File receipt = new File(root, 'build/releaseAll/bundle-receipt.json') assertTrue(zip.delete()) assertTrue(receipt.delete()) @@ -336,7 +336,7 @@ if (gradle.startParameter.taskNames == ['help']) { commit() run(':releaseAllPlan') run(':bundleAll') - List saved = ['manifest.json', 'bundle.zip', 'bundle-receipt.json'].collect { + List saved = ['manifest.json', 'module-release-fixture-mega-bundle.zip', 'bundle-receipt.json'].collect { new File(root, 'build/releaseAll/' + it) } List original = saved.collect { it.bytes } @@ -389,7 +389,7 @@ if (gradle.startParameter.taskNames == ['help']) { def result = run('bundleAll') assertNull(result.task(':core:signMavenPublication')) assertNull(result.task(':core:publishMavenPublicationToCombinedReleaseStagingRepository')) - new ZipFile(new File(root, 'build/releaseAll/bundle.zip')).withCloseable { zip -> + new ZipFile(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip')).withCloseable { zip -> assertTrue(zip.entries().every { it.name.startsWith('example/api-artifact/') }) } } @@ -407,7 +407,7 @@ if (gradle.startParameter.taskNames == ['help']) { run('releaseAllPlan') assertEquals('pom', ReleaseManifest.read(new File(root, 'build/releaseAll/manifest.json')).selected.first().packaging) run('bundleAll') - new ZipFile(new File(root, 'build/releaseAll/bundle.zip')).withCloseable { zip -> + new ZipFile(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip')).withCloseable { zip -> assertEquals(6, zip.size()) assertTrue(zip.entries().every { it.name.contains('.pom') }) } From 01beaad576120349fcc4ab32dbe3bf2d0c818b36 Mon Sep 17 00:00:00 2001 From: Per Nyfelt Date: Thu, 5 Nov 2026 20:38:02 +0100 Subject: [PATCH 2/5] Address review: bundle path constant, override test, upgrade note - Extract the expected default bundle path into a BUNDLE constant in ModuleReleaseTest and add a test that consumer-configured bundleFile overrides the module-mode default - Document re-running bundleAll after upgrading from a pre-2.6.0 build --- release.md | 3 ++ .../plugin/release/ModuleReleaseTest.groovy | 32 +++++++++++++------ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/release.md b/release.md index 7c84da9..0511e84 100644 --- a/release.md +++ b/release.md @@ -5,6 +5,9 @@ `-mega-bundle.zip` (e.g. `jmlx-mega-bundle.zip`), which is also used as the Central Portal deployment name. Override with `combinedRelease { bundleFile = ... }` as before. +- Re-run `bundleAll` after upgrading if a bundle was built with an earlier + version; the old `build/releaseAll/bundle.zip` is no longer used and can be + deleted. ## Ver 2.5.1, 2026-11-05 - Fix #11: use fixed, timezone-independent timestamps for all combined ZIP entries; document per-run receipt hashes and signing limits. diff --git a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy index c3ea965..3ea8a0f 100644 --- a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy +++ b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy @@ -9,6 +9,8 @@ import java.util.zip.ZipFile import static org.junit.jupiter.api.Assertions.* class ModuleReleaseTest { + private static final String BUNDLE = 'build/releaseAll/' + 'module-release-fixture-mega-bundle.zip' + @TempDir File root @Test void helpDoesNotRealizeReleaseAll() { @@ -92,14 +94,14 @@ publishing.publications.maven.pom.withXml { if (!disableMetadata) { def failed = runner('bundleAll').buildAndFail() assertTrue(failed.output.contains("Unpublished project dependency ':core' is still referenced by Gradle Module Metadata")) - assertFalse(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip').exists()) + assertFalse(new File(root, BUNDLE).exists()) } else { run('bundleAll') new ZipFile(new File(root, 'build/releaseAll/staging/example/api-artifact/1.0/api-artifact-1.0.jar')).withCloseable { jar -> assertNotNull(jar.getEntry('Core.class')) assertNotNull(jar.getEntry('Api.class')) } - assertTrue(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip').isFile()) + assertTrue(new File(root, BUNDLE).isFile()) } } } @@ -212,7 +214,7 @@ if (gradle.startParameter.taskNames == ['help']) { Map publication = ReleaseManifest.read(new File(root, 'build/releaseAll/manifest.json')).selected.first() assertFalse(publication.files.any { it.endsWith('.module') }) run('bundleAll') - new ZipFile(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip')).withCloseable { zip -> + new ZipFile(new File(root, BUNDLE)).withCloseable { zip -> assertFalse(zip.entries().any { it.name.contains('.module') }) } } @@ -241,7 +243,7 @@ if (gradle.startParameter.taskNames == ['help']) { assertNull(bundle.task(':unused:signMavenPublication')) assertNull(bundle.task(':unused:check')) assertNull(bundle.task(':releaseAllPrepareMaven')) - File zip = new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip') + File zip = new File(root, BUNDLE) Set entries = new ZipFile(zip).withCloseable { it.entries().collect { it.name } as Set } Set expected = [] as Set ['api-artifact', 'core-artifact'].each { String name -> @@ -259,6 +261,16 @@ if (gradle.startParameter.taskNames == ['help']) { } } + @Test void consumerConfiguredBundleFileOverridesTheModuleModeDefault() { + withServer { String base, List requests -> + fixture(base, "modules = [':core']; bundleFile = layout.buildDirectory.file('custom/my-bundle.zip')") + run('releaseAllPlan') + run('bundleAll') + assertTrue(new File(root, 'build/custom/my-bundle.zip').isFile()) + assertFalse(new File(root, BUNDLE).exists()) + } + } + @Test void planAndConsumersCanShareAnInvocationAfterInitialPlanning() { withServer { String base, List requests -> fixture(base, "modules = [':core']") @@ -266,7 +278,7 @@ if (gradle.startParameter.taskNames == ['help']) { // Request consumers first to prove ordering is independent of CLI order. def result = run(':bundleAll', ':releaseAllPrepareMaven', ':releaseAllPlan') assertNotNull(result.task(':core:signMavenPublication')) - assertTrue(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip').isFile()) + assertTrue(new File(root, BUNDLE).isFile()) List tasks = result.tasks*.path [':releaseAllSigningCheck', ':releaseAllGuard', ':releaseAllPrepareMaven', ':bundleAll'].each { assertTrue(tasks.indexOf(':releaseAllPlan') < tasks.indexOf(it)) @@ -292,7 +304,7 @@ if (gradle.startParameter.taskNames == ['help']) { build.text = build.text.replace("modules = [':core']", "modules = [':api', ':core']") new File(root, 'api/src/main/java/Api.java').text = '/** Updated. */ public class Api { public int value() { return 42; } }' commit() - File zip = new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip') + File zip = new File(root, BUNDLE) File receipt = new File(root, 'build/releaseAll/bundle-receipt.json') assertTrue(zip.delete()) assertTrue(receipt.delete()) @@ -336,9 +348,9 @@ if (gradle.startParameter.taskNames == ['help']) { commit() run(':releaseAllPlan') run(':bundleAll') - List saved = ['manifest.json', 'module-release-fixture-mega-bundle.zip', 'bundle-receipt.json'].collect { + List saved = ['manifest.json', 'bundle-receipt.json'].collect { new File(root, 'build/releaseAll/' + it) - } + } + new File(root, BUNDLE) List original = saved.collect { it.bytes } requests.clear() String[] flags = request == 'fullRelease' ? [] as String[] : [':releaseAll'] as String[] @@ -389,7 +401,7 @@ if (gradle.startParameter.taskNames == ['help']) { def result = run('bundleAll') assertNull(result.task(':core:signMavenPublication')) assertNull(result.task(':core:publishMavenPublicationToCombinedReleaseStagingRepository')) - new ZipFile(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip')).withCloseable { zip -> + new ZipFile(new File(root, BUNDLE)).withCloseable { zip -> assertTrue(zip.entries().every { it.name.startsWith('example/api-artifact/') }) } } @@ -407,7 +419,7 @@ if (gradle.startParameter.taskNames == ['help']) { run('releaseAllPlan') assertEquals('pom', ReleaseManifest.read(new File(root, 'build/releaseAll/manifest.json')).selected.first().packaging) run('bundleAll') - new ZipFile(new File(root, 'build/releaseAll/module-release-fixture-mega-bundle.zip')).withCloseable { zip -> + new ZipFile(new File(root, BUNDLE)).withCloseable { zip -> assertEquals(6, zip.size()) assertTrue(zip.entries().every { it.name.contains('.pom') }) } From a1a8b5b97ecac1346c957e25269f4cd26e596ff7 Mon Sep 17 00:00:00 2001 From: Per Nyfelt Date: Thu, 5 Nov 2026 21:08:53 +0100 Subject: [PATCH 3/5] Strengthen override test: assert releaseAll uploads the configured bundle - Restore single-literal BUNDLE constant - Extend the fixture server to answer uploads and capture request bodies; a variant marks coordinates published once the upload arrives so the post-upload availability probe succeeds - Run releaseAll in consumerConfiguredBundleFileOverridesTheModuleModeDefault and assert the multipart upload carries filename="my-bundle.zip" --- .../plugin/release/ModuleReleaseTest.groovy | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy index 3ea8a0f..ffb7836 100644 --- a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy +++ b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy @@ -9,7 +9,7 @@ import java.util.zip.ZipFile import static org.junit.jupiter.api.Assertions.* class ModuleReleaseTest { - private static final String BUNDLE = 'build/releaseAll/' + 'module-release-fixture-mega-bundle.zip' + private static final String BUNDLE = 'build/releaseAll/module-release-fixture-mega-bundle.zip' @TempDir File root @@ -262,12 +262,16 @@ if (gradle.startParameter.taskNames == ['help']) { } @Test void consumerConfiguredBundleFileOverridesTheModuleModeDefault() { - withServer { String base, List requests -> + withServer(Collections.synchronizedSet([] as Set), ['example:core-artifact:1.0'] as Set) { String base, List requests, List bodies -> fixture(base, "modules = [':core']; bundleFile = layout.buildDirectory.file('custom/my-bundle.zip')") run('releaseAllPlan') - run('bundleAll') + run(':bundleAll') assertTrue(new File(root, 'build/custom/my-bundle.zip').isFile()) assertFalse(new File(root, BUNDLE).exists()) + run(':releaseAll') + assertTrue(requests.any { it.contains('/publisher/upload') }) + assertTrue(bodies.any { it.contains('filename="my-bundle.zip"') }, + "upload should use the configured bundle file, bodies: ${bodies*.readLines()?.flatten()}") } } @@ -572,22 +576,42 @@ ${name == 'api' ? "dependencies { ${compileOnly ? 'compileOnly' : 'api'} project } private void withServer(Set published = [] as Set, Closure action) { + withServer(published, false, [] as Set) { String base, List requests, List bodies -> action(base, requests) } + } + + /** Variant that also captures request bodies and answers uploads; the closure receives (base, requests, bodies). */ + private void withServer(Set published, boolean captureBodies, Closure action) { + withServer(published, captureBodies, [] as Set, action) + } + + /** Variant for full upload flows: captures bodies, answers uploads, and marks the given coordinates + * published once the upload request arrives, so post-upload availability probes succeed. */ + private void withServer(Set published, Set deployedOnUpload, Closure action) { + withServer(published, true, deployedOnUpload, action) + } + + private void withServer(Set published, boolean captureBodies, Set deployedOnUpload, Closure action) { List requests = Collections.synchronizedList([]) + List bodies = Collections.synchronizedList([]) def server = HttpServer.create(new InetSocketAddress('127.0.0.1', 0), 0) server.createContext('/') { exchange -> requests.add(exchange.requestURI.toString()) boolean portal = exchange.requestURI.path.contains('/publisher/published') boolean status = exchange.requestURI.path.contains('/publisher/status') + boolean upload = exchange.requestURI.path.contains('/publisher/upload') boolean released = published.any { String coordinate -> def (group, name, version) = coordinate.split(':') - exchange.requestURI.path.endsWith("/${group.replace('.', '/')}/${name}/${version}/${name}-${version}.pom") + exchange.requestURI.path.endsWith("/${group.replace('.', '/')}/${name}/${version}/${name}-${version}.pom") || + exchange.requestURI.path.endsWith("/${group.replace('.', '/')}/${name}/${version}/${name}-${version}.jar") } - byte[] body = (status ? '{"deploymentState":"PUBLISHED"}' : portal ? '{"published":false}' : '').getBytes('UTF-8') - exchange.sendResponseHeaders(portal || status || released ? 200 : 404, exchange.requestMethod == 'HEAD' ? -1 : body.length) + if (captureBodies) bodies.add(new String(exchange.requestBody.readAllBytes(), 'UTF-8')) + if (upload) published.addAll(deployedOnUpload) + byte[] body = (status ? '{"deploymentState":"PUBLISHED"}' : portal ? '{"published":false}' : upload ? 'upload-deployment-id' : '').getBytes('UTF-8') + exchange.sendResponseHeaders(portal || status || upload || released ? 200 : 404, exchange.requestMethod == 'HEAD' ? -1 : body.length) exchange.responseBody.withCloseable { it.write(body) } } server.start() - try { action("http://127.0.0.1:${server.address.port}".toString(), requests) } + try { action("http://127.0.0.1:${server.address.port}".toString(), requests, bodies) } finally { server.stop(0) } } From d6c647282a87ee98fe65b8ff76dec04d84b47a2c Mon Sep 17 00:00:00 2001 From: Per Nyfelt Date: Thu, 5 Nov 2026 21:27:05 +0100 Subject: [PATCH 4/5] Review follow-ups: fail-fast timeout, lazy assertion message, drop unused overload - Add @Timeout(120) to the module-mode override test so a regression in the post-upload availability probe fails instead of polling ~10 minutes - Build the upload assertion message lazily via Supplier and print only Content-Disposition lines, not the binary ZIP body - Remove the unused withServer(Set, boolean, Closure) overload --- .../gradle/plugin/release/ModuleReleaseTest.groovy | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy index ffb7836..410ea78 100644 --- a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy +++ b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy @@ -261,7 +261,9 @@ if (gradle.startParameter.taskNames == ['help']) { } } - @Test void consumerConfiguredBundleFileOverridesTheModuleModeDefault() { + @Test + @org.junit.jupiter.api.Timeout(120) + void consumerConfiguredBundleFileOverridesTheModuleModeDefault() { withServer(Collections.synchronizedSet([] as Set), ['example:core-artifact:1.0'] as Set) { String base, List requests, List bodies -> fixture(base, "modules = [':core']; bundleFile = layout.buildDirectory.file('custom/my-bundle.zip')") run('releaseAllPlan') @@ -271,7 +273,7 @@ if (gradle.startParameter.taskNames == ['help']) { run(':releaseAll') assertTrue(requests.any { it.contains('/publisher/upload') }) assertTrue(bodies.any { it.contains('filename="my-bundle.zip"') }, - "upload should use the configured bundle file, bodies: ${bodies*.readLines()?.flatten()}") + { -> "upload should use my-bundle.zip; Content-Disposition lines: ${bodies*.readLines().flatten().findAll { it.startsWith('Content-Disposition') }}" } as java.util.function.Supplier) } } @@ -579,11 +581,6 @@ ${name == 'api' ? "dependencies { ${compileOnly ? 'compileOnly' : 'api'} project withServer(published, false, [] as Set) { String base, List requests, List bodies -> action(base, requests) } } - /** Variant that also captures request bodies and answers uploads; the closure receives (base, requests, bodies). */ - private void withServer(Set published, boolean captureBodies, Closure action) { - withServer(published, captureBodies, [] as Set, action) - } - /** Variant for full upload flows: captures bodies, answers uploads, and marks the given coordinates * published once the upload request arrives, so post-upload availability probes succeed. */ private void withServer(Set published, Set deployedOnUpload, Closure action) { From 3e351730275a2d08a2dad6cf68ee6d3b9b256251 Mon Sep 17 00:00:00 2001 From: Per Nyfelt Date: Thu, 5 Nov 2026 21:30:44 +0100 Subject: [PATCH 5/5] Import Timeout instead of fully-qualified annotation --- .../se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy index 410ea78..ffd0967 100644 --- a/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy +++ b/src/test/groovy/se/alipsa/gradle/plugin/release/ModuleReleaseTest.groovy @@ -2,6 +2,7 @@ package se.alipsa.gradle.plugin.release import com.sun.net.httpserver.HttpServer import org.junit.jupiter.api.Test +import org.junit.jupiter.api.Timeout import org.junit.jupiter.api.io.TempDir import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource @@ -262,7 +263,7 @@ if (gradle.startParameter.taskNames == ['help']) { } @Test - @org.junit.jupiter.api.Timeout(120) + @Timeout(120) void consumerConfiguredBundleFileOverridesTheModuleModeDefault() { withServer(Collections.synchronizedSet([] as Set), ['example:core-artifact:1.0'] as Set) { String base, List requests, List bodies -> fixture(base, "modules = [':core']; bundleFile = layout.buildDirectory.file('custom/my-bundle.zip')")