@@ -93,6 +93,63 @@ expression in `%regex[]` before passing it to `include`/`exclude`.
93
93
}
94
94
```
95
95
96
+ ## Skipping Relocation for String Constants
97
+
98
+ If there is a class like:
99
+
100
+ ``` java
101
+ package foo ;
102
+
103
+ public class Bar {
104
+ public static void main (String [] args ) {
105
+ System . out. println(" foo.Bar" );
106
+ }
107
+ }
108
+ ```
109
+
110
+ in your project, and you configure the relocation like:
111
+
112
+ === "Kotlin"
113
+
114
+ ```kotlin
115
+ tasks.shadowJar {
116
+ relocate("foo", "my.foo")
117
+ }
118
+ ```
119
+
120
+ === "Groovy"
121
+
122
+ ```groovy
123
+ tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
124
+ relocate 'foo', 'my.foo'
125
+ }
126
+ ```
127
+
128
+ the string constant ` "foo.Bar" ` will be relocated to ` "my.foo.Bar" ` by default. This may not be want you want, you can
129
+ skip relocating string constants in the classes like:
130
+
131
+ === "Kotlin"
132
+
133
+ ```kotlin
134
+ tasks.shadowJar {
135
+ relocate("foo", "my.foo") {
136
+ // Optionally, defaults to `false`.
137
+ skipStringConstants = true
138
+ }
139
+ }
140
+ ```
141
+
142
+ === "Groovy"
143
+
144
+ ```groovy
145
+ tasks.named('shadowJar', com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
146
+ relocate('foo', 'my.foo') {
147
+ // Optionally, defaults to `false`.
148
+ skipStringConstants = true
149
+ }
150
+ }
151
+ ```
152
+
96
153
## Automatically Relocating Dependencies
97
154
98
155
Shadow is shipped with a task that can be used to automatically configure all packages from all dependencies to be
0 commit comments