|
45 | 45 | # Allows: letters, digits, underscores, dots, and dollar signs (inner classes) |
46 | 46 | _VALID_JAVA_CLASS_NAME = re.compile(r"^[a-zA-Z_$][a-zA-Z0-9_$.]*$") |
47 | 47 |
|
| 48 | +# Skip validation/analysis plugins that reject generated instrumented files |
| 49 | +# (e.g. Apache Rat rejects missing license headers, Checkstyle rejects naming, etc.) |
| 50 | +_MAVEN_VALIDATION_SKIP_FLAGS = [ |
| 51 | + "-Drat.skip=true", |
| 52 | + "-Dcheckstyle.skip=true", |
| 53 | + "-Dspotbugs.skip=true", |
| 54 | + "-Dpmd.skip=true", |
| 55 | + "-Denforcer.skip=true", |
| 56 | + "-Djapicmp.skip=true", |
| 57 | +] |
| 58 | + |
48 | 59 |
|
49 | 60 | def _validate_java_class_name(class_name: str) -> bool: |
50 | 61 | """Validate that a string is a valid Java class name. |
@@ -493,6 +504,7 @@ def _compile_tests( |
493 | 504 | return subprocess.CompletedProcess(args=["mvn"], returncode=-1, stdout="", stderr="Maven not found") |
494 | 505 |
|
495 | 506 | cmd = [mvn, "test-compile", "-e", "-B"] # Show errors but not verbose output; -B for batch mode (no ANSI colors) |
| 507 | + cmd.extend(_MAVEN_VALIDATION_SKIP_FLAGS) |
496 | 508 |
|
497 | 509 | if test_module: |
498 | 510 | cmd.extend(["-pl", test_module, "-am"]) |
@@ -1447,6 +1459,7 @@ def _run_maven_tests( |
1447 | 1459 | # JaCoCo's report goal is bound to the verify phase to get post-test execution data |
1448 | 1460 | maven_goal = "verify" if enable_coverage else "test" |
1449 | 1461 | cmd = [mvn, maven_goal, "-fae", "-B"] # Fail at end to run all tests; -B for batch mode (no ANSI colors) |
| 1462 | + cmd.extend(_MAVEN_VALIDATION_SKIP_FLAGS) |
1450 | 1463 |
|
1451 | 1464 | # Add --add-opens flags for Java 16+ module system compatibility. |
1452 | 1465 | # The codeflash-runtime Serializer uses Kryo which needs reflective access to |
|
0 commit comments