charangowdamd-cmd opened a new pull request, #13549: URL: https://github.com/apache/maven/pull/13549
Fixes #13479. ### Description Maven 4 treats -P ?id as an optional profile (MNG-7051): activate it if it exists, skip it otherwise. In Maven 3.x, -P ?id was read literally as a profile named ?id, which caused a warning that ?id does not exist and left the real profile unactivated. This causes builds that pass -P ?profile (such as CI matrices testing Maven 3 and 4 side by side) to silently skip profiles on Maven 3. This PR adds support for accepting ? after +, -, and ! prefixes in -P, aligning with Maven 4's prefix evaluation order, and skipping any degenerate tokens that are left empty after stripping prefixes. ### Changes - Extracted profile activation option handling into package-private performProfileActivation(CommandLine, List<String>, List<String>) in MavenCli. - Stripped leading ? optional-profile marker after processing +, -, or ! prefixes. - Skipped tokens that become empty after stripping prefixes. - Added unit tests estOptionalProfiles and estDegenerateProfileTokens in MavenCliTest. --- - [x] Your pull request should address just one issue, without pulling in other changes. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Each commit in the pull request should have a meaningful subject line and body. - [x] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. - [x] Run mvn verify to make sure basic checks pass. - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
