197 Commits

Author SHA1 Message Date
Elliotte Rusty Harold
0710deb4fd
[MNG-8613] Copy edit dependency javadocs (#2143)
* Copy edit dependency javadocs
2025-03-05 14:29:21 +00:00
Guillaume Nodet
d80804c3b4 [maven-release-plugin] prepare for next development iteration 2025-03-05 10:43:59 +01:00
Guillaume Nodet
3952d00ce6 [maven-release-plugin] prepare release maven-4.0.0-rc-3 2025-03-05 10:43:59 +01:00
Guillaume Nodet
ce86116518
[MNG-8610] Add javadoc for all o.a.m.api packages (#2142) 2025-03-04 15:17:18 +01:00
Tamas Cservenak
ece5dbb422
[MNG-8601] Add type test-java-source type (#2136)
Similar to java-source type, but for tests sources.

---

https://issues.apache.org/jira/browse/MNG-8601
2025-03-03 12:22:29 +01:00
Guillaume Nodet
cd7db1cfbe
[MNG-8588] Add activated profiles to Project interface (#2132)
Co-authored-by: Giovanni van der Schelde <gvdschelde@gmail.com>
2025-02-27 12:07:03 +01:00
Tamas Cservenak
efae0a41f3
[MNG-8586] Expose Maven version segments as properties (#2116)
Expose version segments. Also add the properties to generated doco.

---

https://issues.apache.org/jira/browse/MNG-8586
2025-02-21 23:18:14 +01:00
Guillaume Nodet
5b77395cfd
[MNG-8558] Switch toolchain support for v4 API (#2084) 2025-02-11 13:33:57 +01:00
Tamas Cservenak
edd246c3a5
[MNG-8517] Cleanup dependencies (#2098)
Fix inter-module connections.

---

https://issues.apache.org/jira/browse/MNG-8517
2025-02-10 16:02:53 +01:00
Tamas Cservenak
2766d24fda
[MNG-8573] Introduce OS Service (#2099)
And move the OS static helper to util, is not profile specific.
This service is meant primarily for plugins and extensions.
Is intentionally minimalistic, in case of new requirements, we can extend it.

---

https://issues.apache.org/jira/browse/MNG-8573
2025-02-10 15:12:18 +01:00
Tamas Cservenak
fa6a873a68
[MNG-8535] Full std stream support for executor (#2082)
The std stream support was incomplete in maven-executor. Also some unrelated fixes.

---

https://issues.apache.org/jira/browse/MNG-8535
2025-02-08 17:25:25 +01:00
Guillaume Nodet
3fde7657f5 [MNG-8540] Add a real caching API and add missing infos to ArtifactResolverResult 2025-02-07 01:45:02 +01:00
Guillaume Nodet
c8e2af96a3 [MNG-8540] Add equals/hashCode to requests 2025-02-07 01:45:02 +01:00
Guillaume Nodet
c61b255b16
ProjectManager cleanup (#2073) 2025-01-31 00:29:13 +01:00
Martin Desruisseaux
7b4a4bf759
[MNG-8395] Redirect the <sourceDirectory> element to <Source> (#2061)
* Include the list of <Source> elements in the path translation.

* Add a `SourceRoot` interface for the properties declared in the POM's `<Source>` element.
The API use method names without `get` prefix in anticipation for possible use of records in the future.

In the `MavenProject` class, the `compileSourceRoots`, `testCompileSourceRoots` and `scriptSourceRoots`
fields are replaced by redirections to the new `sources` field with paths wrapped in `SourceRoot` objects.
The getters and setters methods for the previous fields are deprecated.
This commit contains other opportunistic deprecations on methods working with deprecated interfaces.

In the POM file, the above-cited properties are ignored if a corresponding `<Source>` element exists.
This rule exits because Maven sets default values to those fields, which can interfer with user's setting.

* Deprecate POM elements that are replaced by <Source> elements.

* Add @Deprecated annotation on model elements flagged as @deprecated in the documentation.

* Update `ProjectManager` API using `SourceRoot`:

- Add `addSourceRoot(Project, …)` methods.
- Add `getSourceRoots()` and `getEnabledSourceRoots(ProjectScope, Language)`.
- Remove `get/addResource(Project, …)` methods.
- Remove `get/addCompileSourceRoots(Project, …)` methods.

---------

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2025-01-30 13:22:39 +01:00
Tamas Cservenak
7f4c24ca17
[MNG-8545] More repository handling fixes (#2067)
Multiple fixes:
* cling does not override repositories properly at bootstrap
* Source problems caused cache misses

---

https://issues.apache.org/jira/browse/MNG-8545
2025-01-29 10:46:53 +01:00
Christoph Läubrich
74c950b750
[MNG-8541] Support throwing Exception from Mojo#execute (#2066)
Co-authored-by: Christoph Läubrich <christoph@laeubi-soft.de>
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2025-01-29 09:21:00 +01:00
Guillaume Nodet
2155d9f0c2
[MNG-8519] Introduce Request / Results / RequestTrace (#2050) 2025-01-29 09:17:07 +01:00
Guillaume Nodet
21121d8f6c
[MNG-8503] Configure logging using maven.logger.* properties rather than org.slf4j.simpleLogger.* (#2048) 2025-01-27 15:09:46 +01:00
Guillaume Nodet
aeec37f8e7
[MNG-8478] Fix formatting of timestamp in logger (#2046) 2025-01-15 07:28:29 +01:00
Guillaume Nodet
81b7565c20 [MNG-8484] Use List.copyOf to make a defensive immutable copy of the input collection 2025-01-13 20:22:00 +01:00
Guillaume Nodet
f5a407cf79 [MNG-8515] Use specialized methods
* UnaryOperator<String> instead of Function<String, String>
* BinaryOperator<String> instead of BiFunction<String, String, String>
2025-01-13 17:14:35 +01:00
Guillaume Nodet
28f6047464
[MNG-8514] Improve VersionRangeResolverResult (#2039) 2025-01-13 15:49:18 +01:00
Elliotte Rusty Harold
03cca08d8d
[MNG-8483] Prefer Objects.requireNonNull (#2019)
* Prefer Objects.requireNonNull
2025-01-10 17:14:24 +00:00
Nils Breunese
a1f4955dda
[MNG-8482] Use instanceof assignments to get rid of casting expressions (#2018)
Co-authored-by: Nils Breunese <nbreunese@bol.com>
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2025-01-10 09:42:00 +01:00
Elliotte Rusty Harold
99452bb868
Fix comparisons against null in PathSource.equals (#2026)
* Fix comparisons against null
2025-01-08 15:51:49 +00:00
Elliotte Rusty Harold
b99eac7246
Copy edits in comments, API doc, and messages (#2020)
* Copy edits
2025-01-07 12:02:00 +00:00
Tamas Cservenak
0222aff6c9
[MNG-8447] Lossy ProblemCollector (#1994)
Historically (from Maven3) "problem collection" (in various scenarios, like building effective settings and toolchains, to building models) were done by passing around `List<Problem>` structure. This proved quite ineffective, as in case of (really) huge projects with quite big count of problems reported choked Maven (but also produced unusable output). We are aware of projects producing 3 million warnings! Dumping all of them onto console/log makes really no sense.

This PR changes Maven that by default it reports "problems" (settings building, toolchains building, or model building) as one liner warnings: how much and where were problems collected. This produces much more less overwhelming output than happens on master. User can control "build errors" using `-e`, so `mvn -e` will dump errors on screen/log.

The new `org.apache.maven.api.services.ProblemCollector<P>` class, that is somewhat "drop in" replacement for `List`, but with huge difference: it is "lossy", in a way, it maintains counters precisely, but actual problem instances are simply dropped after threshold `maven.builder.maxProblems` is surpassed (default 100). See `org.apache.maven.api.Constants#MAVEN_BUILDER_MAX_PROBLEMS`.

Rules:
* on problem addition counters are always updated
* if below threshold, store the problem (and will be reported later to the user)
* if above threshold, try to drop one problem with severity lower than currently reported problem, if succeeded, store the current problem, otherwise drop it

---

https://issues.apache.org/jira/browse/MNG-8447
2024-12-19 15:50:21 +01:00
Guillaume Nodet
8a69678007
[MNG-8446] Project cannot start due to too many warnings (#1993)
JIRA issue: [MNG-8446](https://issues.apache.org/jira/browse/MNG-8446)

This will help (but is not sufficient) to make [camel-quarkus](https://github.com/apache/camel-quarkus) buildable with maven 4.x.

---

https://issues.apache.org/jira/browse/MNG-8446
2024-12-17 18:44:55 +01:00
Guillaume Nodet
4714483009 [maven-release-plugin] prepare for next development iteration 2024-12-14 00:22:29 +01:00
Guillaume Nodet
273314404f [maven-release-plugin] prepare release maven-4.0.0-rc-2 2024-12-14 00:22:18 +01:00
Guillaume Nodet
5d449f9a24
[MNG-8244] Using before:all / all / after:all is not triggered (#1973) 2024-12-14 00:04:37 +01:00
Tamas Cservenak
5897cfe68d
[MNG-8430] Resolver 2.0.5 (#1975)
* [MNG-8430] Resolver 2.0.5

Prepare for Resolver 2.0.5

---

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

* Switch to staged release

---------

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2024-12-14 00:01:58 +01:00
Guillaume Nodet
a85ec9ffcc
Add missing package infos (#1980) 2024-12-13 16:40:20 +01:00
Tamas Cservenak
50aecc7432
[MNG-8419][MNG-8424] Too aggressive warning for pre-Maven4 passwords (#1970)
Toned down the Maven4 sec dispatcher messages. Also, IF maven3 passwords detected AND there was `.mvn/extensions.xml` the warnings were doubled.

Examples:

Failure to start Maven (due non-decryptable passwords):
```
$ mvn clean
[ERROR] Error executing Maven.
[ERROR] Error building settings
 * FATAL: Could not decrypt password (fix the corrupted password or remove it, if unused) {xL6L/HbmrY++sNkphnq3fguYepTpM04WlIXb8nB1pk=}
 * WARNING: Detected 2 pre-Maven 4 legacy encrypted password(s) - configure password encryption with the help of mvnenc for increased security.
$
```

Warning at start (due Maven3 passwords):
```
$ mvn clean
[INFO]
[INFO] Some problems were encountered while building the effective settings (use -X to see details)
[INFO]
[INFO] Scanning for projects...
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Apache Maven
...
```

---

https://issues.apache.org/jira/browse/MNG-8424
https://issues.apache.org/jira/browse/MNG-8419
2024-12-12 17:43:08 +01:00
Guillaume Nodet
54ffc5014e
[MNG-5729] Use monotonic time measurements (#1965) 2024-12-12 12:02:17 +01:00
Guillaume Nodet
9c77221cbc
[MNG-8393] Enable consumer pom by default for 4.1.0 model version only (#1963) 2024-12-12 09:07:12 +01:00
Guillaume Nodet
781d19d9f1
[MNG-8410] Rename maven-api-meta to maven-api-annotations (#1957) 2024-12-10 22:43:27 +01:00
Guillaume Nodet
1b5b5c8f9e
[MNG-8415] Add constant for the security settings xml file (#1956)
* Add a constant for the security settings file
* Avoid usage of system properties by using the ProtoSession
* Regen
2024-12-09 13:19:44 +01:00
Tamas Cservenak
9238d2ffeb [maven-release-plugin] prepare for next development iteration 2024-11-25 11:57:49 +01:00
Tamas Cservenak
d81b1b6a28 [maven-release-plugin] prepare release maven-4.0.0-rc-1 2024-11-25 11:57:24 +01:00
Tamas Cservenak
fcd9c0f018
[MNG-8385] Introduce proto session, make CLIng use PropertyContributor (#1929)
And make use of it in CLIng. Also, move from "late" Resolver session factory to "early" CLIng invocation of `PropertyContributor` SPI and make contribution visible across whole Maven, not only Resolver.

---

https://issues.apache.org/jira/browse/MNG-8385
2024-11-20 20:58:27 +01:00
Tamas Cservenak
8dec40ff57
Rename versionFilter property and tidy up documentation (#1920)
This property was introduced in 4-alpha-12, so no issue just
putting the property in place.
2024-11-18 11:45:50 +01:00
Tamas Cservenak
ab7d766c72
Exception usage cleanup (#1910)
This is just a cleanup of exception usage (by making them checked, fixing compiler issues, and undoing the change). There are at least two bugs (runtime escapes) fixed in this PR.
2024-11-16 21:36:20 +01:00
Guillaume Nodet
46707e0f28
[MNG-8340] Resolve parent according to the exact model location (#1857) 2024-11-13 20:26:56 +01:00
Tamas Cservenak
1ab2ccf066
Add maven.repo.local.head (#1881)
As counterpart to maven.repo.local.tail, but this one "prepends" while other "appends". This means one can do like this

```
$ mvn install -Prun-its -Dmaven.repo.local.head=~/.m2/repository-it
```

And have stuff installed into dedicated IT local repo (as IT bits must be installed), instead to pollute own local repo.

---

https://issues.apache.org/jira/browse/MNG-8370
2024-11-07 11:14:15 +01:00
Tamas Cservenak
dfd5ec5f85
[MNG-8362] Adding some missing config properties (#1861)
To have them listed in generated docs, as they were forgotten.
Also, adding a "compat" support for Maven 3.9.x property for chained reposes.

---

https://issues.apache.org/jira/browse/MNG-8362
2024-11-05 17:06:57 +01:00
Guillaume Nodet
8005826df7 [MNG-8361] Fix typo in color styles 2024-11-02 10:29:52 +01:00
Guillaume Nodet
2a6fc5ab67
[MNG-8329] ArtifactInstallerRequest and ArtifactDeployerRequest should use Collection<ProducedArtifact> (#1836) 2024-10-25 18:43:07 +02:00
Guillaume Nodet
f6528183f2
[MNG-8361][MNG-8300] Fix color styles" (#1851)
* [MNG-8361] Document color styles properly
* [MNG-8300] Revert to bright-black to restore transfer colors
2024-10-25 14:24:08 +02:00