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.
I have a project http://source.apidesign.org/hg/bck2brwsr/ and in revision a20721a10717 there is a pom file emul/pom.xml which needs to suppress Java's rt.jar. It does that by: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> <compilerArguments> <bootclasspath>non-existing</bootclasspath> </compilerArguments> <source>1.7</source> <target>1.7</target> </configuration> </plugin> This prevent the Javac to use classes from the JDK. However the NetBeans IDE does not understand this argument and still offers all classes from the active platform JDK. I'd like the editor behave the same way command line Javac does for projects defining their own bootclasspath.
Created attachment 129224 [details] Good enough implementation I can polish the patch, provide some testcases, etc. Let me know what is needed.
we already use the bootclasspath parameter in endorsed classpath (see EndorsedClassPathImpl). But if I understand it right you never want to pass a real value there, you just want to disable it. In such a case I would prefer if bcp only got removed if a certain stopword appeared in the bootclasspath value, otherwise we might get problems on the endorsed CP that is heavily used in j2ee. I would assume that the stopword would cause the BCP to be empty, not including the non-existing items. please see EndorsedClassPathImpl.getBootClasspath() on what method to use to get bootclasspath off the project metadata.
Created attachment 129507 [details] Reusing EndorsedClassPathImpl.getBootClasspath Leaving the pom parsing to already existing code is even better. This new patch works for me as well. Btw. is not it a bug that when bootclasspath attribute is specified, the active platform bootstrap libraries are also added? The compiler plugin will not see them...!
Jardo, I don't feel that the patch is safe. As far as I understand it you are not including JDK classes every-time when there is a bootclasspath attribute presented. Could we do that just in case when the attribute contains some 'special' value as Milos suggested in comment 2?
the current solution dates back to issue 172952. I think the main problem is that it's mostly enough to specify rt.jar or a small subset of jdk's jars in order to have the compiler plugin work correctly, however the same cannot be said about project's bootclasspath with is used in other scenarios as well. So I would also reiterate the request to create a special password to appear in the compiler plugin configuration that would influence the behaviour and would be described in documentation (wiki maybe) eg. netbeans.disable.bootclasspath or something similar.. without such backdoor solution, I would consider it too dangerous to integrate at the current stage of development.
OK. Options: #1 - I can modify the patch to seek for value "netbeans.no.bootclasspath" among the strings returned from getBootClasspath(). That would be save enough to integrate to 7.3, I guess. #2 - We can wait and integrate the current patch as soon as release73 branch is created and we start working on next version. That would give us plenty of time to find possible issues. We can also do both #1 now and #2 after branching. Right?
If you update the patch as described in #1 what would be the benefit from moving to solution #2 once the release branch will be created? If there is no strong argument for #2 I would rather avoid of finding possible issues :)
Created attachment 130514 [details] Only skips the JDK libraries when "dont.use.jdk.bootclasspath" phrase is used
Miloši, may I integrate now?
looks good to me with one exception dont.use.jdk.bootclasspath should be prepended with netbeans. or something similar to make it obvious to readers of the pom file that the token is not maven related but netbeans..
OK. Will prefix with "netbeans." and integrate.
ergonomics#a187997c0b78 The token has been renamed to "netbeans.ignore.jdk.bootclasspath".
Integrated into 'main-golden', will be available in build *201301240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/a187997c0b78 User: Jaroslav Tulach <jtulach@netbeans.org> Log: #223682: A way to instruct NetBeans to ignore JDK's bootclasspath in editor code completion & co.