You have to specify the target folder to something like below. Currently if you look in your target folder you probably have a Version.java file in there. By adding the targetPath it will put the filtered .java file into your src/java folder and will compile it to your target folder.
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.java</include>
</includes>
<targetPath>${basedir}/src/main/java/</targetPath>
</resource>