Interface RelocationSpec


public interface RelocationSpec
Configures the optional scoping block on a relocate(from, to) { ... } rule (see ShadedJarExtension). Without this block, a rule applies to everything under its from prefix, as before.

Patterns are a small, deliberately non-full-glob subset — see Relocator.matchesPattern: either an exact dotted class name ( "com.example.Foo") or a prefix wildcard ("com.example.**", matching that package and everything nested under it).

   relocate 'com.google.common', 'com.example.shaded.guava', {
       // Leave this one annotation under its original name so a tool that
       // scans for it by exact FQCN still finds it.
       exclude 'com.google.common.annotations.VisibleForTesting'
   }
 
Excludes always win over includes. If any include patterns are given, only names matching at least one of them are eligible at all; excludes are then still applied on top.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    exclude(String... patterns)
     
    void
    include(String... patterns)
     
  • Method Details

    • include

      void include(String... patterns)
    • exclude

      void exclude(String... patterns)