My setup: jdk 7, Tomcat 7.0.29, ,Eclipse Juno (with m2e[Maven 3.0.4 embedded], m2eclipse-wtp)
I have a Dynamic Web Project with this JSTL dependency:
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>
<version>1.2.1</version>
</dependency>
When I mvn package
and deploy on Tomcat, I get these non-fatal messages in the log that don't stop my app from deploying:
validateJarFile(...\WEB-INF\lib\jsp-api-2.1.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/el/Expression.class
validateJarFile(...\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
I check and yes, JARs in question are being packaged in the WAR. I check the dependencies with mvn dependency:tree
and get this:
[INFO] \- org.glassfish.web:javax.servlet.jsp.jstl:jar:1.2.1:compile
[INFO] \- javax.servlet.jsp.jstl:jstl-api:jar:1.2:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] \- javax.servlet.jsp:jsp-api:jar:2.1:compile
Both JARs are showing in the compile
scope, But if I check the pom.xml on org.glassfish.web:javax.servlet.jsp.jstl:jar:1.2.1
I see this:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
that shows them on the provided
scope, which I thought would exclude them from the packaging.
Questions:
- How do I tell the WAR plugin to not include these JAR's?
<excludes/>
won't cut it because this also removes them from the build path. - What if I want to develop against the Servlet 3.0 spec but keeping this JSTL version?