-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNG-8395] Redirect the <sourceDirectory> element to <Source> #2061
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javadoc fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Notable changes:
SourceRoot
interface for the properties declared in the POM's<Source>
element.sourceDirectory
,testSourceDirectory
,scriptSourceDirectory
,resources
,testResources
elements and theResource
structure. They are replaced by<source>
elements.MavenProject
class, replace thecompileSourceRoots
,testCompileSourceRoots
andscriptSourceRoots
fields by redirections to the newsources
field with paths wrapped inSourceRoot
objects. 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
SourceRoot
API uses method names without theget
prefix in anticipation for possible use of records in the future.