Results 1 to 5 of 5

Thread: How do you import the Spring Framework source code itself into an Eclipse project ?

  1. #1
    Join Date
    Jan 2009
    Posts
    6

    Default How do you import the Spring Framework source code itself into an Eclipse project ?

    ( I am not sure this is the best subforum to ask, but I could not see any more appropriate, since my question is about the eclipse IDE )

    What is the best way of opening the spring framework project itself in Eclipse ?
    I mean, I have tried to download the file "spring-framework-2.5.6-with-dependencies.zip" and then unzipped it, and found a "root directory" there which contained an ant file, but no maven file "pom.xml" and no eclipse files ".classpath" and ".project"...

    Since there are no eclipse files there, I do not think you can (in Eclipse) choose "File - Import - General - Existing projects into workspace".
    If there had been a "pom.xml" file there, then you might have been able to generate the eclipse files with commands such as "mvn eclipse:eclipse" and "mvn eclipse:configure-workspace -Declipse.workspace=<WORKSPACE>" ...

    I guess I could create a new empty project, and then add the "src" directory as a source folder in the build path, and then manually add a bunch of jar files until the whole thing will compile, but I would like to believe that there is an easier way of getting a fully working eclipse project with the spring framework itself ?

  2. #2
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    swman,

    the best way would be to check out the SVN trunk from https://src.springframework.org/svn/spring-framework/.

    You'll find .project and .classpath files for Eclipse in the source tree.

    HTH

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  3. #3
    Join Date
    Jan 2009
    Posts
    6

    Default

    Okay, I have now checked out the code from the suggested subversion repository but when opening the projects in eclipse, I had 356 errors.
    Most of the errors seem to be related to non-existing jar-files that should exist within a classpath variable IVY_CACHE.
    According to a response in the thread
    http://forum.springframework.org/showthread.php?t=63345
    that variable should be set to:
    <your-svn-checkout-dir>/ivy-cache/repository
    but I did not receive any directory named "ivy-cache" within the checkout directory.

    / Tom

  4. #4
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    You need to first run the build from the command line:

    Go into build-spring-framework and execute ant test.

    That will pull down all the dependencies into the ivy cache. You can open re-open Eclipse again.

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  5. #5
    Join Date
    Jan 2009
    Posts
    6

    Default

    No, it did not work but I still had many errors in eclipse.
    However, I instead tried the same thing with the subversion code located in:
    https://src.springframework.org/svn/...work-3.0.0.M1/
    and it worked better (but not perfect). Now at least four of the projects work fine, i.e. if I close all the others then I get 0 errors. The four compilable projects are:
    org.springframework.core
    org.springframework.expression
    org.springframework.instrument
    org.springframework.instrument.classloading

    but when I also try to open
    org.springframework.jdbc
    then it will need another four projects to become opened, which causes compiling problems.
    The problem (possibly the only remaining problem) is now that the file
    com.springsource.javax.el-2.1.0.jar
    can not be found at the expected path

    C:\spring_framework_from_repository\tags\spring-framework-3.0.0.M1\ivy-cache\repository\javax.el\com.springsource.javax.e l\2.1.0\com.springsource.javax.el-2.1.0.jar
    Here the problem is the directory "2.1.0" since my directory is
    C:\spring_framework_from_repository\tags\spring-framework-3.0.0.M1\ivy-cache\repository\javax.el\com.springsource.javax.e l\1.0.0
    i.e. this was the directory created/downloaded into ivy-cache when I executed the ant script.

    Maybe it should not be so surprising that the trunk did not work (that is kind of normal, I believe or isn't it ?) but I believe that a subversion tag named M1 should work fine, since I guess M1 means "Milestone 1" and is expected to be fairly stable and at least definitely easily compilabe with all relative paths being correct.

    Can anyone else really make the subversion code within the M1 tag work easily without manually creating a directory "2.1.0" and from somewhere download a "com.springsource.javax.el-2.1.0.jar" file ?

    / Tom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •