Commit Graph

746 Commits

Author SHA1 Message Date
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 c49c4e0b18
[MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
Guillaume Nodet 2788849c37
Switch version to 4.0.0 for @since tags (#1068) 2023-03-23 06:29:39 +01:00
Guillaume Nodet 8052c720e7 [maven-release-plugin] prepare for next development iteration 2023-03-15 17:06:58 +01:00
Guillaume Nodet 26d10a4bf9 [maven-release-plugin] prepare release maven-4.0.0-alpha-5 2023-03-15 17:06:43 +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
Guillaume Nodet fbeefb85ab [maven-release-plugin] prepare for next development iteration 2023-01-27 16:33:47 +01:00
Guillaume Nodet 009cf4a721 [maven-release-plugin] prepare release maven-4.0.0-alpha-4 2023-01-27 16:33:38 +01:00
Guillaume Nodet f153ac134c
[MNG-7598] Fix compatibility issues with toolchains and settings (#971)
* Split the header on two lines
* Properly delegates equals/hashCode to the v4 models
* Introduce object tracking in settings / toolchains
* Get back to a single template for v3 models
* Switch settings / toolchains mergers to deep merge
* Fix binary compatibility with 3.x
2023-01-27 15:56:16 +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 1968951a53
[MNG-7642] Restore compatibility with flatten-maven-plugin (#947)
Revert "[MNG-7505] Remove ReportingConverter (#906)"
This reverts commit adf89ef63f.
2023-01-09 16:06:48 +01:00
Michael Osipov 7b00069388 [MNG-7658] CI-friendly versions should only come from/rely on user properties
This closes #945
2023-01-01 21:08:55 +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
Guillaume Nodet 0e82026f2a [maven-release-plugin] prepare for next development iteration 2022-12-12 11:37:35 +01:00
Guillaume Nodet 2ccf57baa5 [maven-release-plugin] prepare release maven-4.0.0-alpha-3 2022-12-12 11:36:07 +01:00
Guillaume Nodet adf89ef63f
[MNG-7505] Remove ReportingConverter (#906) 2022-12-11 18:57:15 +01:00
Guillaume Nodet f27b975ddc
[MNG-7576] Restore compatibility for flatten-maven-plugin (#903) 2022-12-05 17:22:33 +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 de19cfcd2b [MNG-7601] Reformat sources 2022-11-22 14:26:01 +01:00
Guillaume Nodet 3f03f0e7b2
[MNG-7576] Restore compatibility with maven 3.x (#841) 2022-11-21 09:50:33 +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
Konrad Windszus 79b6dd0bab
[MNG-6609] expose packaging via property "project.packaging" (#835) 2022-10-24 13:13:35 +02:00
Guillaume Nodet 18eff3baeb
Restore compatibility with 3.x (#836)
* Restore compatibility with 3.x
* Deprecate the old constructor
2022-10-20 23:06:06 +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 77312f323b [maven-release-plugin] prepare for next development iteration 2022-10-15 01:41:39 +02:00
Guillaume Nodet c07700ffc9 [maven-release-plugin] prepare release maven-4.0.0-alpha-2 2022-10-15 01:41:31 +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 66851463f6 [maven-release-plugin] prepare for next development iteration 2022-10-14 22:57:05 +02:00
Guillaume Nodet 0d973fb624 [maven-release-plugin] prepare release maven-4.0.0-alpha-1 2022-10-14 22:36:41 +02:00
Guillaume Nodet 2b6977a85f
Fix site generation (#828) 2022-10-14 21:52: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
Sylwester Lachiewicz 5502c0c8db [MNG-7502] Upgrade to Guice 5.1.0 2022-09-10 21:27:25 +02: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
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
Karl Heinz Marbaise 896c707d32
[MNG-7447] - Several Improvements by using Stream API 2022-04-04 20:39:14 +02:00
Arturo Bernal 48fc4c9937 [MNG-7299] Simplify conditional expressions
This closes #583
2022-03-05 23:32:14 +01:00
Giovanni van der Schelde b2a21f12f8 [MNG-7244] Remove deprecated WARNING for usage of pom.X placeholders
This closes #678
2022-02-19 23:05:27 +01:00
Christoph Läubrich 62cf29bab3 [MNG-7407] Introduce a ModelVersionProcessor component to make CI Friendly Versions pluggable
This closes #675
2022-02-19 17:49:59 +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 ae8aebea19
[MNG-7182] Use the MX xpp parser instead of a STAX transformation (#486) 2021-11-29 13:31:55 +01:00
Hervé Boutemy f46a9131d5 fix javadoc errors 2021-10-17 12:07:50 +02:00
Arturo Bernal 0080e84588
[MNG-7297] Remove redundant type arguments (#581) 2021-10-11 20:58:38 +02:00
Arturo Bernal b31f3aeef3
[MNG-7291] Avoid String concatenation in loops (#572) 2021-10-10 22:12:41 +02:00
Arturo Bernal 16afe061c9 [MNG-7290] Java8 improvements
Closes #571
2021-10-10 12:50:42 +02:00