Commit Graph

3078 Commits

Author SHA1 Message Date
Tamas Cservenak 6f136ef4d2 [MNG-7789] Cleanup
PR had a leftover (unused but injected member). Removed.

---

https://issues.apache.org/jira/browse/MNG-7789
2023-05-24 12:50:23 +02:00
Tamas Cservenak 12ccaacf63 [MNG-7789] Dependency validation rules used wrong data (#1115)
Refactored and now dropped the unused pluginDescriptor/dependencies validation. Now we have "plugin dependency" (using POM) components to perform dependency validation.

Also, two "inlined" validation from plugin dependencies resolver factored out to components, along with 3 existing moved to newly added (they were wrongly validating descriptor dependencies while intent was to validate "real" dependencies) validators.

Ported from
6c562a46ee

---

https://issues.apache.org/jira/browse/MNG-7789
2023-05-24 08:50:28 +02:00
huazhongming 8f19d9ae28
[MNG-7639] Add unit test for DefaultRepositorySystemSessionFactory#newRepositorySession (#1096)
Signed-off-by: crazyhzm <crazyhzm@apache.org>
2023-05-23 10:50:16 +02:00
Tamas Cservenak 3f0f165242 [MNG-7786] Fix plugin validation misleading message
Bugfix post merge: all scopes EXCEPT provided and test...

---

https://issues.apache.org/jira/browse/MNG-7786
2023-05-19 18:08:37 +02:00
Tamas Cservenak 099a3f346c [MNG-7788] Plugin Validation Report logged before summary (#1114)
This change uses different technique to hook into "session end", and thus is invoked before ExecutionEventLogger is.

---

https://issues.apache.org/jira/browse/MNG-7788
2023-05-19 17:49:31 +02:00
Tamas Cservenak 11d97e64e7 [MNG-7787] Introduce new options for plugin validation report (#1113)
Added NONE and INLINE modes.

---

https://issues.apache.org/jira/browse/MNG-7787
2023-05-19 17:49:21 +02:00
Tamas Cservenak a90950155c [MNG-7786] Fix plugin validation misleading message (#1112)
Reword the validation warning and add new check for real plugin dependencies in wrong scopes (do not rely on build-time derived descriptor, but on real data instead).

---

https://issues.apache.org/jira/browse/MNG-7786
2023-05-19 17:49:05 +02:00
Guillaume Nodet d826b575ac
[MNG-7784] Fix compatibility for SuperPomProvider (#1109) 2023-05-17 07:19:19 +02:00
Petr Široký 59342ce249
[MNG-7743] Make the build work on JDK 20 (#1065)
* [MNG-7743] Make the build work on JDK 20

 * the behaviour before the fix was already pretty confusing. JDK 19 and
   older do not check the presense of '{' in the constructor, so the
   URL object got created, but when converting to file the result would
   be e.g. '/../../src/test/remote-repo' which is completely wrong.
   But it seems the affected tests did not really care, as all of them
   were passing

* Remove forgotten println

Co-authored-by: Yeikel <email@yeikel.com>

* Test with latest JDK

* Do not run ITs with jdk 20, but just the "build itself"

---------

Co-authored-by: Yeikel <email@yeikel.com>
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2023-05-16 11:06:05 +02:00
Guillaume Nodet b76e78072a
[MNG-7785] Clean usage of SessionData (#1094) 2023-05-16 10:56:44 +02:00
Tim te Beek a8319821a9
[MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String) (#1104)
* [MNG-6829] Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)

Use this link to re-run the recipe: https://public.moderne.io/recipes/org.openrewrite.java.migrate.apache.commons.lang.IsNotEmptyToJdk?organizationId=QXBhY2hlIE1hdmVu

Co-authored-by: Moderne <team@moderne.io>

* Apply Spotless

---------

Co-authored-by: Moderne <team@moderne.io>
2023-05-09 19:46:02 -04:00
Tamas Cservenak 8b8f2c3ddd [MNG-7767] Tone down plugin validator (#1092)
This change reduces default output making it more compact, and also renames the "levels" to brief, default and verbose.

---

https://issues.apache.org/jira/browse/MNG-7767
2023-04-26 15:53:21 +02:00
Giovanni van der Schelde 81231b8865 [MNG-7707] Skip consumer pom artifact transformation when no pom is available (fixes #1060) 2023-04-21 21:27:03 +02:00
Guillaume Nodet 2db7c85b64
[MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061)
This commit introduces three properties:

 * project.rootDirectory: the project's directory or parent directory containing a .mvn subdirectory or a pom.xml flagged with the root="true" attribute. If no such directory can be found, accessing the rootDirectory property will throw an IllegalStateException.

 * session.topDirectory : the directory of the topmost project being built, usually the current directory or the directory pointed at by the -f/--file command line argument. The topDirectory is similar to the executionRootDirectory property available on the session, but renamed to make it coherent with the new rootDirectory and to avoid using root in its name. The topDirectory property is computed by the CLI as the directory pointed at by the -f/--file command line argument, or the current directory if there's no such argument.

 * session.rootDirectory : the rootDirectory for the topDirectory project.

The topDirectory and rootDirectory properties are made available on the MavenSession / Session and deprecate the executionRootDirectory and multiModuleProjectDirectory properties. The rootDirectory should never change for a given project and is thus made available for profile activation and model interpolation (without the project. prefix, similar to basedir). The goal is also to make the rootDirectory property also available during command line arguments interpolation.

A root boolean attribute is also added to the model to indicate that the project is the root project. This attribute is only supported if the buildconsumer feature is active and removed before the pom is installed or deployed. It can be used as an alternative mechanism to the .mvn directory.
2023-04-20 12:58:12 +02:00
Guillaume Nodet 9e51a8fe95
[MNG-7763] Provide UTF-8 as a default value for project.build.sourceEncoding and project.reporting.outputEncoding (#1085) 2023-04-17 15:20:54 +02:00
Karl Heinz Marbaise 5c750eacb4
[MNG-7766] - Migrate to use mockito-bom 4.11.0 2023-04-16 14:54:16 +02:00
Karl Heinz Marbaise c49c4e0b18
[MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
Tamas Cservenak 432bd7af3a [MNG-7741] Track missing files, plugin and parent pom dependencies (#1058)
Add more information when using `-Dmaven.repo.local.recordReverseTree=true`.

Signed-off-by: Grzegorz Grzybek <gr.grzybek@gmail.com>

---

https://issues.apache.org/jira/browse/MNG-7741
2023-04-12 13:08:37 +02:00
Niels Basjes 328ea1be31
[MNG-7750] Ensure no unwanted interpolation in plugins from profiles. (#1076)
This is the port of https://github.com/apache/maven/pull/1075 to the master branch.

The good thing is that this is ONLY the tests because the maven 4 does not have the problem of MNG-7750.

A few small changes in the tests were needed to handle the internal differences between maven 3.x and maven 4.x.

---

https://issues.apache.org/jira/browse/MNG-7750
2023-04-12 12:26:40 +02:00
Tamas Cservenak 53b6473237 [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:55:40 +02:00
Guillaume Nodet b2ee29e03e [MNG-6825] Get rid of commons-lang 2023-04-06 10:51:18 +02:00
Tim te Beek 8421a36592
[MNG-6825] Replace StringUtils (#1078)
Co-authored-by: Moderne <team@moderne.io>
2023-04-01 01:56:03 +00:00
Elliotte Rusty Harold 54afd174ef
remove unused branches in fake (#1069)
* remove unused branches in a fake object
2023-03-23 10:36:23 +00:00
Guillaume Nodet ae933fe68d
[MNG-7720] Simplify code (#1063) 2023-03-23 06:31:49 +01:00
Elliotte Rusty Harold cadeab53f6
MNG-7738 don't dump raw stack traces to System.err (#1064) 2023-03-22 12:44:37 +00:00
Tim te Beek 703f814e34
[MNG-6825] Replace FileUtils with Commons IO (#1067)
* [MNG-6825] Replace FileUtils with Commons IO

Co-authored-by: Moderne <team@moderne.io>

* Minor fixes and reverts where cases are not handled yet

* Drop explicit dependencies on plexus-utils

---------

Co-authored-by: Moderne <team@moderne.io>
2023-03-19 20:19:22 +00:00
Slawomir Jaranowski e9e0a51738 [MNG-7725] Update surefire to 3.0.0 in default binding 2023-03-14 16:42:10 +01:00
Guillaume Nodet 10128b4484
Remove references to Xpp3DomBuilder and use XmlNodeBuilder instead (#1045) 2023-03-09 16:26:58 +01:00
Hervé Boutemy ea21d6f6fc [MNG-7666] update documentation 2023-03-08 18:45:23 +01:00
Tamas Cservenak 1ffd68b802
[MNG-7720] Wrong build order of forked projects (#1040)
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.

---

https://issues.apache.org/jira/browse/MNG-7720
2023-03-08 09:04:35 +01:00
Andrey Bruykhov f7d3e30d10 Using Set<>() for contains()
This closes #998
2023-03-07 17:54:07 +01:00
Tamas Cservenak c1dfb947b5
[MNG-7715] Update to resolver 1.9.6 (#1036)
Adjust some UTs as error message did change.

---

https://issues.apache.org/jira/browse/MNG-7715
2023-03-06 11:17:56 +01:00
Christoph Läubrich f41d533e71 [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 #1029
2023-03-03 18:04:36 +01:00
Tamas Cservenak 65d95f08a6
[MNG-7717] Maven warns wrongly about deprecated parameter (#1031)
The implementation for MNG-7706 is wrong: it changes parameter NAME,
where it should check type and defaultValue instead.

---

https://issues.apache.org/jira/browse/MNG-7717
2023-03-03 08:52:40 +01:00
Tamas Cservenak afc1a2bd86
[MNG-7713] Drop legacy-local-repository option (#1020)
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:17:55 +01:00
Tamas Cservenak 22d2b47c04
[MNG-7706] Deprecate 'localRepository' parameter expression (#1009) (#1012)
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 18:14:45 +01:00
Tamas Cservenak a35307771c
[MNG-7702] Use latest deploy plugin (#1007)
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:34 +01:00
Guillaume Nodet 1d9dd4a364 [MNG-7679] [REGRESSION] Build fails when executing a single mojo without a POM
This closes #993
2023-02-20 21:21:34 +01:00
Alexey Venderov b82479bf11
[MNG-7689] Check if execution lifecycle phase is not null (#996) 2023-02-15 08:49:39 +01:00
Andrey Bruykhov 7b38457506 Normalize regex patterns
This #990
2023-02-09 18:47:51 +01:00
Andrey Bruykhov 6e25a2674b [MNG-7686] Speed up by replacing non-pattern #replaceAll() with #replace() or precompiled patterns
This closes #984
2023-02-07 21:55:12 +01:00
Andrey Bruykhov ef3cf56b51 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.

This closes #985
2023-02-07 20:46:28 +01:00
Christoph Läubrich 0525d90d42 [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 #981
2023-02-05 13:17:09 +01:00
Tamas Cservenak dfb406c5b3
Fix site plugin warning (#974)
As date format in these two files were not parsed.
2023-01-30 16:20:35 +01:00
Guillaume Nodet 41429b15ab
[MNG-7673] IllegalArgumentException thrown for invalid checksum 'never' (#972) 2023-01-30 15:11:30 +01:00
Guillaume Nodet 30fafa6741
[MNG-7672] Fork should only execute the project and its submodules (#968) 2023-01-30 15:08:08 +01:00
Guillaume Nodet f77de570b7
[MNG-7646] Do not parse the whole reactor unless required by command line options (#963) 2023-01-26 11:42:23 +01:00
Tamas Cservenak 8918c8144f
[MNG-7622] Maven Transformation and Consumer POM (#907)
Maven Consumer POM redone, it happens only in "maven3 realm" (before resolver), and allows use cases like m-gog-p and checksum-m-p work as before.

Key aspects:
* consumer POM is injected to build earliest possible as attached artifact
* it lives and is visible just like any other attached artifact (so m-gpg-p can process it)
* just before the install/deploy, they are "swapped out" to replace POM along with all "extras" it may have (checksum, signature)
* to support use cases like MNG-7067 (in memory model is changed, but not POM file), OnChangeTransformer could be extended to take into account both: file content and model content.

---

https://issues.apache.org/jira/browse/MNG-7622
2023-01-25 11:27:00 +01:00
Guillaume Nodet c1a900190f
[MNG-7629] Change reactor reader to copy packaged artifacts and reuse them across builds if needed (#954) 2023-01-19 11:55:20 +01:00
Tamas Cservenak 01ba8291cd
[MNG-7666] Update default binding and lifecycle plugin versions (#956)
Finally use 3.x plugins for all.

---

https://issues.apache.org/jira/browse/MNG-7666
2023-01-16 14:30:48 +01:00
Guillaume Nodet a00a44f75b
[MNG-7660] Rename Dom to XmlNode in the v4 api (#946)
* Rename Dom to XmlNode and Xpp3Dom to XmlNodeImpl
* Use XmlNodeBuilder instead of DomBuilder
2023-01-03 16:52:23 +01:00
Hervé Boutemy fbdf109b34
[MNG-7571] add Maven API javadoc (#830) 2022-12-31 17:32:07 +01:00
Pavel Horal 6178f6ed86
[MNG-7648] Fix locationTracking in DefaultModelBuildingRequest copy constructor (#940)
- Fix locationTracking in DefaultModelBuildingRequest copy constructor
- Add location tracking unit test
2022-12-29 14:02:33 +01:00
Guillaume Nodet 8150c62749 [MNG-7650] Reformat 2022-12-26 16:12:32 +01:00
Michael Osipov 538a6b40a5 [MNG-7352] org.apache.maven.toolchain.java.JavaToolchainImpl should be public
This closes #934
2022-12-23 09:16:13 +01:00
Michael Osipov f0364acb2f Directories, not folders 2022-12-18 16:36:16 +01:00
Michael Osipov 3eec6b82d3 [MNG-7636] Document MavenProject#getAttachedArtifacts() as read-only
This closes #918
2022-12-18 13:11:20 +01:00
Christoph Läubrich 7a1cc12a47 [MNG-7637] Possible NPE in MavenProject#hashCode()
This closes #921
2022-12-18 11:59:51 +01:00
Konrad Windszus ce18c56206
[MNG-7598] Enforce binary backwards-compatibility (#874)
For now only enabled in core and plugin-api

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2022-12-15 10:50:39 +01:00
Guillaume Nodet adf89ef63f
[MNG-7505] Remove ReportingConverter (#906) 2022-12-11 18:57:15 +01:00
Simon 55431cd267
[MNG-7578] Fallback on Linux executable in Windows for findTool utility (#861)
* [MVN-7578] Fallback on Linux executable in Windows for findTool utility
* Fix code style
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2022-12-09 10:07:48 +01:00
Tamas Cservenak 6773c05128
[MNG-7619] Reverse Dependency Tree (#902)
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:31 +01:00
Konrad Windszus 0d4a1a1257
[MNG-7609] Clarify extension descriptor documentation (#896) 2022-12-05 10:04:35 +01:00
Tamas Cservenak 69ef6a61ba [MNG-7612] Chained LRM
Adds new feature: Chained Local Repository Manager.

Cherry-pick 2dc7a356d3

---

https://issues.apache.org/jira/browse/MNG-7612
2022-12-03 16:55:05 +01:00
Tamas Cservenak a840ba91e3
[MNG-7608] Make native transport the default (#892)
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
2022-12-02 16:12:48 +01:00
Guillaume Nodet 249c0fe0f1
[MNG-7617] Small optimisations and cleanup in the project/model building (#816)
* Clean a bit DefaultProfileActivationContext
* Cleanup DefaultProjectBuildingResult
* Cache the injected list to avoid repetitive lookups
* Lazily compute the MavenBuildTimestamp
* Use a single loop to select active profiles
2022-12-02 14:58:56 +01:00
Guillaume Nodet f0cc176b33
[MNG-7616] Add missing exported artifacts for the new API (#894) 2022-12-02 14:56:02 +01:00
Konrad Windszus 3d0939662a
[MNG-7611] Change semantics of plugin descriptor's "requiredJavaVersion" (#888)
Always assume version constraint (the same as in requiredMavenVersion)
2022-12-01 21:54:09 +01:00
Tamas Cservenak f70b0019cc
[MNG-7607] Add M4 Transport API (#884)
Something simple to use and would reuse all the auth/proxy etc data from Maven. Intentionally super-trivial API.

If something more "serious" needed, plugin should probably roll it's own solution.

---

https://issues.apache.org/jira/browse/MNG-7607
2022-12-01 13:53:08 +01:00
Tamas Cservenak c6ecff9923
[MNG-7586] Update Maven Resolver to 1.9.2 (#882)
Updates resolver to latest release.

---

https://issues.apache.org/jira/browse/MNG-7586
2022-11-26 20:08:34 +01:00
Guillaume Nodet de19cfcd2b [MNG-7601] Reformat sources 2022-11-22 14:26:01 +01:00
Slawomir Jaranowski b1c1f7556d [MNG-7600] LocalRepositoryManager is created too early
LocalRepositoryManager needs configurations from RepositorySystemSession
so must be created after session configuration is finished.
2022-11-21 16:45:35 +01:00
Guillaume Nodet dc88c6193c
[MNG-7580] Introduce new SettingsBuilder and ToolchainsBuilder services (#852) 2022-11-21 09:51:28 +01:00
Guillaume Nodet 3f03f0e7b2
[MNG-7576] Restore compatibility with maven 3.x (#841) 2022-11-21 09:50:33 +01:00
Guillaume Nodet 6a27f5f2f6
[MNG-7597] Fix infinite loop when iterating PropertiesAsMap (#872) 2022-11-21 09:37:42 +01:00
Tamas Cservenak 724ac0b541 Revert "[MNG-7586] Update Maven Resolver to 1.9.1 (#870)"
This reverts commit 113919a5ef.
2022-11-17 17:46:08 +01:00
Tamas Cservenak 113919a5ef
[MNG-7586] Update Maven Resolver to 1.9.1 (#870)
Changes:
- hook in lifecycle

---

https://issues.apache.org/jira/browse/MNG-7586
2022-11-17 16:26:42 +01:00
Slawomir Jaranowski fa15fcf153 [MNG-7590] Allow to configure resolver by properties in settings.xml 2022-11-09 23:15:25 +01:00
Guillaume Nodet dfcf5791fc
[MNG-7583] Allow concurrent access to the MavenPluginManager (#855) 2022-11-09 14:13:18 +01:00
Michael Osipov 9c60138915 [MNG-7556] Clean up notion between user properties and system properties
This closes #810
2022-10-29 20:44:15 +02:00
Abdel Hajou bc8c6be269 [MNG-7564] Check if session is null when generating metadata
Closes #857.
2022-10-29 13:38:47 +02:00
Konrad Windszus daa8e16902
[MNG-7570] Plugin descriptor can carry the required Maven version (#832)
Its value takes precedence over POMs Maven prerequisite
2022-10-19 08:15:28 +02:00
Konrad Windszus d857c3a915
[MNG-7566] Allow a Maven plugin to require a Java version (#827) 2022-10-18 11:45:54 +02:00
Guillaume Nodet 550f0c90fc Restore compatibility for the maven-release-plugin 2022-10-15 01:33:17 +02:00
Guillaume Nodet a492c9a4ff
Fix the repackaged plexus-utils groupId (#829)
* Fix plexus gav
* Install maven instead of just building it

The plugins need to be available in the local repo, else the build may download old snapshots
2022-10-15 01:20:24 +02:00
Guillaume Nodet 2b6977a85f
Fix site generation (#828) 2022-10-14 21:52:26 +02:00
Guillaume Nodet 3f90e7028e
Restore compatibility on SettingsBuilder, ToolchainsBuilder and MojoDescriptorCreator (#820) 2022-10-11 16:31:57 +02:00
Tamas Cservenak 3bc2cf6a7a
[MNG-7547] Simpler G level metadata generation (#806) 2022-10-11 14:11:17 +02:00
Guillaume Nodet ae655e0e83
[MNG-7553] v4 api enhancements
* Fix DefaultArtifactManager to allow using both Artifact and Dependency
* Add a TODO for an EventSpy related api
* Add simple string/model conversion on the XmlFactory
* Decouple services creation
* Move services to @Singleton scope
* Add protected constructors as builders should not be created directly
* Fix typos "can not" -> "cannot"
* Add some null checks on build(xx) shortcut methods
* Add a some missing conversion to immutable collections for requests
2022-10-10 20:47:26 +02:00
Guillaume Nodet bff84bd634
Replace Properties with Map<String, String> in the v4 api (#808) 2022-10-05 16:52:17 +02:00
Guillaume Nodet 2a9f39336c
[MNG-7553] New clean API with immutable model (#703) 2022-10-02 10:41:25 +02:00
Martin Kanters 7e0e9f9fbe [MNG-7310] Using the plexusContainer to prevent loading lifecycles from defined by extensions from other submodules.
This resolves #639.
2022-09-16 14:46:01 +02:00
Guillaume Nodet 631f1c7611 [MNG-7401] [MNG-7474] Remove unused commented code 2022-08-23 11:54:18 +02:00
Guillaume Nodet e02e0c84ce [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>
# Conflicts:
#	maven-core/src/main/java/org/apache/maven/lifecycle/internal/LifecycleModuleBuilder.java
#	maven-core/src/main/java/org/apache/maven/session/scope/internal/SessionScope.java
2022-08-23 11:51:44 +02:00
Giovanni van der Schelde a53a1aa232 [MNG-7443] Implement consistent logging between optional projects and optional profiles
This closes #701
2022-07-29 11:06:26 +02:00
Michael Osipov 0f8f22e404 [MNG-7020] Remove Maven 2 WagonExcluder backward compat code
This closes #394
2022-07-24 10:47:35 +02:00
Hervé Boutemy 35b93b0a58 [MNG-7353] Add support for "mvn pluginPrefix:version:goal"
This closes #757
2022-07-21 14:38:30 -07:00
Marc Wrobel 8125b3131f Fix typos in code
Fix minor typos in code :

- test method names,
- method parameter names,
- variable names.
2022-07-19 00:45:13 +02:00
Marc Wrobel 5ce5591ae3 Fix minor typos
Fix various minor typos in :

- project documentations,
- javadoc and comments,
- test files.
2022-07-18 19:22:19 +02:00
Michael Osipov efa9f0c678 [MNG-7513] Address commons-io_commons-io vulnerability found in maven latest version
We can safely remove Commons IO altogether because it is not used in any direct or
transitive usecase at compile time or runtime.

This closes #771
2022-07-18 17:26:54 +02:00
Josef Cacek 03b1faff7e [MNG-7511] Ensure the degreeOfConcurrency is a positive number in MavenExecutionRequest
This closes #767
2022-07-18 13:35:27 +02:00
Tamas Cservenak f05397a88d
Pull out lifecycle plugin versions (#766)
To lessen mistake (copy-paste vs forgotten update) but also just to
make things less redundant. This also makes possible "experimenting"
much more easier.

This is merely a refactoring that does not takes or gives anything, just tidies up.
2022-07-12 15:13:55 +02:00
Guillaume Nodet 415eaf31de
[MNG-7160] Ability to customize core extensions classloaders (#616) 2022-06-15 10:43:17 +02:00
Slawomir Jaranowski 54f9d91ebb [MNG-7468] Check unsupported plugins parameters in configuration 2022-06-03 20:54:27 +02:00
Guillaume Nodet 7da0214d1d [MNG-7476] Display a warning when an aggregator mojo is locking other mojos executions
# Conflicts:
#	maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
2022-05-30 13:29:43 +02:00
Guillaume Nodet 2a276d0dcf [MNG-7487] Fix deadlock during forked lifecycle executions
# Conflicts:
#	maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java

# Conflicts:
#	maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
2022-05-30 13:15:06 +02:00
Guillaume Nodet 6767f2500f [MNG-7486] Create a multiline message helper for boxed log messages
This closes #746
2022-05-29 13:35:24 +02:00
Tamas Cservenak fc1962e659
[MNG-7478] Transport selection should use config properties (#739)
Instead of user properties, as this allows making "permanent" the
selection by using MAVEN_OPTS and other places as well. Currently
only via command line works.

Also, do not modify existing Maven behavior, so introduce "default" branch
in selection. See comment in code
2022-05-17 08:54:29 +02:00
Tamas Cservenak a83ed86c48 [MNG-7471] Make Resolver util and connector-basic provided (#732)
Problem: resolver spi, impl and connector-basic has changes in 1.8.0 (SPI interface RepositoryLayout got new method, that is implemented in connector-basic, and code from impl is using it). But, Maven core exports only resolver api, spi and impl packages, while the rest is at mercy of a plugin. This means ,that these artifacts (api, spi and impl) will always come from Maven core, whatever version plugin declares, while the "rest" (connector-basic and util) will be of version that plugin declares. The current state hence prevented ANY KIND of changes on SPI interfaces that would be implemented in connector-basic (which is the case in Resolver 1.8.0).

Solution: make all these resolver artifacts "provided" (to behave like maven-core or maven-plugin-api is behaving): simply put, whatever resolver artifact plugin depends on, it should NOT use it's own version, but the version from Maven. This ensures that api-spi-impl-connector-basic as "aligned" and are same version.

Details:

The change is to make util is exportedArtifact AND exportedPackage, while connector-basic is only exportedArtifact.

Reasoning:
* exportedArtifact -- prevents "own" artifact to be added to realm
* exportedPackage -- makes it "visible" in realm

So, this basically prevents bad versions of util and connector-basic
enter the plugin realm (as they will be not added to it), while
util remains "visible" to plugins, as the intent was, most
common due GenericVersions etc.

This change also results in simpler expectations to plugin developers:
resolver libraries should really behave like maven-core or maven-compat:
when plugin declares dependency on these (w/ scope provided as best
practice), they really get version of these that are of version that
maven runs in, not version they declare. So same thing happens now with
resolver: you will get same version of resolver that maven uses your plugin
runs in.

Before this change, it was a mixed bag: api, spi and impl was from maven,
while util and connector-basic was version you pulled in as dep.
2022-05-11 16:09:52 +02:00
Guillaume Nodet 1c22f94522 [MNG-7459] Revert "[MNG-7347] SessionScoped beans should be singletons for a given session (#621)"
This reverts commit faf5d5d274.
2022-05-09 10:11:54 +02:00
Slawomir Jaranowski 3dd0afd897 [MNG-7464] Warn about using read-only parameters for Mojo in configuration 2022-05-05 21:12:25 +02:00
Giovanni van der Schelde 93196d4bb7 [MNG-7404] Drop deprecated prefixless expressions
Fixed failing unit tests to use the 'project.' prefix and removed legacy
unit tests that tested support for prefixless expressions.

Closes #696.
2022-04-27 20:12:57 +02:00
Slawomir Jaranowski 702f52d0ea [MNG-7457] Warn about deprecated plugin Mojo 2022-04-24 09:57:10 +02:00
Slawomir Jaranowski 9ac2d08dc7 [MNG-5222] Improvement in deprecated params detection 2022-04-23 09:24:22 +02:00
Tamas Cservenak 551009ab49
[MNG-7454] Include resolver-transport-http in Maven (#720)
Addendum to be2b7f890d98af20eb0753650b6605a68a97ac05:
* fix property name to align with existing ones
* fix logging configuration as no more shaded httpClient
* fix constant names
2022-04-16 18:19:23 +02:00
Hervé Boutemy 643d1e7828 [MNG-7438] add execution id to "configuring mojo" debug message
[DEBUG] Configuring mojo execution
'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test:default-test'
with basic configurator

rephrase "Configuring" to "Loading" mojo "from plugin realm"
to differentiate from "configuring mojo" = apply configuration

rename populatePluginFields(..) private method
to populateMojoExecutionFields(..) to better match the intent
2022-04-15 18:42:02 +02:00
Tamas Cservenak be2b7f890d
[MNG-7454] Include resolver-transport-http in Maven (#711)
But keep Wagon as default transport. This PR merely includes
resolver http and file transport and switches wagon-http
to non-shaded one.

Changes:
* switch to non-shaded wagon-http (as httpClient is now shared)
* include resolver http and file transport
* override resolver default behaviour (native transport preferred over wagon, when both on classpath)
* provide simplistic means to choose transport

The chosen transport can be seen in debug (-X) output on line
`[DEBUG] Using transporter XXX...`

The `-Dmaven.transport` simplistic switch can be used to choose transport:
* not set: default, that is Wagon
* `wagon`: explicitly sets Wagon
* `resolver`: explicitly sets resolver native transports (file and http)
* `auto`: relies on resolver "auto discovery" (priorities, etc). This is MUST to keep transport pluggable with 3rd party transports. In fact, this was the default so far in Maven, along with the fact that native resolver transports were not included (as resolver prefers native ones over Wagon).
2022-04-13 12:51:37 +02:00
Gabriel Belingueres c99028b9fb [MNG-5222] Maven 3 no longer logs warnings about deprecated plugin parameters
- Added warning when setting deprecated parameter with value different
than the default.
- Changed Logger to SLF4J.
2022-04-12 20:49:24 +02:00
Tamas Cservenak bdb35f2deb [MNG-7432] Resolver session contains non-MavenWorkspaceReader
As Resolver session contains non-MavenWorkspaceReader, the reactor models (already resolved w/ profiles applied) are re-built when using Resolver within Mojo, instead to get them via ReactorReader as expected. The rebuilt models will lack explicit (-P on CLI) profiles applied, as resolver itself is not maven aware, hence there is no way to "tell" resolver to apply them. Building reactor models w/ profiles applied is NOT done using resolver, but by Maven when loading up reactor, as profiles are NOT applied for downstream transitive dependencies (see discussion on MNG-1388 why).

Signed-off-by: Christoph Läubrich <christoph@laeubi-soft.de>
Co-authored-by: Christoph Läubrich <christoph@laeubi-soft.de>
Co-authored-by: Tamas Cservenak <tamas@cservenak.net>
2022-04-08 10:46:30 +02:00
Karl Heinz Marbaise 896c707d32
[MNG-7447] - Several Improvements by using Stream API 2022-04-04 20:39:14 +02:00
Jacky d92538b80f
[MNG-7445] - Refactoring, remove the useless line
Contribution by JakcyHu Gakiii

Signed-off-by: Karl Heinz Marbaise <khmarbaise@apache.org>
2022-04-01 22:20:38 +02:00
Guillaume Nodet 31193cbf0c
[MNG-7391] Fix MojosExecutionStrategy lookup to be able to look into the SessionScope (#693) 2022-03-15 06:56:07 +01:00
Guillaume Nodet 97c1e4b4aa
Remove unused test which should have been removed with MNG-7047 (#686) 2022-03-09 13:44:01 +01:00
Guillaume Nodet b3d5c12c7a
[master][MNG-7350] Introduce a factory for ModelCache (#629)
* [MNG-7350] Introduce a factory for ModelCache
* [MNG-7350] Introduce a factory for ModelCache
Fix missing javadoc and binding
2022-03-09 13:29:51 +01:00
Hervé Boutemy 8e5676c84a
[MNG-7391] add execution strategy+runner required by Maven Build Cache (#661)
* [MNG-7391] add execution strategy+runner required by Maven Build Cache
* Fix previous commit
* Fix javadoc
* Fix checkstyle
Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2022-03-09 11:35:05 +01:00
Maarten Mulders 09e51544df Remove unused import 2022-03-03 10:40:03 +01:00
Michael Osipov 83bbbb3cfb [MNG-6960] Use RuntimeInformation instead of reading properties
This closes #685
2022-02-27 19:27:25 +01:00
Karsten Thoms 5394e750d9 (refactoring) Resolve usage of deprecated method
Replace usage of
  MavenExecutionRequest#getSelectedProjects()
by
  MavenExecutionRequest#getProjectActivation().getOptionalActiveProjectSelectors()

Signed-off-by: Karsten Thoms <karsten.thoms@karakun.com>

This closes #664
2022-02-27 12:58:35 +01:00
Christoph Läubrich e327be3d85 [MNG-7402] BuildListCalculator never detaches the classloader
This closes #683
2022-02-26 21:38:56 +01:00
Sylwester Lachiewicz 69d6c6d5a2 [MNG-7417] Several classes do not set properties properly for building requests
This closes #306
2022-02-20 19:17:47 +01:00
Martin Kanters 03df5f7c63 [MNG-7390] Allow selecting modules outside the cwd into the reactor using --projects
This closes #677
2022-02-19 23:59:40 +01:00
Maarten Mulders 0be5e406d7 [MNG-7406] Do not include formatted details in Exception message
Closes #672
2022-02-16 22:11:52 +01:00
Christoph Läubrich a4729755ae [MNG-7400] Allow more WorkspaceReaders to participate
This closes #667
2022-02-12 21:42:08 +01:00
Guillaume Nodet 1d473233f2 [MNG-6727] Using version range in parent and CI Friendly Version fails 2022-02-01 14:35:07 +01:00
Guillaume Nodet 6b607109d3 [MNG-7349] Limit relocation warning message to direct dependencies only
# Conflicts:
#	maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java
2022-01-24 07:57:43 +01:00
Guillaume Nodet 9d4b2b23f0
[MNG-7345] Fix exported packages (#618) 2022-01-18 10:42:47 +01:00
Falko Modler ab4fec0a33 [MNG-7381] Shorten parallel builder thread name to artifactId, conditionally with groupId
This closes #662
2022-01-17 20:39:11 +01:00
Falko Modler 18725ec1e0 [MNG-7380] Don't log non-threadsafe warning if only building a single module
This closes #655
2022-01-11 15:30:52 +01:00
Guillaume Nodet faf5d5d274
[MNG-7347] SessionScoped beans should be singletons for a given session (#621) 2022-01-10 08:19:33 +01:00
Hervé Boutemy c229278477 rework javadoc 2022-01-08 17:27:28 +01:00
Hervé Boutemy f30a0ab4dd [MNG-7267] update artifact handlers documentation 2022-01-08 16:03:57 +01:00
Hervé Boutemy 8bde888dc8 [MNG-7267] update lifecycle documentation after switch from Plexus XML 2022-01-08 15:57:39 +01:00
Hervé Boutemy e617d51bd4 [MNG-7264] packaging plugins bindings cannot be empty 2022-01-08 15:25:54 +01:00
Tamas Cservenak 7180d68a18 Proposal to change abstract provider
Changes:
* validate input
* do not modify loop invariant within loop body
2022-01-08 15:25:54 +01:00
Hervé Boutemy a53083db6c [MNG-7264] refactor packaging bindings providers to ease maintenance 2022-01-08 15:25:54 +01:00
Hervé Boutemy a7375a0eff [MNG-7263] use constants instead of copy/paste 2022-01-08 15:25:13 +01:00
Hervé Boutemy 94af1d99f8 [MNG-7263] improve AbstractLifecycleProvider 2022-01-08 15:25:13 +01:00
Hervé Boutemy 711d5fbbf2 [MNG-7263] introduce AbstractLifecycleProvider 2022-01-08 15:25:13 +01:00
Hervé Boutemy e5b0831c10 [MNG-7263] refactor lifecycle providers to ease documentation
- lifecycle id
- phases
- default plugins bindings
2022-01-08 15:25:13 +01:00
Michael Osipov 2670c00751 [MNG-5561] Plugin relocation loses configuration
Previously, to locate plugin configuration in a project the plugin descriptor
was read first and then the GA were extracted. This always worked because the
GA from the model and the GA from plugin descriptor (plugin.xml) were identical.
When a plugin is relocated the target artifact is read, thus its plugin
descriptor as well. Naturally, the GA of new (relocated) does not correspond to
the old (static) one in the model. Therefore, the configuration is not found.
New approach is to use the original plugin GA to locate the configuration in
the model regardless of the relocation.

This closes #642
2022-01-06 16:54:03 +01:00