reda-alaoui commented on PR #178: URL: https://github.com/apache/maven-build-cache-extension/pull/178#issuecomment-6401268976
@AlexanderAshitkin, 1adbd36 reworks the fix along the lines you suggested: the source roots are now recorded as build metadata instead of being hard-coded. - On save, `buildinfo.xml` records the compile and test compile source roots the build registered inside its build directory (new `compileSourceRoots` / `testCompileSourceRoots` lists, paths relative to the project base directory). - On restore, exactly those roots are registered again, when generated sources are restored and the directory exists. The hard-coded `target/generated-sources` / `target/generated-test-sources` roots are gone. The hard-coded parent root was not only too narrow, it also broke builds. On a partial restore where the compiler runs (e.g. an entry saved by a build stopped at `initialize`, then `clean package`), maven-compiler-plugin 3.12.1 scanned the restored `target/generated-sources/annotations` files through the parent root, then cleared that directory before invoking javac, which failed with `error reading .../Setting_.java`. With the real root (`target/generated-sources/annotations`), the compiler recognizes its own generated sources directory and skips it. `Issue106Test` covers both sides: - `partialRestoreOfABuildStoppedAtInitializeCompiles` reproduces the failure above: it fails with the previous commit and passes now. - `generatedSourcesAreVisibleToPluginsRunningAfterARestoredCompilation` checks the original purpose: after a restore that skips `compiler:compile`, maven-javadoc-plugin still documents the annotation processor's output. It fails when no source root is restored. The full integration suite passes (350 tests). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
