apache / apache/maven

[MNG-7074] Environment Variable defaulting

Open
#8,376 5 comments 1 reaction 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Loïc Hermann](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=loichrn)** opened **[MNG-7074](https://issues.apache.org/jira/browse/MNG-7074?redirect=false)** and commented

Hi all,

maven build in CI environment often rely on environnement variables.

If those environment variables are not defined on the developper environment the build will fail.

`For now defaulting those environment variable can only be done by defining one profile per variable which is really verbose.`

`it would be easier if we can either`

`add a default value where the variable is used:`

```

`$\{env.VARIABLE_NAME:defaultValue`}

```

or have a section to define default values in the pom:

```

   <`VARIABLE_NAME`>defaultValue

```

I would love to work on a PR to implements one of those solution if this make sense to you.

 

Regards

---

1 votes, 2 watchers

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Maven core's existing environment-variable interpolation and the two proposed default-value syntaxes in the issue. Decide which approach is appropriate and trace its impact through POM processing. Done means the chosen behavior is specified clearly and covered by relevant tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.