* 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
Even though this should not be supported, Maven 3.x is always using the 4.0.0 superpom. So if the version is not a supported model version, simply use 4.0.0. Any invalid value will be later verified by the model validator and eventually throw a meaninful exception.
It uses immutable list and while it suggests it allows this below, it actually fails on constructs like this (runtime ONLY):
{noformat}
new DefaultProfileSelector()
.addProfileActivator(new JdkVersionProfileActivator())
.addProfileActivator(new PropertyProfileActivator())
{noformat}
As default ctor creates immutable list, but API kinda suggests this is ok.
---
https://issues.apache.org/jira/browse/MNG-7910
The IT associated with this PR is using the Maven model to generate a hocon POM parser. This requires the maven-api-model module to attach the POM as an artifact, and the maven.yml change so that the model is present in the local repository.
Improve DefaultModelValidator.compareModelVersions to be able to compare
versions which different numbers of segments, allowing it to compare
"4", "4.0", and "4.0.0" to each other for example.
Signed-off-by: Craig Andrews <candrews@integralblue.com>
# Conflicts:
# maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
Co-authored-by: Craig Andrews <candrews@integralblue.com>
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.