[MCOMPILER-579] allow module-version configuration by mguillem · Pull Request #273 · apache/maven-compiler-plugin (original) (raw)
I think that we should not provide --module-version parameter for the test classes. We are restricted to only one module version per module-info.class file, and that file is in the main code. I realize that we have documentation in the Maven web site suggesting to provide a module-info in the tests also, but I think that we should deprecate this practice because of its drawback. For example, this approach (overwriting the main/module-info.java with test/module-info.java) requires that Maven plugins put the project upside-down, with the test classes declared as the main project and the real main classes declared as patches applied on the tests. There is better alternatives, such as generating the --patch-module parameters automatically.
Therefore, if you agree to move moduleVersion into CompilerMojo, I suggest that you do it in this pull request.