I'm creating a maven plugin and I need to write a new file in the project directory.
For some reason when I try to create a new file I get the AccessDeniedException.
StackTrace:
[ERROR] Failed to execute goal org.ofx:ofx-maven-plugin:1.0-SNAPSHOT:generateScreensEnum (default) on project preloader: Execution default of goal org.ofx:ofx-maven-plugin:1.0-SNAPSHO
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
c:\devl\work\preloader>
It is a none existing file so It should not be a locked resource case. I also tried writing to a different folder (not the project folder) just in case to see if it solves it, it does not.
My code:
Files.write(enumLocation, lines, Charset.defaultCharset(), StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING);
Any ideas ?