Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 24825
172
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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic