Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify Spring boot Embedded Tomcat extract path

I have realized that when I run spring booth application, embedded tomcat files extracted under /tmp file.

Periodic cleanup removes this folder so application gives an error.

Is there any way to modify the path, changing from /tmp to /customfolder.

like image 602
Ahmet Karakaya Avatar asked Feb 10 '17 06:02

Ahmet Karakaya


People also ask

Can we change embedded Tomcat server in spring boot?

The Spring Boot framework provides the default embedded server (Tomcat) to run the Spring Boot application. It runs on port 8080. It is possible to change the port in Spring Boot.

How do I change the port of embedded Tomcat in spring boot?

Another way to change the port of embedded tomcat in the Spring Boot application is by specifying the server. port property in the resource file. For example, if you want your Spring boot application to listen on port 8080, then you can specify server. port=8080 on the application.

How do you specify file path in application properties in spring boot?

properties in default location. Spring Boot loads the application. properties file automatically from the project classpath. All you have to do is to create a new file under the src/main/resources directory.

Does spring boot use embedded Tomcat?

By default, Spring Boot provides an embedded Apache Tomcat build. By default, Spring Boot configures everything for you in a way that's most natural from development to production in today's platforms, as well as in the leading platforms-as-a-service.


1 Answers

You are looking for the property server.tomcat.basedir, aren't you?

server.tomcat.basedir= # Tomcat base directory. If not specified
                       # a temporary directory will be used.
like image 52
Andrew Tobilko Avatar answered Sep 28 '22 07:09

Andrew Tobilko