Find uses of deprecated classes
org.openrewrite.java.search.FindDeprecatedClasses
Find uses of deprecated classes, optionally ignoring those classes that are inside deprecated scopes.
- groupId: org.openrewrite
- artifactId: rewrite-java
- version: 7.40.6
Type | Name | Description |
---|---|---|
String | typePattern | Optional. A type pattern that is used to find matching classes. |
Boolean | matchInherited | Optional. When enabled, find types that inherit from a deprecated type. |
Boolean | ignoreDeprecatedScopes | Optional. When a deprecated type is used in a deprecated method or class, ignore it. |
This recipe has no required configuration parameters and comes from a rewrite core library. It can be activated directly without adding any dependencies.
Gradle
Maven POM
Maven Command Line
build.gradle
plugins {
id("org.openrewrite.rewrite") version("5.40.4")
}
rewrite {
activeRecipe("org.openrewrite.java.search.FindDeprecatedClasses")
}
repositories {
mavenCentral()
}
pom.xml
<project>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>4.45.0</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.java.search.FindDeprecatedClasses</recipe>
</activeRecipes>
</configuration>
</plugin>
</plugins>
</build>
</project>
shell
mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
-Drewrite.activeRecipes=org.openrewrite.java.search.FindDeprecatedClasses
The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.
Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.