Search code examples
mavenembedded-tomcat-8

How to run spring web app (jdk 8) with embedded Tomcat 8


We have a Spring web app (JDK 1.8) and (for development purposes) we're running it on embedded tomcat container, i.e. - we're using tomcat7-maven-plugin. The app is being started with

mvn tomcat7:run ...

For what I found out on I-net, there is no tomcat8-maven-plugin yet.

I found a few posts that claim that this also works with Tomcat 8, but it's not clear how to configure maven plugin to run Tomcat version 8, instead of version 7.

I tried this: https://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/adjust-embedded-tomcat-version.html

and the build was successful, but the run failed with:

[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2: run (default-cli) on project spotbuy: Execution default-cli of goal org.apache.t omcat.maven:tomcat7-maven-plugin:2.2:run failed: An API incompatibility was encountered while executing org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:run: java.lang.NoSuchMethodError: org.apache.catalina.startup.Tomcat.setDefaultRealm(Lorg/apache/catalina/Realm;)

I researched again and I found out, this is known unresolved problem.

Provided it's even possible, can anybody, please, give more details what and where should be configured?


Solution

  • It's not possible ... for now ...