restrict-imports-enforcer-rule

Gradle plugin & Maven Enforcer rule that restricts usage of unwanted imports in Java, Kotlin and Groovy source files.

MIT License

Stars
72

Bot releases are hidden (Show)

restrict-imports-enforcer-rule - v2.5.0 Latest Release

Published by skuzzle 9 months ago

Maven Central Gradle Plugin Portal

[!NOTE]
This is the first release after migrating our build to Gradle and which uses shaded dependencies.
If you encounter any irregularities with this version, please do not hesitate to file an issue.

Features

  • #38 Dependencies are shaded into plugin artifacts
  • #59 Provide a Gradle plugin
  • #118 Print absolute paths in exception messages to make IntelliJ render clickable links

maven

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.5.0</version>
</dependency>

Gradle plugin DSL

plugins {
  id("de.skuzzle.restrict.imports") version "2.5.0"
}

Gradle Legacy

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("de.skuzzle.enforcer:restrict-imports-gradle-plugin:2.5.0")
  }
}

apply(plugin = "de.skuzzle.restrict.imports")

Gradle version catalog (Toml)

[plugins]
restrictImports = { id = "de.skuzzle.restrict.imports", version = "2.5.0" }
restrict-imports-enforcer-rule - v2.5.0-rc-2

Published by skuzzle 9 months ago

Maven Central

[!NOTE]
This is the first release after migrating our build to Gradle and which uses shaded dependencies.
If you encounter any irregularities with this version, please do not hesitate to file an issue.

Features

  • #38 Dependencies are shaded into plugin artifacts
  • #59 Provide a Gradle plugin
  • #118 Print absolute paths in exception messages to make IntelliJ render clickable links

Maven Central coordinates for this release:

maven

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.5.0-rc-2</version>
</dependency>

Gradle plugin DSL

plugins {
  id("de.skuzzle.restrict.imports") version "2.5.0-rc-2"
}

Gradle Legacy

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("de.skuzzle.enforcer:restrict-imports-gradle-plugin:2.5.0-rc-2")
  }
}

apply(plugin = "de.skuzzle.restrict.imports")

Gradle version catalog (Toml)

[plugins]
restrict-imports = { id = "de.skuzzle.restrict.imports", version = "2.5.0-rc-2" }
restrict-imports-enforcer-rule - v2.5.0-rc-1

Published by skuzzle 9 months ago

Maven Central

Features

  • #59 Provide a Gradle plugin

Maven Central coordinates for this release:

maven

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.5.0-rc-1</version>
</dependency>

Gradle plugin DSL

plugins {
  id("de.skuzzle.restrict.imports") version "2.5.0-rc-1"
}

Gradle Legacy

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("de.skuzzle.enforcer:restrict-imports-gradle-plugin:2.5.0-rc-1")
  }
}

apply(plugin = "de.skuzzle.restrict.imports")

Gradle version catalog (Toml)

[plugins]
restrict-imports = { id = "de.skuzzle.restrict.imports", version = "2.5.0-rc-1" }
restrict-imports-enforcer-rule - 2.4.0

Published by skuzzle over 1 year ago

Maven Central

Bug fixes

  • #55 Make parallel analysis the default
  • #63 Support for ignoring classes that cannot be fixed

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.4.0</version>
</dependency>
restrict-imports-enforcer-rule - 2.4.0-rc1

Published by skuzzle over 1 year ago

Maven Central JavaDoc

Bug fixes

  • #55 Make parallel analysis the default
  • #63 Support for ignoring classes that cannot be fixed

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.4.0-rc1</version>
</dependency>
restrict-imports-enforcer-rule - 2.3.1

Published by skuzzle over 1 year ago

Maven Central JavaDoc

Bug fixes

  • #79 Recognize full qualified annotation use

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.3.1</version>
</dependency>
restrict-imports-enforcer-rule - 2.3.0

Published by skuzzle over 1 year ago

Maven Central JavaDoc

Bug fixes

  • #73 Classloader issues while locating LanguageSupport instances
  • #76 ** wildcard must match at least a single package part

Misc

  • Updated various dependencies

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.3.0</version>
</dependency>
restrict-imports-enforcer-rule - 2.2.0

Published by skuzzle over 1 year ago

Maven Central JavaDoc

Features

  • #60 Fall back to line-by-line parsing if full-compilation-unit parsing failed.

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.2.0</version>
</dependency>
restrict-imports-enforcer-rule - 2.1.0

Published by skuzzle almost 2 years ago

Maven Central JavaDoc

Features

  • #57 Detect full qualified class usages (must be enabled via <parseFullCompilationUnit>true</parseFullCompilationUnit>)

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.1.0</version>
</dependency>
restrict-imports-enforcer-rule - 2.0.0

