REST CRUD Example for Spring Boot
- To Run this project locally:
$ mvn spring-boot:run
- To build and run from executable war:
$ mvn package $ java -jar target/movies-0.3.war
- To build and run on standalone Tomcat server:
$ mvn package -Ptomcat $ cp target/movies-0.3.war <Tomcat Root>/webapps/
- To access Movies app, open: http://localhost:8081/v1/movies
- To access Movies app deployed on Tomcat: http://localhost:8080/movies-0.3/v1/movies
- To access swagger-ui, open: http://localhost:8081/swagger-ui.html
-
Settings -> Build-Execution-Deployment -> Compiler -> Select "Build Project Automatically"
-
Press
ctrl+shift+alt+/
and search for theregistry
. In the registry, enable :compiler.automake.allow.when.app.running
-
Run app from IntelliJ: in Application.java click right mouse button on the
main()
method and selectDebug 'Application.java'
-
Set
<excludeDevtools>false</excludeDevtools>
in pom.xml -
Set
PASSWORD
and$DEBUG_PORT
for remote update in application.properties -
Run app in debug mode without choosing the port:
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n"
-
In Intellij add new Configuration and Run it
- Run –> Edit Configurations… -> Add (+) -> Application
- Use
org.springframework.boot.devtools.RemoteSpringApplication
as the main class. - Add
http://$HOST:$DEBUG_PORT
to the Program arguments
-
Edit some Java file end reload it:
Build -> Build Projekt (Ctrl+F9)
- server should reload and restart automatically