in src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java [129:150]
private void addProjectPomProfiles(
MavenProject project, Map<String, Profile> allProfiles, Map<String, Profile> activeProfiles) {
if (project == null) {
// shouldn't happen as this mojo requires a project
getLog().debug("No pom.xml found to read Profiles from.");
return;
}
getLog().debug("Attempting to read profiles from pom.xml...");
while (project != null) {
for (Profile profile : project.getModel().getProfiles()) {
allProfiles.put(profile.getId(), profile);
}
if (project.getActiveProfiles() != null) {
for (Profile profile : project.getActiveProfiles()) {
activeProfiles.put(profile.getId(), profile);
}
}
project = project.getParent();
}
}