Skip to content

Conversation

@cstamas
Copy link
Member

@cstamas cstamas commented Feb 26, 2025

Where user can create ad-hoc command line parms. The difference between .mvn/maven.conf and this file is that this file allows goals as well. The CLI and atFile are merged, in this order, hence, goals in atFile will come AFTER goals specified on CLI, if CLI has them.

Source order (first wins for options, while goals are collected/aggregated from sources):

  • CLI
  • atFile (if specified, may have goals that are appended)
  • maven.config (if present, may not have goals)

Note: option is called af or long at-file for similarity with javac @file, but commons CLI does not support options without leading hyphen.


https://issues.apache.org/jira/browse/MNG-8594

Where user can create ad-hoc command line parms. The difference
between .mvn/maven.conf and this file is that this file allws
goals as well. The CLI and atFile are merged, in this order,
hence, goals in atFile will come AFTER goals specified on CLI.

---

https://issues.apache.org/jira/browse/MNG-8594
@cstamas cstamas added this to the 4.0.0-rc-3 milestone Feb 26, 2025
@cstamas cstamas self-assigned this Feb 26, 2025
@cstamas cstamas requested a review from gnodet February 26, 2025 10:40
@cstamas cstamas marked this pull request as ready for review February 26, 2025 11:02
@gnodet
Copy link
Contributor

gnodet commented Feb 26, 2025

Looks good, that can be handy !
Any way to add a small UT or IT maybe ?

@cstamas
Copy link
Member Author

cstamas commented Feb 26, 2025

@gnodet Added IT, that revealed precedence issue in case of User Properties (-D) that was present for maven.config as well, fixed.

Optional<Map<String, String>> up = getter.apply(option);
if (up.isPresent()) {
had++;
items.putAll(up.get());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was putAll, meaning property coming from lower precedence (they are in-order), overwrote already present (higher precedence) property.

Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cstamas cstamas merged commit 12ff710 into apache:master Feb 26, 2025
13 checks passed
@cstamas cstamas deleted the MNG-8594 branch February 26, 2025 17:31
@jira-importer
Copy link

Resolve #9852

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants