Skip to content

Commit 1987e3c

Browse files
authored
Fix Maven metadata copy across reactor modules (#1020)
* Fix Maven metadata copy across reactor modules * Fix grund cross-reference formatting
1 parent f328d3a commit 1987e3c

21 files changed

Lines changed: 344 additions & 6 deletions

File tree

docs/src/docs/asciidoc/changelog.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
== Release 1.1.6
1515

16+
- Fix Maven `native:metadata-copy` replacement when sequential reactor modules share an output directory, including failure-safe staging and removal of stale metadata types.
1617
- Maven native test goals now read the matching Surefire or Failsafe execution, including its configured `testClassesDirectory`, and keep their test-ID output separate.
1718
- Clarify the separate Gradle launcher, JDK 17 compilation toolchain, and GraalVM prerequisites; add a docs-independent core build mode while keeping the default full build responsible for included-build assembly, verification, and documentation rendering.
1819

native-maven-plugin/docs/e2e.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ This protects [§FS-resources-and-metadata.2](functional/resources-and-metadata.
7373
disabled stages, merge behavior, and `native:metadata-copy`. This protects [§FS-tracing-agent](functional/tracing-agent.md#fs-tracing-agent-maven-goals-attach-and-post-process-native-image-tracing-agent-metadata) and
7474
[§common/FS-common-libraries.3](../../common/docs/functional-spec.md#3-native-image-tracing-agent).
7575

76+
#### 3.6.1 Shared reactor destination
77+
78+
`issues/MetadataCopyReactorFunctionalTest` with `reproducers/issue-650` verifies deterministic
79+
replacement and merge behavior when sequential reactor modules share one metadata destination. It
80+
also verifies that replacement removes metadata types absent from the later module and that a failed
81+
`native-image-configure` invocation leaves the destination unchanged without staging output. This
82+
protects [§FS-tracing-agent.4.1](functional/tracing-agent.md#41-shared-destination-replacement).
83+
7684
### 3.7 Maven integration
7785

7886
`SBOMFunctionalTest`, `JavaApplicationWithTestsFunctionalTest`, `issues/JavaAppWithTestsAndParentPomFunctionalTest`

native-maven-plugin/docs/functional/tracing-agent.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ configurations and must remove the filter and its directory when the Maven sessi
4646
`native:metadata-copy` must copy or merge selected agent stages into the configured output
4747
directory and honor disabled main/test stages.
4848

49+
### 4.1 Shared destination replacement
50+
51+
When sequential metadata-copy invocations share an output directory, `merge=false` must ignore
52+
existing destination metadata and replace every Native Image metadata entry owned by the goal with
53+
the current module's selected stages, while `merge=true` must include the existing destination as
54+
an input and replace it with the combined result. The goal must generate into staging and update the
55+
configured destination only after `native-image-configure` succeeds. If post-processing fails, the
56+
configured destination must remain unchanged and the staging output must be removed. This preserves
57+
the replacement and merge modes in
58+
[§root/FS-tracing-agent.4](../../../docs/spec/functional/tracing-agent.md#4-merge-and-copy) and the
59+
existing Maven parameter meanings required by
60+
[§root/REQ-backwards-compatibility.2](../../../docs/spec/requirements.md#2-configuration-compatibility).
61+
4962
## 5. Agent example
5063

5164
Agent collection is enabled through `<agent>` configuration or `-Dagent=true`; post-processing is
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Issue 650 reactor fixture metadata
2+
3+
The JSON files cannot contain comments, so this adjacent manifest grounds each metadata fixture used
4+
by the shared-reactor-destination scenario:
5+
6+
- `first-module/fixture-target/native/agent-output/test/jni-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
7+
- `first-module/fixture-target/native/agent-output/test/predefined-classes-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
8+
- `first-module/fixture-target/native/agent-output/test/proxy-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
9+
- `first-module/fixture-target/native/agent-output/test/reflect-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
10+
- `first-module/fixture-target/native/agent-output/test/resource-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
11+
- `first-module/fixture-target/native/agent-output/test/serialization-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
12+
- `second-module/fixture-target/native/agent-output/test/jni-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
13+
- `second-module/fixture-target/native/agent-output/test/predefined-classes-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
14+
- `second-module/fixture-target/native/agent-output/test/proxy-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
15+
- `second-module/fixture-target/native/agent-output/test/reflect-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
16+
- `second-module/fixture-target/native/agent-output/test/resource-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
17+
- `second-module/fixture-target/native/agent-output/test/serialization-config.json`[§E2E-functional-tests.3.6.1](../../docs/e2e.md#361-shared-reactor-destination)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
{"name":"issue650.FirstModuleMarker"}
3+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"resources":{"includes":[]}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

0 commit comments

Comments
 (0)