Copy to appropriate package during compile


I use Eclipse Moxy as my JAXB implementation for its JSON support. To use a JAXB implementation other than the reference implementation included in the JDK you need to put a file in every package that contains classes you want to marshal/unmarshal with the 3rd party JAXB implementation.

I can’t figure out a way to copy these files to the right packages during or just after a compile. Right now since those files aren’t being copied my unit tests are failing because I use properties on the marshaller that the JDK version of JAXB doesn’t support.

This is super-easy in ANT:

 <copy todir="${build.dir}">
            <fileset dir="src/java" includes="**/*.properties"/>

What is the gradle equivalent?

This SO post suggests I can use a processResources task; however, including this in my build.gradle doesn’t result in being copied anywhere (

processResources {
  from ('src/java') {
    include '**/*.properties'