Include JSTL dependency with Maven

flybywire picture flybywire · Feb 16, 2010 · Viewed 50.7k times · Source

I am using maven2, how do I add a dependency to JSTL (The JSP Standard Tag Library) ?

Answer

Jerry Tian picture Jerry Tian · Apr 18, 2011

The dependencies mentioned above is not enough for me(using Tomcat 5.x as servlet container, which doesn't provide JSTL implementation itself). It just imports the according JSTL interface package into project, and will cause a runtime error in Tomcat.

Here is the dependency part used in my project, hopefully can help others out. The hardest part is the naming of the Apache's JSTL implementation in repository.

  <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.1.1</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <scope>runtime</scope>
        <version>1.1.1</version>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>c</artifactId>
        <version>1.1.1</version>
        <scope>runtime</scope>
        <type>tld</type>
    </dependency>
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>fmt</artifactId>
        <version>1.1.1</version>
        <scope>runtime</scope>
        <type>tld</type>
    </dependency>