diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java
similarity index 97%
rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java
rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java
index 0a4344db4d..f7f8cfb708 100644
--- a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java
+++ b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java
@@ -1,50 +1,50 @@
-package com.baeldung.springsecuritythymeleaf;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
-
-@Configuration
-@EnableWebSecurity
-public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
-
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests()
- .anyRequest()
- .authenticated()
- .and()
- .formLogin()
- .loginPage("/login")
- .permitAll()
- .successForwardUrl("/index")
- .and()
- .logout()
- .permitAll()
- .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
- .logoutSuccessUrl("/login");
- }
-
- @Autowired
- public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
- auth.inMemoryAuthentication()
- .withUser("user")
- .password(passwordEncoder().encode("password"))
- .roles("USER")
- .and()
- .withUser("admin")
- .password(passwordEncoder().encode("admin"))
- .roles("ADMIN");
- }
-
- @Bean
- public BCryptPasswordEncoder passwordEncoder() {
- return new BCryptPasswordEncoder();
- }
-}
+package com.baeldung.springsecuritythymeleaf;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
+
+@Configuration
+@EnableWebSecurity
+public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
+
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+ http.authorizeRequests()
+ .anyRequest()
+ .authenticated()
+ .and()
+ .formLogin()
+ .loginPage("/login")
+ .permitAll()
+ .successForwardUrl("/index")
+ .and()
+ .logout()
+ .permitAll()
+ .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
+ .logoutSuccessUrl("/login");
+ }
+
+ @Autowired
+ public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
+ auth.inMemoryAuthentication()
+ .withUser("user")
+ .password(passwordEncoder().encode("password"))
+ .roles("USER")
+ .and()
+ .withUser("admin")
+ .password(passwordEncoder().encode("admin"))
+ .roles("ADMIN");
+ }
+
+ @Bean
+ public BCryptPasswordEncoder passwordEncoder() {
+ return new BCryptPasswordEncoder();
+ }
+}
diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java
similarity index 100%
rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java
rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java
diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java
similarity index 95%
rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java
rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java
index a2337f9db5..bb8f04d965 100644
--- a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java
+++ b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java
@@ -1,18 +1,18 @@
-package com.baeldung.springsecuritythymeleaf;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-@Controller
-public class ViewController {
-
- @RequestMapping("/login")
- public String login() {
- return "login";
- }
-
- @RequestMapping({ "/index", "/" })
- public String index() {
- return "index";
- }
-}
+package com.baeldung.springsecuritythymeleaf;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+public class ViewController {
+
+ @RequestMapping("/login")
+ public String login() {
+ return "login";
+ }
+
+ @RequestMapping({ "/index", "/" })
+ public String index() {
+ return "index";
+ }
+}
diff --git a/spring-security-thymeleaf/src/main/resources/application.properties b/spring-security-modules/spring-security-thymeleaf/src/main/resources/application.properties
similarity index 100%
rename from spring-security-thymeleaf/src/main/resources/application.properties
rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/application.properties
diff --git a/spring-security-thymeleaf/src/main/resources/logback.xml b/spring-security-modules/spring-security-thymeleaf/src/main/resources/logback.xml
similarity index 100%
rename from spring-security-thymeleaf/src/main/resources/logback.xml
rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/logback.xml
diff --git a/spring-security-thymeleaf/src/main/resources/templates/index.html b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html
similarity index 97%
rename from spring-security-thymeleaf/src/main/resources/templates/index.html
rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html
index 27426ec496..a419655d9e 100644
--- a/spring-security-thymeleaf/src/main/resources/templates/index.html
+++ b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html
@@ -1,18 +1,18 @@
-
-
-
-Welcome to Spring Security Thymeleaf tutorial
-
-
- Welcome
- Spring Security Thymeleaf tutorial
- Text visible to user.
- Text visible to admin.
- Text visible only to
- authenticated users.
- Authenticated username:
-
- Authenticated user roles:
-
-
+
+
+
+Welcome to Spring Security Thymeleaf tutorial
+
+
+ Welcome
+ Spring Security Thymeleaf tutorial
+ Text visible to user.
+ Text visible to admin.
+ Text visible only to
+ authenticated users.
+ Authenticated username:
+
+ Authenticated user roles:
+
+
\ No newline at end of file
diff --git a/spring-security-thymeleaf/src/main/resources/templates/login.html b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html
similarity index 97%
rename from spring-security-thymeleaf/src/main/resources/templates/login.html
rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html
index 0177f7d8e8..f4a32e0911 100644
--- a/spring-security-thymeleaf/src/main/resources/templates/login.html
+++ b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html
@@ -1,15 +1,15 @@
-
-
-
-Custom Login Page
-
-
- Custom Login Page
-
-
+
+
+
+Custom Login Page
+
+
+ Custom Login Page
+
+
\ No newline at end of file
diff --git a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java
similarity index 100%
rename from spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java
rename to spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java
diff --git a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java
similarity index 97%
rename from spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java
rename to spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java
index d2e7354d2d..c87d1bacc3 100644
--- a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java
+++ b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java
@@ -1,27 +1,27 @@
-package com.baeldung.springsecuritythymeleaf;
-
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.MockMvc;
-
-@RunWith(SpringRunner.class)
-@WebMvcTest
-public class ViewControllerIntegrationTest {
-
- @Autowired
- MockMvc mockMvc;
-
- @Test
- public void givenUser_whenPerformingGet_thenReturnsIndex() throws Exception {
- mockMvc.perform(get("/index").with(user("user").password("password"))).andExpect(status().isOk()).andExpect(view().name("index"));
- }
-
-}
+package com.baeldung.springsecuritythymeleaf;
+
+import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.servlet.MockMvc;
+
+@RunWith(SpringRunner.class)
+@WebMvcTest
+public class ViewControllerIntegrationTest {
+
+ @Autowired
+ MockMvc mockMvc;
+
+ @Test
+ public void givenUser_whenPerformingGet_thenReturnsIndex() throws Exception {
+ mockMvc.perform(get("/index").with(user("user").password("password"))).andExpect(status().isOk()).andExpect(view().name("index"));
+ }
+
+}
diff --git a/spring-security-x509/README.md b/spring-security-modules/spring-security-x509/README.md
similarity index 100%
rename from spring-security-x509/README.md
rename to spring-security-modules/spring-security-x509/README.md
diff --git a/spring-security-x509/keystore/Makefile b/spring-security-modules/spring-security-x509/keystore/Makefile
similarity index 100%
rename from spring-security-x509/keystore/Makefile
rename to spring-security-modules/spring-security-x509/keystore/Makefile
diff --git a/spring-security-x509/keystore/keystore.jks b/spring-security-modules/spring-security-x509/keystore/keystore.jks
similarity index 100%
rename from spring-security-x509/keystore/keystore.jks
rename to spring-security-modules/spring-security-x509/keystore/keystore.jks
diff --git a/spring-security-x509/pom.xml b/spring-security-modules/spring-security-x509/pom.xml
similarity index 95%
rename from spring-security-x509/pom.xml
rename to spring-security-modules/spring-security-x509/pom.xml
index 5b44a13bf5..a4ff908eed 100644
--- a/spring-security-x509/pom.xml
+++ b/spring-security-modules/spring-security-x509/pom.xml
@@ -11,7 +11,7 @@
com.baeldung
parent-boot-1
0.0.1-SNAPSHOT
- ../parent-boot-1
+ ../../parent-boot-1
diff --git a/spring-security-x509/spring-security-x509-basic-auth/pom.xml b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/pom.xml
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/pom.xml
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/pom.xml
diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java
diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java
diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties
diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml
diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html
diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java
diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java
diff --git a/spring-security-x509/spring-security-x509-client-auth/pom.xml b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/pom.xml
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/pom.xml
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/pom.xml
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java
diff --git a/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java
similarity index 100%
rename from spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java
rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java