Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OAuth2 Authorization Server with Spring Boot 3 and Java 24

NotificationsYou must be signed in to change notification settings

musabbozkurt/oauth2-authorization-server

Repository files navigation

Prerequisites

  • Java 24 should be installed -->export JAVA_HOME=$(/usr/libexec/java_home -v 24)
  • Maven should be installed
  • Docker should be installed
  • Postman can be installed

How to Run and Test

  • Runexport DEEPSEEK_API_KEY=your_api_key_here command to set DeepSeek API key
  • Rundocker-compose up -d command to run necessary services
  • Runmvn test ormvn clean install ormvn clean package or./mvnw clean install command to run all the tests
  • Runmvn spring-boot:run command to run the application
  • Import the followings to test in Postman
  • Swagger:http://localhost:9000/swagger-ui/index.html
    • ClickAuthorize and enter the following credentials
    • client_id:client
    • client_secret:secret
    • Use one of the following default values to log inhttp://localhost:9000/login
      • username:Developer password:password
      • username:Admin password:password
      • username:User password:password
  • Actuator:http://localhost:9000/actuator/
  • Database credentials
    • url:jdbc:mariadb://localhost:3306/oauth2_authorization_server
    • username:mb_test
    • password:test
  • Redis
    • host:localhost
    • port:6379
  • Redis Insight:http://localhost:5540/
    • ClickAdd Redis database
    • Connection URL -->redis://default@host.docker.internal:6379
    • ClickAdd Database
    • img.png
  • Ollama
    • http://localhost:3000/ sign up for an account for local environment
    • Search formxbai-embed-large and download it if it does not exist
    • Search fordeepseek-r1:7b and download it if it does not exist

Debugging Spring Boot Tests in IntelliJ IDEA

  1. Run one of the below commands in the terminal
    • mvn test -Dmaven.surefire.debug
    • If port 5005 is already in use, you can specify a custom port
      • mvn test -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
  2. Open IntelliJ IDEA
  3. Go toRun > Attach to Process (or use shortcut)
    • Windows/Linux:Ctrl + Alt + 5
    • Mac:Cmd + Alt + 5
  4. Select the Java process running your tests
  5. The test will pause until you connect your debugger. Once connected, you can use breakpoints and step through yourcode.

How to Run and Test Native Image with GraalVM

  • Java 24 GraalVM edition should be installed
  • Rundocker-compose up -d command to run necessary services
  • Run./mvnw -Pnative native:compile or./mvnw -Pnative native:compile -DskipTests command to build the native image
  • Run./target/oauth2-authorization-server command to run the native image
  • InstallGrype (OPTIONAL)
    • Runnative-image-inspect ./target/oauth2-authorization-server-0.0.1 | grype -v command to scan vulnerabilities
  • Runnative-image-inspect ./target/oauth2-authorization-server-0.0.1 >output.json command and openoutput.json orvisithttp://localhost:9000/actuator/sbom/native-image to inspect all libraries, methods etc. used in the native image
  • Runopen ./target/oauth2-authorization-server-build-report.html to see build report
  • Use Swagger UI to test the application

Spring Boot with CRaC(Coordinated Restore at Checkpoint) by Creating Ready to Restore Container Image.

How to Run and Test AI Models Locally with Docker Desktop Model Runner

  • Requires: Docker Desktop 4.40 and later
  • Rundocker-compose up -d command to run necessary services
  • Rundocker model pull ai/gemma3:4B-Q4_K_M command to pull the model
    • Rundocker model run ai/gemma3:4B-Q4_K_M command to run the model to test it from the command line (OPTIONAL)
  • Docker Desktop -->Settings -->Features in development -->Beta features -->Enable Docker Model Runner -->Enable host-side TCP support -->Apply & Restart
    • Docker_Desktop_Enable_Host_Side_TCP_Support.png
  • Runmvn test ormvn clean install ormvn clean package or./mvnw clean install command to run all the tests
  • Runmvn spring-boot:run command to run the application
  • Use Swagger UI to test the application

References


[8]ページ先頭

©2009-2025 Movatter.jp