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
Created attachment 111620 [details]
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.