This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Discovered during fixing form which does not find its GroupLayout in JDK9 environment - but: if ProjectClassPathModifier.add{Libraries|Roots|AntArtifacts...} is called for Project which 1/ targets JDK 9 (sourcelevel == 9), and 2/ contains module-info.java (= it is a regular module for JDK 9 runtime), the artifact or library is added to legacy classpath. It is therefore part of unnamed module, which is invisible to the modular project. The attached patch introduces a SPI for ProjectClassPathModifier, which - allows the project implementation to change the classpath type for adding artifacts - allows the ProjectClassPathModifier to manipulate the module-info.java The default implementation is part of java project core, and allows project-specific provider to take over the default impl.
Created attachment 163866 [details] Proposed changes / SPI Maven project was also adjusted, to allow extensible module path
Please review the proposed SPI
Seems good to me.
Implemented in jet-main#2de339ad9f28
Integrated into 'main-silver', will be available in build *201703230002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/2de339ad9f28 User: Svata Dedic <sdedic@netbeans.org> Log: #270094: ProjectClassPathModifier can declare required directives in module-info