Announcement Announcement Module
Collapse
No announcement yet.
spring-servlet maven dependency Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-servlet maven dependency

    Hi Springers,


    I've been trying to find the maven dependency declaration for spring-web-servlet but no success so far. I have look in many searchers like google, yahoo, mvnrepository.com/artifact/org.springframework and more but nothing yet.


    I have tried:

    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>org.springframework.web.servlet</artifactId>
    <version>2.5.6</version>
    </dependency>


    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-servlet</artifactId>
    <version>2.5.6</version>
    </dependency>


    Plase assist. Thanks!

  • #2
    Maven dependency

    The package you are looking for "org.springframework.web.servlet" actually ships with spring-webmvc package.Try using the following maven dependency:
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>2.5.6</version>
    </dependency>
    This should resolve your problem.
    Cheers,
    Sushant

    Comment


    • #3
      Hi,

      Thanks for your reply, however it does not work, Maven complains about not being able to lacate the symbol @PathVariable which is org.springframework.web.bind.annotation.PathVariab le.

      That class is contained inside the spring-servlet jar. I had too install manually that jar and it worked OK; however manually installing that jar is not a portable solution, thus: does anybody know the proper Maven dependency config?

      Thanks!

      Comment


      • #4
        I had to do some bit of research to sort your problem and Here is the solution for that:
        The PathVariable is a feature only available from Spring v 3.0.M2 which is the latest release.
        So use the following entry in your pom.xml to get the desired annotation package which contains PathVariable :
        <repositories>
        <repository>
        <id>SpringSource Enterprise Bundle Repositories</id>
        <url>http://repository.springsource.com/maven/bundles/milestone</url>
        </repository>
        </repositories>
        <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>org.springframework.web.servlet</artifactId>
        <version>3.0.0.M2</version>
        </dependency>

        I have tried and tested this in a sample Maven Project and It is showing the PathVariable class available.
        the package is org.springframework.web.bind.annotation
        so I hope your problem is solved.
        "This solution is also helpful for people looking to grab Spring 3.0.0.M2" from Maven respository"
        Cheers,
        Sushant
        Last edited by sushant.kapoor; Apr 2nd, 2009, 06:25 AM.

        Comment


        • #5
          Thank you Sushant! The problem is fixed now.

          Comment

          Working...
          X