Maven:Spring 4 + Spring安全性 [英] Maven : Spring 4 + Spring Security

查看:102
本文介绍了Maven:Spring 4 + Spring安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能告诉我如何使用Spring正确构建Web应用程序吗?我知道Spring框架的最新版本是4.0.0.RELEASE,但是Spring Security的最新版本是3.2.0.RELEASE,它取决于spring 3.2.6 ...也许我错了:)

如何将其与Maven集成? 我可以使用Spring 4还是必须使用以前的版本? 正确的方法是什么?

如果您不觉得困难,可以给我看一下pom.xml吗?

解决方案

使用Spring 4应该没问题.如 Spring Security是基于Spring Framework 3.2.6.RELEASE构建的,但也已针对Spring Framework 4.0.0.RELEASE进行了测试.这意味着您可以将Spring Security 3.2.0.RELEASE与Spring Framework 4.0.0结合使用.RELEASE."

他们继续描述了将Spring 4与Spring Security集成到您的项目中的策略.像这样一个:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-framework-bom</artifactId>
        <version>4.0.0.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
</dependencyManagement>

Can you explain to me how to properly build a web app with Spring? I know that the latest version of Spring framework is 4.0.0.RELEASE, but the latest version of Spring Security is 3.2.0.RELEASE, and it depends on spring 3.2.6... maybe i'm wrong :)

How can I integrate it with Maven? Can I use Spring 4 or must I use the previous version? What is the proper way?

If it`s not hard for you could you show me you pom.xml?

解决方案

You should be fine using Spring 4. As described in the documentation:

"Spring Security builds against Spring Framework 3.2.6.RELEASE, but is also tested against Spring Framework 4.0.0.RELEASE. This means you can use Spring Security 3.2.0.RELEASE with Spring Framework 4.0.0.RELEASE."

They go on to describe strategies for integrating Spring 4 with Spring Security in your project. Like this one:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-framework-bom</artifactId>
        <version>4.0.0.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
</dependencyManagement>

这篇关于Maven:Spring 4 + Spring安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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