JSTL 1.2 Missing From Maven Repositories
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>
If you are running code in a container that already contains JSTL you will just use the jstl-api
dependency with a scope
of provided
. This way your code has access to the API that will be provided by the container.
For those of you using the Knappsack archetypes or using the JBoss Java EE 6 API pom, or no doubt some other dependencies that use javax.servlet.jstl
, you will have problems because the Java EE 6 pom relies on the javax.servlet.jstl
dependency. The answer here is to exclude it from the Java EE 6 dependency and add it separately using the api dependencies described above.
<dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-6.0</artifactId> <version>1.0.0.Final</version> <scope>provided</scope> <type>pom</type> <exclusions> <exclusion> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>jstl-api</artifactId> <version>1.2</version> <scope>provided</scope> </dependency>
I’m surprised that they would eliminate the pom like that, but it may have been due to licensing issues for the reference implementation which I believe has been an issue for some of the standard Java EE APIs and the reason that there is no real definitive deployment of the APIs and we have to mix and match API dependencies from different sources unless you are using the JBoss Java EE 6 dependency to solve the problem.
One thought on “JSTL 1.2 Missing From Maven Repositories”
Comments are closed.
That’s good to know. I wondered what the difference was between the two JSTL 1.2 jars and your post cleared it up. Thanks.