From 43347948083febe5ef77d584546705d4d8a6b187 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 6 Apr 2023 23:06:15 +0200 Subject: [PATCH 1/3] Allow to have multiple versions Signed-off-by: Armel Soro --- stacks/java-maven/{ => 1.2.0}/devfile.yaml | 0 stacks/java-maven/stack.yaml | 7 +++++++ 2 files changed, 7 insertions(+) rename stacks/java-maven/{ => 1.2.0}/devfile.yaml (100%) create mode 100644 stacks/java-maven/stack.yaml diff --git a/stacks/java-maven/devfile.yaml b/stacks/java-maven/1.2.0/devfile.yaml similarity index 100% rename from stacks/java-maven/devfile.yaml rename to stacks/java-maven/1.2.0/devfile.yaml diff --git a/stacks/java-maven/stack.yaml b/stacks/java-maven/stack.yaml new file mode 100644 index 00000000..c0ef934e --- /dev/null +++ b/stacks/java-maven/stack.yaml @@ -0,0 +1,7 @@ +name: java-maven +description: 'Java application based on Maven and OpenJDK' +displayName: Maven Java +icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/java-maven.jpg +versions: + - version: 1.2.0 + default: true # should have one and only one default version From e5576371e9a1877e1ea798d214e8f4dbe309e3d7 Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Thu, 6 Apr 2023 23:08:41 +0200 Subject: [PATCH 2/3] Add new 1.3.0 version for 'java-maven', with JDK 17 Signed-off-by: Armel Soro --- stacks/java-maven/1.3.0/devfile.yaml | 63 ++++++++++++++++++++++++++++ stacks/java-maven/stack.yaml | 2 + 2 files changed, 65 insertions(+) create mode 100644 stacks/java-maven/1.3.0/devfile.yaml diff --git a/stacks/java-maven/1.3.0/devfile.yaml b/stacks/java-maven/1.3.0/devfile.yaml new file mode 100644 index 00000000..652f48e2 --- /dev/null +++ b/stacks/java-maven/1.3.0/devfile.yaml @@ -0,0 +1,63 @@ +schemaVersion: 2.1.0 +metadata: + name: java-maven + displayName: Maven Java + description: Java application based on Maven 3.6 and OpenJDK 17 + icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/java-maven.jpg + tags: + - Java + - Maven + projectType: Maven + language: Java + version: 1.3.0 +starterProjects: + - name: springbootproject + git: + remotes: + origin: 'https://github.com/odo-devfiles/springboot-ex.git' +components: + - name: tools + container: + image: registry.access.redhat.com/ubi9/openjdk-17:1.16-1.1696518670 + command: ["tail", "-f", "/dev/null"] + memoryLimit: 512Mi + mountSources: true + endpoints: + - name: http-maven + targetPort: 8080 + - exposure: none + name: debug + targetPort: 5858 + volumeMounts: + - name: m2 + path: /home/user/.m2 + env: + - name: DEBUG_PORT + value: '5858' + - name: m2 + volume: {} +commands: + - id: mvn-package + exec: + component: tools + workingDir: ${PROJECT_SOURCE} + commandLine: 'mvn -Dmaven.repo.local=/home/user/.m2/repository package' + group: + kind: build + isDefault: true + - id: run + exec: + component: tools + workingDir: ${PROJECT_SOURCE} + commandLine: 'java -jar target/*.jar' + group: + kind: run + isDefault: true + - id: debug + exec: + component: tools + workingDir: ${PROJECT_SOURCE} + commandLine: 'java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=${DEBUG_PORT},suspend=n -jar target/*.jar' + group: + kind: debug + isDefault: true diff --git a/stacks/java-maven/stack.yaml b/stacks/java-maven/stack.yaml index c0ef934e..18d7a195 100644 --- a/stacks/java-maven/stack.yaml +++ b/stacks/java-maven/stack.yaml @@ -5,3 +5,5 @@ icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main versions: - version: 1.2.0 default: true # should have one and only one default version + # 1.3.0: with JDK 17 + - version: 1.3.0 From 0b832950fff63442f44af1c5ec7d89711bc02b9a Mon Sep 17 00:00:00 2001 From: Armel Soro Date: Wed, 18 Oct 2023 18:07:14 +0200 Subject: [PATCH 3/3] Switch the default version to 1.3.0 1.3.0 is the most up-to-date version using Devfile 2.1.0 schema, for backward compatibility with current samples. We are purposely not using the most up-date version on 2.2.0 schema, as this would reportedly break current samples. See [1] for more context. [1] https://github.com/devfile/registry/pull/169#issuecomment-1551785206 Signed-off-by: Armel Soro --- stacks/java-maven/stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stacks/java-maven/stack.yaml b/stacks/java-maven/stack.yaml index 18d7a195..decbeab1 100644 --- a/stacks/java-maven/stack.yaml +++ b/stacks/java-maven/stack.yaml @@ -4,6 +4,6 @@ displayName: Maven Java icon: https://raw.githubusercontent.com/devfile-samples/devfile-stack-icons/main/java-maven.jpg versions: - version: 1.2.0 - default: true # should have one and only one default version # 1.3.0: with JDK 17 - version: 1.3.0 + default: true # should have one and only one default version