maven/compat
Tamas Cservenak 0222aff6c9
[MNG-8447] Lossy ProblemCollector (#1994)
Historically (from Maven3) "problem collection" (in various scenarios, like building effective settings and toolchains, to building models) were done by passing around `List<Problem>` structure. This proved quite ineffective, as in case of (really) huge projects with quite big count of problems reported choked Maven (but also produced unusable output). We are aware of projects producing 3 million warnings! Dumping all of them onto console/log makes really no sense.

This PR changes Maven that by default it reports "problems" (settings building, toolchains building, or model building) as one liner warnings: how much and where were problems collected. This produces much more less overwhelming output than happens on master. User can control "build errors" using `-e`, so `mvn -e` will dump errors on screen/log.

The new `org.apache.maven.api.services.ProblemCollector<P>` class, that is somewhat "drop in" replacement for `List`, but with huge difference: it is "lossy", in a way, it maintains counters precisely, but actual problem instances are simply dropped after threshold `maven.builder.maxProblems` is surpassed (default 100). See `org.apache.maven.api.Constants#MAVEN_BUILDER_MAX_PROBLEMS`.

Rules:
* on problem addition counters are always updated
* if below threshold, store the problem (and will be reported later to the user)
* if above threshold, try to drop one problem with severity lower than currently reported problem, if succeeded, store the current problem, otherwise drop it

---

https://issues.apache.org/jira/browse/MNG-8447
2024-12-19 15:50:21 +01:00
..
maven-artifact [MNG-8433] Use the switch expressions syntax (#1983) 2024-12-17 10:56:12 +01:00
maven-builder-support [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-compat [MNG-8433] Use the switch expressions syntax (#1983) 2024-12-17 10:56:12 +01:00
maven-embedder [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-model [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-model-builder [MNG-8433] Use the switch expressions syntax (#1983) 2024-12-17 10:56:12 +01:00
maven-plugin-api [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-repository-metadata [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-resolver-provider [MNG-8433] Use the switch expressions syntax (#1983) 2024-12-17 10:56:12 +01:00
maven-settings [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-settings-builder [MNG-8447] Lossy ProblemCollector (#1994) 2024-12-19 15:50:21 +01:00
maven-toolchain-builder [MNG-8447] Lossy ProblemCollector (#1994) 2024-12-19 15:50:21 +01:00
maven-toolchain-model [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
pom.xml [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00