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 223682 - Support for pom.xml with bootclasspath definition
Summary: Support for pom.xml with bootclasspath definition
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.3
Hardware: PC Linux
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-11 21:28 UTC by Jaroslav Tulach
Modified: 2013-10-17 20:08 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Good enough implementation (2.92 KB, patch)
2012-12-11 21:31 UTC, Jaroslav Tulach
Details | Diff
Reusing EndorsedClassPathImpl.getBootClasspath (2.42 KB, patch)
2012-12-18 13:35 UTC, Jaroslav Tulach
Details | Diff
Only skips the JDK libraries when "dont.use.jdk.bootclasspath" phrase is used (5.99 KB, patch)
2013-01-23 09:49 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2012-12-11 21:28:33 UTC
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.
Comment 1 Jaroslav Tulach 2012-12-11 21:31:19 UTC
Created attachment 129224 [details]
Good enough implementation

I can polish the patch, provide some testcases, etc. Let me know what is needed.
Comment 2 Milos Kleint 2012-12-12 07:41:43 UTC
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.
Comment 3 Jaroslav Tulach 2012-12-18 13:35:47 UTC
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...!
Comment 4 Martin Janicek 2012-12-18 14:58:25 UTC
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?
Comment 5 Milos Kleint 2012-12-19 07:55:39 UTC
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.
Comment 6 Jaroslav Tulach 2012-12-19 13:54:30 UTC
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?
Comment 7 Martin Janicek 2012-12-20 09:36:40 UTC
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 :)
Comment 8 Jaroslav Tulach 2013-01-23 09:49:26 UTC
Created attachment 130514 [details]
Only skips the JDK libraries when "dont.use.jdk.bootclasspath" phrase is used
Comment 9 Jaroslav Tulach 2013-01-23 09:50:41 UTC
Miloši, may I integrate now?
Comment 10 Milos Kleint 2013-01-23 09:58:13 UTC
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..
Comment 11 Jaroslav Tulach 2013-01-23 10:42:03 UTC
OK. Will prefix with "netbeans." and integrate.
Comment 12 Jaroslav Tulach 2013-01-23 10:50:39 UTC
ergonomics#a187997c0b78

The token has been renamed to "netbeans.ignore.jdk.bootclasspath".
Comment 13 Quality Engineering 2013-01-24 03:02:25 UTC
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.