apache / apache/maven-release

[MRELEASE-844] Support providing user properties via properties file

Open
#1,089 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
128
Forks
145
Avg merge
7h 7m
Merged PRs (30d)
3

Description

**[Patrick van Dissel](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=pvdissel)** opened **[MRELEASE-844](https://issues.apache.org/jira/browse/MRELEASE-844?redirect=false)** and commented

For usage of the `mvn release:prepare` command in situations where CLI arguments are not possible, I would like to have support for providing the plugin user properties via a properties file.

An example situation I need it for, is the following:
CI systems like Jenkins have multiple steps in a single job. Environment variables being only in scope for one single step, making it impossible to have a maven release plugin userProperty created dynamicly and use the CLI args ("-D...") to pass userProperties to maven.
Specific use case is passing a custom `releaseVersion` and `developmentVersion`, I noticed for this a nice solution is already on the roadmap under the case MRELEA[SE-431](https://issues.apache.org/jira/browse/SE-431). But I'm sure this new properties file can be used in more cases.

As I need this for the release:prepare goal, I currently implemented this only for this goal. I've attached the patch "support.user.properties.patch" with my implementation. I've fitted it in the maven-release-plugin instead of the maven-release-manager as this change is purely about reading configuration that is lateron passed to maven-release-manager APIs.

Technical details:
- The properties file to put the user properties in, is currently called 'release.user.properties'
- Order of reading the user properties is:
- First read the properties from the pom (where available)
- Merge the read properties with the properties from the release.user.properties
- Merge the merged properties with user properties provided the command line arguments
- Then call to maven-release-manager API is made, which reads/writes the 'release.properties' file
- All non-readonly user properties supported by release:prepare are supported
- All properties from the original release.properties file are supported
- I only created a unit-test, as I couldn't find out how integration-tests work or where they are located

---

**Affects:** 2.4.1, 2.5

**Attachments:**
- [support.user.properties.patch](https://issues.apache.org/jira/secure/attachment/12718298/support.user.properties.patch) (_35.87 kB_)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the maven-release-plugin implementation of the release:prepare goal and its existing unit test. Read how properties are read before the maven-release-manager API is called, including release.user.properties and release.properties. Done means supported user properties can be loaded from the file with the stated precedence, while command-line values remain highest priority.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.