argos/dmp-backend/web/src/main/java/eu/eudat/EuDatApplication.java

47 lines
1.7 KiB
Java
Raw Normal View History

2017-12-15 11:05:51 +01:00
package eu.eudat;
import com.fasterxml.jackson.annotation.JsonInclude;
2023-10-11 16:53:12 +02:00
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import eu.eudat.data.BaseEntity;
2017-12-15 11:05:51 +01:00
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
2018-01-17 13:03:51 +01:00
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
2023-10-11 16:53:12 +02:00
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
2018-10-02 16:33:58 +02:00
import org.springframework.scheduling.annotation.EnableAsync;
2017-12-15 11:05:51 +01:00
2023-10-11 16:53:12 +02:00
@SpringBootApplication(scanBasePackages = {
"eu.eudat",
"eu.eudat.depositinterface",
"gr.cite",
"gr.cite.tools",
"gr.cite.commons"
})
2023-11-08 12:37:16 +01:00
@EntityScan({
"eu.eudat.data"})
2018-10-02 16:33:58 +02:00
@EnableAsync
2018-01-17 13:03:51 +01:00
public class EuDatApplication extends SpringBootServletInitializer {
2017-12-15 17:57:41 +01:00
2023-10-11 16:53:12 +02:00
@Bean
@Primary
public ObjectMapper primaryObjectMapper() {
return JsonMapper.builder().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.serializationInclusion(JsonInclude.Include.NON_NULL)
2023-10-11 16:53:12 +02:00
.addModule(new JavaTimeModule()).build();
}
2018-01-31 16:39:16 +01:00
@Override
2018-01-17 13:03:51 +01:00
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(EuDatApplication.class);
2018-01-31 16:39:16 +01:00
}
2017-12-15 17:57:41 +01:00
2017-12-15 11:05:51 +01:00
public static void main(String[] args) {
SpringApplication.run(EuDatApplication.class, args);
}
}