diff --git a/.gitignore b/.gitignore index 26d0463..d7dbd04 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ /features/fish.payara.eclipse.tools.server.feature/.polyglot.build.properties /.metadata/.plugins/org.eclipse.m2e.logback/logback.2.1.0.20221015-0744.xml /.metadata/ +/.idea diff --git a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/MavenBuildTool.java b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/MavenBuildTool.java index 9f255e7..c508e4c 100644 --- a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/MavenBuildTool.java +++ b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/MavenBuildTool.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020-2022 Payara Foundation + * Copyright (c) 2020-2024 Payara Foundation * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 @@ -89,7 +89,7 @@ public List getStartCommand(String contextPath, String microVersion, Str } else { commands.add("package"); } - commands.add(PLUGIN + "start"); + commands.add(PLUGIN + "dev"); if (contextPath != null && !contextPath.trim().isEmpty()) { commands.add("-DcontextRoot=" + contextPath); } diff --git a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/Messages.properties b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/Messages.properties index 085c0b2..fecdc01 100644 --- a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/Messages.properties +++ b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/Messages.properties @@ -4,7 +4,7 @@ runtimeName=Runtime Name emptyRuntimeName=Runtime name is required! duplicateRuntimeName=Runtime name {0} is already used! runtimeIdentified=Found Payara Server version {0}. -unsupportedVersion=Only Payara 6, 5, 4 and 3.1 are supported +unsupportedVersion=Only Payara 7, 6, 5, 4 and 3.1 are supported versionsNotMatching=The versions of local and remote server do not match. runtimeNotValid=There is no valid Payara runtime in specified directory. diff --git a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/MicroProjectTab.java b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/MicroProjectTab.java index 3e7ae4c..d7774d2 100644 --- a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/MicroProjectTab.java +++ b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/MicroProjectTab.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020-2022 Payara Foundation + * Copyright (c) 2020-2024 Payara Foundation * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 @@ -9,7 +9,6 @@ */ package fish.payara.eclipse.tools.micro.ui; -import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_MICRO_VERSIONS; import static fish.payara.eclipse.tools.micro.MicroConstants.ATTR_BUILD_ARTIFACT; import static fish.payara.eclipse.tools.micro.MicroConstants.ATTR_CONTEXT_PATH; import static fish.payara.eclipse.tools.micro.MicroConstants.ATTR_DEBUG_PORT; @@ -35,6 +34,7 @@ import java.util.List; import java.util.Map; +import fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspace; @@ -82,7 +82,7 @@ public void createControl(Composite parent) { group = SWTFactory.createGroup(mainComposite, Messages.microVersionComponentLabel, 1, 1, GridData.FILL_HORIZONTAL); - microVersionText = SWTFactory.createCombo(group, SWT.READ_ONLY, 1, ARCHETYPE_MICRO_VERSIONS); + microVersionText = SWTFactory.createCombo(group, SWT.READ_ONLY, 1, MicroProjectWizard.getVersions().toArray(new String[0])); microVersionText.addModifyListener(getDefaultListener()); group = SWTFactory.createGroup(mainComposite, Messages.buildArtifactComponentLabel, 1, 1, diff --git a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroProjectWizard.java b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroProjectWizard.java index 43aab59..24d8e6d 100644 --- a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroProjectWizard.java +++ b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroProjectWizard.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020-2022 Payara Foundation + * Copyright (c) 2020-2024 Payara Foundation * Copyright (c) 2008-2010 Sonatype, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 @@ -13,6 +13,12 @@ import static java.lang.Boolean.TRUE; import static java.util.stream.Collectors.toList; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.StringReader; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.UnknownHostException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -53,6 +59,12 @@ import org.eclipse.ui.INewWizard; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkingSet; +import org.w3c.dom.Document; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; public class MicroProjectWizard extends Wizard implements INewWizard { @@ -75,24 +87,15 @@ public MicroProjectWizard() { private static final String NAME = "\\[name\\]"; //$NON-NLS-1$ private static final String PROJECT_NAME_REGEX = "\\$\\{[^\\}]++\\}"; //$NON-NLS-1$ - private static final String ARCHETYPE_GROUP_ID = "fish.payara.maven.archetypes"; //$NON-NLS-1$ - private static final String ARCHETYPE_ARTIFACT_ID = "payara-micro-maven-archetype"; //$NON-NLS-1$ + public static final String ARCHETYPE_GROUP_ID = "fish.payara.maven.archetypes"; //$NON-NLS-1$ + public static final String ARCHETYPE_ARTIFACT_ID = "payara-micro-maven-archetype"; //$NON-NLS-1$ public static final String ARCHETYPE_VERSION_5X = "1.4.0"; //$NON-NLS-1$ - public static final String ARCHETYPE_VERSION_6X = "2.0"; //$NON-NLS-1$ + public static final String STARTER_ARCHETYPE_GROUP_ID = "fish.payara.starter"; + public static final String STARTER_ARCHETYPE_ARTIFACT_ID = "payara-starter-archetype"; + public static final String ARCHETYPE_VERSION_6X = "1.0-beta9"; //$NON-NLS-1$ private static final String ARCHETYPE_JDK_VERSION = "jdkVersion"; //$NON-NLS-1$ private static final String ARCHETYPE_JDK_VERSION_DEFAULT_VALUE = "1.8"; //$NON-NLS-1$ public static final String ARCHETYPE_MICRO_VERSION = "payaraMicroVersion"; //$NON-NLS-1$ - private static final String ARCHETYPE_MICRO_VERSION_DEFAULT_VALUE = "6.2023.2"; //$NON-NLS-1$ - public static final String[] ARCHETYPE_MICRO_VERSIONS = new String[]{"6.2023.2", "6.2023.1", "6.2022.2", "6.2022.1", - "5.2022.5", "5.2022.4", "5.2022.3", - "5.2022.2", "5.2022.1", "5.2021.10", - "5.2021.9", "5.2021.8", "5.2021.7", - "5.2021.6", "5.2021.5", "5.2021.4", - "5.2021.3", "5.2021.2", "5.2021.1", - "5.2020.7", "5.2020.6", "5.2020.5", - "5.2020.4", "5.2020.3", "5.2020.2", - "5.201", "5.194", "5.193.1", "5.192", - "5.191", "5.184", "5.183", "5.182", "5.181"}; //$NON-NLS-1$ public static final String ARCHETYPE_AUTOBIND_HTTP = "autoBindHttp"; //$NON-NLS-1$ private static final String ARCHETYPE_CONCURRENT_API = "addConcurrentApi"; //$NON-NLS-1$ private static final String ARCHETYPE_RESOURCE_API = "addResourceApi"; //$NON-NLS-1$ @@ -105,6 +108,57 @@ public MicroProjectWizard() { private static final String ARCHETYPE_DEPLOY_WAR = "deployWar"; //$NON-NLS-1$ private static final String EMPTY = ""; //$NON-NLS-1$ + + public static final String DEFAULT_REPOSITORY_URL = "https://repo1.maven.org/maven2/"; // NOI18N + + private static final String METADATA_URL = "fish/payara/extras/payara-micro/maven-metadata.xml"; // NOI18N + + private static final List versions = new ArrayList<>(); + public static List getVersions() { + if (versions.isEmpty()) { + try { + // Construct the full URL + String urlString = DEFAULT_REPOSITORY_URL + METADATA_URL; + URL url = new URL(urlString); + + // Open connection + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + + // Read the response + BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder xmlResponse = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) { + xmlResponse.append(line); + } + in.close(); + + // Parse the XML response + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(new InputSource(new StringReader(xmlResponse.toString()))); + + String latest = doc.getElementsByTagName("latest").item(0).getTextContent(); + // Extract versions + NodeList versionNodes = doc.getElementsByTagName("version"); + for (int i = versionNodes.getLength() - 1; i >= 0; i--) { + String version = versionNodes.item(i).getTextContent(); + if ((version.contains("Alpha") || version.contains("Beta") || version.contains("SNAPSHOT")) // NOI18N + && !version.equals(latest)) { + continue; + }; + versions.add(version); + } + + } catch (Exception e) { + e.printStackTrace(); + } + + } + return versions; + } + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.selection = selection; @@ -134,12 +188,12 @@ public void createPageControls(Composite pageContainer) { private Archetype getArchetype() { Archetype archetype = new Archetype(); - archetype.setGroupId(ARCHETYPE_GROUP_ID); - archetype.setArtifactId(ARCHETYPE_ARTIFACT_ID); + archetype.setGroupId(STARTER_ARCHETYPE_GROUP_ID); + archetype.setArtifactId(STARTER_ARCHETYPE_ARTIFACT_ID); archetype.setVersion(ARCHETYPE_VERSION_6X); Properties properties = new Properties(); properties.put(ARCHETYPE_JDK_VERSION, ARCHETYPE_JDK_VERSION_DEFAULT_VALUE); - properties.put(ARCHETYPE_MICRO_VERSION, ARCHETYPE_MICRO_VERSION_DEFAULT_VALUE); + properties.put(ARCHETYPE_MICRO_VERSION, getVersions().get(0)); properties.put(ARCHETYPE_AUTOBIND_HTTP, TRUE.toString()); properties.put(ARCHETYPE_CONCURRENT_API, FALSE.toString()); properties.put(ARCHETYPE_RESOURCE_API, FALSE.toString()); diff --git a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroSettingsWizardPage.java b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroSettingsWizardPage.java index e841a82..160c5c5 100644 --- a/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroSettingsWizardPage.java +++ b/bundles/fish.payara.eclipse.tools.micro/src/fish/payara/eclipse/tools/micro/ui/wizards/MicroSettingsWizardPage.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020-2022 Payara Foundation + * Copyright (c) 2020-2024 Payara Foundation * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 @@ -12,15 +12,17 @@ import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_AUTOBIND_HTTP; import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_CONTEXT_ROOT; import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_MICRO_VERSION; -import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_MICRO_VERSIONS; import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_VERSION_5X; import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_VERSION_6X; +import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_GROUP_ID; +import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.ARCHETYPE_ARTIFACT_ID; +import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.STARTER_ARCHETYPE_GROUP_ID; +import static fish.payara.eclipse.tools.micro.ui.wizards.MicroProjectWizard.STARTER_ARCHETYPE_ARTIFACT_ID; import static java.nio.charset.StandardCharsets.UTF_8; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Map; -import java.util.Properties; import java.util.stream.Collectors; import org.apache.maven.archetype.catalog.Archetype; @@ -76,7 +78,7 @@ private void createUI(Composite parent) { microVersionCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1)); microVersionCombo.setData("name", ARCHETYPE_MICRO_VERSION); //$NON-NLS-1$ microVersionCombo.addModifyListener(e -> validate()); - microVersionCombo.setItems(ARCHETYPE_MICRO_VERSIONS); + microVersionCombo.setItems(MicroProjectWizard.getVersions().toArray(new String[0])); Label autobindLabel = new Label(parent, SWT.NONE); autobindLabel.setText(Messages.autobindComponentLabel); @@ -129,19 +131,25 @@ private String validateInput() { } public Archetype getArchetype() { - String[] versionToken = microVersionCombo.getText().trim().split("\\."); - archetype.setVersion(versionToken.length > 1 && Integer.parseInt(versionToken[0]) < 6 ? ARCHETYPE_VERSION_5X : ARCHETYPE_VERSION_6X); + String[] versionToken = microVersionCombo.getText().trim().split("\\."); + if (versionToken.length > 1 && Integer.parseInt(versionToken[0]) < 6) { + archetype.setGroupId(ARCHETYPE_GROUP_ID); + archetype.setArtifactId(ARCHETYPE_ARTIFACT_ID); + archetype.setVersion(ARCHETYPE_VERSION_5X); + } else { + archetype.setGroupId(STARTER_ARCHETYPE_GROUP_ID); + archetype.setArtifactId(STARTER_ARCHETYPE_ARTIFACT_ID); + archetype.setVersion(ARCHETYPE_VERSION_6X); + } + return archetype; } public Map getProperties() { - Map properties = archetype.getProperties() - .entrySet().stream().collect( - Collectors.toMap( - e -> e.getKey().toString(), - e -> e.getValue().toString() - ) - ); + Map properties = archetype.getProperties() + .entrySet() + .stream() + .collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().toString())); String contextRoot = contextPathCombo.getText().trim(); try { contextRoot = contextRoot.startsWith("/") ? '/' + URLEncoder.encode(contextRoot.substring(1), UTF_8.name()) diff --git a/bundles/fish.payara.eclipse.tools.server/plugin.properties b/bundles/fish.payara.eclipse.tools.server/plugin.properties index 9fae39e..1117e64 100644 --- a/bundles/fish.payara.eclipse.tools.server/plugin.properties +++ b/bundles/fish.payara.eclipse.tools.server/plugin.properties @@ -27,9 +27,9 @@ runtimeTypeVendor=Oracle Corporation runtimeTypeGlassFishVendor=Payara runtimeTypeNameglassfish=Payara -runtimeTypeDescriptionglassfish=Supports Payara 6, 5, 4 and 3.1 +runtimeTypeDescriptionglassfish=Supports Payara 7, 6, 5, 4 and 3.1 serverTypeNameglassfish=Payara -serverTypeDescriptionPayara=Supports Payara Server 6, 5 and 4. Can also be used for GlassFish. +serverTypeDescriptionPayara=Supports Payara Server 7, 6, 5 and 4. Can also be used for GlassFish. payara.server.runConfigurationName=Payara Server payara.micro.runConfigurationName=Payara Micro diff --git a/bundles/fish.payara.eclipse.tools.server/plugin.xml b/bundles/fish.payara.eclipse.tools.server/plugin.xml index cd98451..2368573 100644 --- a/bundles/fish.payara.eclipse.tools.server/plugin.xml +++ b/bundles/fish.payara.eclipse.tools.server/plugin.xml @@ -29,9 +29,9 @@ - + - + @@ -88,6 +88,7 @@ + @@ -127,7 +128,7 @@ - + @@ -137,9 +138,22 @@ - + + + + + + + + + + + + + + @@ -317,7 +331,7 @@ - + @@ -325,7 +339,7 @@ - + @@ -333,7 +347,23 @@ - + + + + + + + + + + + + + + + + + diff --git a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/Messages.properties b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/Messages.properties index aec1d1f..1877f0b 100644 --- a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/Messages.properties +++ b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/Messages.properties @@ -4,7 +4,7 @@ runtimeName=Runtime Name emptyRuntimeName=Runtime name is required! duplicateRuntimeName=Runtime name {0} is already used! runtimeIdentified=Found Payara Server version {0}. -unsupportedVersion=Only Payara 6, 5, 4 and 3.1 are supported +unsupportedVersion=Only Payara 7, 6, 5, 4 and 3.1 are supported versionsNotMatching=The versions of local and remote server do not match. runtimeNotValid=There is no valid Payara runtime in specified directory. diff --git a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/PayaraRuntime.java b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/PayaraRuntime.java index 730c905..474f17e 100644 --- a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/PayaraRuntime.java +++ b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/PayaraRuntime.java @@ -8,7 +8,7 @@ ******************************************************************************/ /****************************************************************************** - * Copyright (c) 2018-2022 Payara Foundation + * Copyright (c) 2018-2024 Payara Foundation * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -35,6 +35,7 @@ import org.eclipse.jdt.launching.IVMInstall; import org.eclipse.jdt.launching.IVMInstallType; import org.eclipse.jdt.launching.JavaRuntime; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jst.server.core.IJavaRuntime; import org.eclipse.jst.server.core.internal.IGenericRuntimeWorkingCopy; import org.eclipse.wst.server.core.IRuntimeType; @@ -75,6 +76,7 @@ public final class PayaraRuntime extends RuntimeDelegate implements IJavaRuntime private static final VersionConstraint VERSION_CONSTRAINT_4 = new VersionConstraint("[1.7"); private static final VersionConstraint VERSION_CONSTRAINT_5 = new VersionConstraint("[1.8"); private static final VersionConstraint VERSION_CONSTRAINT_6 = new VersionConstraint("[1.8"); + private static final VersionConstraint VERSION_CONSTRAINT_7 = new VersionConstraint("[1.8"); protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id"; protected static final String PROP_VM_INSTALL_ID = "vm-install-id"; @@ -157,7 +159,9 @@ public static String createDefaultRuntimeName(Version version) { String baseName = "Payara Server"; // TODO: - detect GF if (version != null) { - if (version.matches("[6-7)")) { + if (version.matches("[7-8)")) { + baseName += " 7"; + } else if (version.matches("[6-7)")) { baseName += " 6"; } else if (version.matches("[5-6)")) { baseName += " 5"; @@ -222,7 +226,7 @@ public IStatus validateVersion() { return new Status(ERROR, SYMBOLIC_NAME, runtimeNotValid); } - if (!version.matches("[3.1-7)")) { + if (!version.matches("[3.1-8)")) { return new Status(ERROR, SYMBOLIC_NAME, unsupportedVersion); } @@ -233,6 +237,10 @@ public VersionConstraint getJavaVersionConstraint() { Version version = getVersion(); if (version != null) { + if (version.matches("[7")) { + return VERSION_CONSTRAINT_7; + } + if (version.matches("[6")) { return VERSION_CONSTRAINT_6; } @@ -260,7 +268,6 @@ public IStatus validateServerLocation(IPath location) { // This is maybe a redundant check to the GUI annotation but // needed in case where a GUI is not involved (although we don't know // yet what case that would be) - if (location == null || !location.toFile().exists()) { return new Status(ERROR, SYMBOLIC_NAME, bind(pathDoesNotExist, "Specified path")); } diff --git a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/PayaraRuntimeBridge.java b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/PayaraRuntimeBridge.java index 4263fa3..766589f 100644 --- a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/PayaraRuntimeBridge.java +++ b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/PayaraRuntimeBridge.java @@ -8,7 +8,7 @@ ******************************************************************************/ /****************************************************************************** - * Copyright (c) 2018-2022 Payara Foundation + * Copyright (c) 2018-2024 Payara Foundation * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -96,7 +96,9 @@ public List getRuntimeComponents() { if (payaraVersion != null) { String payaraMainVersion; - if(payaraVersion.matches("[6")) { + if(payaraVersion.matches("[7")) { + payaraMainVersion = "7"; + } else if(payaraVersion.matches("[6")) { payaraMainVersion = "6"; } else if(payaraVersion.matches("[5")) { payaraMainVersion = "5"; diff --git a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibraries.java b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibraries.java index f4553d0..0ba510d 100644 --- a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibraries.java +++ b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibraries.java @@ -8,7 +8,7 @@ ******************************************************************************/ /****************************************************************************** - * Copyright (c) 2018-2023 Payara Foundation + * Copyright (c) 2018-2024 Payara Foundation * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -115,7 +115,25 @@ public class SystemLibraries { "mq/lib/jaxm-api.jar" }; + private static final String[] LIBRARIES_7 = { + "glassfish/modules/jakarta.*.jar", + "glassfish/modules/weld-osgi-bundle.jar", + "glassfish/modules/bean-validator.jar", + "glassfish/modules/jersey-*.jar", + "glassfish/modules/glassfish-api.jar", + "glassfish/modules/ha-api.jar", + "glassfish/modules/endorsed/*.jar", + "glassfish/modules/org.eclipse.persistence*.jar", + "glassfish/modules/jaxb*.jar", + "glassfish/modules/webservices*.jar", + "mq/lib/jaxm-api.jar" + }; + public static String[] getLibraryIncludesByVersion(Version version) { + if (version.matches("[7")) { + return LIBRARIES_7; + } + if (version.matches("[6")) { return LIBRARIES_6; } diff --git a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibrariesContainer.java b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibrariesContainer.java index 447c6bf..6a5df3b 100644 --- a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibrariesContainer.java +++ b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/internal/SystemLibrariesContainer.java @@ -8,7 +8,7 @@ ******************************************************************************/ /****************************************************************************** - * Copyright (c) 2018-2022 Payara Foundation + * Copyright (c) 2018-2024 Payara Foundation * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -276,7 +276,9 @@ public static List createClasspathEntriesForLibraries(IProject URL doc; String javaEEVersion; - if(version.matches("[6")) { + if(version.matches("[7")) { + javaEEVersion = "11"; + } else if(version.matches("[6")) { javaEEVersion = "9"; } else if(version.matches("[5")) { javaEEVersion = "8"; diff --git a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/sdk/server/config/ConfigBuilderProvider.java b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/sdk/server/config/ConfigBuilderProvider.java index e13eb9d..2b11b84 100644 --- a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/sdk/server/config/ConfigBuilderProvider.java +++ b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/sdk/server/config/ConfigBuilderProvider.java @@ -8,7 +8,7 @@ ******************************************************************************/ /****************************************************************************** - * Copyright (c) 2018-2022 Payara Foundation + * Copyright (c) 2018-2024 Payara Foundation * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -60,7 +60,9 @@ public class ConfigBuilderProvider { * @return Library builder configuration for given GlassFish server version. */ public static URL getBuilderConfig(final Version version) { - if (version.matches("[6")) { + if (version.matches("[7")) { + return ConfigBuilderProvider.class.getResource("PayaraV7.xml"); + } else if (version.matches("[6")) { return ConfigBuilderProvider.class.getResource("PayaraV6.xml"); } else if (version.matches("[5")) { return ConfigBuilderProvider.class.getResource("PayaraV5.xml"); diff --git a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/utils/PayaraLocationUtils.java b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/utils/PayaraLocationUtils.java index 558f5d9..5f2bfe2 100644 --- a/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/utils/PayaraLocationUtils.java +++ b/bundles/fish.payara.eclipse.tools.server/src/fish/payara/eclipse/tools/server/utils/PayaraLocationUtils.java @@ -8,7 +8,7 @@ ******************************************************************************/ /****************************************************************************** - * Copyright (c) 2018-2023 Payara Foundation + * Copyright (c) 2018-2024 Payara Foundation * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v2.0 * which accompanies this distribution, and is available at @@ -223,7 +223,7 @@ private static Version getVersionFromPropertiesFile(File gfVersionProperties) { properties.load(fis); int major = Integer.parseInt(properties.getProperty("major_version")); int minor = Integer.parseInt(properties.getProperty("minor_version")); - int update = Integer.parseInt(properties.getProperty("update_version")); + int update = Integer.parseInt(properties.getProperty("update_version").split("\\.")[0]); return new Version(major + "." + minor + "." + update); } catch (IOException e) { throw new IllegalArgumentException(e);