5

I have the following:

shadowJar {
    relocate 'com.google.common', 'com.example.com.google.common'
}

which produces '-all.jar' files with all of the module's dependencies.

shadowJar {
    relocate 'com.google.common', 'com.example.com.google.common'

    dependencies {
        include('com.example.com.google.common')
    }
}

and:

shadowJar {
    relocate 'com.google.common', 'com.example.com.google.common'

    dependencies {
        include(dependency('com.google.guava:guava:14+'))
    }
}

both produce '-all.jar' files with absolutely no classes.

How do I go about creating the '-all.jar' files that includes only the project's classes and the relocated classes?

Noel Yap
  • 18,822
  • 21
  • 92
  • 144

1 Answers1

1

You need to specify guava in the shadow configuration. For example:

dependencies {
    shadow 'com.google.guava:guava:14+'
}
Noel Yap
  • 18,822
  • 21
  • 92
  • 144