如何使用 Jetty Jspc Maven 插件 Tomcat 7
How to use Jetty Jspc Maven Plugin for Tomcat 7
我按照 https://www.eclipse.org/jetty/documentation/current/jetty-jspc-maven-plugin.html 使用 Jetty Jspc Maven 插件 9.3.11。由于
,已编译的 JSP 无法 运行
java.lang.ClassNotFoundException:
org.apache.jasper.runtime.JspSourceImports
JspSourceImports
是 Tomcat 8 引入的接口,因此在 Tomcat 7 上不可用。Jetty Jspc Maven 插件不允许我配置 [=20] =] 要编译的版本。
我假设隐式附带特定版本的插件。所以,问题是如何使用 Tomcat 7 的 Jetty Jspc Maven 插件?
如果需要较旧的 JSP 支持,您可以使用较旧的 Jetty 8 jspc 插件吗?
Note: Jetty 8 is EOL (End of Life) now, and it used the Glassfish Jasper 2.2.2 JSP engine (which has been completely deprecated and replaced with Apache Jasper 8.5.4 in Jetty 9)
对于 Jetty 8,您将在:
- JSP 2.2
- JSTL 1.2
参见:org.mortbay.jetty:jetty-jspc-maven-plugin:8.1.16.v20140903
解决方案似乎完全符合我上面评论中的预期:
<plugin>
<!-- https://www.eclipse.org/jetty/documentation/9.3.x/jetty-jspc-maven-plugin.html -->
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jspc-maven-plugin</artifactId>
<version>${jetty-jspc-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${tomcat.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>jspc</goal>
</goals>
</execution>
</executions>
</plugin>
${tomcat.version}
是 7.x 分支的某个版本。不需要让它与运行时版本完全匹配,只需要 API 兼容。
我按照 https://www.eclipse.org/jetty/documentation/current/jetty-jspc-maven-plugin.html 使用 Jetty Jspc Maven 插件 9.3.11。由于
,已编译的 JSP 无法 运行java.lang.ClassNotFoundException: org.apache.jasper.runtime.JspSourceImports
JspSourceImports
是 Tomcat 8 引入的接口,因此在 Tomcat 7 上不可用。Jetty Jspc Maven 插件不允许我配置 [=20] =] 要编译的版本。
我假设隐式附带特定版本的插件。所以,问题是如何使用 Tomcat 7 的 Jetty Jspc Maven 插件?
如果需要较旧的 JSP 支持,您可以使用较旧的 Jetty 8 jspc 插件吗?
Note: Jetty 8 is EOL (End of Life) now, and it used the Glassfish Jasper 2.2.2 JSP engine (which has been completely deprecated and replaced with Apache Jasper 8.5.4 in Jetty 9)
对于 Jetty 8,您将在:
- JSP 2.2
- JSTL 1.2
参见:org.mortbay.jetty:jetty-jspc-maven-plugin:8.1.16.v20140903
解决方案似乎完全符合我上面评论中的预期:
<plugin>
<!-- https://www.eclipse.org/jetty/documentation/9.3.x/jetty-jspc-maven-plugin.html -->
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jspc-maven-plugin</artifactId>
<version>${jetty-jspc-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jasper</artifactId>
<version>${tomcat.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>jspc</goal>
</goals>
</execution>
</executions>
</plugin>
${tomcat.version}
是 7.x 分支的某个版本。不需要让它与运行时版本完全匹配,只需要 API 兼容。