Skip to content

Document how to make a shadowed JAR the default output of a project#1941

Merged
Goooler merged 3 commits intomainfrom
g/20260301/doc-shadow-jar-default
Mar 2, 2026
Merged

Document how to make a shadowed JAR the default output of a project#1941
Goooler merged 3 commits intomainfrom
g/20260301/doc-shadow-jar-default

Conversation

@Goooler
Copy link
Copy Markdown
Member

@Goooler Goooler commented Mar 1, 2026

Closes #1893.

@Goooler Goooler force-pushed the g/20260301/doc-shadow-jar-default branch from 21ce316 to 19e0f3d Compare March 1, 2026 12:07
@Goooler Goooler marked this pull request as ready for review March 1, 2026 12:31
@Goooler Goooler requested a review from Copilot March 1, 2026 12:31

This comment was marked as outdated.

@Goooler

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as resolved.

commit 7970269
Author: Goooler <wangzongler@gmail.com>
Date:   Mon Mar 2 10:37:45 2026 +0800

    Reformat

commit dcdcbc2
Merge: c1dddbb 09f5081
Author: Goooler <wangzongler@gmail.com>
Date:   Mon Mar 2 10:34:52 2026 +0800

    Merge remote-tracking branch 'origin/main' into g/20260301/doc-shadow-jar-default

commit c1dddbb
Author: Zongle Wang <wangzongler@gmail.com>
Date:   Sun Mar 1 21:00:58 2026 +0800

    Update src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt

    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

commit 2fe8042
Author: Zongle Wang <wangzongler@gmail.com>
Date:   Sun Mar 1 20:51:38 2026 +0800

    Update src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt

commit 7cec848
Author: Zongle Wang <wangzongler@gmail.com>
Date:   Sun Mar 1 20:37:13 2026 +0800

    Apply suggestions from code review

    Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

commit a4dc367
Author: Goooler <wangzongler@gmail.com>
Date:   Sun Mar 1 20:30:35 2026 +0800

    Fix test

commit 27a89d1
Author: Goooler <wangzongler@gmail.com>
Date:   Sun Mar 1 20:23:01 2026 +0800

    Tweak `important` block

commit 0683e67
Author: Goooler <wangzongler@gmail.com>
Date:   Sun Mar 1 20:14:43 2026 +0800

    Merge tests

commit 4d76626
Merge: 11ed4d9 7a91558
Author: Goooler <wangzongler@gmail.com>
Date:   Sun Mar 1 20:12:01 2026 +0800

    Merge remote-tracking branch 'origin/copilot/address-issue-1893' into g/20260301/doc-shadow-jar-default

    # Conflicts:
    #	docs/multi-project/README.md

commit 11ed4d9
Author: Goooler <wangzongler@gmail.com>
Date:   Sun Mar 1 20:11:40 2026 +0800

    Polish doc

commit 19e0f3d
Author: Goooler <wangzongler@gmail.com>
Date:   Sun Mar 1 19:39:35 2026 +0800

    Add tests

commit 7053f5d
Author: Goooler <wangzongler@gmail.com>
Date:   Sun Mar 1 19:35:14 2026 +0800

    Update doc

commit 7a91558
Author: Goooler <wangzongler@gmail.com>
Date:   Fri Feb 27 20:54:26 2026 +0800

    Fix formats

commit 37538f0
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Fri Feb 27 12:45:48 2026 +0000

    test: add integration tests for shadow JAR as default project artifact (#1893)

    Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>

commit 6331f98
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Fri Feb 27 12:30:19 2026 +0000

    docs: add section on making shadowed jar the default output in multi-project builds (#1893)

    Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>

commit 12cfe62
Author: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Date:   Fri Feb 27 12:28:29 2026 +0000

    Initial plan
@Goooler Goooler force-pushed the g/20260301/doc-shadow-jar-default branch from 7970269 to 35d39c8 Compare March 2, 2026 02:42

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@bric3 bric3 left a comment

Choose a reason for hiding this comment

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

Thanks @Goooler, looks good to me.

I noted two things:

  • the order of the clear instructions when configuring the configuration,
  • some alignment issues in the test script bodies.

Comment on lines +216 to +217
"""
${getDefaultProjectBuildScript("java-library")}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nitpick: alignment seems off.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is formatted by ktfmt. We can do nothing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, maybe it's ktfmt opinionated style rules that don't follow the "standard" kotlin. I know it's possible to choose the official kotlin ones, as these are not the default.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Since we require an indent size of two, we have to accept the Google style. To be honest, I prefer ktlint.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah I just saw, the project is using google

shadow/build.gradle.kts

Lines 54 to 55 in 6a52076

kotlin { ktfmt(libs.ktfmt.get().version).googleStyle() }
kotlinGradle { ktfmt(libs.ktfmt.get().version).googleStyle() }

FYI, the standard kotlin style is settable via .kotlinlangStyle()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

kotlinlangStyle enforces indent size for 4. And it's not much different from the Google style for actual styles.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting! Thanks for the precision.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This should be addressed by diffplug/spotless#2872.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool thanks

Goooler and others added 2 commits March 2, 2026 22:28
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
@Goooler Goooler enabled auto-merge (squash) March 2, 2026 14:38
@Goooler Goooler merged commit fd72306 into main Mar 2, 2026
8 checks passed
@Goooler Goooler deleted the g/20260301/doc-shadow-jar-default branch March 2, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suggestion to make a shadowed jar the default output of a project

4 participants