A Java bytecode analyzer that detects and blocks forbidden API calls during builds with Ant, Maven, or Gradle.
Policeman's Forbidden API Checker is a Java build tool that analyzes bytecode to detect calls to restricted APIs and fails the build if violations are found. It helps developers enforce coding standards, prevent security vulnerabilities, and ensure compatibility by blocking unwanted method, class, or field usage during compilation.
Java developers and teams using Apache Ant, Maven, or Gradle who need to enforce API usage policies, improve code security, or maintain compatibility across environments.
It provides automated, build-integrated enforcement of API restrictions with accurate bytecode analysis, supporting multiple build systems without requiring source code modifications.
Policeman's Forbidden API Checker
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates seamlessly as plugins for Apache Ant, Maven, and Gradle, making it easy to adopt in most Java projects without major setup overhead.
Parses compiled Java bytecode to detect API invocations precisely, ensuring reliable detection even after code transformations or optimizations.
Fails builds immediately when forbidden calls are found, enforcing compliance proactively and preventing violations from reaching production.
Includes a command-line tool for use outside standard build systems, enabling audits, custom scripts, or integration in non-standard workflows.
Allows defining custom rules for method, class, and field signatures, supporting tailored enforcement for security, compatibility, or coding standards.
Documentation is hosted on a separate Wiki, which can be less accessible, harder to navigate, and potentially outdated compared to integrated docs or official repositories.
Analyzes bytecode rather than source code, which can make error messages less intuitive for debugging and might miss issues in code that hasn't been compiled yet.
Enforces by failing builds by default, which can be too aggressive for teams wanting gradual adoption, warnings-only modes, or flexibility in development environments.
The project itself uses Apache Ant with specific version requirements and Ivy setup, which might complicate contributions or updates for users unfamiliar with older build tools.