4

我想将Spring 框架从 3.0 升级到 3.2,但想暂时跳过升级spring-security

我可以将新的 spring 3.2 与旧的 spring-security 3.0 一起使用吗?

使用的 Spring 模块是 spring-core、spring-orm、spring-mvc(仅用于 Web 服务)

4

2 回答 2

4

我们正在成功运行基于 Spring 3.2.1.RELEASE 和 Spring Security 3.1.3.RELEASE 的应用程序。我们在设置时没有任何特别的问题。

不幸的是,我没有任何消息来源表明这是官方支持的。

如果你在你的项目中使用 Maven,你应该强制版本以避免在你的类路径中有多个版本的相同 jar:

<properties>
    <spring.version>3.2.1.RELEASE</spring.version>
    <spring-security.version>3.1.3.RELEASE</spring-security.version>
</properties>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <!-- Etc. (specify a fixed version for each Spring jar) -->
    </dependencies>
</dependencyManagement>
于 2013-03-21T09:52:38.443 回答
0

我正在运行稍微不同的组合 - Spring 3.1.4Spring Security 3.0.5,它也可以正常工作:

<properties>
    <spring.version>3.1.4.RELEASE</spring.version>
    <spring.security.version>3.0.5.RELEASE</spring.security.version>
</properties>

<dependencies>
    <!-- SPRING -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>


    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.flex</groupId>
        <artifactId>spring-flex</artifactId>
        <version>1.0.3.RELEASE</version>
        <exclusions>
            <exclusion>
                <artifactId>spring-web</artifactId>
                <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
                <artifactId>spring-webmvc</artifactId>
                <groupId>org.springframework</groupId>
            </exclusion>
            <exclusion>
                <artifactId>spring-beans</artifactId>
                <groupId>org.springframework</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>${spring.security.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${spring.security.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${spring.security.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
        <version>${spring.version}</version>
    </dependency>
</dependencies>
于 2014-11-28T10:06:41.063 回答