I am using maven2, how do I add a dependency to JSTL (The JSP Standard Tag Library) ?
I am using maven2, how do I add a dependency to JSTL (The JSP Standard Tag Library) ?
You need to add it to your pom.xml file.
In the dependencies node you need to add a reference to JSTL. You will probably need to set its scope to compile. So it would look something like this
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>"whatever version you need"</version>
<scope>runtime</scope>
</dependency>
This is assuming you have the proper references to the maven distribution repository in your pom.xml or settings.xml
It seems in the last few weeks or so the Maven JSTL dependency has vanished from at least the central repository. This has caused a number of issues around the web.
Oracle has released the separate API and implementation dependencies which is really how they should be broken down. Now, instead of having one javax.servlet.jstl dependency you will use the following:
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
</dependency>
And this works.