Commit Graph

3455 Commits

Author SHA1 Message Date
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
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 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
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
Slawomir Jaranowski 2a188e75a1 [MNG-7896] Upgrade Junit from 5.9.1 to 5.10.0 2023-09-24 22:16:12 +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
Guillaume Nodet dd2f1214d6
[MNG-7891] Support configuration for extensions (#1252) 2023-09-22 09:14:56 +02:00
Guillaume Nodet aefa9599fb
Avoid usage of XmlStreamReader (#1256) 2023-09-22 09:03:47 +02:00
Guillaume Nodet eb20034763 Simplify ReactorModelPool and use a concurrent map 2023-09-22 08:34:51 +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 1865c9c6fd Fix bad version in test poms 2023-09-22 08:34:51 +02:00
Guillaume Nodet d5a8e33617 Make DefaultModelBuildingListener#project field final 2023-09-22 08:34:51 +02:00
Guillaume Nodet fd4493580a
[MNG-7820] Get rid of plexus-utils introspection classes (#1251) 2023-09-22 08:02:25 +02:00
Guillaume Nodet e91cee9a2d
[MNG-7820] Get rid of plexus-utils DAG class (#1250) 2023-09-22 08:02:04 +02:00
Guillaume Nodet 0c37cff681
[MNG-7820] Get rid of plexus-utils Os class (#1249) 2023-09-22 08:01:36 +02:00
Guillaume Nodet 1eae6684e3
[MNG-7881] Expose the rootDirectory for model processing (#1245) 2023-09-19 16:31:35 +02:00
Guillaume Nodet 34b0591f03
[MNG-7820] Remove dependency on plexus-utils StringUtils / FileUtils (#1243)
Co-authored-by: crazyhzm <crazyhzm@apache.org>
2023-09-14 13:48:15 +02:00
Slawomir Jaranowski ce8fc3a31c [MNG-7878] Extend test for ConsumerPom and modules in plugin configuration 2023-09-14 09:51:37 +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 46fd5e9586
Add ModelLocator#locateExistingPom to abstract a bit more (#1237) 2023-09-11 18:15:00 +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 0b3246381d
Remove useless @author tags (#1226)
This information is usually more accurately given by the GIT history
2023-09-06 10:39:32 +02:00
Guillaume Nodet 06938249a7
[MNG-7792] Use a standalone asm version (#1126) 2023-09-05 23:09:03 +02:00
Guillaume Nodet 64b32c0bb4
[MNG-7871] Fix location tracking (#1222) 2023-09-05 18:06:44 +02:00
Guillaume Nodet 98ec2eb1c8
[MNG-7861] Remove artifacts which should be kept hidden (#1221) 2023-09-01 22:26:41 +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
Tamas Cservenak 059e3c5914
Fix dependabot alerts (#1214)
(that are not applicable, but look ugly).

These tests are NOT built, but are taken from real projects
several years ago, and used in POM related UTs.

Hence, for example update of velocity is completely okay,
even if in "real life" it would not compile.
2023-08-03 11:29:10 +02:00
Tamas Cservenak 36db1e35ca
[MNG-7846] Break out of endless loop (#1206)
This is most probably "just" about broken Throwable implementations.
Some override getCause but does not perform checks to what it was inited
as "this" means "not yet inited" actually.

---

https://issues.apache.org/jira/browse/MNG-7846
2023-07-19 17:37:28 +02:00
Guillaume Nodet 9b12ccdeb0
Rename Type#getName() to getId() and improve javadoc (#1198) 2023-07-06 09:20:03 +02:00
Guillaume Nodet 8f45d51bd6 Prefer using String.isEmpty over String.length()>0 2023-07-04 08:36:08 +02:00
Guillaume Nodet 08979553f2 Prefer Files.newInputStream 2023-07-04 08:36:08 +02:00
Guillaume Nodet e39142b77a
[MNG-7830] Switch from plexus-xml to stax / woodstox (#1185) 2023-06-29 12:03:50 +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 dbfcfd5eb3
[MNG-7228] MavenProject.getOriginalModel returns interpolated parts (#1183) 2023-06-24 10:51:08 +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
Tamas Cservenak 764a9ca0be [MNG-7823] Improve plugin validation level parsing (#1182)
Changes:
* always parse it at session start
* hence, will WARN if needed there as well, and will warn once
* do not re-parse and possibly warn always, reuse parsed enum

---

https://issues.apache.org/jira/browse/MNG-7823
2023-06-23 13:05:57 +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
Karl Heinz Marbaise 5ebbb8ff50
[MNG-7764] Small code improvements (#1088) 2023-06-16 10:54:09 +02:00
Slawomir Jaranowski 09e58d188c [MNG-7811] Plugins verification - reporting improvements
cherry-pick e625606588
2023-06-16 09:47:44 +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 967d8fc19c
[MNG-7794][MNG-7809] Deprecate RepositorySystem and make maven-compat optional (#1150)
* Move maven-compat to jsr330
* Remove more ties to RepositorySystem
* Move more stuff to maven-compat
* Move PluginManager and LocalRepositoryNotAccessibleException to maven-compat
* Fix tests
* Break circular dependency loop in components
* Move unused deprecated classes
2023-06-15 16:24:56 +02:00
Tamas Cservenak 4f8648af7b
[MNG-7790] Update lifecycle plugins, take 2 (#1163)
Changes:
* war 3.3.3 -> 3.4.0

---

https://issues.apache.org/jira/browse/MNG-7790
2023-06-15 14:09:06 +02:00
Hervé Boutemy 6ee2c5c442 [MNG-5987] document goals execution order
fixes #1145
2023-06-14 07:48:39 +02:00
Guillaume Nodet 898e4e4b3c
Simplify code (#1156) 2023-06-13 22:45:33 +02:00
Slawomir Jaranowski 973b1b9684 [MNG-7806] Plugins verification - remove used in module(s) report
cherry-pick: 3135553e2d
2023-06-13 21:22:42 +02:00
Guillaume Nodet 56ee6a878d
[MNG-7751] Provide a way to inject XmlNode into plugins (#1071) 2023-06-12 21:39:23 +02:00
Tamas Cservenak be3625d190
[MNG-7790] Update lifecycle plugins (#1154)
Changes:
install: 3.1.0 -> 3.1.1
deploy: 3.1.0 -> 3.1.1
resources: 3.3.0 -> 3.3.1
compiler: 3.10.1 -> 3.11.0
surefire: 3.0.0 -> 3.1.2
plugin: 3.7.0 -> 3.9.0
wrapper: 3.1.1 -> 3.2.0

---

https://issues.apache.org/jira/browse/MNG-7790
2023-06-12 11:18:02 +02:00
Guillaume Nodet c79a7a0272
[MNG-7740] Remove old temporary consumer*pom files from buildDir (#1117)
Co-authored-by: Giovanni van der Schelde <Giovanni.vanderSchelde@infosupport.com>
2023-06-05 10:47:13 +02:00
Guillaume Nodet e08c95a673
[MNG-7655] Switch to plexus-utils / plexus-xml 4 (#1093) 2023-06-04 21:03:41 +02:00
Guillaume Nodet b2953c52d5
[MNG-7795] IllegalArgumentException: 'other' has different root during plugin validation (#1133)
Checks the paths before relativizing them.
Normalize and relative before adding to result
Rename local vars
Apply to ExecutionEventLogger

---

https://issues.apache.org/jira/browse/MNG-7795

Co-authored-by: Andreas Dangel <adangel@apache.org>
2023-06-01 19:05:48 +02:00
Tamas Cservenak b430e7d826 [MNG-7799] Plugin validation may falsely report there are issues (#1136)
But to show no issue, as locality to be shown is not same as reported
issues.

---

https://issues.apache.org/jira/browse/MNG-7799
2023-06-01 19:01:11 +02:00
Henning Schmiedehausen 8552ac3fea
[MNG-7797] Return BRIEF mode (#1132)
Make BRIEF a legal value again.

---

https://issues.apache.org/jira/browse/MNG-7797
2023-06-01 17:24:31 +02:00
Tamas Cservenak 46807790f6 [MNG-7791] Split validation issues by "locality" aspect (#1122)
Changes:
* introduce "internal" (to project) and "external" aspect
* make "inline" default as it was in 3.9.0 and 3.9.1
* remove "default" report level
* summary and verbose reports "internal only" or ALL issues

Example of outputs while building maven-3.8.x:
https://gist.github.com/cstamas/defd6a52939f5a277bf5fc669c01aedb

---

https://issues.apache.org/jira/browse/MNG-7791
2023-05-26 18:22:12 +02:00