Commit Graph

199 Commits

Author SHA1 Message Date
Guillaume Nodet 69b34f4f3c
[MNG-8322] Use the new ToolchainsBuilder and SettingsBuilder (#1778) 2024-10-17 11:25:53 +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 1cff5947ac
Revert "Make rootDirectory really mandatory" (#1800)
This reverts commit 608a99fb08.

---

https://issues.apache.org/jira/browse/MNG-8302
2024-10-16 16:22:26 +02:00
Guillaume Nodet 0d04bb9a21
[MNG-8041] Move PathScope into the dependency collection request (#1807)
JIRA issue: [MNG-8041](https://issues.apache.org/jira/browse/MNG-8041)
IT PR: https://github.com/apache/maven-integration-testing/pull/390
2024-10-16 16:15:37 +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
Guillaume Nodet fee69f2f89
[MNG-8294] Consistency checks when loading parent (#1784) 2024-10-09 13:07:31 +02:00
Tamas Cservenak 445236398d
Make rootDirectory mandatory (#1787)
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-10-08 21:45:28 +02:00
Guillaume Nodet 6c8b808760
[MNG-5910] Warn if both exists and missing file activation are set (#1773) 2024-10-08 15:46:42 +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
Guillaume Nodet f6417e4944 [MNG-8281] Interpolator service 2024-10-02 23:26:05 +02:00
Guillaume Nodet 5c981cdef0 Add serialVersionUID to API exceptions 2024-10-02 23:26:05 +02:00
Guillaume Nodet 2d224623a3
[MNG-8120] Refactor ModelBuilder and ProjectBuilder (#1700)
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.
2024-09-28 11:03:24 +02:00
Tamas Cservenak 034ef155da
[MNG-8263] Remove last remnants of wrapper integration (#1736)
Last two bits to be removed:
* wrapper lifecycle
* exploded scripts

---

https://issues.apache.org/jira/browse/MNG-8263
2024-09-24 09:54:24 +02:00
Tamas Cservenak 368ddec0e4
[MNG-8233] Client should handle modelIds as "opaque" (#1701)
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
2024-09-19 19:38:41 +02:00
Guillaume Nodet 8d9f8da444
[MNG-8239] Add missing ModelCacheFactory (#1728) 2024-09-18 13:42:07 +02:00
Guillaume Nodet 30f52651a7 [MNG-8249] Fix annotation processor to correctly handle inner-inner classes 2024-09-16 08:25:19 +02:00
Guillaume Nodet 2b13a43c09
[MNG-8235] Move remote repositories into requests (#1712) 2024-09-12 08:19:14 +02:00
Guillaume Nodet 85f5dca4a6
[MNG-8234] Revert the addition of the priority tag (#1711) 2024-09-12 08:18:35 +02:00
Guillaume Nodet 625b4561f0
[MNG-8232] Introduce ModelTransformer (#1702) 2024-09-12 08:15:53 +02:00
Guillaume Nodet bcd5d9c9f9
DI improvements (#1717)
* Code cleanup
* Provide build path with causes when an exception occur
* Fix toString to display meaningful info
* Javadoc
* Add @NonNull and @Overrides annotations
* Support for @Nullable on fields and parameters
2024-09-12 08:14:46 +02:00
Guillaume Nodet f137c13877
[MNG-8190] Restrict build pom feature to 4.1.0 model version (#1707) 2024-09-11 18:31:06 +02:00
Guillaume Nodet bb99857f34 Enhance DiIndexProcessor
Sort and *update* the file (in case of a partial build)
2024-09-10 22:18:44 +02:00
Guillaume Nodet 8a61f7d20a
[MNG-8249] Provide an annotation processor for DI (#1704) 2024-09-10 19:18:47 +02:00
Tamas Cservenak a98d530e33 [maven-release-plugin] prepare for next development iteration 2024-08-30 14:59:00 +02:00
Tamas Cservenak 697c543b4e [maven-release-plugin] prepare release maven-4.0.0-beta-4 2024-08-30 14:58:34 +02:00
Guillaume Nodet b370e5e929
[MNG-8210] Replace Maven "module" term by "subproject" (#1651)
Co-authored-by: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
2024-08-29 20:21:40 +02:00
Guillaume Nodet e11b475e8b
[MNG-8052] Concurrently lifecycle executor (#1429) 2024-08-29 19:44:53 +02:00
Guillaume Nodet c948b26484
[MNG-8218] Always normalize Path in PathSource (#1684) 2024-08-29 19:44:16 +02:00
Guillaume Nodet acec540547
[MNG-8052] New lifecycle for Maven 4 (#1448) 2024-08-29 06:48:54 +01:00
Guillaume Nodet 30dc81227b
Renaming of `ArtifactCoordinate.getVersion()` + documentation (#1662)
* 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>
2024-08-27 23:13:34 +02:00
Konrad Windszus 7306c41b49
[MNG-8214] Improve model velocity template to support subclasses (#1660)
Make the constructors protected and take the Builder as argument
2024-08-27 09:05:43 +02:00
Guillaume Nodet 78887f1b7e
[MNG-8181] Provide a variable for maven central repo url, backed by an environment variable (#1615) 2024-08-26 18:21:28 +02:00
Guillaume Nodet 9bfaf54e90
Document that V4 mojo are supposed to be threadsafe (#1675) 2024-08-26 15:14:03 +02:00
Guillaume Nodet 6ac914d6f9
[MNG-7914] Provide a single entry point for configuration (#1595)
* [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
2024-08-22 16:47:43 +02:00
Guillaume Nodet 7e550efae0
[MNG-8215] Add location tracking for toolchains (#1608) 2024-08-16 23:04:46 +02:00
Konrad Windszus e335f95dfd
documentation: Fix parameter description 2024-08-16 16:16:22 +02:00
Martin Desruisseaux 008d0b4d5b
Add `getModuleName(Path)` and `getModuleDescription(Path)` methods in `DependencyResolverResult`. (#1625)
Those methods are helpful for plugins that need to provide `--add-reads` and similar options,
as they allow to reuse the cached values instead of decoding `module-info.class` many times.
2024-08-16 11:19:34 +02:00
Jan-Jelle Kester 5b61e95f23
[MNG-7344] Track dependencyManagement import location in effective Model for MPH-183 (#603)
Co-authored-by: Maarten Mulders <mthmulders@apache.org>
Co-authored-by: Juul Hobert <juul.hobert@infosupport.com>
Co-authored-by: Giovanni van der Schelde <gvdschelde@gmail.com>
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-08-15 15:24:49 +02:00
Konrad Windszus 1ee18d36ce
[MPLUGIN-530] Deprecate requirements in plugin descriptor 1.1.0 (#1638)
The replacement for v4 plugins should be Maven DI annotations while for
v3 plugins it is JSR 330 annotations
2024-08-15 14:07:47 +02:00
Guillaume Nodet 4369fa8dff
[API] Expose InputLocation formatter in the XmlFactory (#1616) 2024-08-11 00:21:50 +02:00
Martin Desruisseaux 473b5374f0
[MNG-8197] Use default classifier when Eclipse Aether specifies none (#1621)
* Use default classifier when Eclipse Aether specifies none.
The important change in this commit is in the implementation of `getClassifier()` methods.
However, this commit opportunistically refactors the code with a base class shared by `DefaultDependency` and `DefaultDependencyCoordinate` implementations.

* Preserve the type declared in the dependency (e.g. "modular-jar") when wrapping the object from Maven model.
2024-08-11 00:20:04 +02:00
Slawomir Jaranowski d35864e348 [MNG-8179] Upgrade Parent to 43 2024-07-10 22:52:34 +02:00
Guillaume Nodet fd8f99ed90
Fix Maven 4 extensions (#1601)
* 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
2024-07-09 14:10:26 +02:00
Guillaume Nodet b852f74084 [MNG-8134] Add a @Resolution annotation to mojos to inject project dependencies collection / resolution result 2024-06-11 09:23:04 +02:00
Guillaume Nodet 8d483f922b [MNG-8152] Implement @SessionScoped and @MojoExecutionScoped from the DI API 2024-06-11 09:23:04 +02:00
Guillaume Nodet 5d139bdd12 [MNG-8151] Merge DependencyCollector into DependencyResolver 2024-06-11 09:23:04 +02:00