4

I'm using Eclipse to add Maven Dependencies to my project.

While going to the create pom.xml then clicking the dependencies tab, I'm able to select spring jar dependencies but I cannot find or load jstl from here. Does anyone know how to automatically do it from this screen, or does this always have to be manually typed in to the pom.xml

javax.servlet.jsp.jstl <-- I believe is the current

enter image description here

mc805
  • 127
  • 1
  • 2
  • 11
  • Missing artifact javax.servlet.jsp.jstl:jstl:jar:1.2 <---- I also get this when I try to type it manually under Group Id Artifcat Id – mc805 Oct 17 '15 at 22:17

3 Answers3

12

Add this to your pom and change the versions if you want :

<groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
diginoise
  • 7,352
  • 2
  • 31
  • 39
question_maven_com
  • 2,457
  • 16
  • 21
  • 1
    Thanks, yeah I ended up adding groupId as javax.servlet... for some reason in mvnrepository.com it shows the groupId as javax.servlet.jsp.jstl... I guess they weren't the most reliable site... Thanks again – mc805 Oct 18 '15 at 02:39
4

You're seeing it because of

Try to add this

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

Instead of this

<dependency>
    <groupId>javax.servlet.jsp.jstl</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

It'll solve your problem.

Daksharaj kamal
  • 526
  • 1
  • 4
  • 11
1

Add this to your pom (below), then you can go to project, rigth-click-> Maven -> Update Project and wait few seconds for the sinc and "voila" (y)

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>
Ariel-.
  • 11
  • 1
  • 4