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 - [JDK9] SPI to declare required module for ProjectClassPathProvider
Summary: [JDK9] SPI to declare required module for ProjectClassPathProvider
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: Dev
Hardware: PC Linux
: P2 normal (vote)
Assignee: apireviews
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2017-03-16 14:53 UTC by Svata Dedic
Modified: 2017-03-23 02:47 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed changes / SPI (54.50 KB, patch)
2017-03-16 14:57 UTC, Svata Dedic
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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