diff --git a/Others/spring-framework/6.2.10/24.03-lts-sp1/Dockerfile b/Others/spring-framework/6.2.10/24.03-lts-sp1/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..3d084feef82b99f463d82ac68c5b5db3bed2d39d --- /dev/null +++ b/Others/spring-framework/6.2.10/24.03-lts-sp1/Dockerfile @@ -0,0 +1,33 @@ +ARG BASE=openeuler/openeuler:24.03-lts-sp1 +FROM ${BASE} as BUILDER + +ARG TARGETARCH +ARG VERSION=6.2.10 +ARG JDK_VERSION=17.0.15_6 + +RUN if [ "$TARGETARCH" = "amd64" ]; then \ + BUILDARCH="x64"; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + BUILDARCH="aarch64"; \ + fi \ + && cd / \ + && yum install -y wget \ + && wget https://mirrors.tuna.tsinghua.edu.cn/Adoptium/17/jdk/${BUILDARCH}/linux/OpenJDK17U-jdk_${BUILDARCH}_linux_hotspot_${JDK_VERSION}.tar.gz \ + && tar -zxvf OpenJDK17U-jdk_${BUILDARCH}_linux_hotspot_${JDK_VERSION}.tar.gz \ + && rm -f OpenJDK17U-jdk_${BUILDARCH}_linux_hotspot_${JDK_VERSION}.tar.gz + +ENV JAVA_HOME=/jdk-17.0.15+6 +ENV PATH=${JAVA_HOME}/bin:$PATH + +WORKDIR /home/spring-framework +COPY example src/main/java/com/example +COPY pom.xml.template pom.xml.template + +ENV SPRING_VERSION=${VERSION} + +RUN dnf install -y gettext maven \ + && envsubst < pom.xml.template > pom.xml \ + && mvn clean compile dependency:build-classpath -Dmdep.outputFile=target/classpath.txt + +CMD CLASS_PATH="target/classes:$(cat target/classpath.txt)" && \ + java -cp "$CLASS_PATH" com.example.MainApp \ No newline at end of file diff --git a/Others/spring-framework/6.2.10/24.03-lts-sp1/example/AppConfig.java b/Others/spring-framework/6.2.10/24.03-lts-sp1/example/AppConfig.java new file mode 100644 index 0000000000000000000000000000000000000000..2b8cc9866b280afe3580e54aa8997cabe33a66a1 --- /dev/null +++ b/Others/spring-framework/6.2.10/24.03-lts-sp1/example/AppConfig.java @@ -0,0 +1,9 @@ +package com.example; + +import org.springframework.context.annotation.*; + +@Configuration +@ComponentScan("com.example") +public class AppConfig { + +} diff --git a/Others/spring-framework/6.2.10/24.03-lts-sp1/example/HelloService.java b/Others/spring-framework/6.2.10/24.03-lts-sp1/example/HelloService.java new file mode 100644 index 0000000000000000000000000000000000000000..429261eae1dccaf1c159e82076e25cc987b1c333 --- /dev/null +++ b/Others/spring-framework/6.2.10/24.03-lts-sp1/example/HelloService.java @@ -0,0 +1,10 @@ +package com.example; + +import org.springframework.stereotype.Component; + +@Component +public class HelloService { + public void sayHello() { + System.out.println("Hello, Spring Framework!"); + } +} diff --git a/Others/spring-framework/6.2.10/24.03-lts-sp1/example/MainApp.java b/Others/spring-framework/6.2.10/24.03-lts-sp1/example/MainApp.java new file mode 100644 index 0000000000000000000000000000000000000000..c72324b1a41a81b0a537cfa6f8cdb5757e586a43 --- /dev/null +++ b/Others/spring-framework/6.2.10/24.03-lts-sp1/example/MainApp.java @@ -0,0 +1,12 @@ +package com.example; + +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +public class MainApp { + public static void main(String[] args) { + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); + HelloService helloService = context.getBean(HelloService.class); + helloService.sayHello(); + context.close(); + } +} diff --git a/Others/spring-framework/6.2.10/24.03-lts-sp1/pom.xml.template b/Others/spring-framework/6.2.10/24.03-lts-sp1/pom.xml.template new file mode 100644 index 0000000000000000000000000000000000000000..555ade978c768f9eded61903f75b5d3ecb184183 --- /dev/null +++ b/Others/spring-framework/6.2.10/24.03-lts-sp1/pom.xml.template @@ -0,0 +1,44 @@ + + 4.0.0 + + com.example + spring-framework-demo + 1.0-SNAPSHOT + + + 17 + ${SPRING_VERSION} + + + + + + org.springframework + spring-context + ${spring.version} + + + + org.springframework + spring-aop + ${spring.version} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + ${java.version} + ${java.version} + + + + + diff --git a/Others/spring-framework/meta.yml b/Others/spring-framework/meta.yml index 775ae702dbb8b5174a4c4224c34ac6d3952ee13b..616bcf86c43913806269ea5eb553c5ddcc2f85b6 100644 --- a/Others/spring-framework/meta.yml +++ b/Others/spring-framework/meta.yml @@ -1,2 +1,5 @@ 6.2.6-oe2403sp1: path: 6.2.6/24.03-lts-sp1/Dockerfile + +6.2.10-oe2403sp1: + path: 6.2.10/24.03-lts-sp1/Dockerfile \ No newline at end of file