Spring Boot disable @Cacheable per request

I'm trying to disable a Cacheable function in Spring Boot based on a URL parameter. For example http://myapplication.com/some/request?cache=false I tried the condition with SpEL but I haven't been able to get it work @Cacheable(value = "value", key...
more »

2017-05-19 23:05 (1) Answers

How to check if Resttemplate gets error?

How can I check if I get an error with RestTemplate in my SpringBootApplication properly? I managed to create an ResponseErrorHandler but am not sure how to handle that error in my code. So I want to print an error message if an error occured and els...
more »

2017-05-19 18:05 (1) Answers

spring-boot with the gradle java java-plugin

I use gradle with the new java-library plugin. With this plugin we can use new configurations for dependencies instead of 'compile', 'runtime', 'test' etc. see java-library plugin documentation But with the spring-boot plugin, when I launch the task...
more »

2017-05-18 17:05 (0) Answers

customize 403 error on a spring boot Rest server

I'm trying (without success) to customize the 403 Exception error on my spring boot application. This application is a rest server which return json response. It has custom AuthenticationProvider which check the validity of a JWT token. When the toke...
more »

2017-05-15 15:05 (1) Answers

Dot notation with Gradle 3.5 and Spring Boot

I'm stuck with the usage of dot notation in Gradle build scripts. I have a multi project build with a main project and sub projects. Then main build.gradle is something like this subprojects { apply plugin: 'java' sourceCompatibility = 1.8...
more »

2017-05-15 14:05 (2) Answers

Alternate to mvn spring-boot:run

I have a spring boot application which I run using: mvn spring-boot:run and this works perfectly fine. I want to run this application using java -jar option and when I run it: java $JAVA_OPTS -jar target/backend-1.0-SNAPSHOT.jar --server.port=8...
more »

2017-05-14 19:05 (2) Answers

Spring Boot Ambiguous mapping. Cannot map method

I have 2 REST controllers in my Spring Boot application with simple CRUD operations. REST controller, that is mapped to "/json/currency" package ua.alekstar.moneysaver.rest; import org.springframework.web.bind.annotation.*; import ua.alekstar.mone...
more »

2017-05-13 20:05 (1) Answers

Artifactory publish of root and subproject archive

I have this build.gradle with 3 submodules armstrong-api, armstrong-impl and armstrong-ws. armstrong.yaml is published from rootProject. I am trying to figure out how can also publish armstrong-ws.war along with armstrong.yaml. I have been searching ...
more »

2017-05-13 05:05 (0) Answers

flyway + gradle + spring boot configuration

How can I configure flyway in build.gradle to get url ,username, password from other properties file? Instead of this: flyway { url = 'jdbc:postgresql://localhost:5432/db' user = 'a' password = 'a' locations = ['filesystem:db/migra...
more »

2017-05-12 17:05 (0) Answers

Spring Boot logging with Lombok

I would like to use Project Lombok's log annotation in my Spring Boot projects but I don't want to lose the functionality of being able to change the logging from the application.properties. The Spring logging docs aren't overly clear on what the d...
more »

2017-05-10 22:05 (1) Answers

Compile using nexus jar

I'm newer using Gradle, I have an application that contain many subprojects spring-boot. The file build.gradle of the main project is like this snippet: apply plugin: VerifyEventStoreEnvironmentPlugin apply plugin: EventuateDependencyPlugin apply p...
more »

2017-05-09 11:05 (0) Answers

Jackson accepting negative dates

I am trying to get a date field from JSON in a spring-boot application with Jackson. The JSONFormat looks like this: @NotNull(message = ValidationErrors.NOT_BLANK_MESSAGE) @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd") private Da...
more »

2017-05-09 09:05 (1) Answers

Spring RestController Async Results

The blog post http://farazdagi.com/blog/2014/rest-long-running-jobs (as well as the referenced resources) recommend using the following scenario when using REST to wait for long running jobs Return the payload immediately if the result is already ...
more »

2017-05-09 08:05 (1) Answers