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.

Bug 270094

Summary: [JDK9] SPI to declare required module for ProjectClassPathProvider
Product: java Reporter: Svata Dedic <sdedic>
Component: ProjectAssignee: apireviews <apireviews>
Status: RESOLVED FIXED    
Severity: normal CC: sdedic, tstupka, tzezula
Priority: P2 Keywords: API, API_REVIEW_FAST
Version: Dev   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed changes / SPI

Description Svata Dedic 2017-03-16 14:53:46 UTC
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.
Comment 1 Svata Dedic 2017-03-16 14:57:28 UTC
Created attachment 163866 [details]
Proposed changes / SPI

Maven project was also adjusted, to allow extensible module path
Comment 2 Svata Dedic 2017-03-16 14:58:25 UTC
Please review the proposed SPI
Comment 3 Tomas Zezula 2017-03-16 15:08:45 UTC
Seems good to me.
Comment 4 Svata Dedic 2017-03-20 14:06:28 UTC
Implemented in jet-main#2de339ad9f28
Comment 5 Quality Engineering 2017-03-23 02:47:47 UTC
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