Skip to content
Advertisement

Tag: spring-boot

Gradle: Build ‘fat jar’ with Spring Boot Dependencies

I am using Gradle to build and package a very simple spring boot application (99% static content) into a jar with embedded tomcat. I tried creating said jar, at first the result was 86k and did not launch, because it was missing some Spring boot classes. I concluded this jar I made contained none of the application’s dependencies, and since

Embedded Redis for Spring Boot

I run my Integration Test cases with Spring Boot with the help of my local Redis server on my machine. But I want an embedded Redis server which is not dependent on any server and can run on any environment, like the H2 in-memory database. How can I do it? Answer You can use an embedded Redis like https://github.com/kstyrc/embedded-redis Add

Spring Boot Actuator without Spring Boot

I’ve been working on a Spring/Spring MVC application and I’m looking to add performance metrics. I’ve come across Spring Boot Actuator and it looks like a great solution. However my application is not a Spring Boot application. My application is running in a traditional container Tomcat 8. I added the following dependencies I created the following config class. I even

SpringBoot with Thymeleaf – css not found

First to say is that I’ve been searching for a solution for a while now and I’m quite desperate now. I cannot get the css file to be accessible from html page when run by Spring Boot. html.file Application.java folder structure: I’ve tried putting the css folder into a static folder and/or removing the addResourcesHandlers, referencing to the css by

How to write a unit test for a Spring Boot Controller endpoint

I have a sample Spring Boot app with the following Boot main class Controller What’s the easiest way to write a unit test for the controller? I tried the following but it complains about failing to autowire WebApplicationContext Answer Spring MVC offers a standaloneSetup that supports testing relatively simple controllers, without the need of context. Build a MockMvc by registering

Advertisement