Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frimtec/idea-import-control-plugin
:no_entry: IntelliJ-IDEA Plugin for a lightweight Java module import control.
https://github.com/frimtec/idea-import-control-plugin
annotation import inspection intellij java jetbrains-plugin
Last synced: 7 days ago
JSON representation
:no_entry: IntelliJ-IDEA Plugin for a lightweight Java module import control.
- Host: GitHub
- URL: https://github.com/frimtec/idea-import-control-plugin
- Owner: frimtec
- License: apache-2.0
- Created: 2020-10-29T07:51:29.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-01T08:30:52.000Z (9 months ago)
- Last Synced: 2024-04-01T09:35:03.512Z (9 months ago)
- Topics: annotation, import, inspection, intellij, java, jetbrains-plugin
- Language: Java
- Homepage:
- Size: 633 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# IntelliJ-IDEA Import Control Plugin
[![JetBrains Plugins][jetbrains-plugin-release-shield]][jetbrains-plugin]
![Plugin Downloads][jetbrains-plugin-download-shield]![Project Maintenance][maintenance-shield]
[![License][license-shield]][license][![Build Status][build-status-shield]][build-status]
[![Deploy Status][deploy-status-shield]][deploy-status]![Icon](images/icon.png)
IntelliJ-IDEA inspection rule for Java [Import Control][import-control-readme].
Reports all imports and references to module private classes ([Documentation][import-control-plugin-readme]).
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 visibility 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][import-control-readme] 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][import-control] and is available on [maven central][maven-central-import-control-api].
![Icon](images/errors.png)
## Installation
- Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "import-control" >
Install Plugin- Manually:
Download the [latest release][latest-release] and install it manually using
Settings/Preferences > Plugins > ⚙ > Install plugin from disk...## How to use
* Install the Plugin [Import Control][jetbrains-plugin] from the Jetbrains Plugin-Repository.
* Configure the inspection rule ```Import/reference of module private classes``` (in group Java / Visibility).## Configuration
![Icon](images/settings.png)
### 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).[license-shield]: https://img.shields.io/github/license/frimtec/idea-import-control-plugin.svg
[license]: https://opensource.org/licenses/Apache-2.0
[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg
[build-status-shield]: https://github.com/frimtec/idea-import-control-plugin/workflows/Build/badge.svg
[build-status]: https://github.com/frimtec/idea-import-control-plugin/actions?query=workflow%3ABuild
[deploy-status-shield]: https://github.com/frimtec/idea-import-control-plugin/actions/workflows/release.yml/badge.svg
[deploy-status]: https://github.com/frimtec/idea-import-control-plugin/actions/workflows/release.yml
[jetbrains-plugin-release-shield]: https://img.shields.io/jetbrains/plugin/v/15308
[jetbrains-plugin-download-shield]: https://img.shields.io/jetbrains/plugin/d/15308
[jetbrains-plugin]: https://plugins.jetbrains.com/plugin/15308-import-control
[import-control-plugin-readme]: https://github.com/frimtec/idea-import-control-plugin/blob/main/README.md
[import-control-readme]: https://github.com/frimtec/import-control/blob/main/README.md
[import-control]: https://github.com/frimtec/import-control
[maven-central-import-control-api]: https://search.maven.org/artifact/com.github.frimtec/import-control-api
[latest-release]: https://github.com/frimtec/idea-import-control-plugin/releases/latest