This is a demo application with Spring Boot with DDD architecture, MySQL 8, Spring Data JDBC, Flyway for database migration.
- Java 25
- Apache Maven 3.9.11
- Spring Boot 4.0 with Spring MVC
Note
Highlights information that users should take into account, even when skimming.
Tip
Optional information to help a user be more successful.
Important
Crucial information necessary for users to succeed.
[!WARNING]
| // after viper read config, replace all placeholders with values | |
| func ReplacePlaceHolders() { | |
| r, _ := regexp.Compile("\\${[a-zA-Z0-9.: _]+}") | |
| replacer := func(placeHolder []byte) []byte { | |
| name := string(placeHolder) | |
| name = name[2 : len(name)-1] | |
| index := strings.Index(name, ":") | |
| if index != -1 { | |
| defaultValue := name[index+1:] |
| //usr/bin/env jbang "$0" "$@" ; exit $? | |
| //JAVA 21 | |
| //DEPS org.junit.jupiter:junit-jupiter-engine:5.10.1 | |
| //DEPS org.junit.platform:junit-platform-console:1.9.3 | |
| //DEPS org.assertj:assertj-core:3.25.1 | |
| package com.example; | |
| import org.junit.jupiter.api.Test; | |
| import org.junit.platform.console.options.CommandLineOptions; |
| FROM linuxchina/jbang-action as builder | |
| ARG mainClass="Hello2.java" | |
| RUN mkdir -p /opt/app/out | |
| WORKDIR /opt/app | |
| COPY $mainClass /opt/app | |
| RUN jbang export portable -O out/app.jar $mainClass |
| FROM linuxchina/jbang-action:0.94.0-graal-java17-22.1.0 as builder | |
| ARG mainClass="Hello2.java" | |
| RUN mkdir -p /opt/app/out | |
| WORKDIR /opt/app | |
| COPY $mainClass /opt/app | |
| RUN jbang export portable --native -O out/main $mainClass |
| import jdk.jfr.consumer.RecordingStream; | |
| import org.springframework.messaging.handler.annotation.MessageMapping; | |
| import org.springframework.stereotype.Controller; | |
| import reactor.core.publisher.Flux; | |
| import java.time.Duration; | |
| import java.time.Instant; | |
| import java.time.temporal.ChronoUnit; | |
| @Controller |
| { | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "title": "JBang catalogs JSON Schema", | |
| "description": "JSON Schema for jbang-catalog.json", | |
| "type": "object", | |
| "properties": { | |
| "aliases": { | |
| "description": "aliases", | |
| "type": "object", | |
| "additionalProperties": { |
| #!/usr/bin/env bash | |
| # https://medium.com/codex/a-bash-template-cheat-sheet-is-very-useful-f8207b442e78 | |
| set -Eeuo pipefail | |
| # Define variables | |
| readonly dir="$(dirname "$0")" | |
| # Usage or Help message | |
| usage() { |
| ///usr/bin/env jbang "$0" "$@" ; exit $? | |
| //DEPS io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.5.Final:linux-x86_64 | |
| import io.netty.incubator.channel.uring.IOUring; | |
| public class HelloIoUring { | |
| public static void main(String[] args) { | |
| IOUring.ensureAvailability(); | |
| System.out.println("Hello io_uring!"); | |
| } |