JPMS Java Modular Application project type

Answered

NetBeans 9 has a new Java Modular Application Project type:

https://netbeans.apache.org/download/nb90/index.html 

It allows to develop several JDK9 modules in one NetBeans project (Ant based). The advantage of this project type over several Java SE projects (each containing one module) is that dependencies are simply managed by declaring appropriate exports and requires in module-info.java, and all modules in the project will be compiled at once.

Does IntelliJ have a similar feature?

Bruce

0
9 comments

Hi Serge,

The links you sent don't answer my question. I don't see where IntelliJ creates a starter Ant build.xml file to build a project with multiple JPMS modules from the command line the way the NetBeans wizard does. If I go to File->New->Project, I can find Maven and Gradle projects in the new project wizard, but no Ant projects. That is what I am looking for.

Bruce

0

IntelliJ IDEA has no support creating Ant projects. This feature in NetBeans specific.

0

I would like to make a feature request that IntelliJ support creating Ant projects of various kinds, including one that builds multiple JPMS modules like NetBeans does.

0

You can file a request at https://youtrack.jetbrains.com/issues/IDEA, but it's very unlikely to be supported since Ant is being replaced with Maven and Gradle. It's not worth investing in support of the legacy build systems.

0

I was using Maven, but it seems the newer version of Ant does a better job of supporting the new JPMS module system than Maven currently does. That is what is driving me to look at Ant. From what I can tell, Maven can't consolidate Javadoc across multiple JPMS modules. See this bug report: https://issues.apache.org/jira/browse/MJAVADOC-449

0

It should be much easier to address or somehow workaround that Maven bug than implementing full featured Ant projects support in IntelliJ IDEA which may take many months if not years.

0

I don't think this bug will get fixed any time soon. The poster of the Sept. 1 comment on that bug report mentioned the issue on the Maven dev email list in a message titled "New standard directory layout for better multi-languages and jigsaw support?" at the end of August. As he points out, the issue is Maven's standard directory layout is not the directory layout JPMS expects when you want to build multiple JPMS modules with a single call to javac. The problem affects more than just building consolidated Javadoc but annotation processing as well. See: https://mail-archives.apache.org/mod_mbox/maven-dev/201808.mbox/browse

He was told to use a different tool called "Pro" because it was not a priority to fix for Maven 4 or 5 since they don't have time to fix it. In other words, it could be years to fix this bug. That is why I am looking at using Ant. If JetBrains does not want to support "legacy" build systems, can they support the new "Pro" build system the Maven team suggested he use? I'm trying to find a workaround for these Maven bugs.

0

Bruce, IntelliJ does not provide the support you seek for JPMS module creation, the jmod and jlink tools are not  integrated into the IDE in the same level that Maven and Gradle support is.  And probably won't be soon, if ever.  Resistance is in every reply to all these types of requests. Sad, but it may make Netbeans look good again.

1

Please sign in to leave a comment.