Search code examples
springversionconflict

Spring mvc and spring security version conflict


Anybody knows if spring mvc version 4.1.3.RELEASE is working with spring security version 4.0.0.RC1?

I'm using java configuration with no xml at all(not even web.xml).

I can't get it working? Any help is welcome.

Thanks


Solution

  • According to spring docs so: Spring Security builds against Spring Framework 4.1.3.RELEASE.

    And to get it work, your pom.xml should be like this one:

    <project
    xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.test</groupId>
    <artifactId>test</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>rapid Maven Webapp</name>
    <url>http://maven.apache.org</url>
    
    <properties>
        <jdk.version>1.8</jdk.version>
        <commons-lang3.version>3.3.2</commons-lang3.version>
        <logback.version>1.0.13</logback.version>
    </properties>
    
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>4.1.3.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.security</groupId>
                <artifactId>spring-security-bom</artifactId>
                <version>4.0.0.RC1</version>
                <!-- <version>4.0.0.CI-SNAPSHOT</version> -->
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    
    <repositories>
        <repository>
            <id>repository.spring.release</id>
            <name>Spring GA Repository</name>
            <url>http://repo.spring.io/release</url>
        </repository>
        <repository>
            <id>spring-snapshot</id>
            <name>Spring Snapshot Repository</name>
            <url>http://repo.springsource.org/snapshot</url>
        </repository>
        <repository>
            <id>spring-milestone</id>
            <name>Spring Milestone Repository</name>
            <url>http://repo.springsource.org/milestone</url>
        </repository>
        <!-- org.javassist -->
        <repository>
            <id>central</id>
            <url>http://repo1.maven.org/maven2/</url>
        </repository>
    </repositories>
    
    
    <dependencies>
        <!-- Core utilities used by other modules. Define this if you use Spring 
            Utility APIs (org.springframework.core.*/org.springframework.util.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
    
        <!-- Expression Language (depends on spring-core) Define this if you use 
            Spring Expression APIs (org.springframework.expression.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
        </dependency>
    
        <!-- Bean Factory and JavaBeans utilities (depends on spring-core) Define 
            this if you use Spring Bean APIs (org.springframework.beans.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
    
        <!-- Aspect Oriented Programming (AOP) Framework (depends on spring-core, 
            spring-beans) Define this if you use Spring AOP APIs (org.springframework.aop.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
        </dependency>
    
        <!-- Application Context (depends on spring-core, spring-expression, spring-aop, 
            spring-beans) This is the central artifact for Spring's Dependency Injection 
            Container and is generally always defined -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
    
        <!-- Various Application Context utilities, including EhCache, JavaMail, 
            Quartz, and Freemarker integration Define this if you need any of these integrations -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
    
        <!-- Transaction Management Abstraction (depends on spring-core, spring-beans, 
            spring-aop, spring-context) Define this if you use Spring Transactions or 
            DAO Exception Hierarchy (org.springframework.transaction.*/org.springframework.dao.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
    
        <!-- JDBC Data Access Library (depends on spring-core, spring-beans, spring-context, 
            spring-tx) Define this if you use Spring's JdbcTemplate API (org.springframework.jdbc.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
    
        <!-- Object-to-Relation-Mapping (ORM) integration with Hibernate, JPA, 
            and iBatis. (depends on spring-core, spring-beans, spring-context, spring-tx) 
            Define this if you need ORM (org.springframework.orm.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
    
        <!-- Object-to-XML Mapping (OXM) abstraction and integration with JAXB, 
            JiBX, Castor, XStream, and XML Beans. (depends on spring-core, spring-beans, 
            spring-context) Define this if you need OXM (org.springframework.oxm.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
        </dependency>
    
        <!-- Web application development utilities applicable to both Servlet and 
            Portlet Environments (depends on spring-core, spring-beans, spring-context) 
            Define this if you use Spring MVC, or wish to use Struts, JSF, or another 
            web framework with Spring (org.springframework.web.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
    
        <!-- Spring MVC for Servlet Environments (depends on spring-core, spring-beans, 
            spring-context, spring-web) Define this if you use Spring MVC with a Servlet 
            Container such as Apache Tomcat (org.springframework.web.servlet.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
    
        <!-- Spring MVC for Portlet Environments (depends on spring-core, spring-beans, 
            spring-context, spring-web) Define this if you use Spring MVC with a Portlet 
            Container (org.springframework.web.portlet.*) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc-portlet</artifactId>
        </dependency>
    
        <!-- Support for testing Spring applications with tools such as JUnit and 
            TestNG This artifact is generally always defined with a 'test' scope for 
            the integration testing framework and unit testing stubs -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
    
        <!-- Spring Security version 4 -->
    
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-acl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-aspects</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-cas</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-crypto</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-ldap</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-openid</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-remoting</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
        </dependency>
    
    
        <!-- Spring Data MongoDB -->
        <!-- Needs for mongodb -->
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>3.1</version>
        </dependency>
    
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>2.12.3</version>
        </dependency>
    
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-mongodb</artifactId>
            <version>1.5.2.RELEASE</version>
        </dependency>
    
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-mongodb-cross-store</artifactId>
            <version>1.5.2.RELEASE</version>
        </dependency>
    
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-mongodb-log4j</artifactId>
            <version>1.5.2.RELEASE</version>
        </dependency>
    
    
        <!-- google common lists -->
    
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
    
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>18.0</version>
        </dependency>
    
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
        </dependency>
    
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
    
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <scope>compile</scope>
        </dependency>
    
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
            <scope>compile</scope>
        </dependency>
    
        <!-- Spice up your java: Automatic Resource Management, automatic generation 
            of getters, setters, equals, hashCode and toString, and more! -->
    
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.14.8</version>
            <scope>provided</scope>
        </dependency>
    
        <dependency>
            <groupId>com.google.code.morphia</groupId>
            <artifactId>morphia</artifactId>
            <version>0.104</version>
        </dependency>
    
        <dependency>
            <groupId>org.mongodb.morphia</groupId>
            <artifactId>morphia</artifactId>
            <version>0.107</version>
        </dependency>
    
        <!-- Lang3 -->
    
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <!-- Spring JPA Data -->
    
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>1.7.0.RELEASE</version>
        </dependency>
    
        <!-- Spring Data REST -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-rest-webmvc</artifactId>
            <version>2.1.2.RELEASE</version>
        </dependency>
    
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-rest-core</artifactId>
            <version>2.1.2.RELEASE</version>
        </dependency>
        <!-- GSON -->
    
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2</version>
        </dependency>
    
        <!-- Joda Time -->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.4</version>
        </dependency>
    
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time-jsptags</artifactId>
            <version>1.1.1</version>
            <scope>runtime</scope>
        </dependency>
    
        <dependency>
            <groupId>org.joda</groupId>
            <artifactId>joda-money</artifactId>
            <version>0.9.1</version>
        </dependency>
        <!-- support JSON serialization and deserialization of Joda data types. -->
    
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <version>2.4.2</version>
        </dependency>
    
    
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
            <version>2.4.4</version>
        </dependency>
    
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-guava</artifactId>
            <version>2.4.4</version>
        </dependency>
    
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
            <version>2.4.4</version>
        </dependency>
    
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-parameter-names</artifactId>
            <version>2.4.4</version>
        </dependency>
    
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
            <version>2.4.4</version>
        </dependency>
    
        <!-- Java API for RESTful Services (JAX-RS) -->
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0-m01</version>
        </dependency>
        <!-- Javassist (JAVA programming ASSISTant) makes Java bytecode manipulation 
            simple -->
        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.18.2-GA</version>
        </dependency>
    
        <!-- JSON Processing is built, assembled and installed using Maven -->
        <dependency>
            <groupId>javax.json</groupId>
            <artifactId>javax.json-api</artifactId>
            <version>1.0</version>
        </dependency>
    
        <!-- Jersey uses Jackson to convert object to / form JSON -->
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>1.18.3</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-json</artifactId>
            <version>1.18.3</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-core</artifactId>
            <version>1.18.3</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-servlet</artifactId>
            <version>1.18.3</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
            <version>1.18.3</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-multipart</artifactId>
            <version>1.18.3</version>
        </dependency>
    
    </dependencies>
    
    <build>
        <finalName>test</finalName>
    
        <plugins>
    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                </configuration>
            </plugin>
    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>false</downloadJavadocs>
                    <wtpversion>2.0</wtpversion>
                </configuration>
            </plugin>
    
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
    
        </plugins>
    
    </build>