maven/impl
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-cli [MNG-8447] Lossy ProblemCollector (#1994) 2024-12-19 15:50:21 +01:00
maven-core [MNG-8447] Lossy ProblemCollector (#1994) 2024-12-19 15:50:21 +01:00
maven-di [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-executor [MNG-8437] mvnsh (#1982) 2024-12-17 10:50:45 +01:00
maven-impl [MNG-8447] Lossy ProblemCollector (#1994) 2024-12-19 15:50:21 +01:00
maven-jline [MNG-8438] maven-jline: Migrate to Maven DI (off javax.inject) (#1987) 2024-12-17 10:51:50 +01:00
maven-logging [MNG-8433] Use the switch expressions syntax (#1983) 2024-12-17 10:56:12 +01:00
maven-xml [MNG-8444] Exclude maven-xml and maven-xml-impl (the artifact has been renamed) (#1992) 2024-12-17 11:30:28 +01:00
pom.xml [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00