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 268407

Summary: Fix import statements keymap fails to import classes from java-ee-api dependencies
Product: projects Reporter: wwwizard <wwwizard>
Component: MavenAssignee: Tomas Stupka <tstupka>
Status: NEW ---    
Severity: normal CC: wwwizard
Priority: P3    
Version: 8.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Minimal Java EE pom.xml

Description wwwizard 2016-10-07 14:29:26 UTC
Created attachment 162395 [details]
Minimal Java EE pom.xml

Fix import statements Ctrl+Shift+I fails to import classes from javaee-api dependency.

I'm able to use the fix import statement to import classes from other dependencies.

You can manually add the import statement and the class will be imported successfully.

To reproduce, create the following RESTful endpoint with the attached pom file and Ctrl+Shift+I:

package com.importfails;

@ApplicationPath("resources")
public class JAXRSConfiguration extends Application {
}
Comment 1 wwwizard 2016-10-07 14:41:51 UTC
I tried creating a Maven Java Application, and in this case Ctrl+Shift+I works.

But when I create a Maven project using Project from Archetype fix imports fails:

Group ID: com.airhacks
Artifact ID: javaee7-essentials-archetype
Version: 1.3
Comment 2 wwwizard 2016-10-11 11:48:13 UTC
Fix import statements works at home on latest Ubuntu, NetBeans, and Java 8.

The only difference I can think of is that I'm not using the bundled Maven. Instead Maven Home in NetBeans is pointing to an installed version.
Comment 3 Tomas Stupka 2016-10-26 14:43:10 UTC
worked for me with nb 8.2 and dev
please reproduce the issue and attach your messages.log file from that session

thanks
Comment 4 Tomas Stupka 2016-10-27 09:35:47 UTC
taken from user mail:
Ok, tried it again.
I am not using the bundled Maven, I have version 3.3.9 installed.
Go to Options > Java > Maven > Experimental > and check "Use the following location to store Maven binaries" and set the Directory to a valid maven repo. After this, imports fail to work.
Once the experimental stuff has been enabled, disabling it does not fix the issue.
Hope this helps.
Comment 5 Tomas Stupka 2016-10-27 12:49:55 UTC
still can't reproduce

what exactly does it mean, that the import fails to work - you do not get option, or it isn't added to the surce file, ... ?

and again - i would like to see your messages.log file - reproduce the issue and attach your messages.log file from that NB session

> Go to Options > Java > Maven > Experimental > and check "Use the following location to store Maven binaries" and set the Directory to a valid maven repo. After this, imports fail to work.
note that the location applies for the maven client, not a maven repository