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 203267

Summary: [71cat] SourceLevelQuery claims 1.3 for non-core packagings
Product: projects Reporter: muellermi <muellermi>
Component: MavenAssignee: Jesse Glick <jglick>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 7.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: messages

Description muellermi 2011-10-06 22:35:43 UTC
Product Version = NetBeans IDE Dev (Build 201110050601)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 21.0-b17

- Select new project
- choose Maven, OSGi Bundle
- provide name and click Finish
- verify project properties,  Source/Binary Format
--> It's set to 1.3. Should default to 1.6
Comment 1 muellermi 2011-10-06 22:38:01 UTC
Created attachment 111620 [details]
messages
Comment 2 Jesse Glick 2011-10-28 00:06:20 UTC
The actual source level used is JDK 5, as you can confirm by using generics in the bundle and building; the IDE just does not recognize this, because when its embedder looks up the version of maven-compiler-plugin in the project (to see if it is at least 2.3, when -source 5 was made the default), it finds nothing, even though an actual build will use 2.3.2 (the default version of this plugin fixed by the Maven 3.0.3 core). The fallback behavior for "no known version", as for pre-2.3 versions, is to use -source 1.3.

Seems that MavenProject.buildPlugins produces a list of plugins defined in the lifecycle of the plugin providing the packaging; but their versions are all missing (as they are in maven-bundle-plugin-2.2.0.jar!/META-INF/plexus/components.xml), and pluginManagement.plugins does not list m-c-p. Perhaps Maven just falls back to using the latest released version of a plugin if the lifecycle does not specify otherwise? DefaultLifecyclePluginAnalyzer seems to indicate that it would. The solution is then to fall back to -source 5 when no version is specified for m-c-p at all.
Comment 3 Jesse Glick 2011-10-28 00:08:27 UTC
core-main #d373566533a5