Skip to content

Commit

Permalink
Merge pull request #290 from m-reza-rahman/master
Browse files Browse the repository at this point in the history
Fix TomEE validation
  • Loading branch information
Reza Rahman authored Dec 25, 2023
2 parents 3aaa320 + 0f151e3 commit a1ff83b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 38 deletions.
20 changes: 5 additions & 15 deletions ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@

<developers>
<!-- All active committers should add their information here. -->
<developer>
<id>rokon12</id>
<name>A N M Bazlur Rahman</name>
<email>[email protected]</email>
</developer>
<developer>
<id>jeyvison</id>
<name>Jeyvison Nascimento</name>
Expand All @@ -63,11 +58,6 @@
<name>Ivar Grimstad</name>
<email>[email protected]</email>
</developer>
<developer>
<id>ivonet</id>
<name>Ivo Woltring</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
Expand Down Expand Up @@ -102,7 +92,7 @@
<version>3.9.4</version>
</dependency>

<!-- for Maven Embedded to work -->
<!-- Dependencies for Embedded Maven -->
<dependency>
<groupId>org.apache.maven.resolver</groupId>
<artifactId>maven-resolver-connector-basic</artifactId>
Expand Down Expand Up @@ -151,9 +141,9 @@
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -207,7 +197,7 @@
</resources>
</deployment>
</configuration>
</plugin>
</plugin>
</plugins>
</build>
</project>
70 changes: 53 additions & 17 deletions ui/src/main/java/org/eclipse/starter/ui/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,24 +147,24 @@ public void onJakartaVersionChange() {
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 });
runtimes.get("tomee").setDisabled(true);

if (jakartaVersion != 10) {
javaVersions.get("8").setDisabled(false);

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


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

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

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

if (!runtime.equals("glassfish")) {
profiles.get("core").setDisabled(false);
Expand All @@ -180,13 +180,20 @@ public void onProfileChange() {
new Object[] { jakartaVersion, profile, javaVersion, docker, runtime });
jakartaVersions.get("8").setDisabled(false);

if (!runtime.equals("wildfly")) {
if (!(runtime.equals("wildfly") || runtime.equals("tomee"))) {
jakartaVersions.get("9").setDisabled(false);
jakartaVersions.get("9.1").setDisabled(false);
}

if (jakartaVersion != 10) {
if (!(runtime.equals("wildfly")
|| (runtime.equals("tomee") && (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) || ((jakartaVersion == 9.1) && (javaVersion != 8))) {
runtimes.get("tomee").setDisabled(false);
}

Expand All @@ -212,13 +219,23 @@ public void onJavaVersionChange() {
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 });
runtimes.get("tomee").setDisabled(true);

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

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

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

Expand Down Expand Up @@ -255,29 +272,48 @@ public void onRuntimeChange() {

profiles.get("full").setDisabled(false);

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

dockerFlags.get("true").setDisabled(false);

if (runtime.equals("none")) {
dockerFlags.get("true").setDisabled(true);
} else if (runtime.equals("payara")) {
if ((jakartaVersion != 8) && (javaVersion == 8)) {
javaVersion = 11;
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) && (javaVersion == 8)) {
javaVersion = 11;
if (jakartaVersion != 8) {
if (javaVersion == 8) {
javaVersion = 11;
}

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

if ((jakartaVersion != 8) && (javaVersion == 8)) {
javaVersion = 11;
}
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);
Expand Down
6 changes: 1 addition & 5 deletions ui/src/main/java/org/eclipse/starter/ui/VersionInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class VersionInfo {

public static final String VERSION_PROPERTY = "version";
public static final String COMPILE_DEFAULT_ARCHETYPE_VERSION = "2.2.0";
public static final String COMPILE_DEFAULT_ARCHETYPE_VERSION = "2.3.0";
public static final String ARCHETYPE_VERSION_ENV_VAR = System.getenv("ARCHETYPE_VERSION");
public static final String ARCHETYPE_VERSION = ( ARCHETYPE_VERSION_ENV_VAR != null)
? System.getenv("ARCHETYPE_VERSION")
Expand All @@ -37,12 +37,8 @@ public Response getProperties() {
}

private void loadPomProperties() throws IOException {

InputStream is = this.getClass().getClassLoader()
.getResourceAsStream("version.properties");
pomProperties.load(is);
}


}

2 changes: 1 addition & 1 deletion ui/src/main/webapp/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<p:ajax event="change" listener="#{project.onRuntimeChange}"
process="@form" update="@form" />
</p:selectOneRadio>
<h:outputText styleClass="footnote" value="TomEE requires Web Profile and Jakarta EE below 10, GlassFish requires no Docker support and Web Profile or the Jakarta EE Platform, WildFly requires Jakarta EE 8 or 10."/>
<h:outputText styleClass="footnote" value="GlassFish requires no Docker support and Web Profile or the Jakarta EE Platform, WildFly requires Jakarta EE 8 or 10, TomEE requires Web Profile and Jakarta EE 8 or 9.1."/>
</p:column>

<p:outputLabel for="@next" value="Docker support" />
Expand Down

0 comments on commit a1ff83b

Please sign in to comment.