English | Français | 日本語 | Español
A hello-world Spring Boot (Java) web app. Deploy it free from its GitHub address with the MitsuruTech
deploy a web app from GitHub feature: no account, nothing to
install. It is small enough to be a first test of deploying to learntools.dev, and the steps
are in the manual's guide to deploying Python, Node, Go and Java apps from GitHub.
Language Java
Build mvn -q -DskipTests package
Start java -jar target/*.jar
Those are the platform's defaults; nothing here needs changing.
Three things worth copying into your own project:
- Spring Boot reads
SERVER_PORTfrom the environment by itself, and the environment beatsapplication.properties, so the platform's port wins with no code involved. <finalName>app</finalName>. The start command is a glob,target/*.jar, so it wants exactly one jar. Spring Boot's repackage leaves the pre-repackage jar as.jar.original, which the glob skips; naming the artifact also keeps the version out of the filename so the start command never needs editing.- The first build is slow. Maven fetches Spring Boot and its dependencies through the platform's proxy, which allows Maven Central. Later builds reuse the cache.
mvn spring-boot:run
This work is licensed under CC BY-NC-SA 4.0. You may share it and adapt it for learning and teaching, if you credit Mitsuru Technologies Ltd, do not use it commercially, and share anything you make from it under the same licence. The full text is in the LICENSE file. It covers the files in this repository.
Made by Mitsuru Technologies for the MitsuruTech Learning Platform: Python, Java, Go, Node, SQL and Linux in the browser for schools and colleges, with container labs, web apps deployed from GitHub, and quizzes that mark themselves. Try code with no account in the playground.