lmmendes / datadog_buildpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App version

lmmendes opened this issue · comments

If datadog vcap service doesn't define a DD_VERSION the default version should be retrieved from META-INF file that exists under the app folder, it has the following structure:

Manifest-Version: 1.0
Created-By: Maven Jar Plugin 3.2.0
Build-Jdk-Spec: 11
Implementation-Title: nebula
Implementation-Version: 0.1.0-SNAPSHOT
Main-Class: org.springframework.boot.loader.JarLauncher
Start-Class: io.mb.nebula.NebulaApplication
Spring-Boot-Version: 2.3.8.RELEASE
Spring-Boot-Classes: BOOT-INF/classes/
Spring-Boot-Lib: BOOT-INF/lib/
Spring-Boot-Classpath-Index: BOOT-INF/classpath.idx

This is a safer approach in my option than trying to find the POM file under the META-INF folder because it requires us to know the artifact group and id, or using a glob and trying to find the pom.xml or pom.properties under that folder.

Also this approach would have to be adapted if gradle was used.