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

Open
#387 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
java
Domain
build-system

Research direction

Start in src/main/java/org/apache/maven/plugins/help/AllProfilesMojo.java at lines 153-156 and trace how active profiles are collected while walking parent projects. Verify the Maven profile context used for each project, then confirm the output does not mark parent profiles active for the child when their activation conditions differ.

Written by the indexing model from the issue text.

Description

bug

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.

Dominant language
Java
Stars
29
Forks
42
Avg merge
23h 15m
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-help-plugin

All issues in apache/maven-help-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.