diff --git a/rest/taskana-rest-spring-example/src/main/resources/application.properties b/rest/taskana-rest-spring-example/src/main/resources/application.properties index ecaa114f3..6d12eae5c 100644 --- a/rest/taskana-rest-spring-example/src/main/resources/application.properties +++ b/rest/taskana-rest-spring-example/src/main/resources/application.properties @@ -22,6 +22,9 @@ devMode=false ####### property that control if the database is cleaned and sample data is generated generateSampleData=true +####### Property that informs about the Taskana's version. This version is shown the application web +version=@project.version@ + ####### control LDAP usage taskana.ldap.useLdap=false ####### properties to connect to LDAP diff --git a/rest/taskana-rest-spring-example/src/test/resources/application.properties b/rest/taskana-rest-spring-example/src/test/resources/application.properties index 27c503833..b4a656d4a 100644 --- a/rest/taskana-rest-spring-example/src/test/resources/application.properties +++ b/rest/taskana-rest-spring-example/src/test/resources/application.properties @@ -8,6 +8,10 @@ datasource.password=sa taskana.schemaName=TASKANA ####### property that control rest api security deploy use true for no security. devMode=false + +####### Property that informs about the Taskana's version. This version is shown the application web +version=@project.version@ + ####### control LDAP usage taskana.ldap.useLdap=false ####### properties to connect to LDAP diff --git a/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskanaEngineController.java b/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskanaEngineController.java index 5e1e344cf..c74cef4fc 100644 --- a/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskanaEngineController.java +++ b/rest/taskana-rest-spring/src/main/java/pro/taskana/rest/TaskanaEngineController.java @@ -3,6 +3,7 @@ package pro.taskana.rest; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -28,6 +29,9 @@ public class TaskanaEngineController { @Autowired TaskanaEngineImpl taskanaEngineImpl; + @Value("${version:Local build}") + private String version; + @GetMapping(path = "/v1/domains", produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity> getDomains() { return new ResponseEntity<>(taskanaEngineConfiguration.getDomains(), HttpStatus.OK); @@ -66,10 +70,6 @@ public class TaskanaEngineController { */ @GetMapping(path = "/v1/version", produces = {MediaType.APPLICATION_JSON_VALUE}) public ResponseEntity currentVersion() { - String version = TaskanaEngineController.class.getPackage().getImplementationVersion(); - if (version == null) { - version = "1.0-DEFAULT"; - } VersionResource resource = new VersionResource(); resource.setVersion(version); return new ResponseEntity<>(resource,