0
votes

I have a scala play application; I am trying to expose health check for our service. Part of the health check I would like to capture the project artifact version.

Can I know how I can reference project artifact version from health check controller in play application. We are making use of sbt for the build.

sample sbt file

import root.sbt.Keys._ import com.typesafe.sbt.SbtNativePackager._ import NativePackagerKeys._ import play.PlayScala

name := "artifact-name"

version := "0.5"

scalaVersion := "2.11.1"

javacOptions ++= Seq("-source", "1.7", "-target", "1.7")

scalacOptions += "-target:jvm-1.7"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

1
seem's similar question is already posted; I got the answer from here stackoverflow.com/questions/8957025/…Laxmikanth Samudrala

1 Answers

1
votes

The xsbt-reflect plugin gives you access to the SBT variables at runtime.

All you need to do inside of your health route is return

Reflect.version