Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've inherited an app that uses Spring. The original developers are not available. The Spring jar file is just "spring.jar", so there's no version# in the filename to help me. I'd like to download the Spring source corresponding to the jar file. The MANIFEST.MF file has "Spring-Version: 1.2" however that's not precise enough. I've looked at version 1.2.1 and 1.2.9 and it doesn't match up quite right. The key thing is that org.springframework.web.servlet.view.AbstractCachingViewResolver has a prepareView method which is called from resolveViewName and it does not seem to be in 1.2.1 or 1.2.9.

Is there any easy way to track down the right version?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
122 views
Welcome To Ask or Share your Answers For Others

1 Answer

This will do it:

import org.springframework.core.SpringVersion;

public class VersionChecker
{
    public static void main(String [] args)
    {
        System.out.println("version: " + SpringVersion.getVersion());
    }
}

Compile and run this with spring.jar in your CLASSPATH and it'll display the version for you. See the javadocs as well.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...