From cb8e36f4a8b65335376c59c175cbdb5abc7be2b5 Mon Sep 17 00:00:00 2001
From: NotedSalmon <moreiraandre2001@gmail.com>
Date: Fri, 11 Oct 2024 12:13:37 +0100
Subject: [PATCH 1/3] FISH-9955 updated some properties in maven.ts. Fixing
 script error first

---
 src/main/fish/payara/project/Maven.ts | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/src/main/fish/payara/project/Maven.ts b/src/main/fish/payara/project/Maven.ts
index aec8aa9..3f116da 100644
--- a/src/main/fish/payara/project/Maven.ts
+++ b/src/main/fish/payara/project/Maven.ts
@@ -279,18 +279,25 @@ export class Maven implements Build {
         }
         const cmdArgs: string[] = [
             "archetype:generate",
-            `-DarchetypeArtifactId=payara-micro-maven-archetype`,
-            `-DarchetypeGroupId=fish.payara.maven.archetypes`,
-            `-DarchetypeVersion=` + (project.payaraMicroVersion.split('.')[0] === '5' ? '1.0.5' : '2.0'),
+            `-DarchetypeArtifactId=payara-starter-archetype`,
+            `-DarchetypeGroupId=fish.payara.starter`,
+            `-DarchetypeVersion=1.0-beta9`,
             `-DgroupId=${project.groupId}`,
             `-DartifactId=${project.artifactId}`,
             `-Dversion=${project.version}`,
             `-Dpackage=${project.package}`,
             `-DpayaraMicroVersion=${project.payaraMicroVersion}`,
             '-DaddPayaraApi=true',
-            '-DinteractiveMode=false'
+            '-DinteractiveMode=false',
+            '-DjakartaEEVersion='+ (project.payaraMicroVersion.split('.')[0] === '5' ? '8' : '10')
         ];
-        let process: ChildProcess = cp.spawn(mavenExe, cmdArgs, { cwd: project.targetFolder?.fsPath });
+
+        /**
+         * String PROP_PLATFORM = "platform";
+         * String PROP_PLATFORM_MICRO_VALUE = "micro";
+         * properties.put(PROP_PLATFORM, PROP_PLATFORM_MICRO_VALUE)
+         */
+        let process: ChildProcess = cp.spawn(mavenExe, cmdArgs, { cwd: project.targetFolder?.fsPath, shell: true });
 
         if (process.pid) {
             let outputChannel = ProjectOutputWindowProvider.getInstance().get(`${project.artifactId}`);

From f12e5d5918a768167572084207c79ee355f40b36 Mon Sep 17 00:00:00 2001
From: NotedSalmon <moreiraandre2001@gmail.com>
Date: Mon, 14 Oct 2024 12:48:12 +0100
Subject: [PATCH 2/3] FISH-9958 included the platform for the payara archetype.

---
 src/main/fish/payara/project/Maven.ts | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main/fish/payara/project/Maven.ts b/src/main/fish/payara/project/Maven.ts
index 3f116da..f0aadcc 100644
--- a/src/main/fish/payara/project/Maven.ts
+++ b/src/main/fish/payara/project/Maven.ts
@@ -1,7 +1,7 @@
 'use strict';
 
 /*
- * Copyright (c) 2020-2022 Payara Foundation and/or its affiliates and others.
+ * Copyright (c) 2020-2024 Payara Foundation and/or its affiliates and others.
  * All rights reserved.
  *
  * This program and the accompanying materials are made available under the
@@ -289,15 +289,11 @@ export class Maven implements Build {
             `-DpayaraMicroVersion=${project.payaraMicroVersion}`,
             '-DaddPayaraApi=true',
             '-DinteractiveMode=false',
-            '-DjakartaEEVersion='+ (project.payaraMicroVersion.split('.')[0] === '5' ? '8' : '10')
+            '-DjakartaEEVersion='+ (project.payaraMicroVersion.split('.')[0] === '5' ? '8' : '10'),
+            '-Dplatform=micro'
         ];
 
-        /**
-         * String PROP_PLATFORM = "platform";
-         * String PROP_PLATFORM_MICRO_VALUE = "micro";
-         * properties.put(PROP_PLATFORM, PROP_PLATFORM_MICRO_VALUE)
-         */
-        let process: ChildProcess = cp.spawn(mavenExe, cmdArgs, { cwd: project.targetFolder?.fsPath, shell: true });
+        let process: ChildProcess = cp.spawn(mavenExe, cmdArgs, { cwd: project.targetFolder?.fsPath });
 
         if (process.pid) {
             let outputChannel = ProjectOutputWindowProvider.getInstance().get(`${project.artifactId}`);

From 26f381aa9381ccc5bc09ddb6d56a8ec62d74800a Mon Sep 17 00:00:00 2001
From: Gaurav Gupta <gaurav.gupta@payara.fish>
Date: Mon, 28 Oct 2024 17:35:21 +0530
Subject: [PATCH 3/3] Explicit archetype version

---
 src/main/fish/payara/project/Maven.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/fish/payara/project/Maven.ts b/src/main/fish/payara/project/Maven.ts
index f0aadcc..468ce06 100644
--- a/src/main/fish/payara/project/Maven.ts
+++ b/src/main/fish/payara/project/Maven.ts
@@ -278,7 +278,7 @@ export class Maven implements Build {
             throw new Error("Maven executable [" + mavenExe + "] not found");
         }
         const cmdArgs: string[] = [
-            "archetype:generate",
+            "org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate",
             `-DarchetypeArtifactId=payara-starter-archetype`,
             `-DarchetypeGroupId=fish.payara.starter`,
             `-DarchetypeVersion=1.0-beta9`,
@@ -476,4 +476,4 @@ export class Maven implements Build {
     }
 
 
-}
\ No newline at end of file
+}