It seems Maven is eager to get POM from rootDirectory to support
CI Friendly versions. This change makes it "best effort", as in
if there is no POM, just walk away.
---
https://issues.apache.org/jira/browse/MNG-8288
And move all logic out of invoke. Also, parser and other improvements, mostly adding "extension points" in form of overridable protected method.
---
https://issues.apache.org/jira/browse/MNG-8283
Parser must not (esp "partially") alter global state like
setting Java System Properties. If invoker wants, invoker
can set those (and cleanup).
---
https://issues.apache.org/jira/browse/MNG-8283
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
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
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
* Sus method that nullifies model
* Make it clear
* Same change in new API
* Fix the logic to return the old value when unchanged
---------
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
With the introduction of the build pom and raw -> build pom transformation, the construction of the effective poms in two steps become very problematic. Over the time, multiple caches have been added to the ProjectBuilder and ModelBuilder related classes which are often redundant.
This PR thus changes things and move the recursive construction of the models fully into the ModelBuilder in a single call. When building build poms, a first step is done by parsing the file models from the root, then building all needed effective models from those. All the inference can be cleanly done because the builder has all the file models ready. The result will be used by the ProjectBuilder to build the projects.
Just a simple PR to make properties file a "properties file"
as majority would expect. According to spec '=', ':', or white space
can be delimiter and this file IS valid, but still, users my
be surprised, or tools like IDEs may misinterpret this,
otherwise valid Java Properties File.
Javadoc states wrong things (about format of modelId, they are
paths in reality), but also these all are "implementation details".
Crafting modelIds to "walk" lineage is wrong, there is a dedicated
method that provide "opaque" key Strings in defined order to
do that. And client should not care (nor assume) anything
about format of the key String.
---
https://issues.apache.org/jira/browse/MNG-8233