Commit Graph

25 Commits

Author SHA1 Message Date
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
Jermaine Hua 99777ace02
[MNG-8433] Use the switch expressions syntax (#1983)
Signed-off-by: crazyhzm <crazyhzm@apache.org>

---

https://issues.apache.org/jira/browse/MNG-8433
2024-12-17 10:56:12 +01:00
Guillaume Nodet 5375f61a1d
[MNG-8414] Warn when not able to downgrade consumer POM unless preserveModelVersion is forced to true (#1981) 2024-12-14 00:10:59 +01:00
Guillaume Nodet ddae283c2b
[MNG-8245][MNG-8246] Warn when calling before: or after: phases (#1974) 2024-12-14 00:07:01 +01:00
Guillaume Nodet 5d449f9a24
[MNG-8244] Using before:all / all / after:all is not triggered (#1973) 2024-12-14 00:04:37 +01:00
Tamas Cservenak 5897cfe68d
[MNG-8430] Resolver 2.0.5 (#1975)
* [MNG-8430] Resolver 2.0.5

Prepare for Resolver 2.0.5

---

https://issues.apache.org/jira/browse/MNG-8430

* Switch to staged release

---------

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-12-14 00:01:58 +01:00
Guillaume Nodet ccbd50c975
[MNG-5729] Fix possible NPE with introduction of mononic clock (#1972) 2024-12-13 16:40:45 +01:00
Guillaume Nodet 54ffc5014e
[MNG-5729] Use monotonic time measurements (#1965) 2024-12-12 12:02:17 +01:00
Guillaume Nodet 9c77221cbc
[MNG-8393] Enable consumer pom by default for 4.1.0 model version only (#1963) 2024-12-12 09:07:12 +01:00
Guillaume Nodet 781d19d9f1
[MNG-8410] Rename maven-api-meta to maven-api-annotations (#1957) 2024-12-10 22:43:27 +01:00
Guillaume Nodet 62f85a4233
[MNG-8396] Add a cache layer to the filtered dependency graph (#1944) 2024-12-02 05:19:26 +01:00
Tamas Cservenak 80387c597c
[MNG-8394] Event bridge and properties fix (#1937) 2024-11-29 21:53:26 +01:00
Guillaume Nodet ae56c9b76e Thrown a more meaningful exception 2024-11-25 08:05:44 +01:00
Tamas Cservenak fcd9c0f018
[MNG-8385] Introduce proto session, make CLIng use PropertyContributor (#1929)
And make use of it in CLIng. Also, move from "late" Resolver session factory to "early" CLIng invocation of `PropertyContributor` SPI and make contribution visible across whole Maven, not only Resolver.

---

https://issues.apache.org/jira/browse/MNG-8385
2024-11-20 20:58:27 +01:00
Guillaume Nodet 5c02857a96
[MNG-8384] Make sure plugin's artifacts have a scope (#1928) 2024-11-20 20:04:57 +01:00
Guillaume Nodet bbf57bca60
[MNG-8383] Fix unsupported type dependencies put on classpath (#1921) 2024-11-19 00:56:12 +01:00
Tamas Cservenak 8dec40ff57
Rename versionFilter property and tidy up documentation (#1920)
This property was introduced in 4-alpha-12, so no issue just
putting the property in place.
2024-11-18 11:45:50 +01:00
Tamas Cservenak ab7d766c72
Exception usage cleanup (#1910)
This is just a cleanup of exception usage (by making them checked, fixing compiler issues, and undoing the change). There are at least two bugs (runtime escapes) fixed in this PR.
2024-11-16 21:36:20 +01:00
Tamas Cservenak 1614226c68
[MNG-8379] Decrypt all of settings on building it (#1913)
The decryption should happen transparently, also, resolver should not decrypt for itself only, whole maven should have access to all.

This PR also disables Maven 3.0 IT MNG-4459 as Maven4 stops with this "security through obscurity" (keep encrypted pw in memory kinda for "security reasons" but in reality any mojo or extension can decrypt anything they want).

---

https://issues.apache.org/jira/browse/MNG-8379
2024-11-16 14:55:43 +01:00
Guillaume Nodet a14732597b
[MNG-8336] Only inject plugins information if requested (#1904) 2024-11-15 10:24:21 +01:00
Guillaume Nodet 46707e0f28
[MNG-8340] Resolve parent according to the exact model location (#1857) 2024-11-13 20:26:56 +01:00
Tamas Cservenak 1ab2ccf066
Add maven.repo.local.head (#1881)
As counterpart to maven.repo.local.tail, but this one "prepends" while other "appends". This means one can do like this

```
$ mvn install -Prun-its -Dmaven.repo.local.head=~/.m2/repository-it
```

And have stuff installed into dedicated IT local repo (as IT bits must be installed), instead to pollute own local repo.

---

https://issues.apache.org/jira/browse/MNG-8370
2024-11-07 11:14:15 +01:00
Tamas Cservenak dfd5ec5f85
[MNG-8362] Adding some missing config properties (#1861)
To have them listed in generated docs, as they were forgotten.
Also, adding a "compat" support for Maven 3.9.x property for chained reposes.

---

https://issues.apache.org/jira/browse/MNG-8362
2024-11-05 17:06:57 +01:00
Guillaume Nodet 51123f3abc
Remove unused class (#1866) 2024-11-05 17:00:23 +01:00
Guillaume Nodet 13ad6376e0
[MNG-8346] Reorganize subprojects (#1837)
Reorganize Maven modules into impl and compat directories
2024-10-25 14:31:46 +02:00