TLDR:
I have a Grails 3 project. The run-app command was working fine. Then I checked it into Perforce. Now run-app fails.
DETAILS:
- Grails Version: 3.1.1
- Groovy Version: 2.4.5
- JVM Version: 1.8.0_91
- Gradle 2.13
% grails clean
BUILD SUCCESSFUL
% grails run-app
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':processResources'.
Could not copy file '/Volumes/Neo/singram/work/code/depot/dvdco/webapplications/nightcrawler/grails-app/i18n/messages.properties' to '/Volumes/Neo/singram/work/code/depot/dvdco/webapplications/nightcrawler/build/resources/main/messages.properties'.
GUESS at cause:
Perforce, when a file isn't checked out for editing, will make that file non-writable (chmod a-w). As best I can tell, run-app invokes gradle's processResources which successfully copies the file in question once, then seemingly attempts to copy it again during the same build cycle and fails because thew newly copied file is not writable so it cannot be overwritten with a copy of itself.
WORK-AROUND
The run-app command succeeds if I check out the whole project for editing first. Don't really want to have to do this as it introduces opportunity for error during check-ins.
QUESTION:
Is there a better way than my work-around? Why is gradle's processResources copying the same files more than once? Is there some sort of hook into processResources or run-app that I can use to "chmod -R u+w build" ?