Commit 8bb2a4b
Report dd-java-agent itself as a Maven dependency in SCA telemetry (#10975)
* Report dd-java-agent itself as a Maven dependency in SCA telemetry
Generate META-INF/maven/com.datadoghq/dd-java-agent/pom.properties at
build time so the SCA dependency pipeline (JarReader → DependencyResolver)
detects com.datadoghq:dd-java-agent in the APP_DEPENDENCIES_LOADED
telemetry events.
Add a unit test in DependencyResolverSpecification verifying the resolver
correctly parses the generated pom.properties, and extend the
AbstractServerSmokeTest tracer-dependency assertion to include
com.datadoghq:dd-java-agent so all server smoke tests validate this
end-to-end against the real shadow JAR.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Update telemetry/src/test/groovy/datadog/telemetry/dependency/DependencyResolverSpecification.groovy
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>
* Apply reviewer suggestions
- Use built-in Gradle WriteProperties task instead of custom doLast
action, which handles inputs/outputs/caching natively
- Fix Groovy with{} usage in test: apply it on ZipOutputStream
(not ZipEntry as incorrectly suggested in the upstream commit)
* Use WriteProperties task and wire srcDir via task provider
Use the built-in Gradle WriteProperties task as suggested by bric3.
Instead of splitting the output directory into a separate variable and
adding an explicit dependsOn (which bric3 did not suggest), derive the
srcDir provider from the task itself via generatePomProperties.map{...}.
This way Gradle infers the processResources -> generatePomProperties
dependency automatically, without extra boilerplate.
* spotless
* Follow existing pattern for generated resources
Follow the same pattern as includedAgentDir/includedJarFileTree:
- declare pomPropertiesDir and pomPropertiesFileTree near the top
- add dependsOn(pomPropertiesFileTree) to processResources
- declare main.resources.srcDir(pomPropertiesDir) in the sourceSets block
- register generatePomProperties (WriteProperties) near generateAgentJarIndex
- wire pomPropertiesFileTree.builtBy(generatePomProperties)
This avoids the need for a task-provider-mapped srcDir since WriteProperties
outputs a single file (not a directory), so the fileTree + builtBy approach
is the correct way to express the dependency.
* Combine srcDirs as suggested by reviewer
Replace two separate srcDir calls with a single srcDirs(includedAgentDir, pomPropertiesDir)
as suggested by bric3.
* Keep original srcDir and add srcDirs per reviewer diff
* Fix duplicate srcDir causing processResources failure
includedAgentDir was registered twice — once via srcDir and again
inside srcDirs. Replace both with a single srcDirs call.
* Fix implicit dependency on generatePomProperties from sourcesJar
sourcesJar includes main.resources srcDirs (including pomPropertiesDir)
but had no dependency on generatePomProperties. Add explicit
dependsOn(pomPropertiesFileTree) consistent with the processResources
wiring.
* chore: trigger CI
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Brice Dutheil <brice.dutheil@gmail.com>1 parent daa425b commit 8bb2a4b
File tree
3 files changed
+38
-2
lines changed- dd-java-agent
- dd-smoke-tests/src/main/groovy/datadog/smoketest
- telemetry/src/test/groovy/datadog/telemetry/dependency
3 files changed
+38
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
36 | | - | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
324 | 332 | | |
325 | 333 | | |
326 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
327 | 343 | | |
328 | 344 | | |
329 | 345 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
98 | 118 | | |
99 | 119 | | |
100 | 120 | | |
| |||
0 commit comments