-
-
Notifications
You must be signed in to change notification settings - Fork 967
Description
Task List
- Steps to reproduce provided
- Stacktrace (if present) provided
- Example that reproduces the problem uploaded to Github
- Full description of the issue provided (see below)
Description
I have a multi-project setup with multiple grails plugins and a single main application. I wanted to upgrade to Gradle 4, but every message source placed in one of the plugins will not be loaded when starting the main application.
The main application loads the plugins like this:
grails {
pathingJar = true
exploded = true
plugins {
compile project(':plugin1')
compile project(':pulgin2')
}
}
Also hot reloading has to be enabled in gradle.properties (inside plugin):
exploded=true
Steps to Reproduce
- create multi-project gradle build with a grails plugin and a grails application
- add plugin as a dependency to application
- configure plugin for hot reloading (exploded=true in gradle.properties inside plugin)
- add custom entry in messages.properties inside plugin
- use the created message property inside application, e.g. in a GSP
- start application
Expected Behaviour
Since application has a dependency to the plugin, every message property should be available in the main application.
Actual Behaviour
Message source from plugin is not loaded. The behavior is likely due to the changes of the build output folder in Gradle 4 from build/classes/main to build/classes/groovy/main.
With some debugging I discovered the culprit to be the method findRootResourcesURL in the class grails.io.IOUtils, specifically this line:
rootPath = rootPath.replace('/build/classes/', '/build/resources/')
With the new output folder from Gradle, this will produce a path like */build/resources/groovy/main instead of */build/resources/main.
Environment Information
- Operating System: Windows 10
- Grails Version: 3.3.8
- JDK Version: 8