Copy jaxb.properties to appropriate package during compile


#1

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 jaxb.properties 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 jaxb.properties 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"/>
</copy>

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 jaxb.properties being copied anywhere (http://stackoverflow.com/questions/25283949/gradle-java-compile-ignoring-non-java-source-files):

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