Commit Graph

3526 Commits

Author SHA1 Message Date
Martin Desruisseaux 583667a869
[MNG-8015] Adjustments in new API related to PathType (#1501)
* 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.
2024-05-13 11:53:45 +02:00
Tamas Cservenak ba52bfe600
[MNG-8117] Maven PluginVersionResolver improvement (#1502)
Produces output like this:
https://gist.github.com/cstamas/3ca4bc6cea5f701054061871b5db3f35

---

https://issues.apache.org/jira/browse/MNG-8117
2024-05-09 22:17:59 +02:00
Guillaume Nodet 7451585a19
Fix reactor loading problems (#1497) 2024-05-03 10:48:38 +02:00
Guillaume Nodet febfd2b5c9
Resolver updates (#1495) 2024-05-02 18:33:18 +02:00
Guillaume Nodet 64e9447926
Fix consumer pom builder (#1491) 2024-05-02 17:10:38 +02:00
Guillaume Nodet 6fddd97513
Use the new resolver provider (#1483) 2024-04-25 16:13:36 +02:00
Tamas Cservenak 81e2b3c1ee
Make Maven 4.0.0 be beta-1 (#1484) 2024-04-25 10:48:58 +02:00
Guillaume Nodet 5d1cfd47f3 Cleanup dependencies 2024-04-25 07:46:50 +02:00
Slawomir Jaranowski d0f05ffccf
[MNG-8103] Upgrade default plugin bindings (#1475)
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-04-23 17:34:45 +02:00
Guillaume Nodet 52c5659b25
Fix nasty concurrency issue in AbstractSession (#1479)
* Register the session explicitely
* Fix thread interrupted
2024-04-23 14:55:57 +02:00
Jonas Rutishauser aae74dfbee
[MNG-8082] Exceptions of proxied SessionScoped components are not working correctly (#1449)
Signed-off-by: Jonas Rutishauser <jonas.rutishauser@alumni.ethz.ch>
2024-04-23 14:52:20 +02:00
Hervé Boutemy 860310b692 [MNG-8043] document new default types, replacing artifact handlers 2024-04-23 08:12:44 +02:00
Guillaume Nodet d075fe7e85 [MNG-8084] New model builder and resolver provider 2024-04-12 12:50:18 +02:00
Guillaume Nodet 9be08ccef8 [MNG-8084] Include lifecycle in the API 2024-04-12 12:50:18 +02:00
Guillaume Nodet 8418fb3960 Cache parent artifact resolution 2024-04-03 19:49:40 +02:00
Tamas Cservenak 2594047014
[MNG-8088] Using Resolver with MRESOLVER-512 (#1442)
This makes all the new scopes implemented out of the box, but MNG-8041 still stands (is unsolved).

Related PR https://github.com/apache/maven-resolver/pull/445

---

https://issues.apache.org/jira/browse/MRESOLVER-512
https://issues.apache.org/jira/browse/MNG-8088
2024-03-27 15:46:12 +01:00
Guillaume Nodet 003a5bc06d
[MNG-8084] Make the v4 api usable outside the Maven runtime (#1441) 2024-03-25 11:50:01 +01:00
Guillaume Nodet 52d453caf9
Complete Packaging in v4 api (#1451) 2024-03-25 10:56:37 +01:00
carrychair 267de063ee
remove repetitive words (#1436)
Signed-off-by: carrychair <linghuchong404@gmail.com>
2024-03-18 00:24:53 +00:00
Tamas Cservenak 33788fd7fc [maven-release-plugin] prepare for next development iteration 2024-03-06 20:57:04 +01:00
Tamas Cservenak 0a6a5617fe [maven-release-plugin] prepare release maven-4.0.0-alpha-13 2024-03-06 20:56:36 +01:00
Guillaume Nodet 9780ca1baf
[MNG-8015] Control the type of path where each dependency can be placed (#1401)
Co-authored-by: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
2024-03-01 18:18:13 +01:00
Guillaume Nodet a3e8da805c
Make LifecycleStarter pluggable (#1424) 2024-02-29 00:56:36 +01:00
Guillaume Nodet ce15193394
Fix concurrent cache access (#1425) 2024-02-29 00:31:49 +01:00
Guillaume Nodet 5307bcba09
Use SessionData to store ProjectIndex (#1423) 2024-02-29 00:31:09 +01:00
Guillaume Nodet 3c2f8ebdb7
Use v4 api to resolve project dependencies (#1409) 2024-02-29 00:30:57 +01:00
huazhongming ab6ec5bd74
[MNG-7976] Investigate MNG-6127 IT instability (#1422)
Signed-off-by: crazyhzm <crazyhzm@apache.org>
2024-02-28 15:46:36 +08:00
huazhongming 83949a7384
Use isEmpty instead of length (#1420)
Signed-off-by: crazyhzm <crazyhzm@apache.org>
2024-02-28 15:40:37 +08: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
Guillaume Nodet a31c145ae9
[MNG-8006] Switch property contributors to use a lazy lookup (#1419) 2024-02-20 16:38:09 +01:00
Hervé Boutemy 54c1b2f28a [MNG-8029] improve documentation about mirror settings 2024-02-17 19:40:11 +01:00
Slawomir Jaranowski 972b074656 [MNG-8039] Don't change resolved artifact by DefaultProjectBuilder 2024-02-15 23:17:05 +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 fd825f9b20 ArtifactManager should check for non null artifact early 2024-02-09 18:13:55 +01:00
Guillaume Nodet 07b256ae03 Use role hint when loading a v4 mojo 2024-02-09 18:13:55 +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 05fcfd4591 [DI] Fix constructor bindings, move discovery inside Injector, remove annotation processor 2024-02-09 18:13:31 +01:00
Slawomir Jaranowski c2ec76c6a7 [MNG-8045] Use DependencyGraphDumper instead of own implementation 2024-02-08 20:13:50 +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 20f7cfc361
[MNG-8026] Maven drives regarding scopes (#1392)
Maven should be fully in control regarding dependency scope definitions and their interpretations (and transformations). 
This PR makes following changes:
* no change in behaviour (all works as before), but
* maven codebase contains now all the code related to scopes
* no resolver code is in use that was deprecated (as it was wrong to have it in resolver), see issue [MRESOLVER-471](https://issues.apache.org/jira/browse/MRESOLVER-471)
* this also stops scope definitions duplication as well, they are now defined in one single project: Maven

---

https://issues.apache.org/jira/browse/MNG-8026
2024-01-25 14:58:24 +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
Guillaume Nodet b6a84fcac6
[MNG-8014] Fix multithreaded builder (#1386) 2024-01-22 18:27:48 +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
Tamas Cservenak 3f47580dcc
[MNG-8005] Fix workspace reader drop bug (#1385)
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
2024-01-18 12:51:16 +01:00
Guillaume Nodet e15170ba0e
[MNG-8014] Workaround for deadlocks in model building (#1376) 2024-01-15 13:14:56 +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 a952c9ee10
[MNG-7960] Artifact collection filtering (#1353)
Make Maven more friendly (and tunable) when ranges are being used. There new options are merely affecting range processing, allowing different narrowing strategies. Relies on latest Resolver alpha-6 features.

https://issues.apache.org/jira/browse/MNG-7960
2024-01-11 18:47:28 +01:00
Tamas Cservenak 5261ba9203
[MNG-7982] Switch to enable transitivity in depMgr used by Maven (#1357)
Resolver 2.0.0-alpha-6 introduced "transitive" switch to dependency Manager, make use of it.

---

https://issues.apache.org/jira/browse/MNG-7982
2024-01-11 17:55:21 +01:00
Tamas Cservenak c4ccba7bf9
[MNG-7994] Update to Resolver 2.0.0-alpha-6 (#1373)
Update to alpha-6. Also, move off from deprecated default ctor of def repo session in tests.

---

https://issues.apache.org/jira/browse/MNG-7994
2024-01-11 13:16:51 +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
Tamas Cservenak 2c06637fb4
[MNG-8001] Expose CoreRealm internally (#1369)
Expose internally (not for plugin API) CoreRealm.

---

https://issues.apache.org/jira/browse/MNG-8001
2024-01-10 13:53:42 +01:00
Tamas Cservenak 076b346c0c
[MNG-7998] Minor cleanup regarding "tasks" (#1366)
Just a minor cleanup regarding internals of "tasks".

---

https://issues.apache.org/jira/browse/MNG-7998
2024-01-09 21:57:17 +01:00
Guillaume Nodet 5baa2f4098
[MNG-7977] Fix reactor reader to not resolve any artifacts from projects being built outside the reactor (#1330) 2024-01-08 11:38:13 +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 732e3649e1
[MNG-7980] CLI switch to ignore transitive repositories. (#1354)
If set, Maven will ignore all remote repositories introduced by
transitive dependencies POM.

---

https://issues.apache.org/jira/browse/MNG-7980
2023-12-20 14:03:57 +01:00
Tamas Cservenak 00d243a92e
[MNG-7978] Decouple maven-artifact from maven-resolver-provider (#1352)
As it is actually not needed. This also "pulls in" all of VersionParser into model version parser, so Core implementation now 100% just delegates over there.

---

https://issues.apache.org/jira/browse/MNG-7978
2023-12-20 14:03:35 +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 8001c30b69
[MNG-7974] Upgrade to Resolver 2.0.0-alpha-5 Addendum (#1348)
There was a TODO in code that I missed.

---

https://issues.apache.org/jira/browse/MNG-7974
2023-12-18 13:00:26 +01:00
Tamas Cservenak a1fdd89745
[MNG-7974] Update Resolver 2.0.0-alpha-5 (#1337)
Update to Resolver alpha-5 and apply some cleanups.

Notable changes:
* update resolver to 2.0.0-alpha-5
* detach model-builder from maven-artifact (this is important)
* introduce model builder own VersionParser iface (implemented in resolver-provider)
* API VersionParser implementation reuses VersionParser from resolver-provider to implement the service
* various other cleanups, removal of old plexus, etc

---

https://issues.apache.org/jira/browse/MNG-7974
2023-12-18 12:03:17 +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
Tamas Cservenak 9cd232fc78
Up japicmp baseline (#1338)
From 3.8.7 to 3.8.8, but these two minors have binary incompatibilities (in ctor), so ignores updated as well.

---

https://issues.apache.org/jira/browse/MNG-7961
2023-12-13 16:20:22 +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 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 71eb6de7e5
Better internal helper methods (#1334) 2023-12-07 21:05:02 +01:00
Tamas Cservenak c4f62ff7c8
[MNG-7953] Classpath ordering delegated to Resolver (#1332)
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
2023-12-07 16:07:51 +01:00
Tamas Cservenak 2411c81a9b
Preparations for resolver alpha-3 (#1328)
Updates Maven to Resolver 2.0.0-alpha-3, that is mostly about renames and config changes. 

Related changes for ITs are here: https://github.com/apache/maven-integration-testing/pull/322

---

https://issues.apache.org/jira/browse/MNG-7946
https://issues.apache.org/jira/browse/MNG-7948
2023-12-06 15:08:35 +01:00
huazhongming 4af662f7b3
[MNG-7920] Fix usage of packaging BOM fails in maven-install-plugin (#1305)
Signed-off-by: crazyhzm <crazyhzm@apache.org>
2023-12-05 10:23:26 +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 69bc993b80
[MNG-7945] Fix profile settings being injected into consumer POM (#1323) 2023-11-28 18:17:10 +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
Tamas Cservenak e89b6fd53f
[MNG-7653] Integrate Resolver 2.x onSessionClose (#1301)
Implement onSessionClose and "resolver 2.x way for sessions"...

As digging happens in same area, some other "resolver configuration" issues resolved as well.

Important: contains a "hack" to fix issue in alpha-2, that is marked with TODO to remove once alpha-3+ used.

---

https://issues.apache.org/jira/browse/MNG-7653
https://issues.apache.org/jira/browse/MNG-7935
https://issues.apache.org/jira/browse/MNG-7936
2023-11-21 12:04:01 +01:00
Guillaume Nodet 143af9b085
Fix not closed ForkJoinPools (#1319) 2023-11-20 13:44:59 +01:00
Slawomir Jaranowski 644a15c323 [MNG-7939] Allow to exclude plugins from validation 2023-11-19 22:11:13 +01:00
Guillaume Nodet 3cebbf7a15
Remove usage of old StringTokenizer (#1306) 2023-11-17 16:50:51 +01:00
Guillaume Nodet d62113772e
Clean up dependencies versions (#1300) 2023-11-17 16:31:11 +01:00
Karl Heinz Marbaise 7cfdedefb6
[MNG-7929] - Upgrade Mockito to 5.7.0 2023-11-13 12:02:12 +01:00
Guillaume Nodet 4bd12915c9
[MNG-7662] Use proxies for session scoped beans (#950) 2023-11-09 14:34:11 +01:00
Tamas Cservenak e6d1b4c5de
[MNG-7909] Upgrade to Resolver 2.0.0-alpha-1 (#1282)
Upgrade to Resolver 2.0.0.

Changes:
* many UT code used `new DefaultRepositorySystem()` ctor that is gone (was present due SL only), replaced with mocks
* dropped MavenResolverModule Guice module (as AetherGuice module is gone as well)
* updated Resolver version to 2.0.0-alpha-1
* added jdk transport (that prevails apache on Java 11)
* rename of "native" into "apache", deprecate "native" name
* introduce "jdk" transport

---

https://issues.apache.org/jira/browse/MNG-7909
2023-11-07 16:06:40 +01:00
Guillaume Nodet 7fcdd32e87 [MNG-7615] Multithreaded project builder 2023-11-07 09:20:52 +01:00