Skip to content

Commit

Permalink
Merge pull request #294 from m-reza-rahman/master
Browse files Browse the repository at this point in the history
Refine UI Validation, Upgrade Payara/GlassFish
  • Loading branch information
Reza Rahman authored Feb 4, 2024
2 parents a1ff83b + ba3ef81 commit 16b909f
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 41 deletions.
8 changes: 4 additions & 4 deletions archetype/src/main/resources/archetype-resources/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@
#elseif (${runtime} == 'payara')
#if (${javaVersion} == '17')
#if (${profile} == 'full')
#set ($baseImage = "payara/server-full:6.2023.12-jdk17")
#set ($baseImage = "payara/server-full:6.2024.1-jdk17")
#else
#set ($baseImage = "payara/server-web:6.2023.12-jdk17")
#set ($baseImage = "payara/server-web:6.2024.1-jdk17")
#end
#else
#if (${profile} == 'full')
#set ($baseImage = "payara/server-full:6.2023.12")
#set ($baseImage = "payara/server-full:6.2024.1")
#else
#set ($baseImage = "payara/server-web:6.2023.12")
#set ($baseImage = "payara/server-web:6.2024.1")
#end
#end
#set ($deployDirectory = "$DEPLOY_DIR")
Expand Down
6 changes: 3 additions & 3 deletions archetype/src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
#set ($glassfishUrl = "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/5.1.0/glassfish-5.1.0.zip")
#end
#else
#set ($payaraVersion = "6.2023.12")
#set ($payaraVersion = "6.2024.1")
#set ($tomeeVersion = "9.1.1")
#set ($glassfishContainerId = "glassfish7x")
#if (${profile} == 'web')
#set ($glassfishUrl = "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/web/7.0.11/web-7.0.11.zip")
#set ($glassfishUrl = "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/web/7.0.12/web-7.0.12.zip")
#else
#set ($glassfishUrl = "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.11/glassfish-7.0.11.zip")
#set ($glassfishUrl = "https://repo.maven.apache.org/maven2/org/glassfish/main/distributions/glassfish/7.0.12/glassfish-7.0.12.zip")
#end
#end
#if (${jakartaVersion} == '10')
Expand Down
99 changes: 65 additions & 34 deletions ui/src/main/java/org/eclipse/starter/ui/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,39 @@ public void onJakartaVersionChange() {
"Validating form for Jakarta EE version: {0}, Jakarta EE profile: {1}, Java SE version: {2}, Docker: {3}, runtime: {4}",
new Object[] { jakartaVersion, profile, javaVersion, docker, runtime });
runtimes.get("tomee").setDisabled(true);
runtimes.get("payara").setDisabled(false);

if (!docker && !profile.equals("core")) {
runtimes.get("glassfish").setDisabled(false);
}

