From 3aac6f6771269cab4b470edd6a16909447b4e0e9 Mon Sep 17 00:00:00 2001 From: Michael Yan Date: Sun, 14 Jan 2024 01:14:02 +0800 Subject: [PATCH] Support searching domain path in app --- .../groovy/org/grails/io/support/ResourceLocator.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/grace-bootstrap/src/main/groovy/org/grails/io/support/ResourceLocator.java b/grace-bootstrap/src/main/groovy/org/grails/io/support/ResourceLocator.java index 21465d6a4a..a0ee69d5ed 100644 --- a/grace-bootstrap/src/main/groovy/org/grails/io/support/ResourceLocator.java +++ b/grace-bootstrap/src/main/groovy/org/grails/io/support/ResourceLocator.java @@ -85,6 +85,14 @@ private void initializeForSearchLocation(String searchLocation) { this.classSearchDirectories.add(directory.getCanonicalPath()); } } + File[] appDirectories = new File(searchLocationPlusSlash + "app") + .listFiles(file -> file.isDirectory() && !file.isHidden()); + + if (appDirectories != null) { + for (File directory : appDirectories) { + this.classSearchDirectories.add(directory.getCanonicalPath()); + } + } } catch (IOException ignored) { }