Commit Graph

55 Commits

Author SHA1 Message Date
Tamas Cservenak 49825e6dba
[MNG-8437] mvnsh (#1982)
Maven shell

Changes:
* (unrelated) contains fix for property handling in embedded executor and in lookup invoker
* pulled `-o` (offline) option to "generic" Options from MavenOptions
* introduce mvnsh (scripts, options, CLIng main class)
* simplified invokers (only one context needed for maven now)
* invokers made "reentrant", it all depends HOW context is created

Related PRs:
* mvnd changes https://github.com/apache/maven-mvnd/pull/1228

---

https://issues.apache.org/jira/browse/MNG-8437
2024-12-17 10:50:45 +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 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
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
Guillaume Nodet ccbd50c975
[MNG-5729] Fix possible NPE with introduction of mononic clock (#1972) 2024-12-13 16:40:45 +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
Tamas Cservenak 0f15ad70e5
[MNG-8423] mvnenc -h (#1971)
Expand mvnenc help

---

https://issues.apache.org/jira/browse/MNG-8423
2024-12-12 15:23:28 +01:00
Guillaume Nodet 54ffc5014e
[MNG-5729] Use monotonic time measurements (#1965) 2024-12-12 12:02:17 +01:00
Tamas Cservenak 5b7a6de55a
[MNG-8421] Move all of logging setup to LookupInvoker; mvnenc IT (#1964)
Currently mvnenc is unable to log to file (-l) as logging setup is incomplete, move all of this logic to LookupInvoker. Also, create prompt in mvnenc only when needed. Finally, implement needed changes to support mvnenc ITs and add mvnenc IT.

Other changes:
* get rid of `distributionFileName` dirty hack, is remnant from old ITs
* fix CI re removal of that above and use of site that is brain-dead

---

https://issues.apache.org/jira/browse/MNG-8421
2024-12-12 09:43:12 +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
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 93e0f1bb79
[MNG-8405] Fail On Severity, when set, is not reset (in resident instances) (#1950)
Make it reset that does not leave dangling values for next invocation.

---------

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

Co-authored-by: Tamas Cservenak <tamas@cservenak.net>
2024-12-05 12:37:18 +01:00
Tamas Cservenak e74bde05c9
[MNG-8403] Maven ITs use maven-executor (#1940)
The goal of this PR is manifold, but major one is to be able to use in ITs new options introduced in Maven4. Currently the "embedded" mode supports only Maven3 options, as Maven4 got new CLI entry point (CLIng), while verifier uses old MavenCli entry point, that is also deprecated. Finally, a full cleanup of (black) magic happened as well, keep ITs simple and clean.

Changes:
* dropped from ITs classpath maven-shared-util
* dropped from ITs classpath maven-verifier, copied last master Verifier to maven-it-helper and modified
* enhancements to new maven-executor to make it fully replace maven-verifier
* ITs are now using new infra and are using new CLIng "entry point" as well (so far ITs used deprecated maven-embedder/MavenCLI class).

---

https://issues.apache.org/jira/browse/MNG-8403
2024-12-05 09:02:41 +01:00
Guillaume Nodet 73e30c5d6f
[MNG-8402] System properties can take precedence over builtin expressions (#1947) 2024-12-04 17:54:29 +01:00
Tamas Cservenak 794efae428
[MNG-8400] Make sure base parser uses canonical maven.home (#1945)
As currently it is mixing canonical paths with non-canonical ones.

---

https://issues.apache.org/jira/browse/MNG-8400
2024-12-03 13:50:31 +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
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 cf421eee87
[MNG-8389] MavenExReq lacks u/p/i settings file paths (#1939)
* [MNG-8389] MavenExReq lacks u/p/i settings file paths

The "effective" paths for 3 settings file was not set on
MavenExecutionRequest.

---

https://issues.apache.org/jira/browse/MNG-8389
2024-11-29 21:54:36 +01:00
Tamas Cservenak 80387c597c
[MNG-8394] Event bridge and properties fix (#1937) 2024-11-29 21:53:26 +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
Guillaume Nodet ae56c9b76e Thrown a more meaningful exception 2024-11-25 08:05:44 +01:00
Guillaume Nodet b367e73b50 Recompute colors during logger configuration 2024-11-25 08:05:24 +01:00
Tamas Cservenak 7ad2578e77
[MNG-8386] Pull out executor (#1932)
Yet another CLIng cleanup.

Changes:
* pull out Executor, it does not belong to CLIng (new maven-executor module created with no deps)
* resident and maven invoker fixes (proper handling of resources now), no more SO/OOMs
* enabled UTs in maven-cli (that revealed the issues)
* small bug fixes discovered in cli, improved executor to reveal maven version

---

https://issues.apache.org/jira/browse/MNG-8386
2024-11-22 15:09:32 +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
Tamas Cservenak a55accd518
CLIng+resident: logging subsystem still needs an update (#1931)
As part of capsule creation, capsule logging setup happened as well
but it got "stuck" on very first invocation and never updated.
2024-11-21 14:38:51 +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
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 a67d2746af
[MNG-8375] CLIng diet (#1897)
First part was to "reverse" MavenCli into CLIng, that also became a huge and complex beast. Now, sanitization comes, tearing down unneeded stuff. CLIng should be simple and straightforward.

Now the **invoker** fully parses args, creates Maven instance (ie. local, using Maven components on classpath) and invokes Maven. The new **executor** in turn does NOT fully parses args and is logical equivalent of maven-invoker.

Changes:
* radically simplify CLIng existing classes (and especially API - the fact we have "local", "resident" etc invoker is actually implementation detail).
* introduce "executor", a "lower level" tool that does not parse args (and is logical equivalent of maven-invoker) and support Maven 4.x and Maven 3.x.

---

https://issues.apache.org/jira/browse/MNG-8375
2024-11-13 15:14:56 +01:00
Tamas Cservenak 4f79f2d876
[MNG-8332] Detach CLIng from deprecated Embedder (#1882)
Detach maven-cli from maven-embedder (deprecated). Basically, classes are copied from embedder to cli, while embedder points to old classes and cli to new classes. **One important exception is logging**: the classes are _moved_ to cli, and embedder modified to use those classes (and dependency reversed: embedder now depends on cli). Reason is Verifier, that still calls into "hack method" of deprecated MavenCli, and then without logging classes move would explode due casting.

---

https://issues.apache.org/jira/browse/MNG-8332
2024-11-08 09:49:11 +01:00
Tamas Cservenak 457bb8e000
CLIng: finish TODO (#1888)
Also clear up javadoc.
2024-11-07 17:41:13 +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 62c94d123c
[MNG-8368] Fix dependency resolver not using project repositories (#1865) 2024-11-05 17:01:08 +01:00