Spring Boot

Spring Boot is a powerful framework from the Spring ecosystem designed for simplifying the bootstrapping and development of new Spring applications. The framework aims to minimize coding time and increase productivity by providing a range of out-of-the-box features for developing web applications.

For Spring Boot, we currently support Spring Boot 2 and Spring Boot 3. Spring Boot 2 can be built and deployed with a choice of JDK 11 and JDK17 versions, while Spring Boot 3 can only be built with JDK 17.

AppPaaS builds on top of Gradle Wrapper and Maven Wrapper, which means that if you don't have Gradle Wrapper or Maven Wrapper in your source, it won't be built and fail.

If you use Spring Initializr or an IDE to generate the source, it will most likely come with Wrapper included, but if you need to add it separately, check out the article below to get started.

Gradle Wrapper Doc: https://docs.gradle.org/current/userguide/gradle_wrapper.html

Maven Wrapper Doc: https://maven.apache.org/wrapper/

When building, the jar file is renamed server.jar and is deployed and run under that name.

When using Spring Boot, the build and deployment-specific settings are as follows, respectively

  1. Service Preferences a) Internal port: This is the port that the service listens to after it is deployed. Typically, port 8080 is used when creating a Spring web application and if you have changed that port within the source, you will need to enter the changed value. In AppPaaS beta, we do TCP health checks based on that port. b) External port, whether to open external port: This setting determines whether the service is open to the public. By default, it is set to 443, open, and when set to open, an external domain is assigned and can be accessed from the outside via https://{assigned address}. When set to private, it is not accessible from the outside and only service-to-service communication via internal domain addresses is supported. c) Set automatic deployment: When you set automatic deployment, it will receive a hook for any changes to the selected branch in your repository and will automatically build and deploy. <그림 1>

  2. Advanced Preferences a) Build command: If you select a repository and do not override the build command, the source will be scanned to try to detect gradlew or mvnw. If gradlew is detected, the gradlew clean build command will be performed, and if mvnw is detected, the mvnw clean install will be performed. If you want something other than both to be performed, you can override it by writing in the corresponding value. b) Start command: As mentioned earlier, all jar files are renamed to server.jar, so they are run via the java -jar server.jar command. You can override that value as well. c) Environment variables: It is entered in the form of Key/Value and the entered value is injected into the environment variable of the container OS. The injected environment variables can be retrieved from within the code via System.getenv() or System.getProperty(). They can also be used in the startup command. For example, if you defined a plain environment variable as KEY: ENV, value: dev, you can use it as a startup command like this java -jar server.jar -Dspring.profiles.active=$ENV <그림 2>

Last updated

Logo

ⓒ NHN Cloud Corp. All rights reserved.