maven/api
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-api-annotations [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-cli [MNG-8437] mvnsh (#1982) 2024-12-17 10:50:45 +01:00
maven-api-core [MNG-8447] Lossy ProblemCollector (#1994) 2024-12-19 15:50:21 +01:00
maven-api-di [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-metadata [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-model [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-plugin [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-settings [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-spi [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-toolchain [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
maven-api-xml [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
src/site [MNG-7571] add Maven API javadoc (#830) 2022-12-31 17:32:07 +01:00
pom.xml [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00