In setting up a mixed java7/groovy2 project in maven or gradle, is there any reason for compiling first with javac then groovyc over just letting groovyc handle it all?
I started out compiling them separately and in their own trees (src/main/java and src/main/groovy) as best-practice suggests. However, since java and groovy are used to solve the same problem and are so intermingled, I am now leaning towards dumping all my source into src/main/groovy and letting the groovy compiler handle both .java and .groovy files. This seems to make the project easier to follow when looking at the source tree. Are there any disadvantages?
Letting groovyc
handle both .java
and .groovy
is good. This approach is also used by the Grails
framework. Grails 2 puts all .java files under groovy source directories, like you did. What you're doing now is the best-practice.
Here's an example: https://github.com/groovy/groovy-core/tree/master/src/main/groovy/io
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With