Giovds commented on code in PR #2132:
URL: https://github.com/apache/maven/pull/2132#discussion_r1972535850


##########
api/maven-api-core/src/main/java/org/apache/maven/api/Project.java:
##########
@@ -237,4 +238,68 @@ default String getId() {
      */
     @Nonnull
     Optional<Project> getParent();
+
+    /**
+     * Returns all profiles defined in this project.
+     * <p>
+     * This method returns only the profiles defined directly in the current 
project's POM
+     * and does not include profiles from parent projects.
+     *
+     * @return a non-null, possibly empty list of profiles defined in this 
project
+     * @see Profile
+     * @see #getAllProfiles()
+     */
+    @Nonnull
+    List<Profile> getProfiles();
+
+    /**
+     * Returns all profiles defined in this project and all of its parent 
projects.
+     * <p>
+     * This method traverses the parent hierarchy and includes profiles 
defined in parent POMs.
+     * The returned list contains profiles from the current project and all of 
its ancestors in
+     * the project inheritance chain.
+     *
+     * @return a non-null, possibly empty list of all profiles from this 
project and its parents
+     * @see Profile
+     * @see #getProfiles()
+     */
+    @Nonnull
+    List<Profile> getAllProfiles();

Review Comment:
   Thats a good one. As it also follows the terminology we use within other 
parts of the code base and documentation. It does require some knowledge of our 
domain as consumer of the API but the docs clearly describe the intent



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to