Maven Setup and War Packaging

Harry · 23 Sep 2026 · 1 views
Log in to track your progress and mark lessons complete.

Dependencies

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-webmvc</artifactId>
  <version>5.3.39</version>
</dependency>
<dependency>
  <groupId>org.apache.tiles</groupId>
  <artifactId>tiles-extras</artifactId>
  <version>3.0.8</version>
</dependency>
<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>4.0.1</version>
  <scope>provided</scope>
</dependency>

Why War Packaging

Tiles renders JSPs, and JSPs need a real servlet container with file-based views. Package as <packaging>war</packaging> and deploy to Tomcat 9/10 (use the javax-to-jakarta migration build of Tomcat 10 only with Spring 6, which Tiles does not support - so Tomcat 9 + Spring 5 is the safe pair).

Verify

mvn clean package must produce a war with WEB-INF/tiles/tiles.xml inside. No war, no Tiles.

Key Points

  • Spring 5.3 plus Tiles 3.0.8 plus war packaging.
  • Tomcat 9 matches the javax stack.
  • Provided-scope servlet API keeps the war portable.
Share this post:

Comments (0)

Please login or register to comment.

Create a free account to keep reading

You've enjoyed a free tutorial! Register (it's free) to unlock every tutorial, track your progress and save code.

or sign in with your account

Already have an account? Log in