apache / apache/maven

Change maven cli defaults based on `CI` env variable

Open
#11,088 1 comment 0 reactions 1 assignee Claimed by @gnodet View on GitHub
enhancement mvn4
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
21h 11m
Merged PRs (30d)
312

Description

### New feature, improvement proposal

CI servers usually define a `CI` env variable:

For reference:

- Github [Default environment variables](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables)
- Jenkins [Global Variable Reference](https://ci.eclipse.org/releng/pipeline-syntax/globals#env)
- GitLab [Predefined CI/CD variables reference](https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)

it would be great if maven could detect that and change some of the default settings then, for example:

1. show transfer progress is currently _ON_ by default it should be _OFF_ by default on CI servers
2. batch mode is _OFF_ by default and should be _ON_ by default on CI servers
3. ... maybe more ...

reason is that these options are usually tweaked for the CI and it always adds some boilerplate to these scripts. It would be great if maven can use convention-over-configuration here and switch the defaults depending on where it runs. If anyone absolutely want other values they can still explicitly configure them.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.