wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Problem setting up Servlet / JSP jars in pom.xml for Tomcat 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem setting up Servlet / JSP jars in pom.xml for Tomcat 7" Watch "Problem setting up Servlet / JSP jars in pom.xml for Tomcat 7" New topic
Author

Problem setting up Servlet / JSP jars in pom.xml for Tomcat 7

Jack Rooney
Greenhorn

Joined: Dec 04, 2012
Posts: 14
Hello,

I am using JDK 1.6, Maven 2.2.1, Tomcat 7 and Eclipse Juno (Enterprise Edition).

When trying to import packages such as javax.servlet.*; Eclipse complained
that it does not have it inside its classpath (build path).

So, what I did was include the following dependencies in my pom.xml file:



During tomcat server startup:



Why is it logging this message?

Also, I can't seem to find the right versions for servlet-api 3.0 or jsp 2.2 in the maven repository

http://mvnrepository.com/

Kindly help me...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

More of a Maven question than a Tomcat question.

You need the following:


Note the scope: "provided". That says that these 2 dependencies are provided at runtime by Tomcat and that Maven must NOT include copies of them in the resulting WAR file. Maven will use reference copies of them for compiling.

Also note that you must not attempt to build a WAR using versions of these dependencies that are not compliant with the versions actually in place in the target server.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem setting up Servlet / JSP jars in pom.xml for Tomcat 7