Skip to content

AllProfilesMojo.addProjectPomProfiles() uses parent build context for active profiles #387

Description

@elharo

In src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java:153-156:

if (project.getActiveProfiles() != null) {
for (Profile profile : project.getActiveProfiles()) {
activeProfiles.put(profile.getId(), profile);
}
}
project = project.getParent(); // walks up to parent

When the loop reaches a parent POM, project.getActiveProfiles() returns profiles active in the parent build context. These may not be active for the child project (different JDK, OS, properties). The output can incorrectly mark parent profiles as active when they do not apply to the child.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions