-
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-7553] New clean API with immutable model #703
Conversation
If we want to use immutable objects, we should use Java Records. We still do not have Valhalla ready. The immutable object should be fetched with data via a builder in constructor.
|
Have you had a look at the generated code or are those just general comments about java records / immutable objects ? |
Yes I saw the MDO. |
So the objects from the model are immutable, they absolutely can not be modified. So unless we raise the requirements to JDK 17, I don't see how we could actually use records / List.of(). That said, I'm not sure there's actually much difference at the end. Of course, using records would be less verbose, but given we don't have to maintain that code manually (because it's generated), I'm not sure it really matters. For the |
api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectBuilder.java
Outdated
Show resolved
Hide resolved
api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectBuilderProblem.java
Outdated
Show resolved
Hide resolved
api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectManager.java
Outdated
Show resolved
Hide resolved
Don;t use |
Sorry, I don't get the point of immutable collections vs memory semantics. I agree we should use
in order to make sure the collections are actually safe and immutable. |
f5b2aab
to
38c6397
Compare
All tests are passing. I'd like to go on and merge this PR (and release an alpha version if possible). This would allow further work on other components and plugins (see the various PRs in this PR description) which are blocked because the API is not available in any public release or snapshot version. |
👍 for merge and for release alpha |
👍 as well, will take a deeper look tonight... but that should not block anything |
# Conflicts: # pom.xml
# Conflicts: # maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java
Consider using For instance, jspecify did not include |
* Introduce a Lookup service to retrieve beans from the PlexusContainer * Improvements to the Node dependency graph * Add access to the parent and remote repositories from the project * Enhancements to better support Coordinate * Add ProjectManager#setProperty
…getType to Dependency
Related PRs: