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
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.
This was introduced with
https://github.com/eclipse-sisu/sisu.plexus/issues/51.
This leads to exceptions in case of issues with loading potential
extensions/plexus components instead of logging just with DEBUG level.
* Rename ArtifactCoordinate.getVersion() as getVersionConstraint().
* Introduce DownloadedArtifact, DownloadedDependency and ProducedArtifact.
* Rename coordinate -> coordinates.
* Add documentation on Artifact, ArtifactCoordinates, Dependency and DependencyCoordinates and other classes.
* Remove `LATEST` and `SNAPSHOT` from documentation since they are deprecated.
* Opportunistic addition of some missing `@Override` annotations.
---------
Co-authored-by: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
* [MNG-7914] Provide a single entry point for configuration
* [MNG-7914] Rename global -> installation
* [MNG-7914] Include time zone in Maven build timestamp
* [MNG-7914] Use a single place to document all maven properties
* Add rootDirectory to XmlReaderRequest and fix maven-core exported artifacts
* Set the thread context classloader to the container realm to fix class loading from extensions
* Javadoc cleanup and replacement of some `System.getProperty("...")` by more specific standard methods.
* Add Type.PROCESSOR, MODULAR_PROCESSOR and CLASSPATH_PROCESSOR.
* Modification of the path type API:
* Add a `warningForFilenameBasedAutomodules()` method in `DependencyResolverResult`.
* Add relationships from `JavaPathType` to `javax.tool` location API.
* Modify the `PathType.option(Iterable<? extends Path>)` return type
because the option and the value need to be two separated arguments.
* Fixes according some comments on the pull request.
Create _aether internal_ "extenders" components to serve several purposes:
* extender to meddle with exec request, for example to mediate between effective properties SPI (exec request extender)
* extender to meddle with prepped session and related bits, for example to move out deprecated code from session factory (session extender)
This PR implements M4 API SPI for contributing effective properties and exposes method for effective properties on `Session`.
* `Session` should expose properties service "ready" for interpolation, otherwise each interpolating code (plugin, etc) would need to construct the "effective" ones themselves, repeating same steps over and over again.
* SPI can contribute to user properties
* `Session` exposed properties are all immutable (sans effective, that is computed on each call).
* and lastly, a cleanup: all packages within `o.a.m.internal.aether` are now package protected, to tighten internal encapsulation. New core package `o.a.m.resolver` introduced that contains 2 publicly accessible classes.
---
https://issues.apache.org/jira/browse/MNG-8006https://issues.apache.org/jira/browse/MNG-8021
Maven4 seems sets but then drops/overrides some workspace readers. Partially due hazy borders who or what manages them, as role is split between session factory and session factory caller.
Changes:
* session factory does NOTHING re workspace readers, it becomes fully the caller duty
* two spots calling session factory (default maven, extension bootstrap) are now fully in charge to properly setup workspace readers
Co-authored-by: Jonas Rutishauser <jonas.rutishauser@alumni.ethz.ch>
---
https://issues.apache.org/jira/browse/MNG-8005
A wrapper listener that can receive events even from multiple threads, and passes them to wrapped delegate listener on single thread, keeping delegate implementation simple.
---
https://issues.apache.org/jira/browse/MNG-8007
This is an ongoing effort to confine Plexus, but also perform a bit of cleanup in Maven Core and around. No logic changes, just replacing Plexus with Lookup (that is a thin wrapper around it), and removing unused members, redundant checks, etc. Module maven-compat omitted on purpose.
---
https://issues.apache.org/jira/browse/MNG-7999
* [MNG-7963] Clean up the build
Changes:
* remove hamcrest 1.3 from scope
* set proc:none to prevent warnings (Sisu APT is on classpath),
we do not use annotation processing, we produce Sisu index
explicitly.
* remove some redundant elements from POMs
Remove all ordering from Maven and delegate it to Resolver.
Supersedes https://github.com/apache/maven/pull/1212
This PR makes Maven completely rely on Resolver to order artifacts on classpath (before this PR it was several spots where explicit ordering was applied without ability to affect it). This PR makes now Maven completely rely on Resolver, never "sort" artifacts on it's own, but use resolver result, that in turn depends on session config.
Example invocation:
```
$ mvn -X package -Daether.system.dependencyVisitor=levelOrder
```
Would make Maven use "levelOrder".
Example of default (preOrder, as before) and new levelOlder (new in 2.0): notice how tree is same, but resulting artifact list (and hence, order on classpath) is different:
https://gist.github.com/cstamas/c88ca550006e53edad5b16973b54c349
The new resolver configuration is documented here:
https://maven.apache.org/resolver-archives/resolver-2.0.0-alpha-3/configuration.html
(property No 62)
---
https://issues.apache.org/jira/browse/MNG-7953
* [MNG-7899] Various memory usage improvements
- BatchModeMavenTransferListener removed
- FileSizeFormat moved to top level class
- FileSizeFormat.formatProcess() refactored to accept an StringBuilder as argument
- FileSizeFormat refactored format() methods
- FileSizeFormat refactored, replace DecimalFormat with Math logic to
reduce memory allocation
---------
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
Multiple optimizations :
- renderLevel() method use static constants instead of rebuilding the strings on each call
- replace + operator usage with more PrintStream.print() calls to reduce temporary strings creation
- reduce usage of MessageBuilder.a() method usage with more PrintStream.print() calls to reduce temporary strings creation
- replace the builder() method with a static import
- replace String.format with a simple string concat to reduce memory allocation (garbage)
- change static constants to class member in MavenSimpleLogger
- add a setLength(int) method in MessageBuilder to enable reuse