Published by skuzzle almost 3 years ago

Maven Central JavaDoc

This is a new major release. Upgrading the version might break your build if you don't adjust your configuration
according to the changes mentioned below. Please carefully read the changes section when you are upgrading from 1.x.y.

Changes

(Note: Review carefully, as those might break your existing build when updating from version 1.x.y)

  • #28 Test code is always analyzed unless <includeTestCode> option is configured false.
  • #49 Simplify and formalize "pattern specificity".
  • #53 Package patterns now implicitly match static imports.
  • Declaration variant no longer supported: <restrictImports implementation="de.skuzzle.enforcer.restrictimports.RestrictImports"> (deprecated since 0.12.0).
  • Declaration variant no longer supported: <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports"> (deprecated since 1.4.0).

Features

  • #50 Introduce -Drestrictimports.skip and -Drestrictimports.failBuild command line options.
  • Added <parallel> (-Drestrictimports.parallel) option to run the whole analysis in parallel (Experimental feature, feedback welcome).
  • Improve formatting of the analysis result.

Bug fixes

  • #52 Whitespaces in plugin configuration and source files are handled more gracefully.

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>2.0.0</version>
</dependency>
restrict-imports-enforcer-rule - 1.4.0

Published by skuzzle almost 3 years ago

Maven Central JavaDoc

Features

  • Allow simple declaration as rule via <RestrictImports> instead of requiring fully qualified class name.
  • Build and test against enforcer-api:3.0.0 (coming from 3.0.0-M1)

Deprecations

  • Deprecated full qualified declaration as <restrictImports implementation="de.skuzzle.enforcer.restrictimports.rule.RestrictImports">
    in favor of just <RestrictImports>. Using the deprecated declaration will print a warning during the build. The
    deprecated declaration format will be removed with the next major release, that is 2.x.x

Otherwise Noteworthy

  • #38 Removed Guava dependency altogether.
  • Removed the changelog from the main README. Notable changes for each release are now attached directly to each GitHub
    release. Existing release notes up to version 1.3.0 can still be found in CHANGELOG_LEGACY.md file.

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>1.4.0</version>
</dependency>
restrict-imports-enforcer-rule - 1.3.0

Published by skuzzle about 3 years ago

  • 47: Allow to exclude source roots

Maven Central coordinates for this release:

<dependency>
    <groupId>de.skuzzle.enforcer</groupId>
    <artifactId>restrict-imports-enforcer-rule</artifactId>
    <version>1.3.0</version>
</dependency>
restrict-imports-enforcer-rule - 1.2.0

Published by skuzzle over 3 years ago

  • 44: Bump guava to 30.1.1-jre
  • 43: Allow to run on test code only
restrict-imports-enforcer-rule - 1.1.0

Published by skuzzle over 4 years ago

  • 42: Add some more configuration consistency checks
  • Update section about Versioning and Compatibility
restrict-imports-enforcer-rule - 1.0.1

Published by skuzzle over 5 years ago

Changelog

  • #39: Handle double semicolon after import statement
  • #37: Fix version incompatibility
  • Display analysis duration
restrict-imports-enforcer-rule - 1.0.0

Published by skuzzle over 5 years ago

Changelog

  • #35: Recognize multiple import statements on same line in groovy sources
  • Remove commentLineBufferSize
restrict-imports-enforcer-rule - 0.18.0

Published by skuzzle over 5 years ago

Changelog

  • Fix possible file resource leak while iterating source files
  • Remove sourceFileCharset
  • Soft-Remove commentLineBufferSize
  • #34: Recognize multiple import statements on same line in java sources
  • #33: Possibility to forbid wildcard imports
  • #31: Results show whether a match occurred in a test file
  • #30: Separate import parsing and banned import analysis
restrict-imports-enforcer-rule - 0.17.0

Published by skuzzle over 5 years ago

Changelog

  • #29: SPI for SourceLineParser implementations
  • #27: Introduce failBuild and skip options
  • Fix mysterious case where "* would be recognized as the beginning of a block comment
  • Introduce changelog to readme
  • Add contribution guide lines
restrict-imports-enforcer-rule - 0.16.0

Published by skuzzle over 5 years ago

Changelog

  • #26: Deprecate commentLineBufferSize parameter and replaced with dynamically growing buffer
  • #25: Add additional configuration sanity checks
  • #23: Soft-Remove sourceFileCharset parameter and always use ${project.build.sourceEncoding} now
Package Rankings
Top 27.83% on Repo1.maven.org
Badges
Extracted from project README
Maven Central Gradle Plugin Portal Coverage Status Twitter Follow