version-endpoint

A simple version endpoint

License

License

GroupId

GroupId

berlin.yuna
ArtifactId

ArtifactId

version-endpoint
Last Version

Last Version

0.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

version-endpoint
A simple version endpoint
Project URL

Project URL

https://github.com/YunaBraska/version-endpoint
Source Code Management

Source Code Management

https://github.com/YunaBraska/version-endpoint.git

Download version-endpoint

How to add to project

<!-- https://jarcasting.com/artifacts/berlin.yuna/version-endpoint/ -->
<dependency>
    <groupId>berlin.yuna</groupId>
    <artifactId>version-endpoint</artifactId>
    <version>0.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/berlin.yuna/version-endpoint/
implementation 'berlin.yuna:version-endpoint:0.2.2'
// https://jarcasting.com/artifacts/berlin.yuna/version-endpoint/
implementation ("berlin.yuna:version-endpoint:0.2.2")
'berlin.yuna:version-endpoint:jar:0.2.2'
<dependency org="berlin.yuna" name="version-endpoint" rev="0.2.2">
  <artifact name="version-endpoint" type="jar" />
</dependency>
@Grapes(
@Grab(group='berlin.yuna', module='version-endpoint', version='0.2.2')
)
libraryDependencies += "berlin.yuna" % "version-endpoint" % "0.2.2"
[berlin.yuna/version-endpoint "0.2.2"]

Dependencies

compile (1)

Group / Artifact Type Version
io.rest-assured : rest-assured jar 4.2.0

provided (1)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-web jar 2.2.4.RELEASE

test (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar 2.2.4.RELEASE
junit : junit jar 4.13

Project Modules

There are no modules declared in this project.

version-endpoint

Creates a version endpoint with git properties like SHA etc.

Build Maintainable Coverage Issues Commit Dependencies License Central Tag Javadoc Size Label

Requirements

  • pl.project13.maven:git-commit-id-plugin plugin which generates ${project.build.testOutputDirectory}/git.properties
  • org.springframework.boot:spring-boot-maven-plugin plugin which generates ${project.build.outputDirectory}/META-INF/build-info.properties

How to use it

<dependency>
    <groupId>berlin.yuna</groupId>
    <artifactId>version-endpoint</artifactId>
    <version>0.2.2</version>
</dependency>

Configuration

management:
  endpoint:
    version:
      path: /internal/version
        git:
          include: "*"
          exclude: tags, branch

Example

{
    "projectName": "version-endpoint",
    "projectGroup": "berlin.yuna",
    "projectArtifact": "version-endpoint",
    "projectVersion": "0.2.2",
    "git": {
        "tags": "",
        "build.version": "0.2.2",
        "closest.tag.commit.count": "20",
        "commit.user.name": "Yuna Morgenstern",
        "commit.id.abbrev": "a6729de",
        "branch": "testbranch",
        "build.host": "Cr15t4lF1r3",
        "commit.id.describe-short": "0.1.0-1-dirty",
        "total.commit.count": "8",
        "commit.id.describe": "0.1.0-1-ga6729de-dirty",
        "build.user.email": "[email protected]",
        "commit.id": "a6729de1f723aa3ddc84635a7cf9769dea489e17",
        "commit.message.short": "my cool commit message",
        "commit.user.email": "[email protected]",
        "closest.tag.name": "0.2.2",
        "local.branch.ahead": "0",
        "build.time": "1988-08-20T20:12:58+0100",
        "commit.time": "1988-08-20T18:22:17+0100",
        "local.branch.behind": "0",
        "build.user.name": "",
        "dirty": "true",
        "commit.message.full": "my cool commit message",
        "remote.origin.url": "https://github.com/YunaBraska/version-endpoint.git"
    }
}

Troubleshooting

  • BuildProperties are not initialized: just the following command
mvn clean compile
  • Add spring-boot-maven-plugin if the solution above did't help
<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>${spring-boot.version}</version>
    <executions>
        <execution>
            <phase>compile</phase>
            <id>build-info</id>
            <goals>
                <goal>build-info</goal>
            </goals>
        </execution>
    </executions>
</plugin>                

TODO

[ ] path to custom properties file

logo

Versions

Version
0.2.2
0.2.1
0.2.0
0.0.2
0.0.1