Correct configuration of jstl maven dependencies, jar package conflict problem finally solved

Source: Internet
Author: User
Tags glassfish

Troubled two days of the problem, very headache, and today finally have a solution to the idea, in the final analysis, or to maven enough to understand it. Always complaining about Maven is not good use, there are all kinds of unreasonable problems, originally these are attributed to it is not enough to understand the familiarity, it provides a good solution to the idea, but we usually do not know.

Issue background:Configure JSTL dependence on the blame,

<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>

Please look at this dependence, yes, it is JSTL jar package to you complete the whole underground down, but unexpectedly attached to the JSTL-dependent jar package like Servlet-api.jar, Jsp-api.jar down!!! So here's the problem, yes, most of your projects also need these two jar packages, but you know what's going to be scary? I don't know about the compatibility of the middleware version you're using, anyway, the two packages in my Tomcat are the conflicts with my project through maven down the package!!! That's enough, removing the two packets in Tomcat doesn't seem to work. Here's a look at the solution:fromShare: http://www.javacoder.cn/?p=195      

<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
</exclusion>
</exclusions>
</dependency>

Dear ones, have you encountered the same distress as me? Try it quickly, if can help you, I am also very happy!!!

Correct configuration of jstl maven dependencies, jar package conflict problem finally solved

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.