Announcement Announcement Module
Collapse
No announcement yet.
Spring Tempate for MVC does not resolve dependency Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Tempate for MVC does not resolve dependency

    I have attempted install of the Spring Source 2.9.2 for both Windows 7 and Mac OSX Mountain Lion. I have also attempted to install the STS as a plug in to my current editions of Eclipse, but I have not been able to resolve dependencies when I attempt to create a new project using the Spring MVC Template.

    I have downloaded the libraries and set them as user libraries in the workspace for Spring, Maven and SFG4J. These helped to resolve the logger classes, but none of the Spring imports nor any of the default configuration files will resolve as error free.

    Is there a setting or method that I could use to clear these up and move forward with developing Spring?

    My current attempt is OS X Mtn Lion, MBP , SpringTS 2.9.2, with Spring edition 3.1.

    When I look at the pom.xml.. i see this error. I have attempted to update Maven dependencies, and clean the project without success.

    Please advise,

    "
    Code:
    Multiple annotations found at this line:
    	- Missing artifact javax.servlet:servlet-api:jar:2.5
    	- Missing artifact org.springframework:spring-asm:jar:3.1.0.RELEASE
    	- Missing artifact javax.servlet:jstl:jar:1.2
    	- Missing artifact junit:junit:jar:4.7
    	- Missing artifact org.springframework:spring-context:jar:3.1.0.RELEASE
    	- ArtifactDescriptorException: Failed to read artifact descriptor for 
    	 org.springframework:spring-beans:jar:3.1.0.RELEASE: ArtifactResolutionException: 
    	 Failure to transfer org.springframework:spring-beans:pom:3.1.0.RELEASE from http://
    	 repo1.maven.org/maven2 was cached in the local repository, resolution will not be 
    	 reattempted until the update interval of central has elapsed or updates are forced. 
    	 Original error: Could not transfer artifact org.springframework:spring-beans:pom:
    	 3.1.0.RELEASE from/to central (http://repo1.maven.org/maven2): /Users/user/.m2/
    	 repository/org/springframework/spring-beans/3.1.0.RELEASE/spring-
    	 beans-3.1.0.RELEASE.pom.ahca319822f8fa94c59 (No such file or directory)
    	- Missing artifact org.springframework:spring-expression:jar:3.1.0.RELEASE
    	- Missing artifact org.springframework:spring-webmvc:jar:3.1.0.RELEASE
    	- Missing artifact org.aspectj:aspectjrt:jar:1.6.9
    	- Missing artifact org.slf4j:slf4j-api:jar:1.5.10
    	- ArtifactDescriptorException: Failed to read artifact descriptor for 
    	 org.springframework:spring-aop:jar:3.1.0.RELEASE: ArtifactResolutionException: Failure 
    	 to transfer org.springframework:spring-aop:pom:3.1.0.RELEASE from http://
    	 repo1.maven.org/maven2 was cached in the local repository, resolution will not be 
    	 reattempted until the update interval of central has elapsed or updates are forced. 
    	 Original error: Could not transfer artifact org.springframework:spring-aop:pom:
    	 3.1.0.RELEASE from/to central (http://repo1.maven.org/maven2): Failed to transfer 
    	 http://repo1.maven.org/maven2/org/springframework/spring-aop/3.1.0.RELEASE/
    	 spring-aop-3.1.0.RELEASE.pom. Error code 416, Requested Range Not Satisfiable
    	- Missing artifact aopalliance:aopalliance:jar:1.0
    	- Missing artifact org.slf4j:slf4j-log4j12:jar:1.5.10
    	- Missing artifact javax.servlet.jsp:jsp-api:jar:2.1
    	- Missing artifact org.springframework:spring-core:jar:3.1.0.RELEASE
    	- Missing artifact log4j:log4j:jar:1.2.15
    	- Missing artifact javax.inject:javax.inject:jar:1
    	- Missing artifact org.slf4j:jcl-over-slf4j:jar:1.5.10
    	- Missing artifact org.springframework:spring-web:jar:3.1.0.RELEASE
    	- Missing artifact org.springframework:spring-context-support:jar:3.1.0.RELEASE
    "

  • #2
    I think I may have figured the issue. The SpringTS wants to install the dependencies to a directory in the user path called '.m2' and MacOS X thinks that is supposed to be a reserved style of directory. I will see if I can override this feature in OS X. Otherwise I had to create a user library and download all of the missing jar files for the library Maven dependency.

    Comment


    • #3
      Hey!

      Interested to hear that Mountain Lion has problems with Maven using the .m2 location. This is the location of your local Maven repository, but you can change that, if you want. Just go to the preferences for Maven within STS and choose a different directory for this.

      More general notes here: The MVC template project uses Maven to resolve dependencies, therefore the Maven Integration for Eclipse is used to do so (and therefore Maven in the background). This is the reason my the .m2 directory is being used. This is more a Maven thing than an STS thing, but you can change that preference. If you have installed the STS tooling into an existing Eclipse installation, you need to also install the Maven Integration for Eclipse from the Indigo update site (together with a few add-ons for this integration, like m2e-wtp, etc.). All that comes pre-installed with the STS distribution. That is why I would recommend to use the STS distribution in this case.

      HTH,
      Martin

      Comment


      • #4
        Found the solution

        Hello!

        I've just encountered the same problem but actually the fault is not in the STS or MacOS.
        I am using STS 3.1.0 Release and MacOS 10.7.5 and when I've downloaded the Spring MVC Template I had the same exact error. But I've solved it by editing pom.xml which occurs to have old dependency versions!
        The main problem was with org.slf4j-version. When I changed it version to 1.6.6 it started to work flawlessly!

        Cheers!
        (I know its kind of old topic but still that bug could be fixed by updating the template!)
        Last edited by Atais; Nov 1st, 2012, 05:05 AM.

        Comment


        • #5
          Hey!

          In the meantime a new version of the MVC template project is available and it also includes the update to SLF4J version 1.6.6, as recommended here.

          Cheers,
          -Martin

          Comment

          Working...
          X