Build Fails to Copy Resources with Special Characters in File Name

When files in the resources folder have file names containing supplementary characters / surrogate pairs, Gradle is not capable of copying them to the build folder and fails hard.

Gradle Version: 3.1
Operating System: MAC OS X El Capitan
JVM Version:
java version "1.8.0_51"
Java™ SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot™ 64-Bit Server VM (build 25.51-b03, mixed mode)

Is this a regression? If yes, which version of Gradle do you know it last worked for?
No, tested on 2.N series and also failing

Link to Example Project. Works with Maven, fails with Gradle:

Stack Trace:

Caused by: org.gradle.api.GradleException: Could not copy file '/Users/cgal0002/workspace/github.com/cjbooms/japanese-characters-maven/src/test/resources/supplementary/アンドリューは本当に凄いですawesomeだと思います𩸽.jpg' to '/Users/cgal0002/workspace/github.ccharacters-maven/build/resources/test/supplementary/アンドリューは本当に凄いですawesomeだと思います𩸽.jpg'.
        at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:79)
        ... 68 more
Caused by: org.gradle.internal.nativeintegration.filesystem.FileException: Could not get file mode for '/Users/cgal0002/workspace/github.com/cjbooms/japanese-characters-maven/src/test/resources/supplementary/アンドリューは本当に凄いですawesomeだと思います𩸽.jpg'.
        at org.gradle.internal.nativeintegration.filesystem.services.GenericFileSystem.getUnixMode(GenericFileSystem.java:72)
        ... 105 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not get UNIX mode on /Users/cgal0002/workspace/github.com/cjbooms/japanese-characters-maven/src/test/resources/supplementary/アンドリューは本当に凄いですawesomeだと思います𩸽.jpg: file does not exist.
        at net.rubygrapefruit.platform.internal.DefaultPosixFiles.getMode(DefaultPosixFiles.java:48)
        at org.gradle.internal.nativeintegration.filesystem.services.NativePlatformBackedStat.getUnixMode(NativePlatformBackedStat.java:34)
        at org.gradle.internal.nativeintegration.filesystem.services.GenericFileSystem.getUnixMode(GenericFileSystem.java:70)
        ... 107 more

Hi Conor,

Thanks a lot for the report and the reproducer project!
I filled a GitHub issue to track it.

1 Like