public class GrailsResourceRuntimeHints extends java.lang.Object implements RuntimeHintsRegistrar
The resources a Grails application reads by name at run time, which an image cannot prove are reached.
An image includes what it can prove is used. A compiled asset is asked for by request path and a message bundle by locale, so nothing in the code names either, and an image built without them starts and then serves every page with a missing stylesheet and an untranslated string.
Registered as hints rather than passed as -H:IncludeResources: that option is
experimental and GraalVM now warns it will require unlocking, while hints are the supported way
and are what Spring writes the image's resource configuration from.
Bounded to where those two are actually looked for. A pattern that matched every properties file at every depth would carry the whole classpath into the image -- every dependency's configuration, and whatever else happened to be packaged beside it -- to keep the few that are message bundles.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
ADDITIONAL_PATTERNS_PROPERTY |
Where an application says what else it reads by name, as a comma-separated list of patterns. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
registerHints(RuntimeHints hints, java.lang.ClassLoader classLoader) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Where an application says what else it reads by name, as a comma-separated list of patterns. Read as a property rather than from configuration because this runs while the code is being generated rather than while the application is running, so it is set on the task that does the generating:
tasks.named('processAot') {
systemProperty 'grails.aot.resource-patterns', 'db/migration/**,templates/*.vm'
}