Commit Graph

3078 Commits

Author SHA1 Message Date
Guillaume Nodet e15170ba0e
[MNG-8014] Workaround for deadlocks in model building (#1376) 2024-01-15 13:14:56 +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
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
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 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
Guillaume Nodet 2f6ec159fe [MNG-7615] Add a cycle detection to the transformer context 2023-11-07 09:20:52 +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 61f08f326d Fix build/consumer pom transformation wrt attached artifacts 2023-10-20 21:18:46 +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 92a82dcefd
[MNG-6437] Better support for path and uri in property interpolation (#812) 2023-10-17 19:55:08 +02:00
Guillaume Nodet 14d16064f6
Fix unneeded/wrong substring calls in expression evaluation and put back weak references in cache (#1258) 2023-09-27 09:28:31 +02:00
Guillaume Nodet 558dfc9c6e
[MNG-7880] Trim down consumer POM (#1247) 2023-09-26 08:51:42 +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 6bf55cfc11
[MNG-7879] Add a bom packaging (#1242)
The purpose of the BOM packaging is to more cleanly identity POM that will be consumed as BOM from POM that will be used as parents.  The BOMs can be turned into a consumer POM, whereas parents can not loose any information.
2023-09-22 12:53:44 +02:00
sebastien-doyon dec90acf24
[MNG-7866] Improvements to the logging API usage (technical debt) (#1220) 2023-09-22 11:07:17 +02:00
Guillaume Nodet 10487d7b5d
[MNG-7820] Get rid of plexus-utils (#1255) 2023-09-22 10:59:31 +02:00