Run the CAP Java project using Maven, read the Spring Boot startup output, access OData endpoints at port 8080, and stop the server cleanly.
cd bookshop-java
mvn spring-boot:run
First run downloads Maven dependencies (~2-3 minutes). Subsequent runs are much faster.
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.x.x)
...
[cds] - model loaded from 2 file(s)
[cds] - connect using SQLite in-memory
[cds] - serving CatalogService { path: '/catalog' }
...
Tomcat started on port(s): 8080
Started Application in 4.321 seconds
http://localhost:8080/catalog/$metadata
http://localhost:8080/catalog/Books
http://localhost:8080/catalog/Books?$top=2
Note: CAP Java defaults to port 8080, not 4004 like CAP Node.js.
Press Ctrl+C in the terminal.
In srv/src/main/resources/application.yaml:
server:
port: 4004
mvn spring-boot:run -Dspring-boot.run.profiles=production
mvn spring-boot:run -DskipTests
In application.yaml:
logging:
level:
com.sap.cds: DEBUG # show CDS framework internals
org.springframework: INFO
root: WARN
Add to pom.xml dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
Now when you save a Java file, Maven rebuilds and the server restarts automatically — similar to cds watch.