You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, I have been trying to figure out a way to create an partial "uber" jar. The documentation clearly states that by default it will create an "uber" jar from the shadowJar task, but I was interested in the proper way to only include one of the dependencies, say dependency A (as well as A's dependencies) AND relocate all the packages of dependency A as well. I believe that http://imperceptiblethoughts.com/shadow/#using_shadow_to_package_gradle_plugins adds in the ConfigureShadowRelocation task which achieves my goal, but it seems to do it for ALL dependencies (not sure how to just pick one dependency, dependency A).
Configuring the relocation has always been possible, but the build author is required to know all the package names before hand. Shadow v2.0 corrects this by introducing a new task type ConfigureShadowRelocation. Tasks of this type are configured to target a an instance of a ShadowJar task and run immediately before it.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
dependencies {
compile "A"
compile "B"
compile "C"
}
shadowJar {
//what do i put here to just do relocation for "A"
}
The text was updated successfully, but these errors were encountered:
Your solution looks good for the compilation part.
You might not need the pom configuration if you change compile.extendsFrom(shadowCompile) to compileClasspath.extendsFrom(shadowCompile)
Basically, I have been trying to figure out a way to create an partial "uber" jar. The documentation clearly states that by default it will create an "uber" jar from the
shadowJar
task, but I was interested in the proper way to only include one of the dependencies, say dependencyA
(as well asA
's dependencies) AND relocate all the packages of dependencyA
as well. I believe that http://imperceptiblethoughts.com/shadow/#using_shadow_to_package_gradle_plugins adds in theConfigureShadowRelocation
task which achieves my goal, but it seems to do it for ALL dependencies (not sure how to just pick one dependency, dependencyA
).See below for my configuration
Shadow Version
2.0.1
Gradle Version
Gradle 4.1
Gradle Build Script(s)
The text was updated successfully, but these errors were encountered: