I just used spring boot to develop a non web project , actually a simple project used as a shell script, just access a url by RestTemplate
then send email to some body tell them the result by Freemaker
template.
at first I just dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
then build executable jar(mvn package), it's very big, have 17M. Then after several attempts, now the dependency is
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
even so the executable jar still big, have 12M.
Could exist any manner to reduce executable jar size? after all it's a very small project only have several small class.
In additional, could exist some best practice to create shell script by spring boot, now for this purpose I disable these things
spring.main.web-environment=false
spring.main.banner_mode=off
spring.devtools.livereload.enabled=false
spring.jmx.enabled=false
and disable logger
logging.level.org.springframework=ERROR
logging.level.com.foo=ERROR
could have some best practice to create shell script by spring boot?