Commit 7ed07f2
committed
fix(hostplugin): correct lifespan + loader semantics so the host bean wires
Three corrections surfaced by the full 335-test gate (Task 14 of the LTA
2026.1 migration plan); none was caught by the spec's javap analysis:
1. PluginRuntime.loadFrom — second arg to PluginsLoader.load is
disabledPluginsForAnalysis, not additionalAllowedPlugins as the spec
assumed. Passing "sonarpredict-host" actively EXCLUDED our host plugin
from every Spring analysis container, leaving AnalysisWarnings unwired
and reproducing the original "wall". Reverted to Set.of().
2. NoOpAnalysisWarnings @SonarLintSide(lifespan = INSTANCE -> SINGLE_ANALYSIS).
The per-analysis AnalysisContainer calls install(ContainerLifespan.ANALYSIS),
which matches the SINGLE_ANALYSIS string constant — not INSTANCE.
HtmlSensor, the sensor that triggered the original NoSuchBeanDefinitionException,
lives in this same container.
3. host-plugin-jar maven execution moved from prepare-package to
process-test-classes, plus a maven-antrun copy-host-plugin-for-tests
step that seeds the dev plugins/ dir with the host JAR. Required so the
surefire-time daemon tests (which use AnalysisService's no-arg ctor =
plugins/) can find the host plugin without a full assembly run.
HostPluginIntegrationTest refactored to use @tempdir + hardlink-or-copy
the vendored analyzer JARs plus the host JAR, filtering out *-host.jar
from the vendored glob to avoid a duplicate FileAlreadyExistsException
when antrun has already populated plugins/.
After these three corrections, full mvn verify reports 335/335 tests
passing, JaCoCo report intact, and the unpacked dist bundle analyzes a
Java fixture cleanly with zero NoSuchBeanDefinitionException occurrences.1 parent c0ff8fd commit 7ed07f2
4 files changed
Lines changed: 96 additions & 14 deletions
File tree
- src
- main/java/io/github/randomcodespace/sonarpredict
- daemon
- hostplugin
- test/java/io/github/randomcodespace/sonarpredict/hostplugin
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
403 | 439 | | |
404 | 440 | | |
405 | 441 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | | - | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
Lines changed: 46 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | | - | |
| 35 | + | |
32 | 36 | | |
33 | | - | |
| 37 | + | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
41 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
42 | 81 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 82 | + | |
| 83 | + | |
46 | 84 | | |
47 | 85 | | |
48 | | - | |
| 86 | + | |
49 | 87 | | |
50 | 88 | | |
51 | 89 | | |
52 | | - | |
53 | | - | |
| 90 | + | |
54 | 91 | | |
55 | 92 | | |
56 | 93 | | |
0 commit comments