A Maven plugin that detects uses of legacy Java APIs in your codebase, promoting modern, performant, and idiomatic alternatives.
Modernizer Maven Plugin is a build tool that detects uses of deprecated or legacy Java APIs in compiled bytecode. It helps developers identify and replace outdated patterns with modern, more performant, and safer alternatives supported by newer Java versions or libraries. The plugin scans for over 200 predefined violations, including issues in core Java and third-party dependencies like Guava and Apache Commons.
Java developers and teams using Maven who want to maintain code quality, enforce modernization best practices, and reduce technical debt in large or long-lived codebases.
Developers choose Modernizer for its accurate bytecode-based detection, extensive pre-configured rule set, and seamless Maven integration. It provides actionable feedback specific to API upgrades, unlike generic linters, and offers flexible configuration to adapt to project-specific target Java versions and exclusion needs.
Detect uses of legacy Java APIs
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes over 200 checks for outdated APIs in core Java and libraries like Apache Commons and Guava, as detailed in the default modernizer.xml file.
Allows violations to be scoped based on a target Java version via the <javaVersion> configuration, ensuring checks are relevant to your project's baseline.
Can be run on-demand or automatically during the verify phase with executions in pom.xml, and it supports failing the build on violations for CI/CD pipelines.
Offers fine-grained control through configuration files, patterns, or the @SuppressModernizer annotation, as shown in the dependency and usage examples.
Designed specifically for Maven; users of other build tools like Gradle must rely on third-party plugins, which may have limited features or support compared to the core plugin.
Configuring exclusions requires understanding of javap format and regular expressions, which can be cumbersome and error-prone for developers, as noted in the exclusionsFile and exclusionPatterns documentation.
Only supports CONSOLE and CODE_CLIMATE output formats, which may not integrate with all CI/CD systems or reporting tools, limiting flexibility for diverse environments.
Relies on compiled classes for detection, so it cannot provide feedback until after compilation, potentially delaying the identification of legacy API usage in the development cycle.