Is there any reason to use javac over groovyc in a mixed code project?

When creating a java7 / groovy2 mixed project in maven or gradle, is there any reason to compile first with javac and then groovyc, just letting groovyc handle all this?

I started compiling them separately and in my trees (src / main / java and src / main / groovy), as practice shows. However, since java and groovy are used to solve the same problem and therefore are mixed, I am now inclined to dump all the source code in src / main / groovy and let the groovy compiler handle both .java and. groovy files. This project seems to make tracking the source tree easier. Are there any disadvantages?

+5
source share
1 answer

Take groovycprocesses both as .javawell as .groovy. This approach is also used by the framework Grails. Grails 2 puts all .java files in the groovy source directories, just like you do. What you are doing now is best practice.

Here is an example: https://github.com/groovy/groovy-core/tree/master/src/main/groovy/io

+4
source

All Articles