[MNG-8395] Redirect the <sourceDirectory> element to <Source>#2061
[MNG-8395] Redirect the <sourceDirectory> element to <Source>#2061gnodet merged 14 commits intoapache:masterfrom
Conversation
… `<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.
gnodet
left a comment
There was a problem hiding this comment.
Add a @Deprecated annotation.
…n the documentation.
…d returns only enabled sources.
impl/maven-core/src/main/java/org/apache/maven/project/MavenProject.java
Show resolved
Hide resolved
…Language)` methods accessible from the `Project` interface.
b9e5cc1 to
9648557
Compare
api/maven-api-core/src/main/java/org/apache/maven/api/Project.java
Outdated
Show resolved
Hide resolved
- Add `addSourceRoot(Project, …)` methods. - Deprecate `get/addResource(Project, …)` methods. - Deprecate `get/addCompileSourceRoots(Project, …)` methods.
This is done in a separated commit in case we need to revert.
|
I think we also need to move the |
ea672ac to
9af4ac9
Compare
|
Thx, a few minor changes in Geomatys#1 |
On the ProjectManager interface, Intellij warns me about overridden parameters not being annotated
Test added in pull request 320 of compiler plugin (commit). |
|
Resolve #9458 |
Notable changes:
SourceRootinterface for the properties declared in the POM's<Source>element.sourceDirectory,testSourceDirectory,scriptSourceDirectory,resources,testResourceselements and theResourcestructure. They are replaced by<source>elements.MavenProjectclass, replace thecompileSourceRoots,testCompileSourceRootsandscriptSourceRootsfields by redirections to the newsourcesfield with paths wrapped inSourceRootobjects. The resource fields are not completely replaced, information are duplicated.In the POM file, the above-cited deprecated properties are ignored if a corresponding
<source>element exists. For example, if there is a source with<scope>main</scope>and<lang>java</lang>, then<sourceDirectory>is ignored. This rule exits because Maven sets default values to those fields, which can interfere with user's setting.Note: the
SourceRootAPI uses method names without thegetprefix in anticipation for possible use of records in the future.