gnodet commented on code in PR #2132: URL: https://github.com/apache/maven/pull/2132#discussion_r1972515334
########## 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: What about: * `getDeclaredProfiles()` / `getEffectiveProfiles()` * `getDeclaredActiveProfiles()` / `getEffectiveActiveProfiles()` The `declared` would make reference to only profiles on the current project, while `effective` would make reference to profiles from the project and it's hierarchy, similar to the `effective` model which is computed with the parents merged into it. ########## 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: What about: * `getDeclaredProfiles()` / `getEffectiveProfiles()` * `getDeclaredActiveProfiles()` / `getEffectiveActiveProfiles()` The `declared` would make reference to only profiles on the current project, while `effective` would make reference to profiles from the project and it's hierarchy, similar to the `effective` model which is computed with the parents merged into it. -- 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