Hi all,
  I just come up with a problem using a maven dependency jar that is a
multi-release jar, NetBeans 11.2 is unable to "see" some classes contained
in the jar.

The maven coordinates of the dependencies are:
<dependency>
    <groupId>com.formdev</groupId>
    <artifactId>flatlaf</artifactId>
    <version>0.17</version>
</dependency>

To reproduce create a maven project with compile target and source 11, then
create a JFrame in it (New > JFrame Form... from context menu), then
replace the generated code that sets the Nimbus LAF with the following:
        try {
            javax.swing.UIManager.setLookAndFeel(new
com.formdev.flatlaf.|); // complete here
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
        }

Try to invoke completion at the pipe sign in the highlighted row, you'll
find that no look and feel class is shown, the Look and Feel classes
contained in the maven dependency should be FlatLightLaf, FlatDarkLaf,
FlatIntellijLaf and FlatDarculaLaf.
Note that even entering the class by hand there are error markers even if
the project builds and run successfully.

The only peculiar thing I noticed is that the dependency jar is a
multi-release jar that aims to be compatible with Java 8 but also support
modular programming (Java 9+), to achieve this it stores the
module-info.class into META-INF/versions/9 folder inside the jar. Curious
thing is that NetBeans does not have any problems with the most recent
log4j2 dependency that has a similar structure. Setting compiler source and
target to 8 is another way to get correct behaviour.

Could anyone reproduce?

NetBeans is 11.2 running on OpenJDK 11.0.4 with nb-javac plugin installed.

Regards,
Alex

Reply via email to