Commit Graph

3109 Commits

Author SHA1 Message Date
Tamas Cservenak 36a4e9ff64
[MNG-7754] Improvement and extension of plugin validation (#1079)
This is general rework of current Maven 3.9.x line how it handles plugin and mojo validations.

Changes:
* added plugin validations for dependencies
* introduced pluginValidationManager that gathers violations
* manager creates a report at build end, with dense and non repeating data
* this is in spirit to lessen already too verbose logging, as current solution would report violations as many times plugin is used in reactor, and that can be many (ie. a plugin from parent for each module)


Example report of Maven 3.9.x build: https://gist.github.com/cstamas/b62fdcd53eaf316123cf183f5a24e6a5

---

https://issues.apache.org/jira/browse/MNG-7754
2023-04-12 11:42:30 +02:00
Guillaume Nodet 64227e25a5 [MNG-7720] Simplify code (#1063) 2023-03-23 06:32:46 +01:00
Tamas Cservenak 22e6eb03ea [maven-release-plugin] prepare for next development iteration 2023-03-15 10:40:30 +01:00
Tamas Cservenak 2e178502fc [maven-release-plugin] prepare release maven-3.9.1 2023-03-15 10:39:58 +01:00
Slawomir Jaranowski c294ef6c22 [MNG-7725] Update surefire to 3.0.0 in default binding 2023-03-14 16:05:25 +01:00
Tamas Cservenak 57acdd41b4
[MNG-7720] Wrong build order of forked projects (#1038)
The original fix MNG-7672 matched the "scope" but missed the "order". `project.collectedProjects` are in order as loaded (POM order), is not topologically sorted.

Fix is to use DAG of projects, ask for downstream projects (will return more then we need but sorted) and narrow that list to only contain collected projects.

Related commit: 48cac1c003

---

https://issues.apache.org/jira/browse/MNG-7720
2023-03-08 09:03:33 +01:00
Andrey Bruykhov 528cea3ad9 Using Set<>() for contains()
This closes #998
2023-03-07 18:06:41 +01:00
Tamas Cservenak 366e3f5f86
[MNG-7715] Update to resolver 1.9.6 (#1025)
Update and apply some adjustments to UTs as
error message did change.

---

https://issues.apache.org/jira/browse/MNG-7715
2023-03-06 10:42:55 +01:00
Christoph Läubrich 837db7a756 [MNG-7716] ConcurrencyDependencyGraph deadlock if no root is selected
If ConcurrencyDependencyGraph#getRootSchedulableBuilds returns an empty
list then MultiThreadedBuilder is locked forever as it never gets a
build result (because nothing is scheduled).

This changes the method, that in such case just the first project is
returned, this might not give the best performance, but ensures that
there is at least one build scheduled and the build-loop can proceed.

This closes #1028
2023-03-03 18:06:09 +01:00
Tamas Cservenak 3d4fee3008
[MNG-7717] Maven warns wrongly about deprecated parameter (#1030)
The implementation for MNG-7706 is wrong: it checks parameter name where it should check type and defaultValue (expression) instead.

---

https://issues.apache.org/jira/browse/MNG-7717
2023-03-03 08:52:59 +01:00
Guillaume Nodet 9037805f77
[MNG-7583] Allow concurrent access to the MavenPluginManager (#1001)
* [MNG-7583] Allow concurrent access to the MavenPluginManager (#855)
* Add a default method to avoid breaking the api
2023-03-01 11:31:29 +01:00
Tamas Cservenak 175b35c374
[maven-3.9.x] [MNG-7713] Drop legacy-local-repository option (#1018)
There is really no need for it, and there is a resolver
option if really must (but really should not, local repo
is and should be considered as transient).

---

https://issues.apache.org/jira/browse/MNG-7713
2023-03-01 11:20:19 +01:00
Tamas Cservenak 95ceb71ccc
[MNG-7706] Deprecate 'localRepository' parameter expression (#1009)
This PR deprecates the 'localRepository' mojo parameter expression, and Core will emit warning if used by any Mojo.

---

https://issues.apache.org/jira/browse/MNG-7706
2023-02-23 15:49:47 +01:00
Tamas Cservenak b231238e64
[MNG-7693] For older clients make OOTB defaults (#1008)
Older clients (like pyliglot) will miss to inject ModelCacheFactory
as their Plexus XML will not contain that requirement. For them,
provide OOTB defaults.

This would not happen, if JSR330 used, as then Sisu would remedy
this at runtime, but Plexus XML actually puts things in "concrete"
during build time.

---

https://issues.apache.org/jira/browse/MNG-7693
2023-02-23 09:56:34 +01:00
Tamas Cservenak a2a47daaa3
[MNG-7702] Use latest deploy plugin (#1006)
And have it aligned with install plugin. These two now provides all the fixes and new functionalities like working deployAtEnd etc.

---

https://issues.apache.org/jira/browse/MNG-7702
2023-02-22 13:21:54 +01:00
Tamas Cservenak 74f1dac9fb [MNG-7679] [REGRESSION] Build fails when executing a single mojo without a POM
This closes #1004
2023-02-20 21:20:36 +01:00
Andrey Bruykhov 4454cd6d82 Normalize regex patterns
This closes #988
2023-02-09 18:49:45 +01:00
Andrey Bruykhov fbf6bdaf01 [MNG-7686] Speed up by replacing non-pattern #replaceAll() with #replace() or precompiled patterns
This closes #984
2023-02-07 22:10:29 +01:00
Andrey Bruykhov 1ef583d3e6 Added missing @Deprecated/@deprecated annotations
@Deprecated annotatio is helpful to prevent usage of deprecated API.
For example: developer can see crossed out method/field name if this item
is deprecated.
2023-02-07 20:39:33 +01:00
Christoph Läubrich 72efba9b14 [MNG-7544] MavenMetadataSource#retrieve(MetadataResolutionRequest) does not check for null when reading from project map
Currently, if a project is returned from the workspace reader, but is not part
of the reactor, a NPE occurs. In this case, the repositories are read from
the model instead.

This closes #805
2023-02-05 13:34:04 +01:00
Tamas Cservenak ad29c3c548 [maven-release-plugin] prepare for next development iteration 2023-01-31 10:58:16 +01:00
Tamas Cservenak 9b58d2bad2 [maven-release-plugin] prepare release maven-3.9.0 2023-01-31 10:57:57 +01:00
Tamas Cservenak e9d570889f Reformat 2023-01-31 10:22:08 +01:00
Tamas Cservenak a5d0ca4f1d
Fix site plugin warning (#973)
As date format in these two files were not parsed.
2023-01-30 16:20:46 +01:00
Guillaume Nodet 48cac1c003
[MNG-7672] Fork should only execute the project and its submodules (#969) 2023-01-30 15:08:26 +01:00
Tamas Cservenak f7ca0b697a
[MNG-7608] Make native transport the default (#961)
This immediately cuts in "half" the count of HTTP requests against Maven Central or any major MRM.

Altering the meaning of "default": is now same as "auto", but still leaving it in place for future, as "default" at some point may again become something different than "native".

---

https://issues.apache.org/jira/browse/MNG-7608
2023-01-17 10:08:18 +01:00
Tamas Cservenak 51354e6a7d
[maven-3.9.x] [MNG-7666] Update default binding and lifecycle plugin versions (#955)
Finally use 3.x plugins for all.

---

https://issues.apache.org/jira/browse/MNG-7666
2023-01-16 14:31:09 +01:00
Pavel Horal 86d6e2aeff [MNG-7648] Fix locationTracking in DefaultModelBuildingRequest copy constructor (#940)
- Fix locationTracking in DefaultModelBuildingRequest copy constructor
- Add location tracking unit test
2023-01-01 13:41:09 +01:00
Michael Osipov 88ec1d2383 [MNG-7352] org.apache.maven.toolchain.java.JavaToolchainImpl should be public
This closes #934
2022-12-24 19:57:42 +01:00
Simon a6b8a9e9fb [MNG-7578] Fallback on Linux executable in Windows for findTool utility (#861)
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2022-12-18 17:17:34 +01:00
Michael Osipov 46c84876d7 Directories, not folders 2022-12-18 16:37:08 +01:00
Michael Osipov a1d43778ef [MNG-7636] Partially revert MNG-5868 to restore backward compatibility (see MNG-7316)
Co-authored-by: Gary Gregory <ggregory@rocketsoftware.com>

This closes #919
2022-12-18 13:27:16 +01:00
Christoph Läubrich 4db9b94baf [MNG-7637] Possible NPE in MavenProject#hashCode()
This closes #921
2022-12-18 12:13:07 +01:00
Tamas Cservenak 69c5a5dbdb
[MNG-7619] Reverse Dependency Tree (#900)
Adds Maven feature that is able to explain why an artifact is present in local repository.

Usable for diagnosing resolution issues.

In local repository, for each artifact it records `.tracking` folder, containing farthest artifact that got to this artifact, and the list of graph nodes that lead to it.

Note: this is based on by @grgrzybek proposal and reuses some code he provided. See https://github.com/apache/maven-resolver/pull/182

---

https://issues.apache.org/jira/browse/MNG-7619
2022-12-05 16:19:20 +01:00
Tamas Cservenak 2dc7a356d3 [MNG-7612] Chained LRM
Adds new feature: Chained Local Repository Manager.

---

https://issues.apache.org/jira/browse/MNG-7612
2022-12-02 17:57:47 +01:00
Tamas Cservenak 573a3e1ec5
[MNG-7614] Translate Plexus XML to proper resolver configuration (#895)
Now that Maven 3.9.x contains other transports than Wagon, the Plexus XML is not just to be "stuffed", but translation should happen to proper resolver configuration to make them available to all transports.

---

https://issues.apache.org/jira/browse/MNG-7614
2022-12-02 16:12:01 +01:00
Slawomir Jaranowski 693814f0a5 [MNG-7613] Parent POM 38 - code reformat 2022-12-02 12:54:12 +01:00
Tamas Cservenak c3919cdd0e
[MNG-7586] Update Maven Resolver to 1.9.2 (#881)
* [MNG-7586] Update Maven Resolver to 1.9.2

Updates resolver to latest release.

---

https://issues.apache.org/jira/browse/MNG-7586
2022-11-26 20:08:09 +01:00
Slawomir Jaranowski 474a470aa9 [MNG-7600] LocalRepositoryManager is created too early
LocalRepositoryManager needs configurations from RepositorySystemSession
so must be created after session configuration is finished.

(cherry picked from commit b1c1f7556d)
2022-11-22 00:01:05 +01:00
Tamas Cservenak b8b41c6d40 Revert "[3.9.x][MNG-7586] Update Maven Resolver to 1.9.1 (#831)"
This reverts commit 2d384ddce3.
2022-11-18 10:28:09 +01:00
Tamas Cservenak 2d384ddce3
[3.9.x][MNG-7586] Update Maven Resolver to 1.9.1 (#831)
Update to Maven Resolver 1.9.1 and apply required changed changes in Maven.

Changes:
- hook in lifecycle

---

https://issues.apache.org/jira/browse/MNG-7586
2022-11-17 16:21:41 +01:00
Slawomir Jaranowski fa2febb6f3 [MNG-7590] Allow to configure resolver by properties in settings.xml
Cherry-pick from fa15fcf153
2022-11-12 12:36:39 +01:00
Piotrek Żygieło 8a5dada82c [MNG-7568] Consider inactive profiles for validation 2022-11-05 10:30:11 +01:00
Abdel Hajou 3212efee78 [MNG-7564] Check if session is null when generating metadata
Backported (and adapted) from master.
2022-10-31 10:20:08 +01:00
Michael Osipov 0f4387543d [MNG-7556] Clean up notion between user properties and system properties 2022-10-29 20:19:49 +02:00
Tamas Cservenak 5136a5ea81
Maven-3.9.x Simplify maven-plugin metadata handling (#807) 2022-10-11 14:11:34 +02:00
Sylwester Lachiewicz 2f7dfcfe82 [MNG-7502] Upgrade to Guice 5.1.0
(cherry picked from commit 5502c0c8db)
2022-09-11 10:00:07 +02:00
Guillaume Nodet b762fa9d5c
[3.9.x] [MNG-7401] [MNG-7474] Keep a single maven session and fix session scope (#743)
* [MNG-7474] SessionScoped beans should be singletons for a given session

Now that the Session is not cloned anymore, we can revert to the original
(Maven < 3.3) behavior of the session scoped components.

Co-authored-by: Christoph Läubrich <christoph@laeubi-soft.de>

This closes #743

* Remove setting a value which is the default already

Co-authored-by: Christoph Läubrich <christoph@laeubi-soft.de>
2022-08-23 11:19:11 +02:00
Hervé Boutemy 95bdbf6821 [MNG-7353] Add support for "mvn pluginPrefix:version:goal"
This closes #757
2022-07-21 14:37:34 -07:00
Josef Cacek e1e4f5bda0 [MNG-7511] Ensure the degreeOfConcurrency is a positive number in MavenExecutionRequest
This closes #767
2022-07-18 22:35:28 +02:00