updated to spring-boot 1.5.22.RELEASE and apache camel 3.20.5
This commit is contained in:
parent
fe7a8b1631
commit
61756adf8c
37
pom.xml
37
pom.xml
|
@ -3,7 +3,6 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>eu.dnetlib</groupId>
|
||||
<artifactId>validator-api</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
@ -12,24 +11,42 @@
|
|||
<scm>
|
||||
<developerConnection>scm:git:gitea@code-repo.d4science.org:MaDgIK/uoa-validator-api.git</developerConnection>
|
||||
</scm>
|
||||
|
||||
<parent>
|
||||
<groupId>eu.dnetlib</groupId>
|
||||
<artifactId>uoa-spring-boot-parent</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>1.5.22.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<timestamp>${maven.build.timestamp}</timestamp>
|
||||
<maven.build.timestamp.format>E MMM dd HH:mm:ss z yyyy</maven.build.timestamp.format>
|
||||
<java.vesrion>11</java.vesrion>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<spring-boot-version>1.5.22.RELEASE</spring-boot-version>
|
||||
<!--gson-version>2.9.0</gson-version-->
|
||||
<!--swagger-version>2.7.0</swagger-version-->
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- validator -->
|
||||
<dependency>
|
||||
<groupId>eu.dnetlib</groupId>
|
||||
<artifactId>uoa-validator-engine2</artifactId>
|
||||
<version>0.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring boot -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- jpa, crud repository -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -40,18 +57,19 @@
|
|||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>9.4.1212.jre7</version>
|
||||
</dependency>
|
||||
|
||||
<!--Apache Camel -->
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-core</artifactId>
|
||||
<version>3.20.3</version>
|
||||
<version>3.20.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-oaipmh</artifactId>
|
||||
<version>3.20.3</version>
|
||||
<version>3.20.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -60,7 +78,7 @@
|
|||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>1.5.8.RELEASE</version>
|
||||
<version>1.5.22.RELEASE</version>
|
||||
<configuration>
|
||||
<mainClass>eu.dnetlib.validatorapi.ValidatorApiApplication</mainClass>
|
||||
<executable>true</executable>
|
||||
|
@ -69,6 +87,7 @@
|
|||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
<goal>build-info</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package eu.dnetlib.validatorapi;
|
||||
|
||||
import eu.dnetlib.validatorapi.configuration.GlobalVars;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.context.annotation.PropertySources;
|
||||
|
||||
|
@ -12,7 +10,7 @@ import org.springframework.context.annotation.PropertySources;
|
|||
@PropertySource("classpath:validatorapi.properties"),
|
||||
@PropertySource(value = "classpath:dnet-override.properties", ignoreResourceNotFound = true)
|
||||
})
|
||||
@EnableConfigurationProperties({GlobalVars.class})
|
||||
|
||||
public class ValidatorApiApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ValidatorApiApplication.class, args);
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
package eu.dnetlib.validatorapi.configuration;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ConfigurationProperties("validatorapi.globalVars")
|
||||
@Validated
|
||||
public class GlobalVars {
|
||||
public static Date date = new Date();
|
||||
private Date buildDate;
|
||||
private String buildDate;
|
||||
private String version;
|
||||
|
||||
public String getBuildDate() {
|
||||
|
@ -17,7 +19,7 @@ public class GlobalVars {
|
|||
return buildDate.toString();
|
||||
}
|
||||
|
||||
public void setBuildDate(Date buildDate) {
|
||||
public void setBuildDate(String buildDate) {
|
||||
this.buildDate = buildDate;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
package eu.dnetlib.validatorapi.controllers;
|
||||
|
||||
import eu.dnetlib.validatorapi.configuration.GlobalVars;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin(origins = "*")
|
||||
public class ValidatorApiCheckDeployController {
|
||||
private static final Logger log = LogManager.getLogger(ValidatorApiCheckDeployController.class);
|
||||
|
||||
@Autowired
|
||||
private GlobalVars globalVars;
|
||||
|
||||
@RequestMapping(value = {"", "/health_check"}, method = RequestMethod.GET)
|
||||
public String hello() {
|
||||
log.debug("Hello from validator-api!");
|
||||
return "Hello from validator-api!";
|
||||
}
|
||||
|
||||
// @PreAuthorize("hasAnyAuthority(@AuthorizationService.PORTAL_ADMIN)")
|
||||
@RequestMapping(value = "/health_check/advanced", method = RequestMethod.GET)
|
||||
public Map<String, String> checkEverything() {
|
||||
Map<String, String> response = new HashMap<>();
|
||||
|
||||
if(globalVars.date != null) {
|
||||
response.put("Date of deploy", globalVars.date.toString());
|
||||
}
|
||||
if(globalVars.getBuildDate() != null) {
|
||||
response.put("Date of build", globalVars.getBuildDate());
|
||||
}
|
||||
if(globalVars.getVersion() != null) {
|
||||
response.put("Version", globalVars.getVersion());
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
|
@ -1,2 +1,2 @@
|
|||
validatorapi.globalVars.buildDate=@timestamp@
|
||||
validatorapi.globalVars.version=@version@
|
||||
#validatorapi.globalVars.buildDate=@timestamp@
|
||||
#validatorapi.globalVars.version=@version@
|
Loading…
Reference in New Issue