需要Spring版本# - 只有spring.jar文件 [英] Need Spring version# - only have spring.jar file

查看:76
本文介绍了需要Spring版本# - 只有spring.jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一个使用Spring的应用程序。原始开发人员不可用。 Spring jar文件只是spring.jar,因此文件名中没有版本#来帮助我。我想下载对应于jar文件的Spring源代码。 MANIFEST.MF文件有Spring-Version:1.2,但这还不够精确。我看过版本1.2.1和1.2.9并且它不匹配。关键是 org.springframework.web.servlet.view.AbstractCachingViewResolver 有一个 prepareView 方法,该方法是从 resolveViewName ,它似乎不在1.2.1或1.2.9。

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?

推荐答案

这样做:

import org.springframework.core.SpringVersion;

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

在CLASSPATH中用spring.jar编译并运行它它会为你显示版本。请参阅 javadocs 以及。

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

这篇关于需要Spring版本# - 只有spring.jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