Skip to content

Commit

Permalink
Handle Java version above 8 for compileJSPs task
Browse files Browse the repository at this point in the history
  • Loading branch information
cherylking committed May 3, 2024
1 parent d943de9 commit 06e2052
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/io/openliberty/tools/ant/jsp/CompileJSPs.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corporation 2014, 2020.
* (C) Copyright IBM Corporation 2014, 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -384,7 +384,7 @@ private void writeServerXML(File serverDir) throws FileNotFoundException {
ps.println("<webApplication name=\"jspCompile\" location=\"fake.war\"/>");
}
ps.println("<httpEndpoint id=\"defaultHttpEndpoint\" host=\"localhost\" httpPort=\"0\"/>");
ps.print("<jspEngine prepareJsps=\"0\" scratchdir=\"" + serverDir.getAbsolutePath() + "/jsps\" jdkSourceLevel=\"" + source + "\"/>");
ps.print("<jspEngine prepareJsps=\"0\" scratchdir=\"" + serverDir.getAbsolutePath() + "/jsps\" javaSourceLevel=\"" + source + "\"/>");
ps.println("<webContainer deferServletLoad=\"false\"/>");
ps.println("<keyStore password=\"dummyKeystore\"/>");
ps.println("</server>");
Expand Down Expand Up @@ -501,6 +501,8 @@ public void setSource(String src) {
source = "17";
} else if ("1.8".equals(src) || "8".equals(src)) {
source = "18";
} else { // for Java 11 and beyond
source = src;
}
}

Expand Down

0 comments on commit 06e2052

Please sign in to comment.