Commit Graph

32 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
Guillaume Nodet 8a69678007
[MNG-8446] Project cannot start due to too many warnings (#1993)
JIRA issue: [MNG-8446](https://issues.apache.org/jira/browse/MNG-8446)

This will help (but is not sufficient) to make [camel-quarkus](https://github.com/apache/camel-quarkus) buildable with maven 4.x.

---

https://issues.apache.org/jira/browse/MNG-8446
2024-12-17 18:44:55 +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 4714483009 [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
Guillaume Nodet 273314404f [maven-release-plugin] prepare release maven-4.0.0-rc-2 2024-12-14 00:22:18 +01:00
Guillaume Nodet 1fd7f879a4
[MNG-5729] Fix transfer rate computation (#1969) 2024-12-14 00:03:27 +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
Tamas Cservenak 50aecc7432
[MNG-8419][MNG-8424] Too aggressive warning for pre-Maven4 passwords (#1970)
Toned down the Maven4 sec dispatcher messages. Also, IF maven3 passwords detected AND there was `.mvn/extensions.xml` the warnings were doubled.

Examples:

Failure to start Maven (due non-decryptable passwords):
```
$ mvn clean
[ERROR] Error executing Maven.
[ERROR] Error building settings
 * FATAL: Could not decrypt password (fix the corrupted password or remove it, if unused) {xL6L/HbmrY++sNkphnq3fguYepTpM04WlIXb8nB1pk=}
 * WARNING: Detected 2 pre-Maven 4 legacy encrypted password(s) - configure password encryption with the help of mvnenc for increased security.
$
```

Warning at start (due Maven3 passwords):
```
$ mvn clean
[INFO]
[INFO] Some problems were encountered while building the effective settings (use -X to see details)
[INFO]
[INFO] Scanning for projects...
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Apache Maven
...
```

---

https://issues.apache.org/jira/browse/MNG-8424
https://issues.apache.org/jira/browse/MNG-8419
2024-12-12 17:43:08 +01:00
Guillaume Nodet 54ffc5014e
[MNG-5729] Use monotonic time measurements (#1965) 2024-12-12 12:02:17 +01:00
Tamas Cservenak 6cb4482a98
[MNG-8411][MNG-8412][MNG-8416] mvnenc fixes (#1959)
Cumulative mvnenc fixes:
* make the 3 goals (sans init) work in batch mode
* move the Maven DI SecDispatcher provider to test scope in maven-impl (duplicates components in Maven)
* update to SecDisparcher 4.0.3 (contains fix for MNG-8416 and one other bug)

---

https://issues.apache.org/jira/browse/MNG-8411
https://issues.apache.org/jira/browse/MNG-8412
https://issues.apache.org/jira/browse/MNG-8416
2024-12-11 10:13:06 +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 1b5b5c8f9e
[MNG-8415] Add constant for the security settings xml file (#1956)
* Add a constant for the security settings file
* Avoid usage of system properties by using the ProtoSession
* Regen
2024-12-09 13:19:44 +01:00
Jermaine Hua d6edb027c3
[MNG-8388] Fix escape characters being replaced to change the original configuration (#1946)
* [MNG-8388] Fix escape characters being replaced to change the original configuration

Signed-off-by: crazyhzm <crazyhzm@apache.org>

* Add unit test

---------

Signed-off-by: crazyhzm <crazyhzm@apache.org>
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-12-05 19:36:08 +01:00
Guillaume Nodet 789e2de812
[MNG-8404] ModelValidator: add unit tests and simplify a bit (#1948) 2024-12-05 15:16:47 +01:00
Guillaume Nodet 73e30c5d6f
[MNG-8402] System properties can take precedence over builtin expressions (#1947) 2024-12-04 17:54:29 +01:00
Guillaume Nodet a58551d9ab [MNG-8391] Wrong effective model when conflicting values come from parents and profiles 2024-12-01 20:41:22 +01:00
Guillaume Nodet 175e219a56 Remove usages of Properties 2024-12-01 20:41:22 +01:00
Tamas Cservenak 9238d2ffeb [maven-release-plugin] prepare for next development iteration 2024-11-25 11:57:49 +01:00
Tamas Cservenak d81b1b6a28 [maven-release-plugin] prepare release maven-4.0.0-rc-1 2024-11-25 11:57:24 +01:00
Tamas Cservenak 9bea6ec23b
Post merge fix (the profile condition activation missed some reshuffle of project layout) (#1933) 2024-11-22 10:48:50 +01:00
Guillaume Nodet 986f59683e
[MNG-8286] Add a condition profile based on a simple expressions (#1771) 2024-11-20 21:36:48 +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
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 46707e0f28
[MNG-8340] Resolve parent according to the exact model location (#1857) 2024-11-13 20:26:56 +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 62c94d123c
[MNG-8368] Fix dependency resolver not using project repositories (#1865) 2024-11-05 17:01:08 +01:00
Guillaume Nodet 51123f3abc
Remove unused class (#1866) 2024-11-05 17:00:23 +01:00
Guillaume Nodet 2a6fc5ab67
[MNG-8329] ArtifactInstallerRequest and ArtifactDeployerRequest should use Collection<ProducedArtifact> (#1836) 2024-10-25 18:43:07 +02:00
Guillaume Nodet c0866ec067
[MNG-8360] Fix parent profiles not reported as activated (#1852) 2024-10-25 17:34:15 +02:00
Tamas Cservenak f6c5de33f9
Better subproject names (#1853)
No issue, just make subprojects better named.
2024-10-25 15:40:16 +02: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