You can specify which classes should be processed using several methods:
By Name or Package
Use <classNames> and/or <packageNames> to define targets. You can also use <excludeClassNames> to filter them out.
Supported formats for names and packages:
- Absolute paths: Use dots (
.) as separators (e.g., com.myOrg.myApp.MyClass). - Glob patterns: Use slashes (
/) as separators and standard placeholders like ?, *, or ** (e.g., com/myOrg/myApp/package?).
To skip specific types, use:
<skipAbstractTypes>true</skipAbstractTypes><skipInterfaces>true</skipInterfaces>
By Annotations
Use the <annotations> element to include all classes that carry at least one of the specified annotations. If used alongside <classNames> or <packageNames>, a class must match both the name/package criteria AND have at least one of the specified annotations.
Restricting the Classpath
Control which dependencies are scanned using the <classpath> element:
PROJECT_ONLY: Only source files of the current project.WITH_COMPILE_DEPENDENCIES: Project source plus compile dependencies.WITH_RUNTIME_DEPENDENCIES: Project source plus runtime dependencies (default).WITH_ALL_DEPENDENCIES: All dependencies.
Note: If no classes match your criteria, the plugin will fail by default. Set <failIfNoClassesMatch>false</failIfNoClassesMatch> to prevent this.
<configuration>
<classNames>com.myOrg.myApp.MyClass</classNames>
<packageNames>
<packageName>com.myOrg.myApp.package1</packageName>
<packageName>com.myOrg.myApp.package2</packageName>
</packageNames>
<excludeClassNames>com.myOrg.myApp.package2.HiddenClass</excludeClassNames>
</configuration>