webcane / readme-app

web application which holds and manages articles to read
0 stars 0 forks source link

info vs app properties #72

Closed webcane closed 1 year ago

webcane commented 1 year ago

set up info app properties see https://www.callicoder.com/spring-boot-actuator/

# INFO ENDPOINT CONFIGURATION
info.app.name=@project.name@
info.app.description=@project.description@
info.app.version=@project.version@
info.app.encoding=@project.build.sourceEncoding@
info.app.java.version=@java.version@

instead of app defined

app:
  url: @project.url@
  name: @project.name@
  version: @project.version@
  description: @project.description@
  email: @project.developers[0].email@
webcane commented 1 year ago

alternative maven build-info https://docs.spring.io/spring-boot/docs/2.2.1.RELEASE/maven-plugin/examples/build-info.html

current GET http://localhost:8080/management/info

{
"build": {
    "artifact": "readme-app",
    "name": "readme-app",
    "time": "2022-09-20T19:29:05.746Z",
    "version": "1.0.0",
    "group": "cane.brothers"
    }
}

it could be accesable by build properties

@Autowired
BuildProperties buildProperties;
webcane commented 1 year ago

GET http://localhost:8080/management/info

{
"app": {
"url": "https://github.com/webcane/readme-app",
"name": "readme-app",
"version": "1.0.0",
"email": "@project.developers[0].email@",
"description": "Web application which holds and manages articles to read"
},
"git": {
"branch": "master",
"commit": {
"id": "4f92376",
"time": "2022-09-22T18:08:27Z"
}
},
"build": {
"artifact": "readme-app",
"name": "readme-app",
"time": "2022-09-22T18:30:00.497Z",
"version": "1.0.0",
"group": "cane.brothers"
},
"java": {
"version": "17.0.3",
"vendor": {
"name": "Homebrew",
"version": "Homebrew"
},
"runtime": {
"name": "OpenJDK Runtime Environment",
"version": "17.0.3+0"
},
"jvm": {
"name": "OpenJDK 64-Bit Server VM",
"vendor": "Homebrew",
"version": "17.0.3+0"
}
}
}