- 1. Requirements
- 2. Spring Boot Tutorials [fire]
- 3. Docker Image
- 4. Packaging OCI Images, Layered Jars
- 5. Actuator service
- 6. Template Engines
- 7. Data base changing
- 8. Springdoc OpenAPI
- 9. Add maven wrapper
- 10. Spring Boot family
- 11. Open API 2 (Swagger2) to 3 Converter
- 12. Section for testing ascii-doc [info circle]
Tip
|
It’s possible to use emojis as admonition icons on GitHub. |
-
API documentation for the project located here
http://localhost:8080/doc
-
Package
jar
filemvn clean package
-
Build image
docker build . --tag url-shortener
ordocker build --no-cache -t url-shortener .
-
Build image
docker build . --tag url-shortener:1.0
with version (image tag) -
Run docker image
docker run -it -p 8080:8080 url-shortener:latest
-
Run with Spring profile
docker run -e "SPRING_PROFILES_ACTIVE=prod" -p 8085:8085 -t url-shortener
-
./gradlew wrapper --gradle-version 6.2.2
Update gradle version
docker run -rm -e "SPRING_PROFILES_ACTIVE=dev" -p 8080:8080 -t url-shortener
-
run jar local
java -Dspring.profiles.active=prod -jar target/url-shortener-1.0.0-SNAPSHOT.jar
FROM adoptopenjdk/openjdk11:alpine-slim as build
WORKDIR /workspace/app
COPY mvnw .
COPY .mvn .mvn
COPY pom.xml .
COPY src src
RUN ./mvnw install -DskipTests
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
FROM adoptopenjdk/openjdk11:alpine-jre
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/target/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT ["java","-cp","app:app/lib/*","-Dspring.profiles.active=prod","se.techinsight.Application"]
-
link to the documentation
-
https://ostechnix.com/how-to-analyze-and-explore-the-contents-of-docker-images/
-
run command
mvn clean spring-boot:build-image docker run -it -p80:8080 url-shortener:1.0.0-SNAPSHOT curl -s http://localhost:80/actuator/info | jq . { "app": { "name": "url-shortener-service", "description": "URL Shortener on Spring Boot", "version": "1.0.0-SNAPSHOT" }, "env": { "java": { "vendor": "Oracle Corporation", "vm-name": "OpenJDK 64-Bit Server VM", "runtime-version": "11.0.4+11" } }, "context": { "bean-definition-count": 387, "startup-date": 1599166535710 } }
-
-
link to actuator http://localhost:8080/actuator
-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
-
FreeMarker
-
Groovy Templates
-
Thymeleaf
-
Velocity
-
Mustache
-
GSP = Groovy Server Pages
# swagger-ui custom path
springdoc.swagger-ui.path=/doc
open in browser http://localhost:8080/doc
for documentation,
-
http://localhost:8080/v2/api-docs used only for testing purposes
mvn --version
mvn -N io.takari:maven:wrapper
mvn -N io.takari:maven:wrapper -Dmaven=3.6.3
-
https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/
-
Every list item has at least one paragraph of content, which may be wrapped, even using a hanging indent.
Additional paragraphs or blocks are adjoined by putting a list continuation on a line adjacent to both blocks.
- list continuation
-
a plus sign (
+
) on a line by itself
-
A literal paragraph does not require a list continuation.
$ gem install asciidoctor
-
AsciiDoc lists may contain any complex content.
Application Language AsciiDoc
Python
Asciidoctor
Ruby
Supplier () -> x
Consumer x -> ()
Callable () -> x throws ex
Runnable () -> ()
Function x -> y
BiFunction x,y -> z
Predicate x -> boolean
UnaryOperator x1 -> x2
BinaryOperator x1,x2 -> x3
http://kaviddiss.com/2015/07/18/building-modern-web-applications-using-java-spring/ https://hackernoon.com/url-shortening-service-in-java-spring-boot-and-redis-d2a0f8848a1d
-
[heartbeat]
-
[power off]
-
[motorcycle]
-
[street view]
-
[ship]
-
[bus]
-
[eur]
-
[cab]
-
[calculator]
-
[anchor]