Apache Maven core
Go to file
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
.github Execute IT tests with clean local repository 2023-01-17 19:48:48 +01:00
.mvn Improve the use of checkstyle in the build (#477) 2021-07-06 08:09:20 +02:00
apache-maven [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
api [MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061) 2023-04-20 12:58:12 +02:00
build [MNG-7553] New clean API with immutable model (#703) 2022-10-02 10:41:25 +02:00
maven-artifact [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-bom [maven-release-plugin] prepare for next development iteration 2023-03-15 17:06:58 +01:00
maven-builder-support [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-compat [MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061) 2023-04-20 12:58:12 +02:00
maven-core [MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061) 2023-04-20 12:58:12 +02:00
maven-embedder [MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061) 2023-04-20 12:58:12 +02:00
maven-model [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-model-builder [MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061) 2023-04-20 12:58:12 +02:00
maven-model-transform [MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061) 2023-04-20 12:58:12 +02:00
maven-plugin-api [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-repository-metadata [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-resolver-provider [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-settings [maven-release-plugin] prepare for next development iteration 2023-03-15 17:06:58 +01:00
maven-settings-builder [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-slf4j-provider [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-slf4j-wrapper [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-toolchain-builder [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
maven-toolchain-model [maven-release-plugin] prepare for next development iteration 2023-03-15 17:06:58 +01:00
maven-xml-impl [MNG-7451] - Remove public modifier from test methods / test classes 2023-04-15 19:24:20 +02:00
plexus-utils [maven-release-plugin] prepare for next development iteration 2023-03-15 17:06:58 +01:00
src [MNG-7038] Introduce public properties to point to the root and top directories of (multi-module) project (#1061) 2023-04-20 12:58:12 +02:00
.asf.yaml configure Jira integration 2022-05-02 17:37:27 +02:00
.git-blame-ignore-revs [MNG-7601] Fix git blame rev 2022-11-22 15:38:45 +01:00
.gitattributes Fixed line feeds, added .gitattributes 2013-01-29 16:27:02 +01:00
.gitignore Make sure RAT plugin ignores files in the target folder (#813) 2022-10-05 15:37:00 +02:00
CONTRIBUTING.md (doc) Update dead link for Github PR docs 2021-10-10 11:48:27 +02:00
Jenkinsfile Execute IT tests with clean local repository 2023-01-17 19:48:48 +01:00
Jenkinsfile.its [MWRAPPER-14] remove Maven Wrapper from core 2021-12-26 17:42:35 +01:00
LICENSE Add a LICENSE/NOTICE that can be picked up for the src assembly 2013-09-11 16:39:30 -04:00
NOTICE update copyright year 2019-11-16 23:18:37 +01:00
README.md [MNG-7765] - Minimum Build Requirement is wrong 2023-04-14 10:42:02 +02:00
deploySite.sh Use properly quoted shell arguments with "$@" 2019-06-10 20:26:40 +02:00
doap_Maven.rdf Update DOAP with Maven 3.9.1 release 2023-03-18 11:26:07 +01:00
pom.xml [MNG-7753] Upgrade resolver to 1.9.8 (was 1.9.7). 2023-04-17 14:23:50 +02:00

README.md

Apache Maven

ASF Jira Apache License, Version 2.0, January 2004 Maven Central Reproducible Builds Jenkins Status Jenkins tests

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

If you think you have found a bug, please file an issue in the Maven Issue Tracker.

Documentation

More information can be found on Apache Maven Homepage. Questions related to the usage of Maven should be posted on the Maven User List.

Where can I get the latest release?

You can download the release source from our download page.

Contributing

If you are interested in the development of Maven, please consult the documentation first and afterward you are welcome to join the developers mailing list to ask questions or discuss new ideas/features/bugs etc.

Take a look into the contribution guidelines.

License

This code is under the Apache License, Version 2.0, January 2004.

See the NOTICE file for required notices and attributions.

Donations

Do you like Apache Maven? Then donate back to the ASF to support the development.

Quick Build

If you want to bootstrap Maven, you'll need:

  • Java 8+
  • Maven 3.2.5 or later
  • Run Maven, specifying a location into which the completed Maven distro should be installed:
    mvn -DdistributionTargetDir="$HOME/app/maven/apache-maven-4.0.x-SNAPSHOT" clean package