Commit Graph

170 Commits

Author SHA1 Message Date
Guillaume Nodet 3c2f8ebdb7
Use v4 api to resolve project dependencies (#1409) 2024-02-29 00:30:57 +01:00
Tamas Cservenak cf438ca624
[MNG-8059] Paths everywhere (#1413)
Make execution flow never invoke path.toFile, at least what model-builder and maven-resolver-provider matters. Using new methods from Resolver 2 alpha8 and also adding in relevant maven bits, as half of the work was already done.

---

https://issues.apache.org/jira/browse/MNG-8059
2024-02-26 18:04:44 +01:00
Hervé Boutemy 54c1b2f28a [MNG-8029] improve documentation about mirror settings 2024-02-17 19:40:11 +01:00
Guillaume Nodet 0c529f830a
[MNG-8053] Profile activation by packaging in the POM (#1410) 2024-02-15 09:42:00 +01:00
Guillaume Nodet fc9a7d8da3 Add missing @Override annotations 2024-02-09 20:20:54 +01:00
Guillaume Nodet ef4b5737a2 [API] Use ProjectScope for accessing compile source roots and resources
# Conflicts:
#	api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectManager.java
2024-02-09 18:13:31 +01:00
Guillaume Nodet 3f271b8f1b [API] Add a PluginXmlFactory 2024-02-09 18:13:31 +01:00
Guillaume Nodet c88afd470f
Clean mdo schemas (#1365)
* fix namespace location
* remove unneeded CDATA
* code formatting
* use {@code xxx}
* generate location tracking classes
* add location tracking to toolchain model
* Fix javadoc
2024-02-07 22:28:01 +01:00
Guillaume Nodet c813320848
Remove empty dependency scope from the api (#1402) 2024-02-07 14:37:36 +01:00
Tamas Cservenak 76794c0237
[MNG-8043] Dependency properties should be provided by Maven (#1399)
Followup of MRESOLVER-484:
* move off deprecated resolver bits
* introduce non-deprecated replacements
* move existing to code to those new bits

---

https://issues.apache.org/jira/browse/MNG-8043
2024-02-07 10:51:56 +01:00
Guillaume Nodet a37cf3d37f
[MNG-7954] New dependency injection mechanism (#1393) 2024-02-05 10:45:47 +01:00
Tamas Cservenak 3f9fec2307
[MNG-8026] Maven drives regarding scopes (#1391)
Changes:
* new types for build path, path scope, dependency scope, language
* introduce "extensible enum" and provides registries, SPI providers, etc...
---------
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-02-05 10:42:51 +01:00
Guillaume Nodet 16fc54da7f
[MNG-8037] Restrict project to the entity being built and make it immutable (#1389)
* Make POM and basedir required on the project
* Remove the API to build projects from artifact coordinate
2024-01-31 00:39:19 +01:00
Tamas Cservenak f2595c83d9
[MNG-8023] New method + javadoc on Project (#1387)
Introduce new method that returns POM and project Artifact in sensible manner (so install or deploy and other does not need to figure out anything).

Also, javadoc the class.

---

https://issues.apache.org/jira/browse/MNG-8023
2024-01-23 13:06:56 +01:00
Tamas Cservenak 6afa4770cb
[MNG-8006] [MNG-8021] SPI to contribute properties and more (#1384)
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-8006
https://issues.apache.org/jira/browse/MNG-8021
2024-01-19 12:00:28 +01:00
Guillaume Nodet 0d046da6f1 [maven-release-plugin] prepare for next development iteration 2024-01-12 10:41:50 +01:00
Guillaume Nodet e627879aed [maven-release-plugin] prepare release maven-4.0.0-alpha-12 2024-01-12 10:41:41 +01:00
Guillaume Nodet 8ce99bdbf2 [maven-release-plugin] prepare for next development iteration 2024-01-12 09:24:56 +01:00
Guillaume Nodet aa7994890b [maven-release-plugin] prepare release maven-4.0.0-alpha-11 2024-01-12 09:24:48 +01:00
Tamas Cservenak cfa13f5cc7
[MNG-7999] Confine Plexus Container as much as possible (#1367)
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
2024-01-10 13:55:54 +01:00
Guillaume Nodet 33aec13b84
[MNG-7996] Remove experimental flag from build-consumer feature (#1364) 2024-01-09 14:04:57 +01:00
Guillaume Nodet 782e8679bf
[MNG-7995] Switch to JLine to provide line editing (#1279) 2024-01-08 11:37:09 +01:00
Tamas Cservenak 437f34f8dc
[MNG-7957] Checksum API (backed by Resolver) (#1359)
Expose checksumming API (backed by Resolver).

---

https://issues.apache.org/jira/browse/MNG-7957
2023-12-21 09:05:10 +01:00
Guillaume Nodet b4e78d7c43
[MNG-7985] Provide project access to modified resources / test-resources and to the executionProject (#1356) 2023-12-21 06:31:27 +01:00
Tamas Cservenak a381970609
[MNG-7969][MNG-7981] Add missing information on Maven 4 version api to fix an exception (#1355)
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2023-12-19 20:08:55 +01:00
Guillaume Nodet fe71f7d8aa [maven-release-plugin] prepare for next development iteration 2023-12-18 17:27:24 +01:00
Guillaume Nodet 89d3c0321d [maven-release-plugin] prepare release maven-4.0.0-alpha-10 2023-12-18 17:27:16 +01:00
Tamas Cservenak 6e192fbb54
[MNG-7972] Artifact coordinate out of "standard string" (#1347)
Expose ArtifactCoordinate creation out of standard string.

---

https://issues.apache.org/jira/browse/MNG-7972
2023-12-18 11:30:20 +01:00
Tamas Cservenak 84a48a8bf2
[MNG-7968] Expose Maven Version as Version (not String) (#1346)
Change existing API to expose Version instead of String.

---

https://issues.apache.org/jira/browse/MNG-7968
2023-12-18 10:56:08 +01:00
Guillaume Nodet eec44b4ace
[MNG-7971] Add Artifact#getBaseVersion (#1345) 2023-12-15 16:48:33 +01:00
Guillaume Nodet 2cccc0a476
[MNG-7966] Augment api to provide a Map<Dependency, Path> in the resolution result (#1343) 2023-12-15 07:34:19 +01:00
Tamas Cservenak a1fe9fc387
[MNG-7962] Return language to Type (#1341)
Returns the language property to Type

---

https://issues.apache.org/jira/browse/MNG-7962
2023-12-14 11:51:16 +01:00
Tamas Cservenak eee9514d3d
[MNG-7963] Clean up the build (#1340)
* [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
2023-12-13 23:19:20 +01:00
Guillaume Nodet bdafe22f01 [maven-release-plugin] prepare for next development iteration 2023-12-08 16:05:14 +01:00
Guillaume Nodet 8c116306b6 [maven-release-plugin] prepare release maven-4.0.0-alpha-9 2023-12-08 16:04:57 +01:00
Guillaume Nodet f2803ab5b7 Fix javadoc generation 2023-12-08 15:22:25 +01:00
Guillaume Nodet 2f91c7e9c6
Version resolver API (#1335) 2023-12-08 10:10:49 +01:00
Guillaume Nodet bd849b54ad
Dependency collection / resolution API (#1333) 2023-12-08 09:42:44 +01:00
Guillaume Nodet 23bca281fc
[MNG-7947] Plugin API (#1309)
* Add an InternalSession interface to avoid casting to the implementation in various places
* Upgrade to Guice 6.0.0 and add support for jakarta.inject annotations
* Maven 4 Plugin API
2023-12-05 09:11:33 +01:00
Guillaume Nodet 05fcf5b2d3
[MNG-6036] Add namespace to XmlNode (#1318) 2023-11-28 00:11:34 +01:00
Tamas Cservenak eee037e676
[MNG-7924] Better control over and better integration with Resolver (#1299)
Integrate better and obtain better control over Resolver. These changes did stem from "JPMS module experiment" and are considered improvement but does not implement any functionality related to JPMS module support.

Changes:
* Maven4 should stop "disconnected coexistence" of two type systems (ArtifactHandlers and Resolver ArtifactTypeRegistry), it should unify them.
* Maven4 Core should provide generic and extensible means to introduce new artifact types (fully in extension, and extension should get extended data via "roundtrip" in core/resolver)

---

https://issues.apache.org/jira/browse/MNG-7924
2023-11-27 20:18:14 +01:00
Guillaume Nodet 29e239000b
Add some love to the API (#1310) 2023-11-17 16:52:15 +01:00
Guillaume Nodet 4ddc4bf406
Use 4.0.99 as as intermediate model to keep 4.1.0 for the Maven 4.x model (#1297)
Also generates XSD for extensions 1.2.0 schema
2023-11-06 20:04:44 +01:00
Guillaume Nodet 3fc399318e [maven-release-plugin] prepare for next development iteration 2023-10-20 21:20:23 +02:00
Guillaume Nodet a2cbf4873a [maven-release-plugin] prepare release maven-4.0.0-alpha-8 2023-10-20 21:20:23 +02:00
sebastien-doyon d362690a82
[MNG-7899] Various memory usage improvements 5 (#1270)
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
2023-10-20 16:30:44 +02:00
Guillaume Nodet a734e2a336
Get rid of deprecated method in the v4 Session interface (#1292) 2023-10-20 07:54:44 +02:00
Guillaume Nodet f2df54723b
[MNG-7804] Ability to order plugin executions using the priority xml element (#1147) 2023-10-16 13:28:47 +02:00
Slawomir Jaranowski 5c2e671a06 [MNG-7895] Support ${project.basedir} in file profile activation 2023-09-26 19:50:21 +02:00
Guillaume Nodet 10fa5c713a
[MNG-7893] Allow versioning the superpom according to the model version (#1253) 2023-09-26 07:17:52 +02:00
Guillaume Nodet f24266eb64
[MNG-7836] Support alternative syntaxes for POMs (#1197)
The IT associated with this PR is using the Maven model to generate a hocon POM parser.  This requires the maven-api-model module to attach the POM as an artifact, and the maven.yml change so that the model is present in the local repository.
2023-09-22 09:25:10 +02:00
Guillaume Nodet dd2f1214d6
[MNG-7891] Support configuration for extensions (#1252) 2023-09-22 09:14:56 +02:00
Guillaume Nodet 59a8d90397 Add a o.a.maven.api.services.Source#resolve method 2023-09-22 08:34:51 +02:00
Guillaume Nodet c6380108b1
[MNG-7877] Attach the build POM and simplify build/consumer implementation (#1240)
.. at the cost of loosing xml formatting in the consumer POMs
2023-09-13 13:39:50 +02:00
Guillaume Nodet 45075233c7
[MNG-7876] Add model version analysis and downgrade (#1235) 2023-09-11 18:17:26 +02:00
Guillaume Nodet e71d2d7167
Improve o.a.m.api.services.Source interface (#1236) 2023-09-11 18:14:36 +02:00
Guillaume Nodet 7d6f90e8d0
Move Features to api (#1232) 2023-09-11 00:42:53 +02:00
Guillaume Nodet dde369b6fc [MNG-7810] Provide a SPI for the v4 api
# Conflicts:
#	maven-bom/pom.xml
2023-09-11 00:38:45 +02:00
Guillaume Nodet e2fc256118
Minor improvements to v4 api ToolchainsBuilder (#1234) 2023-09-11 00:37:22 +02:00
Guillaume Nodet 64b32c0bb4
[MNG-7871] Fix location tracking (#1222) 2023-09-05 18:06:44 +02:00
Guillaume Nodet 22ae75a304
[MNG-7843] Allow glob patterns in dependency exclusions (#1200) 2023-08-29 17:25:58 +02:00
huazhongming 7d66d19f8b
[MNG-7822] Add support for TRACE logging level (with style "bold,magenta") (#1215)
Signed-off-by: crazyhzm <crazyhzm@apache.org>
2023-08-25 17:51:43 +02:00
Guillaume Nodet f2593b97ef
[MNG-7862] The ModelLocator should always be used when locating pom.xml (#1217) 2023-08-23 21:25:14 +02:00
Guillaume Nodet c08b221264
[MNG-6401] Support interpolation of the proxy port in settings.xml (#1194)
Co-authored-by: Hervé Boutemy <hboutemy@apache.org>
Co-authored-by: Michael Osipov <michaelo@apache.org>
2023-08-23 10:17:47 +02:00
Guillaume Nodet e7feeb6ff0
Fix codestyle in model code snippets (#1203) 2023-08-22 08:10:39 +02:00
Guillaume Nodet 9b12ccdeb0
Rename Type#getName() to getId() and improve javadoc (#1198) 2023-07-06 09:20:03 +02:00
Guillaume Nodet 567df8dea8 Use correct order in javadoc 2023-07-04 08:36:08 +02:00
Guillaume Nodet 8f45d51bd6 Prefer using String.isEmpty over String.length()>0 2023-07-04 08:36:08 +02:00
Guillaume Nodet 5b540821f2 [maven-release-plugin] prepare for next development iteration 2023-06-24 10:52:55 +02:00
Guillaume Nodet bf699a388c [maven-release-plugin] prepare release maven-4.0.0-alpha-7 2023-06-24 10:52:47 +02:00
Guillaume Nodet a279289bc3 [maven-release-plugin] prepare for next development iteration 2023-06-23 15:08:35 +02:00
Guillaume Nodet a3f0f12fab [maven-release-plugin] prepare release maven-4.0.0-alpha-6 2023-06-23 15:08:27 +02:00
Guillaume Nodet 229b31b626
[MNG-4645] Move Central repo definition out of Maven's core so it can be more easily changed (#1139)
Co-authored-by: Christian Schulte <schulte@apache.org>
2023-06-19 17:04:04 +02:00
Guillaume Nodet 0a8491c329
[MNG-7814] Use location tracking for settings (#1164) 2023-06-19 12:39:14 +02:00
Guillaume Nodet e6303aae32
[MNG-5659] Provide project-specific settings located in ${session.rootdir}/.mvn/settings.xml by default (#1059) 2023-06-19 12:32:14 +02:00
Guillaume Nodet a2d435b74a
Get rid of maven-shared-utils (#1158)
Given maven-shared-utils is being deprecated (see MSHARED-1269), we need to remove its usage in maven.  Maven core only uses the logging/message related classes from maven-shared-utils, so this PR enhance the initial v4 api with the needed interfaces and move the jansi specific code into maven-embedder.
2023-06-15 16:51:32 +02:00
Guillaume Nodet 84e133df7c
[MNG-7585] Remove duplicate classes (#1135) 2023-06-02 13:58:35 +02:00
Guillaume Nodet a27086a6f5 Fix bad javadoc 2023-05-23 16:36:23 +02:00
Guillaume Nodet d826b575ac
[MNG-7784] Fix compatibility for SuperPomProvider (#1109) 2023-05-17 07:19:19 +02:00
Guillaume Nodet 2db7c85b64
[MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061)
This commit introduces three properties:

 * project.rootDirectory: the project's directory or parent directory containing a .mvn subdirectory or a pom.xml flagged with the root="true" attribute. If no such directory can be found, accessing the rootDirectory property will throw an IllegalStateException.

 * session.topDirectory : the directory of the topmost project being built, usually the current directory or the directory pointed at by the -f/--file command line argument. The topDirectory is similar to the executionRootDirectory property available on the session, but renamed to make it coherent with the new rootDirectory and to avoid using root in its name. The topDirectory property is computed by the CLI as the directory pointed at by the -f/--file command line argument, or the current directory if there's no such argument.

 * session.rootDirectory : the rootDirectory for the topDirectory project.

The topDirectory and rootDirectory properties are made available on the MavenSession / Session and deprecate the executionRootDirectory and multiModuleProjectDirectory properties. The rootDirectory should never change for a given project and is thus made available for profile activation and model interpolation (without the project. prefix, similar to basedir). The goal is also to make the rootDirectory property also available during command line arguments interpolation.

A root boolean attribute is also added to the model to indicate that the project is the root project. This attribute is only supported if the buildconsumer feature is active and removed before the pom is installed or deployed. It can be used as an alternative mechanism to the .mvn directory.
2023-04-20 12:58:12 +02:00
Karl Heinz Marbaise c49c4e0b18
[MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
Guillaume Nodet 2788849c37
Switch version to 4.0.0 for @since tags (#1068) 2023-03-23 06:29:39 +01:00
Guillaume Nodet 8052c720e7 [maven-release-plugin] prepare for next development iteration 2023-03-15 17:06:58 +01:00
Guillaume Nodet 26d10a4bf9 [maven-release-plugin] prepare release maven-4.0.0-alpha-5 2023-03-15 17:06:43 +01:00
Guillaume Nodet 9d851eea68
[MNG-7678] Settings (v3) and Settings.Builder() cannot unset a non-null field (#983) 2023-03-13 19:35:35 +01:00
Guillaume Nodet dc8ec4c973
Fix mutable api in PluginContainer (#1019) 2023-03-09 21:14:48 +01:00
Guillaume Nodet fbeefb85ab [maven-release-plugin] prepare for next development iteration 2023-01-27 16:33:47 +01:00
Guillaume Nodet 009cf4a721 [maven-release-plugin] prepare release maven-4.0.0-alpha-4 2023-01-27 16:33:38 +01:00
Guillaume Nodet f153ac134c
[MNG-7598] Fix compatibility issues with toolchains and settings (#971)
* Split the header on two lines
* Properly delegates equals/hashCode to the v4 models
* Introduce object tracking in settings / toolchains
* Get back to a single template for v3 models
* Switch settings / toolchains mergers to deep merge
* Fix binary compatibility with 3.x
2023-01-27 15:56:16 +01:00
Hervé Boutemy 74548dde8e
[MNG-7664] consolidate Velocity templates used to generate code from models (#949) 2023-01-20 00:38:51 +01:00
Guillaume Nodet fc2d94f077 [MNG-7652] switch to Modello Velocity (#944) 2023-01-04 13:57:45 +01:00
Hervé Boutemy a7399a4d52
[MNG-7652] switch to Modello Velocity (#944) 2023-01-03 22:08:35 +01:00
Guillaume Nodet a00a44f75b
[MNG-7660] Rename Dom to XmlNode in the v4 api (#946)
* Rename Dom to XmlNode and Xpp3Dom to XmlNodeImpl
* Use XmlNodeBuilder instead of DomBuilder
2023-01-03 16:52:23 +01:00
Hervé Boutemy fbdf109b34
[MNG-7571] add Maven API javadoc (#830) 2022-12-31 17:32:07 +01:00
Guillaume Nodet 8150c62749 [MNG-7650] Reformat 2022-12-26 16:12:32 +01:00
Piotrek Żygieło 8833330b00 [MNG-7645] Implement some #toString() methods
* Implement Developer#toString()
* Implement IssueManagement#toString()
* Implement License#toString()
* Implement Build#toString()
* Implement Organization#toString()
* Implement MailingList#toString()
* Implement Scm#toString()

This closes #933
2022-12-21 09:30:10 +01:00
Guillaume Nodet 0e82026f2a [maven-release-plugin] prepare for next development iteration 2022-12-12 11:37:35 +01:00
Guillaume Nodet 2ccf57baa5 [maven-release-plugin] prepare release maven-4.0.0-alpha-3 2022-12-12 11:36:07 +01:00
Guillaume Nodet 615390f6fc
[MNG-7596] Upgrade to plexus 3.5.0 (#866) 2022-12-01 22:07:30 +01:00
Tamas Cservenak f70b0019cc
[MNG-7607] Add M4 Transport API (#884)
Something simple to use and would reuse all the auth/proxy etc data from Maven. Intentionally super-trivial API.

If something more "serious" needed, plugin should probably roll it's own solution.

---

https://issues.apache.org/jira/browse/MNG-7607
2022-12-01 13:53:08 +01:00