Skip to content
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

Exclude java.security.Provider SPI configuration from shaded jar #5825

Merged
merged 4 commits into from
Jul 26, 2024
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
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError
systemProp.https.protocols=TLSv1,TLSv1.1,TLSv1.2

jacocoExclusions=com/linecorp/armeria/internal/common/CurrentJavaVersionSpecific,com/linecorp/armeria/*/scalapb/**,META-INF/versions/**
shadowExclusions=META-INF/services/java.security.Provider
org.gradle.caching = true
3 changes: 3 additions & 0 deletions gradle/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,9 @@ relocations [ { from: "com.google.common", to: "com.doe.john.myproject.shaded.gu
Unshaded tests are disabled by default when a shading task is configured. If you want to run unshaded tests,
you can specify `-PpreferShadedTests=false` option.

If you would like to remove specific files when shading the JAR, you may specify the
`-PshadowExclusions=<comma delimited files>` option.

### Trimming a shaded JAR with `trim` flag

If you shade many dependencies, your JAR will grow huge, even if you only use
Expand Down
8 changes: 8 additions & 0 deletions gradle/scripts/lib/java-shade.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ configure(relocatedProjects) {
exclude '/META-INF/*.RSA'
// Exclude the files generated by Maven
exclude '/META-INF/maven/**'

def shadowExclusions = []
if (rootProject.hasProperty('shadowExclusions')) {
shadowExclusions = rootProject.findProperty('shadowExclusions').split(",")
}
shadowExclusions.each {
exclude it
}
}
tasks.assemble.dependsOn tasks.shadedJar

Expand Down
Loading