if (jakartaVersion != 10) {
javaVersions.get("8").setDisabled(false);
if ((jakartaVersion == 8)
|| runtime.equals("open-liberty") || runtime.equals("none")) {
javaVersions.get("8").setDisabled(false);
}

profiles.get("core").setDisabled(true);

if ((jakartaVersion == 9) || (jakartaVersion == 9.1)) {
runtimes.get("wildfly").setDisabled(true);
} else {
if (jakartaVersion == 8) {
runtimes.get("wildfly").setDisabled(false);
} else {
runtimes.get("wildfly").setDisabled(true);
}

if (profile.equals("web") &&
((jakartaVersion == 8) || ((jakartaVersion == 9.1) && (javaVersion != 8)))) {
runtimes.get("tomee").setDisabled(false);
}
}

if ((jakartaVersion != 8) && (javaVersion == 8)) {
runtimes.get("payara").setDisabled(true);
runtimes.get("glassfish").setDisabled(true);
}
} else {
javaVersions.get("8").setDisabled(true);

if (!runtime.equals("glassfish")) {
if (!runtime.equals("glassfish") && !runtime.equals("tomee")) {
profiles.get("core").setDisabled(false);
}

Expand All @@ -180,24 +194,29 @@ public void onProfileChange() {
new Object[] { jakartaVersion, profile, javaVersion, docker, runtime });
jakartaVersions.get("8").setDisabled(false);

if (!(runtime.equals("wildfly") || runtime.equals("tomee"))) {
if (!(runtime.equals("wildfly") || runtime.equals("tomee")
|| (runtime.equals("payara") && (javaVersion == 8))
|| (runtime.equals("glassfish") && (javaVersion == 8)))) {
jakartaVersions.get("9").setDisabled(false);
}

if (!(runtime.equals("wildfly")
|| (runtime.equals("tomee") && (javaVersion == 8)))) {
|| (runtime.equals("tomee") && (javaVersion == 8))
|| (runtime.equals("payara") && (javaVersion == 8))
|| (runtime.equals("glassfish") && (javaVersion == 8)))) {
jakartaVersions.get("9.1").setDisabled(false);
}

if ((jakartaVersion != 10) && !((jakartaVersion == 9.1) && runtime.equals("tomee"))) {
javaVersions.get("8").setDisabled(false);
}

if ((jakartaVersion == 8)
|| runtime.equals("open-liberty") || runtime.equals("none")) {
javaVersions.get("8").setDisabled(false);
}

if ((jakartaVersion == 8) || ((jakartaVersion == 9.1) && (javaVersion != 8))) {
runtimes.get("tomee").setDisabled(false);
}

if (!docker) {
if (!docker && !((jakartaVersion != 8) && (javaVersion == 8))) {
runtimes.get("glassfish").setDisabled(false);
}

Expand All @@ -220,19 +239,39 @@ public void onJavaVersionChange() {
"Validating form for Jakarta EE version: {0}, Jakarta EE profile: {1}, Java SE version: {2}, Docker: {3}, runtime: {4}",
new Object[] { jakartaVersion, profile, javaVersion, docker, runtime });
runtimes.get("tomee").setDisabled(true);
runtimes.get("payara").setDisabled(false);

if (!docker && !profile.equals("core")) {
runtimes.get("glassfish").setDisabled(false);
}

if ((jakartaVersion != 9) && (jakartaVersion != 9.1)) {
runtimes.get("wildfly").setDisabled(false);
}

if (javaVersion == 8) {
jakartaVersions.get("10").setDisabled(true);
profiles.get("core").setDisabled(true);

if (profile.equals("web") && (jakartaVersion == 8)) {
runtimes.get("tomee").setDisabled(false);
}

if (jakartaVersion != 8) {
runtimes.get("payara").setDisabled(true);
runtimes.get("glassfish").setDisabled(true);
runtimes.get("wildfly").setDisabled(true);
}
} else {
if (!runtime.equals("tomee")) {
jakartaVersions.get("10").setDisabled(false);
}

if ((jakartaVersion == 10)
&& !runtime.equals("tomee") && !runtime.equals("glassfish")) {
profiles.get("core").setDisabled(false);
}

if (profile.equals("web") && ((jakartaVersion == 8) || (jakartaVersion == 9.1))) {
runtimes.get("tomee").setDisabled(false);
}
Expand All @@ -249,7 +288,7 @@ public void onDockerChange() {
} else {
runtimes.get("none").setDisabled(false);

if (!profile.equals("core")) {
if (!profile.equals("core") && !((jakartaVersion != 8) && (javaVersion == 8))) {
runtimes.get("glassfish").setDisabled(false);
}
}
Expand All @@ -259,11 +298,13 @@ public void onRuntimeChange() {
LOGGER.log(Level.INFO,
"Validating form for Jakarta EE version: {0}, Jakarta EE profile: {1}, Java SE version: {2}, Docker: {3}, runtime: {4}",
new Object[] { jakartaVersion, profile, javaVersion, docker, runtime });
jakartaVersions.get("10").setDisabled(false);

if (!profile.equals("core")) {
jakartaVersions.get("9.1").setDisabled(false);
jakartaVersions.get("9").setDisabled(false);
jakartaVersions.get("9.1").setDisabled(false);
}

if (javaVersion != 8) {
jakartaVersions.get("10").setDisabled(false);
}

if (jakartaVersion == 10) {
Expand All @@ -282,41 +323,31 @@ public void onRuntimeChange() {
dockerFlags.get("true").setDisabled(true);
} else if (runtime.equals("payara")) {
if (jakartaVersion != 8) {
if (javaVersion == 8) {
javaVersion = 11;
}

javaVersions.get("8").setDisabled(true);
}
} else if (runtime.equals("glassfish")) {
dockerFlags.get("true").setDisabled(true);
profiles.get("core").setDisabled(true);

if (jakartaVersion != 8) {
if (javaVersion == 8) {
javaVersion = 11;
}

javaVersions.get("8").setDisabled(true);
}
} else if (runtime.equals("tomee")) {
jakartaVersions.get("9").setDisabled(true);
jakartaVersions.get("10").setDisabled(true);
jakartaVersions.get("9").setDisabled(true);
profiles.get("core").setDisabled(true);
profiles.get("full").setDisabled(true);

javaVersions.get("8").setDisabled(true);

if (jakartaVersion != 8) {
if (javaVersion == 8) {
javaVersion = 11;
}

javaVersions.get("8").setDisabled(true);
}
}
} else if (runtime.equals("wildfly")) {
jakartaVersions.get("9.1").setDisabled(true);
jakartaVersions.get("9").setDisabled(true);
jakartaVersions.get("9.1").setDisabled(true);

if (jakartaVersion != 8) {
javaVersions.get("8").setDisabled(true);
}
}
}

Expand Down

0 comments on commit 16b909f

Please sign in to comment.