jQuery in Action, 3rd edition
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Tomcat plugin precompile JSPs problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven Tomcat plugin precompile JSPs problem" Watch "Maven Tomcat plugin precompile JSPs problem" New topic

Maven Tomcat plugin precompile JSPs problem

Janne Laitinen

Joined: Oct 20, 2004
Posts: 1

I've been trying to precompile my JSP pages using Maven and have almost succeded in it.

The problem I'm having has to do with the classpath in use when doing the compiling. The JspC compiler classpath contains only the libraries that are under my webapp directory (the one that is created using 'maven war:webapp').

The JPS pages that I'm trying to precompile need a reference to these libraries: jasper-compiler.jar, jasper-runtime.jar, jspapi.jar and servlet-api.jar. But these are also libraries that I don't want to include to the webapp directory.

So how can I tell Maven (or Jasper JspC) to include some additional libraries to its classpath?

Example of my project structure:

-- ...
-- lib
-- src
-- target
-- myapp
-- lib (Only this is included in the classpath, why?)
-- tomcat
-- src (the JSP source codes are generated here)

The lib-directory in the root of my project contains the additional libraries mentioned earlier. I have introduced them in the project.xml, but they are not included in to the war structure (intentionally).

My question/problem again: does anyone know how can I make these libraries also available for the JSP compilation?

I'm using the 'maven tomcat:jspc' goal.

And, if I add the additional libraries to the webapp lib directory, the JSPs will be compiled just fine.


Don't get me started about those stupid light bulbs.
subject: Maven Tomcat plugin precompile JSPs problem
It's not a secret anymore!