Commit Graph

28 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 781d19d9f1
[MNG-8410] Rename maven-api-meta to maven-api-annotations (#1957) 2024-12-10 22:43:27 +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 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 903cf59b0b Add missing annotation 2024-11-13 17:00:46 +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 457bb8e000
CLIng: finish TODO (#1888)
Also clear up javadoc.
2024-11-07 17:41:13 +01:00
Guillaume Nodet 3425b4dd08
[MNG-8334] Fix output redirection (#1826) 2024-10-22 16:53:58 +02:00
Tamas Cservenak 4b9e350985 [maven-release-plugin] prepare for next development iteration 2024-10-19 20:11:20 +02:00
Tamas Cservenak 6e78fcf6f5 [maven-release-plugin] prepare release maven-4.0.0-beta-5 2024-10-19 20:10:56 +02:00
Tamas Cservenak 3ecf9124ca Revert "[maven-release-plugin] prepare release maven-4.0.0-beta-5"
This reverts commit d82ef1a372.
2024-10-19 20:08:03 +02:00
Tamas Cservenak 87912b6554 Revert "[maven-release-plugin] prepare for next development iteration"
This reverts commit f4eeca2472.
2024-10-19 20:07:37 +02:00
Tamas Cservenak f4eeca2472 [maven-release-plugin] prepare for next development iteration 2024-10-18 17:54:38 +02:00
Tamas Cservenak d82ef1a372 [maven-release-plugin] prepare release maven-4.0.0-beta-5 2024-10-18 17:54:23 +02:00
Tamas Cservenak 076c4dfeb7 Revert "[maven-release-plugin] prepare release maven-4.0.0-beta-5"
This reverts commit 2bcd571b56.
2024-10-18 17:05:06 +02:00
Tamas Cservenak ec2a8054c1 Revert "[maven-release-plugin] prepare for next development iteration"
This reverts commit 1813f06f86.
2024-10-18 17:04:56 +02:00
Tamas Cservenak 1813f06f86 [maven-release-plugin] prepare for next development iteration 2024-10-18 16:34:31 +02:00
Tamas Cservenak 2bcd571b56 [maven-release-plugin] prepare release maven-4.0.0-beta-5 2024-10-18 16:34:04 +02:00
Tamas Cservenak 95e59f2437
[MNG-8302] Warn when appropriate (#1810)
First, `rootDirectory` is nullable, CLIng code was not assuming this, fixed.
Second, emit the "no root found" warning ONLY when appropriate (when we have a POM in picture).

---

https://issues.apache.org/jira/browse/MNG-8302
2024-10-17 10:06:47 +02:00
Guillaume Nodet 740100b50c
[MNG-8309] Improve log infrastructure (first step toward multi-threading log view support) (#1792)
Move logging infrastructure to support multi threaded output from mvnd to maven.
Refactor a bit the terminal/log creation done by Cling.
2024-10-15 15:30:39 +02:00
Tamas Cservenak f5e54ca6fa
[MNG-8285] Implement mvnenc CLI tool (#1793)
Implements the `mvnenc` tool that is on par with Maven3 master password encryption functionality wise, but is _really secure_ unlike Maven3 conterpart. On the other hand, _is backward compatible if legacy config is setup_.

Implemented goals: `init`, `encrypt`, `decrypt`, `diag`. Also provides one extra "master source" based on Maven infra Prompter: console master password prompt.

---

https://issues.apache.org/jira/browse/MNG-8285
2024-10-14 21:57:22 +02:00
Tamas Cservenak 7df5b16f78
[MNG-8305] Fix MER showErrors setting (#1795)
---

https://issues.apache.org/jira/browse/MNG-8305
2024-10-14 19:33:06 +02:00
Tamas Cservenak 60ae468a2e
[MNG-8283] More mvnd related changes (#1775)
Changes:
* there is only one parser for "just maven", no need for 3
* aligned scopes (public) of local context for simplicity, we can fix visibility later
* allow custom guice modules (unused, may undo this)
* split logging setup in two steps: config and activate

---

https://issues.apache.org/jira/browse/MNG-8283
2024-10-04 17:33:25 +02:00
Tamas Cservenak 533790bb4a
[MNG-8283] Maven CLIng smaller bugfixes and improvements (#1772)
This PR adopts CLIng for use in mvnd, and adds several improvements to CLIng overall.

Major topics:
* ability to pass in per-request Lookup for customization
* makes parser request creation a bit friendlier
* removes a log of redundancy (same stuff copied over)
* ability to alter rootDirectory detection in parsers
* resident invoker bugfix
* adds UTs for 3 invoker implementations

---

https://issues.apache.org/jira/browse/MNG-8283
2024-10-04 14:23:10 +02:00
Tamas Cservenak ef9aea6b9c
[MNG-8283] Maven CLIng (#1750)
New CLI for Maven. Goals are reusability, extensibility and easier embeddability (a la mvnd). If you build this branch, you will end up with Maven distro that uses "new" `maven-cli:org.apache.maven.cling.MavenCling` class as entry point instead of "old" `maven-embedder:org.apache.maven.cli.MavenCli`.

First step is to make "pretty much equivalent" capable CLI as compared to "old", with some exceptions:
* "encryption" ops are gone, those should be in separate tool anyway
* "deprecated and unsupported" CLI options like `-llr` present ONLY to make Maven fail are gone (now Arg parser will fail).

Current state of affairs is messy, MavenCli mixes everything it can, contains interleaved logic for bootstrapping, arg parsing, default logic and executing Maven. First goal is to clean this up.

Commons CLI are also hidden in this PR, so is ClassWorlds. This basically opens up way to have "alternative" CLI arguments parsers as well.

Currently the "local" (CLI) flow is this:
```
arg[] -> localParser -> Request -> localInvoker -> maven runs (in situ)
```

But the point is if you "come up" somehow with a Request instance, one can also do just:
```
Request -> invoker -> maven runs (somewhere)
```

Local parser:
* parses CLI args
* infers the defaults
* creates Request object that contains all information needed to run Maven
* can be reused outside of CLI as well
* does NOT fiddle with Plexus, logging, etc.

Local invoker:
* accepts Request object
* deals with configuring env (logging, etc), creating DI container, and running Maven ONLY

There are some experiments ongoing as well, like `ForkedInvoker` is, but also `MavenTool`.

---

https://issues.apache.org/jira/browse/MNG-8283
2024-10-03 18:03:55 +02:00