Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.69 KB

java-service-reference.md

File metadata and controls

39 lines (24 loc) · 1.69 KB

Java service command reference

Commands to try in a separate Spring Boot project, saved here for application practice. This repository has no Spring Boot application or JAR to run.

The project needs a configured Maven Wrapper and an executable JAR. Replace target/app.jar with the actual artifact path and use a profile configured for that application.

Build and run

From the application directory:

./mvnw verify
SPRING_PROFILES_ACTIVE=dev java -jar target/app.jar

Run the application after the build succeeds. Its startup logs stay in this terminal.

Inspect from another terminal

curl -i --max-time 5 http://localhost:8080/api/users
ss -ltnp 'sport = :8080'

Use an endpoint the application exposes. curl -i shows headers and the body; it does not fail just because an HTTP error status was returned. A scripted check needs an explicit success condition, such as curl --fail for HTTP 400+ responses.

ss inspects listening TCP sockets on port 8080. Process details depend on the account's access permissions.

If the application is configured to write app.log:

tail -n 50 -f app.log

Spring Boot's running guide and configuration reference, the Maven Wrapper guide, and the curl manual cover the details.

For an existing Ubuntu service example, see DeployLatch's operations guide.

Back to the learning map