Hi,
when migrating to 11/17, we caught an error in the CompileJspMojo logic:
|
compile.setSource(val.getValue()); |
Potential issues
it tries to read "source" from the maven war plugin. However:
- Source Level and Target level are two different things - I do not see a target level specified
maven.compiler.release seems ignored which is the better option, if set.
- It completely ignores the server.xml properties which are both valid:
<jspEngine javaSourceLevel="21" /> or <jspEngine jdkSourceLevel="18" />
While both work, the current docs only mention "javaSourceLevel" to avoid confusion: jdkSourceLevel uses "18" for "1.8" or simply "8" and does not go beyond that.
Recommended changes
- use server.xml (location: configurable) when present.
a. prefer javaSourceLevel
b. then the next best option is jdkSourceLevel
- Otherwise use pom.xml settings
a. Prefer "release" paramter of Maven compiler Plugin
b. Otherwise use source (as of now)
Other changes
Breaking changes
- Potentially fixes builds :) Previously, you could not really set the target properly.
- source should have been target all along, as far as I can tell
Other things to be aware of
I found that jsp-level (2.2/2.3) could have been read from server.xml as well. You might want to open another ticket for this.
Hi,
when migrating to 11/17, we caught an error in the CompileJspMojo logic:
ci.maven/liberty-maven-plugin/src/main/java/io/openliberty/tools/maven/jsp/CompileJspMojo.java
Line 94 in 9b96fb6
Potential issues
it tries to read "source" from the maven war plugin. However:
maven.compiler.releaseseems ignored which is the better option, if set.<jspEngine javaSourceLevel="21" />or<jspEngine jdkSourceLevel="18" />While both work, the current docs only mention "javaSourceLevel" to avoid confusion: jdkSourceLevel uses "18" for "1.8" or simply "8" and does not go beyond that.
Recommended changes
a. prefer javaSourceLevel
b. then the next best option is jdkSourceLevel
a. Prefer "release" paramter of Maven compiler Plugin
b. Otherwise use source (as of now)
Other changes
This would need to get fixed first.
** Does the plugin actually update the web.xml file as other plugins do?
** Do JSP files compiled with compile-jsp work on other application servers or does it compile against the OpenLiberty API?
Breaking changes
Other things to be aware of
I found that jsp-level (2.2/2.3) could have been read from server.xml as well. You might want to open another ticket for this.