java_remove_imports(7)
| JAVA_REMOVE_IMPORTS(7) | Java packaging support | JAVA_REMOVE_IMPORTS(7) |
NAME
java_remove_imports - remove import statements from Java source files
SYNOPSIS
%java_remove_imports [optional flags] <matcher>... [file path]...
DESCRIPTION
This macro removes import statements from Java source files. The script matches all non-whitespace content following the 'import [static]' statement against all patterns provided via the -p flag and all simple class names against names provided by the -n flag.
File path arguments are handled the following way:
Arguments can be specified in arbitrary order.
Matcher is one of:
-n <name>
-p <pattern>
Optional flags:
-s, --strict
EXAMPLES
Example of usage in a .spec file:
%java_remove_imports src -n Nullable
Examples of patterns:
1) import java.lang.Runnable; 2) import java.util.List; 3) import static java.util.*; 4) import static java.lang.String.valueOf; 5) import com.google.common.util.concurrent.Service;
Name 'Runnable' matches 1) Name 'String' matches 4)
Name 'util' does not match anything. Name '*' does not match anything. Name 'valueOf' does not match anything.
Pattern 'Runnable' matches 1). Pattern '[*]' matches 3). Pattern 'java[.]util' matches 2), 3). Pattern 'util' matches 2), 3), 5). Patterns 'java', 'java.*' match 1) - 4).
Pattern 'static' does not match anything.
REPORTING BUGS
Bugs should be reported through the issue tracker at GitHub: <https://github.com/fedora-java/jurand/issues>.
AUTHOR
Written by Marián Konček.
SEE ALSO
| 2025-03-13 | JAVA_REMOVE_IMPORTS |
