You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2016/10/09 13:43:21 UTC

[jira] [Closed] (MCOMPILER-275) Handle separate compilation of module-info.java

     [ https://issues.apache.org/jira/browse/MCOMPILER-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte closed MCOMPILER-275.
------------------------------------
    Resolution: Won't Fix
      Assignee: Robert Scholte

After giving several options a try, the best solution seems to be 2 execution blocks. There's a page (Older projects with module-info) written to illustrate how you can do this.

> Handle separate compilation of module-info.java
> -----------------------------------------------
>
>                 Key: MCOMPILER-275
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-275
>             Project: Maven Compiler Plugin
>          Issue Type: New Feature
>            Reporter: Robert Scholte
>            Assignee: Robert Scholte
>         Attachments: mcompiler-275.patch
>
>
> When you want to add a module-info.java file to your project AND want your code to be compatible with older java version, then you need to call {{javac}} twice.
> To prevent all kinds of magic for selecting the right files to compile with the right version of Java it is probably better to just have a separate folder for it, e.g. {{src/main/jigsaw}}. I'd prefer to call it 'jigsaw' instead of java9, so it'll still makes sense once we're at java16
> On  the jigsaw mailinglist they actually expect the module-info file to be in the {{src/main/java}} as well. Intuition of users might indeed be to simply put it there and let Maven handle it. That should be possible, but it also depends if IDEs can handle this too.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)