eclipse / kapua

Eclipse Public License 2.0
222 stars 160 forks source link

Display Custom Version and Build Number in Swagger UI #4001

Closed MDeLuise closed 5 months ago

MDeLuise commented 5 months ago

Description

This pull request resolves an issue where the version number displayed in the Swagger UI was always retrieved from the pom.xml file, regardless of any custom version and build number specified during the project build process.

Prior to this PR, users were unable to customize the version and build number displayed in the Swagger UI, as it solely relied on the information stored in the pom.xml file. However, with this enhancement, users can now specify custom version and build number values during project builds using the -Dcommons.version=custom-version -Dcommons.build.number=custom-build-number flags. These custom values are then accurately reflected not only in the container environment but also in the Swagger UI.

Usage

If the project is build using mvn clean install then the version displayed in the Swagger UI will be the one defined in the project.version followed by the build number placeholder unknown. If the project is build using mvn clean install -Dcommons.version=foo -Dcommons.build.number=bar then the version displayed in the Swagger UI will be foo-bar.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 16.87%. Comparing base (81a090d) to head (d2fe5f3).

:exclamation: Current head d2fe5f3 differs from pull request most recent head aa5608a. Consider uploading reports for the commit aa5608a to get more accurate results

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse/kapua/pull/4001/graphs/tree.svg?width=650&height=150&src=pr&token=1P4N4CApH8&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse)](https://app.codecov.io/gh/eclipse/kapua/pull/4001?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse) ```diff @@ Coverage Diff @@ ## develop #4001 +/- ## ========================================== Coverage 16.87% 16.87% Complexity 10 10 ========================================== Files 1989 1989 Lines 51791 51791 Branches 4420 4420 ========================================== Hits 8739 8739 Misses 42648 42648 Partials 404 404 ```