Is it possible to excluse packages from Auto Import list?


I would like to test feature 'Editor->Ad unambigious imports on the fly',
but every time, then i type in code:
Collections, Arrays, HashSet etc, i have Multiple chooses in import intension,
so IDEA can't insert it on-the fly.

I want to exclude from Auto Imports entire "com.sun.*" area. But how to do

Alexey Efimov, Java Developer
Tops BI

Comment actions Permalink

Dependency rules can help you here:

Set up two scopes, let's say, "Forbidden Classes" and "Project Source". The "Forbidden Classes" scope should contain all the classes you don't wont to work with. In my case, those are the Sun classes (sun..* || com.sun..). The "Project Source" scope should contain your own sources (src:..*).

Now just add a dependency rule to deny Forbidden Classes usages in Project Source. Well, the classes will still be there in the import popup, but at least you get a warning if you select them.


Please sign in to leave a comment.