Martin Desruisseaux 7b4a4bf759
[MNG-8395] Redirect the <sourceDirectory> element to <Source> (#2061)
* Include the list of <Source> elements in the path translation.

* Add a `SourceRoot` interface for the properties declared in the POM's `<Source>` element.
The API use method names without `get` prefix in anticipation for possible use of records in the future.

In the `MavenProject` class, the `compileSourceRoots`, `testCompileSourceRoots` and `scriptSourceRoots`
fields are replaced by redirections to the new `sources` field with paths wrapped in `SourceRoot` objects.
The getters and setters methods for the previous fields are deprecated.
This commit contains other opportunistic deprecations on methods working with deprecated interfaces.

In the POM file, the above-cited properties are ignored if a corresponding `<Source>` element exists.
This rule exits because Maven sets default values to those fields, which can interfer with user's setting.

* Deprecate POM elements that are replaced by <Source> elements.

* Add @Deprecated annotation on model elements flagged as @deprecated in the documentation.

* Update `ProjectManager` API using `SourceRoot`:

- Add `addSourceRoot(Project, …)` methods.
- Add `getSourceRoots()` and `getEnabledSourceRoots(ProjectScope, Language)`.
- Remove `get/addResource(Project, …)` methods.
- Remove `get/addCompileSourceRoots(Project, …)` methods.

---------

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
2025-01-30 13:22:39 +01:00
2024-11-05 16:56:49 +01:00
2024-10-22 15:53:03 +02:00
2019-11-16 23:18:37 +01:00

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 17+
  • Maven 3.6.3 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
    
Languages
Java 99.6%
Shell 0.2%
Batchfile 0.1%