diff --git a/spring-rest/pom.xml b/spring-rest/pom.xml index 7e86a5d59b..c205d6f5a7 100644 --- a/spring-rest/pom.xml +++ b/spring-rest/pom.xml @@ -1,158 +1,177 @@ - - 4.0.0 - org.baeldung - spring-rest - 0.1-SNAPSHOT + + 4.0.0 + org.baeldung + spring-rest + 0.1-SNAPSHOT - spring-rest - war + spring-rest + war - + - + - - org.springframework - spring-web - ${org.springframework.version} - - - org.springframework - spring-webmvc - ${org.springframework.version} - + + org.springframework + spring-web + ${org.springframework.version} + + + org.springframework + spring-webmvc + ${org.springframework.version} + - + - - javax.servlet - javax.servlet-api - 3.0.1 - provided - + + javax.servlet + javax.servlet-api + 3.0.1 + provided + - - javax.servlet - jstl - 1.2 - runtime - + + javax.servlet + jstl + 1.2 + runtime + - + - - junit - junit-dep - ${junit.version} - test - + + junit + junit-dep + ${junit.version} + test + - - org.hamcrest - hamcrest-core - ${org.hamcrest.version} - test - - - org.hamcrest - hamcrest-library - ${org.hamcrest.version} - test - + + org.hamcrest + hamcrest-core + ${org.hamcrest.version} + test + + + org.hamcrest + hamcrest-library + ${org.hamcrest.version} + test + - - org.mockito - mockito-core - ${mockito.version} - test - + + org.mockito + mockito-core + ${mockito.version} + test + - + - - spring-rest - - - src/main/resources - true - - + + spring-rest + + + src/main/resources + true + + - + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - - - - - - - + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + + + + + + + - - org.codehaus.cargo - cargo-maven2-plugin - ${cargo-maven2-plugin.version} - - true - - jetty8x - embedded - - - - - - - 8082 - - - - + + org.codehaus.cargo + cargo-maven2-plugin + ${cargo-maven2-plugin.version} + + true + + jetty8x + embedded + + + + + + + 8082 + + + + - + - + - - - 3.2.6.RELEASE - 3.1.4.RELEASE + + + 3.2.6.RELEASE + 3.1.4.RELEASE - - 4.3.0.Final - 5.1.27 + + 4.3.0.Final + 5.1.27 - - 1.7.5 - 1.0.11 + + 1.7.5 + 1.0.11 - - 5.0.1.Final + + 5.0.1.Final - - 15.0 - 3.1 + + 15.0 + 3.1 - - 1.3 - 4.11 - 1.9.5 + + 1.3 + 4.11 + 1.9.5 - 4.3 - 4.3.1 + 4.3 + 4.3.1 - 2.1.0 - 1.8.9 + 2.1.0 - - 1.4.5 - 2.16 - + + 3.1 + 2.4 + 2.16 + 1.4.5 + + \ No newline at end of file diff --git a/spring-security-rest-basic-auth/pom.xml b/spring-security-rest-basic-auth/pom.xml index bde8f98a4f..ce6e807f08 100644 --- a/spring-security-rest-basic-auth/pom.xml +++ b/spring-security-rest-basic-auth/pom.xml @@ -239,6 +239,12 @@ + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + org.apache.maven.plugins maven-surefire-plugin @@ -308,11 +314,13 @@ 1.9.5 2.1.0 - 1.8.9 - 1.4.5 - 2.16 + 3.1 + 2.4 + 2.16 + 1.4.5 + \ No newline at end of file diff --git a/spring-security-rest-custom/pom.xml b/spring-security-rest-custom/pom.xml index cd946897a8..12abd6826e 100644 --- a/spring-security-rest-custom/pom.xml +++ b/spring-security-rest-custom/pom.xml @@ -1,272 +1,281 @@ - - 4.0.0 - org.baeldung - spring-security-rest-custom - 0.1-SNAPSHOT + + 4.0.0 + org.baeldung + spring-security-rest-custom + 0.1-SNAPSHOT - spring-security-rest-custom - war + spring-security-rest-custom + war - + - + - - org.springframework.security - spring-security-web - ${org.springframework.security.version} - - - org.springframework.security - spring-security-config - ${org.springframework.security.version} - + + org.springframework.security + spring-security-web + ${org.springframework.security.version} + + + org.springframework.security + spring-security-config + ${org.springframework.security.version} + - + - - org.springframework - spring-core - ${org.springframework.version} - - - org.springframework - spring-context - ${org.springframework.version} - - - org.springframework - spring-jdbc - ${org.springframework.version} - - - org.springframework - spring-beans - ${org.springframework.version} - - - org.springframework - spring-aop - ${org.springframework.version} - - - org.springframework - spring-tx - ${org.springframework.version} - - - org.springframework - spring-expression - ${org.springframework.version} - + + org.springframework + spring-core + ${org.springframework.version} + + + org.springframework + spring-context + ${org.springframework.version} + + + org.springframework + spring-jdbc + ${org.springframework.version} + + + org.springframework + spring-beans + ${org.springframework.version} + + + org.springframework + spring-aop + ${org.springframework.version} + + + org.springframework + spring-tx + ${org.springframework.version} + + + org.springframework + spring-expression + ${org.springframework.version} + - - org.springframework - spring-web - ${org.springframework.version} - - - org.springframework - spring-webmvc - ${org.springframework.version} - + + org.springframework + spring-web + ${org.springframework.version} + + + org.springframework + spring-webmvc + ${org.springframework.version} + - - org.springframework - spring-oxm - ${org.springframework.version} - + + org.springframework + spring-oxm + ${org.springframework.version} + - + - - com.fasterxml.jackson.core - jackson-databind - 2.2.2 - + + com.fasterxml.jackson.core + jackson-databind + 2.2.2 + - + - - javax.servlet - javax.servlet-api - 3.0.1 - provided - + + javax.servlet + javax.servlet-api + 3.0.1 + provided + - - javax.servlet - jstl - 1.2 - runtime - + + javax.servlet + jstl + 1.2 + runtime + - + - - org.apache.httpcomponents - httpcore - ${httpcore.version} - - - commons-logging - commons-logging - - - + + org.apache.httpcomponents + httpcore + ${httpcore.version} + + + commons-logging + commons-logging + + + - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - commons-logging - commons-logging - - - + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + commons-logging + commons-logging + + + - + - - com.google.guava - guava - ${guava.version} - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - + + com.google.guava + guava + ${guava.version} + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + - + - - junit - junit-dep - ${junit.version} - test - + + junit + junit-dep + ${junit.version} + test + - - org.hamcrest - hamcrest-core - ${org.hamcrest.version} - test - - - org.hamcrest - hamcrest-library - ${org.hamcrest.version} - test - + + org.hamcrest + hamcrest-core + ${org.hamcrest.version} + test + + + org.hamcrest + hamcrest-library + ${org.hamcrest.version} + test + - - org.mockito - mockito-core - ${mockito.version} - test - + + org.mockito + mockito-core + ${mockito.version} + test + - + - - spring-security-rest-custom - - - src/main/resources - true - - + + spring-security-rest-custom + + + src/main/resources + true + + - + - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - true - source - - + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + true + source + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + + + + + + + - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - - - - - - - + + org.codehaus.cargo + cargo-maven2-plugin + ${cargo-maven2-plugin.version} + + true + + jetty8x + embedded + + + + + + + 8082 + + + + - - org.codehaus.cargo - cargo-maven2-plugin - ${cargo-maven2-plugin.version} - - true - - jetty8x - embedded - - - - - - - 8082 - - - - + - + - + + + 3.2.6.RELEASE + 3.1.4.RELEASE - - - 3.2.6.RELEASE - 3.1.4.RELEASE + + 4.3.0.Final + 5.1.27 - - 4.3.0.Final - 5.1.27 + + 1.7.5 + 1.0.11 - - 1.7.5 - 1.0.11 + + 5.0.1.Final - - 5.0.1.Final + + 15.0 + 3.1 - - 15.0 - 3.1 + + 1.3 + 4.11 + 1.9.5 - - 1.3 - 4.11 - 1.9.5 + 4.3 + 4.3.1 - 4.3 - 4.3.1 + 2.1.0 - 2.1.0 - 1.8.9 - - - 1.4.5 - 2.16 - + + 3.1 + 2.4 + 2.16 + 1.4.5 + + \ No newline at end of file diff --git a/spring-security-rest-digest-auth/pom.xml b/spring-security-rest-digest-auth/pom.xml index 94712aee25..440f090173 100644 --- a/spring-security-rest-digest-auth/pom.xml +++ b/spring-security-rest-digest-auth/pom.xml @@ -1,306 +1,315 @@ - - 4.0.0 - org.baeldung - spring-security-rest-digest-auth - 0.1-SNAPSHOT + + 4.0.0 + org.baeldung + spring-security-rest-digest-auth + 0.1-SNAPSHOT - spring-security-rest-digest-auth - war + spring-security-rest-digest-auth + war - + - + - - org.springframework.security - spring-security-web - ${org.springframework.security.version} - - - org.springframework.security - spring-security-config - ${org.springframework.security.version} - + + org.springframework.security + spring-security-web + ${org.springframework.security.version} + + + org.springframework.security + spring-security-config + ${org.springframework.security.version} + - + - - org.springframework - spring-core - ${org.springframework.version} - - - commons-logging - commons-logging - - - - - org.springframework - spring-context - ${org.springframework.version} - - - org.springframework - spring-jdbc - ${org.springframework.version} - - - org.springframework - spring-beans - ${org.springframework.version} - - - org.springframework - spring-aop - ${org.springframework.version} - - - org.springframework - spring-tx - ${org.springframework.version} - - - org.springframework - spring-expression - ${org.springframework.version} - + + org.springframework + spring-core + ${org.springframework.version} + + + commons-logging + commons-logging + + + + + org.springframework + spring-context + ${org.springframework.version} + + + org.springframework + spring-jdbc + ${org.springframework.version} + + + org.springframework + spring-beans + ${org.springframework.version} + + + org.springframework + spring-aop + ${org.springframework.version} + + + org.springframework + spring-tx + ${org.springframework.version} + + + org.springframework + spring-expression + ${org.springframework.version} + - - org.springframework - spring-web - ${org.springframework.version} - - - org.springframework - spring-webmvc - ${org.springframework.version} - + + org.springframework + spring-web + ${org.springframework.version} + + + org.springframework + spring-webmvc + ${org.springframework.version} + - - org.springframework - spring-oxm - ${org.springframework.version} - + + org.springframework + spring-oxm + ${org.springframework.version} + - + - - com.fasterxml.jackson.core - jackson-databind - 2.2.2 - + + com.fasterxml.jackson.core + jackson-databind + 2.2.2 + - + - - org.apache.httpcomponents - httpcore - ${httpcore.version} - - - commons-logging - commons-logging - - - + + org.apache.httpcomponents + httpcore + ${httpcore.version} + + + commons-logging + commons-logging + + + - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - commons-logging - commons-logging - - - + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + commons-logging + commons-logging + + + - + - - javax.servlet - javax.servlet-api - 3.0.1 - provided - + + javax.servlet + javax.servlet-api + 3.0.1 + provided + - - javax.servlet - jstl - 1.2 - runtime - + + javax.servlet + jstl + 1.2 + runtime + - + - - com.google.guava - guava - ${guava.version} - + + com.google.guava + guava + ${guava.version} + - + - - org.slf4j - slf4j-api - ${org.slf4j.version} - - - ch.qos.logback - logback-classic - ${logback.version} - - - - org.slf4j - jcl-over-slf4j - ${org.slf4j.version} - - - - org.slf4j - log4j-over-slf4j - ${org.slf4j.version} - + + org.slf4j + slf4j-api + ${org.slf4j.version} + + + ch.qos.logback + logback-classic + ${logback.version} + + + + org.slf4j + jcl-over-slf4j + ${org.slf4j.version} + + + + org.slf4j + log4j-over-slf4j + ${org.slf4j.version} + - + - - org.springframework - spring-test - ${org.springframework.version} - test - + + org.springframework + spring-test + ${org.springframework.version} + test + - - junit - junit-dep - ${junit.version} - test - + + junit + junit-dep + ${junit.version} + test + - - org.hamcrest - hamcrest-core - ${org.hamcrest.version} - test - - - org.hamcrest - hamcrest-library - ${org.hamcrest.version} - test - + + org.hamcrest + hamcrest-core + ${org.hamcrest.version} + test + + + org.hamcrest + hamcrest-library + ${org.hamcrest.version} + test + - - org.mockito - mockito-core - ${mockito.version} - test - + + org.mockito + mockito-core + ${mockito.version} + test + - + - - spring-security-rest-digest-auth - - - src/main/resources - true - - + + spring-security-rest-digest-auth + + + src/main/resources + true + + - + - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - true - source - - + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + true + source + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + **/*LiveTest.java + + + + + + - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - **/*LiveTest.java - - - - - - + + org.codehaus.cargo + cargo-maven2-plugin + ${cargo-maven2-plugin.version} + + true + + jetty8x + embedded + + + + + + + 8082 + + + + - - org.codehaus.cargo - cargo-maven2-plugin - ${cargo-maven2-plugin.version} - - true - - jetty8x - embedded - - - - - - - 8082 - - - - + - + - + + + 3.2.6.RELEASE + 3.1.4.RELEASE - - - 3.2.6.RELEASE - 3.1.4.RELEASE + + 4.3.0.Final + 5.1.27 - - 4.3.0.Final - 5.1.27 + + 4.3 + 4.3.1 - - 4.3 - 4.3.1 + + 1.7.5 + 1.0.11 - - 1.7.5 - 1.0.11 + + 5.0.1.Final - - 5.0.1.Final + + 15.0 + 3.1 - - 15.0 - 3.1 + + 1.3 + 4.11 + 1.9.5 - - 1.3 - 4.11 - 1.9.5 + 2.1.0 - 2.1.0 - 1.8.9 + + 3.1 + 2.4 + 2.16 + 1.4.5 - - 1.4.5 - 2.16 - + \ No newline at end of file diff --git a/spring-security-rest-full/README.md b/spring-security-rest-full/README.md index daa0176cad..a2b7dedbd8 100644 --- a/spring-security-rest-full/README.md +++ b/spring-security-rest-full/README.md @@ -1,10 +1,10 @@ ========= -## Spring Security REST Example Project +## REST Example Project with Spring Security ### Relevant Articles: -- [Spring Security Expressions – hasRole Example](http://www.baeldung.com/spring-security-expressions-basic) +- [Spring Security Expressions � hasRole Example](http://www.baeldung.com/spring-security-expressions-basic) ### Build the Project @@ -12,6 +12,16 @@ mvn clean install ``` + +### Set up MySQL +``` +mysql -u root -p +> CREATE USER 'tutorialuser'@'localhost' IDENTIFIED BY 'tutorialmy5ql'; +> GRANT ALL PRIVILEGES ON *.* TO 'tutorialuser'@'localhost'; +> FLUSH PRIVILEGES; +``` + + ### Use the REST Service ``` diff --git a/spring-security-rest-full/pom.xml b/spring-security-rest-full/pom.xml index dd360dcda6..914cd5fd58 100644 --- a/spring-security-rest-full/pom.xml +++ b/spring-security-rest-full/pom.xml @@ -210,6 +210,12 @@ + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + @@ -222,11 +228,11 @@ 4.3.0.Final 5.1.27 - 1.3.2.RELEASE + 1.4.3.RELEASE - 2.2.2 + 2.2.3 1.7.5 @@ -251,8 +257,11 @@ 1.8.9 - 1.4.5 + 3.1 + 2.4 2.16 + 1.4.5 + \ No newline at end of file diff --git a/spring-security-rest/pom.xml b/spring-security-rest/pom.xml index 5b0907bb81..11456654f5 100644 --- a/spring-security-rest/pom.xml +++ b/spring-security-rest/pom.xml @@ -151,6 +151,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + org.apache.maven.plugins maven-surefire-plugin @@ -219,11 +235,13 @@ 4.3.1 2.1.0 - 1.8.9 - 1.4.5 + 3.1 + 2.4 2.16 + 1.4.5 + \ No newline at end of file