brunoborges commented on PR #1599: URL: https://github.com/apache/maven-dependency-plugin/pull/1599#issuecomment-4184811704
### Bug fix: model sync in `dependency:remove` (`d3e86f2`, `e5e6a86`) Found and fixed a bug in the in-memory model sync during review. When a POM has multiple variants of the same dependency (e.g., both `jar` and `test-jar`), the XML removal correctly targets only the specified variant, but the in-memory model sync was using only `groupId:artifactId` — removing **all** variants from the model. This would cause chained goals to see incorrect state. **Fix:** Model sync now matches on `groupId:artifactId:type:classifier`, consistent with the XML removal logic. **Test added:** `modelSyncPreservesOtherVariantsOnRemove` — sets up a POM with both `jar` and `test-jar` variants, removes only `test-jar`, and verifies the `jar` variant remains in the in-memory model. Also documented type/classifier matching behavior in `managing-dependencies.apt.vm` — explaining that Maven treats `g:a` with different types/classifiers as distinct dependencies. -- 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]
