• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic