bug/837 Get implementation version from package meta information instead of spring configuration
This commit is contained in:
parent
cc8e47b99a
commit
da0eb34d1e
|
|
@ -214,7 +214,7 @@
|
||||||
</goals>
|
</goals>
|
||||||
</pluginExecutionFilter>
|
</pluginExecutionFilter>
|
||||||
<action>
|
<action>
|
||||||
<ignore />
|
<ignore/>
|
||||||
</action>
|
</action>
|
||||||
</pluginExecution>
|
</pluginExecution>
|
||||||
</pluginExecutions>
|
</pluginExecutions>
|
||||||
|
|
@ -287,6 +287,17 @@
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<!--
|
<!--
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,6 @@ devMode=false
|
||||||
####### property that control if the database is cleaned and sample data is generated
|
####### property that control if the database is cleaned and sample data is generated
|
||||||
generateSampleData=true
|
generateSampleData=true
|
||||||
|
|
||||||
####### Property that informs about the Taskana's version. This version is shown the application web
|
|
||||||
version=@project.version@
|
|
||||||
|
|
||||||
####### control LDAP usage
|
####### control LDAP usage
|
||||||
taskana.ldap.useLdap=false
|
taskana.ldap.useLdap=false
|
||||||
####### properties to connect to LDAP
|
####### properties to connect to LDAP
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package pro.taskana.rest;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
|
@ -35,9 +34,6 @@ public class TaskanaEngineController {
|
||||||
this.taskanaEngine = taskanaEngine;
|
this.taskanaEngine = taskanaEngine;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Value("${version:Local build}")
|
|
||||||
private String version;
|
|
||||||
|
|
||||||
@GetMapping(path = "/v1/domains", produces = {MediaType.APPLICATION_JSON_VALUE})
|
@GetMapping(path = "/v1/domains", produces = {MediaType.APPLICATION_JSON_VALUE})
|
||||||
public ResponseEntity<List<String>> getDomains() {
|
public ResponseEntity<List<String>> getDomains() {
|
||||||
return new ResponseEntity<>(taskanaEngineConfiguration.getDomains(), HttpStatus.OK);
|
return new ResponseEntity<>(taskanaEngineConfiguration.getDomains(), HttpStatus.OK);
|
||||||
|
|
@ -90,7 +86,7 @@ public class TaskanaEngineController {
|
||||||
public ResponseEntity<VersionResource> currentVersion() {
|
public ResponseEntity<VersionResource> currentVersion() {
|
||||||
LOGGER.debug("Entry to currentVersion()");
|
LOGGER.debug("Entry to currentVersion()");
|
||||||
VersionResource resource = new VersionResource();
|
VersionResource resource = new VersionResource();
|
||||||
resource.setVersion(version);
|
resource.setVersion(TaskanaEngineConfiguration.class.getPackage().getImplementationVersion());
|
||||||
LOGGER.debug("Exit from currentVersion(), returning {}", new ResponseEntity<>(resource, HttpStatus.OK));
|
LOGGER.debug("Exit from currentVersion(), returning {}", new ResponseEntity<>(resource, HttpStatus.OK));
|
||||||
return new ResponseEntity<>(resource, HttpStatus.OK);
|
return new ResponseEntity<>(resource, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package pro.taskana.rest.resource;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import pro.taskana.configuration.TaskanaEngineConfiguration;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
|
public class ConfigurationTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testImplementationVersionIsInTaskanaCorePackage() {
|
||||||
|
assertNotNull(TaskanaEngineConfiguration.class.getPackage().getImplementationVersion());
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue