Skip to content

Commit 72881ed

Browse files
authored
Merge pull request #11267 from grails/gradle-resource-changes
#11099 #11266 Resources issues in multi-project build
2 parents 338162d + 4d05e30 commit 72881ed

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

grails-bootstrap/src/main/groovy/grails/io/IOUtils.groovy

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ class IOUtils extends SpringIOUtils {
189189
if(classRes) {
190190
String rootPath = classRes.toString() - pathToClassFile
191191
if(rootPath.endsWith(BuildSettings.BUILD_CLASSES_PATH)) {
192-
rootPath = rootPath.replace('/build/classes/', '/build/resources/')
192+
if (BuildSettings.BUILD_CLASSES_PATH == "build/classes/groovy/main" ) {
193+
rootPath = rootPath.replace('/build/classes/groovy/', '/build/resources/')
194+
} else {
195+
rootPath = rootPath.replace('/build/classes/', '/build/resources/')
196+
}
193197
}
194198
else {
195199
rootPath = "$rootPath/"
@@ -231,7 +235,11 @@ class IOUtils extends SpringIOUtils {
231235
if(classRes) {
232236
def rootPath = classRes.toString() - pathToClassFile
233237
if(rootPath.endsWith(BuildSettings.BUILD_CLASSES_PATH)) {
234-
rootPath = rootPath.replace('/build/classes/', '/build/resources/')
238+
if (BuildSettings.BUILD_CLASSES_PATH == "build/classes/groovy/main" ) {
239+
rootPath = rootPath.replace('/build/classes/groovy/', '/build/resources/')
240+
} else {
241+
rootPath = rootPath.replace('/build/classes/', '/build/resources/')
242+
}
235243
}
236244
return new URL("$rootPath$path")
237245
}

0 commit comments

Comments
 (0)