brunoborges commented on PR #1599:
URL: 
https://github.com/apache/maven-dependency-plugin/pull/1599#issuecomment-4185052990

   ## Real-world integration testing
   
   Installed the plugin locally (`3.10.1-SNAPSHOT`) and ran **30 tests** across 
4 major open-source Maven projects to verify `dependency:add` and 
`dependency:remove` work correctly in the wild.
   
   ### Projects tested
   
   | Project | Description | POM complexity |
   |---------|-------------|---------------|
   | [Spring Petclinic](https://github.com/spring-projects/spring-petclinic) | 
Simple Spring Boot app | Standard single-module |
   | [Apache Commons Lang](https://github.com/apache/commons-lang) | Apache 
library | Single-module with managed deps |
   | [Apache Camel](https://github.com/apache/camel) | Large integration 
framework | **4500-line root POM**, 539 property interpolations, massive 
multi-module |
   | [Baeldung Tutorials](https://github.com/eugenp/tutorials) | Hundreds of 
submodules | Large multi-module |
   
   ### Results: 30/30 pass (1 cosmetic observation)
   
   | Test Scenario | Petclinic | Commons Lang | Camel | Tutorials |
   |---------------|-----------|-------------|-------|-----------|
   | Basic add | ✅ | ✅ | ✅ | ✅ |
   | Add with scope | ✅ | ✅ | — | — |
   | Add to `<dependencyManagement>` | ✅ | ✅ | ✅ | ✅ |
   | Add with `-Doptional=true` | ✅ | — | — | — |
   | Add with `-Dtype` / `-Dclassifier` | ✅ | — | — | — |
   | Add BOM import (pom + import + managed) | — | — | — | ✅ |
   | Version inference from managed deps | — | ✅ | — | — |
   | Remove basic | ✅ | — | — | — |
   | Remove from `<dependencyManagement>` | — | ✅ | ✅ | — |
   | Add then remove round-trip | ✅ | — | ✅ | ✅ |
   | Add to submodule | — | — | ✅ | ✅ |
   | Duplicate detection (should fail) | ✅ | — | — | — |
   | Remove nonexistent (should fail) | ✅ | — | — | — |
   | Invalid GAV (should fail) | ✅ | — | — | — |
   | Invalid scope (should fail) | — | ✅ | — | — |
   | Missing `-Dgav` (should fail) | — | ✅ | — | — |
   | Formatting preservation | ✅ | ✅ | ✅ | ✅ |
   | POM with property interpolations | — | — | ✅ | — |
   
   ### Key findings
   
   - **Formatting preservation is excellent** — round-trip (add then remove) 
produces zero diff on all projects, including Camel's 4500-line POM with 539 
property references.
   - **All error cases handled gracefully** — duplicate detection, nonexistent 
removal, invalid GAV, invalid scope, and missing parameters all produce clear, 
actionable error messages.
   - **Version inference works** — adding without version when a managed 
version exists correctly omits the `<version>` element.
   - **BOM import pattern works** — `dependency:add 
-Dgav=...dependencies:pom:3.2.0 -Dscope=import -Dmanaged` correctly produces 
`<type>pom</type>` + `<scope>import</scope>` inside `<dependencyManagement>`.
   - **Submodule targeting works** — using `-f path/to/submodule/pom.xml` or 
running from the submodule directory both work correctly.
   
   ### One cosmetic observation
   
   When `dependency:add` creates a new `<dependencies>` section (because one 
didn't exist) and then `dependency:remove` removes the last entry, the empty 
container element (`<dependencies/>`) is left behind. This is valid XML and 
cosmetic only — not a bug.


-- 
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]

Reply via email to