Giter Club home page Giter Club logo

idea-import-control-plugin's Introduction

IntelliJ-IDEA Import Control Plugin

JetBrains Plugins Downloads

license

Build Deploy release

Icon

IntelliJ-IDEA inspection rule for Java Import Control.

Reports all imports and references to module private classes (Documentation).

Java previous to JDK 9 has a visibility concept that does not support modules very well. If modules are splited into various packages, and only dedicated packages should be exported to other modules, the visibilty modifiers do not fit at all. All public classes can be imported to other modules.
With JDK 9 JPMS was introduced to solve this issue. Using JPMS in a project is not an easy task and sometimes even not possible due to runtime restrictions. This is where Import Control comes to rescue. It fully supports the need for import control between modules but with no runtime impact nor restrictions. Packages of modules that shall be exported to other modules can be annotated with @ExportPackage (or any other annotation of your choice). While editing in the IDE, imports to non exported classes from other modules are immediatly marked as errors.

The @ExportPackage annotation is from the project Import Control and is available on maven central.

Icon

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "import-control" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > โš™ > Install plugin from disk...

How to use

  • Install the Plugin Import Control from the Jetbrains Plugin-Repository.
  • Configure the inspection rule Import/reference of module private classes (in group Java / Visibility).

Configuration

Icon

Package export annotation

Defines the package annotation that flags the package as module export (default com.github.frimtec.libraries.importcontrol.api.ExportPackage).

Root packages

Defines root package (or several if separated by ';') of your multi-module project (only references to these root packages will be analysed).

idea-import-control-plugin's People

Contributors

actions-user avatar dependabot[bot] avatar frimtec avatar github-actions[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.