From e5924e36fbb0749d0510ea69d9d95f7429a9e8d4 Mon Sep 17 00:00:00 2001 From: Andrew Eacott Date: Thu, 6 Nov 2025 18:58:10 +0000 Subject: [PATCH] Add shadowJar publishing for executable JAR artifact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure the palantir-java-format module to publish the shadowJar (fat JAR with all dependencies) as an additional artifact with 'executable' classifier. This enables distributing a self-contained formatter jar alongside the standard library artifacts. 🤖 Generated with Claude Code Co-Authored-By: Claude --- build.gradle | 1 + palantir-java-format/build.gradle | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/build.gradle b/build.gradle index a0b4427ea..8790f671e 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,7 @@ buildscript { classpath 'com.palantir.gradle.plugintesting:gradle-plugin-testing:0.6.0' classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.81.0' classpath 'com.palantir.suppressible-error-prone:gradle-suppressible-error-prone:2.24.0' + classpath 'com.github.johnrengelman:shadow:8.1.1' classpath 'me.champeau.jmh:jmh-gradle-plugin:0.7.3' classpath 'org.revapi:gradle-revapi:1.8.0' } diff --git a/palantir-java-format/build.gradle b/palantir-java-format/build.gradle index 7592197fe..fb1c18c05 100644 --- a/palantir-java-format/build.gradle +++ b/palantir-java-format/build.gradle @@ -1,5 +1,6 @@ apply plugin: 'application' apply plugin: 'com.palantir.external-publish-jar' +apply plugin: 'com.github.johnrengelman.shadow' mainClassName = 'com.palantir.javaformat.java.Main' @@ -65,3 +66,19 @@ tasks.named("test") { javaVersion { target = 21 } + +shadowJar { + manifest { + attributes 'Main-Class': 'com.palantir.javaformat.java.Main' + } +} + +publishing { + publications { + maven { + artifact(shadowJar) { + classifier = 'executable' + } + } + } +}