Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/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 QA Contact: issues <issues.netbeans.org>
Priority: P3    
Version: 7.1   
Target Milestone: 7.1   
Hardware: All   
OS: All   
Whiteboard:
Issue Type: DEFECT Exception Report:
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
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo