From eafb271394bf518131b1d5437b1dd62a3243f1b3 Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Fri, 8 Jul 2022 01:35:31 +0200 Subject: [PATCH 01/73] BAEL-5545: prepared a simple demo to benchmark spring jdbc batch inserts --- persistence-modules/pom.xml | 1 + persistence-modules/spring-jdbc-batch/pom.xml | 60 +++++++++++++++++++ ...SpringJdbcBatchPerformanceApplication.java | 43 +++++++++++++ .../spring/jdbc/batch/config/AppConfig.java | 24 ++++++++ .../spring/jdbc/batch/model/Product.java | 54 +++++++++++++++++ .../batch/repo/BatchProductRepository.java | 33 ++++++++++ .../jdbc/batch/repo/ProductRepository.java | 9 +++ .../batch/repo/SimpleProductRepository.java | 29 +++++++++ .../jdbc/batch/service/ProductService.java | 54 +++++++++++++++++ .../batch/service/ProductServiceUnitTest.java | 26 ++++++++ 10 files changed, 333 insertions(+) create mode 100644 persistence-modules/spring-jdbc-batch/pom.xml create mode 100644 persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java create mode 100644 persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java create mode 100644 persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java create mode 100644 persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java create mode 100644 persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java create mode 100644 persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java create mode 100644 persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java create mode 100644 persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index ee4807933a..612070ea10 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -105,6 +105,7 @@ spring-jooq spring-mybatis spring-persistence-simple + spring-jdbc-batch diff --git a/persistence-modules/spring-jdbc-batch/pom.xml b/persistence-modules/spring-jdbc-batch/pom.xml new file mode 100644 index 0000000000..0401044be1 --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/pom.xml @@ -0,0 +1,60 @@ + + + + + 4.0.0 + + spring-jdbc-batch + 0.0.1-SNAPSHOT + spring-jdbc-batch + Demo project for Spring Boot Jdbc batch support + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + + + 11 + + + + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.postgresql + postgresql + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + ${java.version} + ${java.version} + + + + + diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java new file mode 100644 index 0000000000..aef2100de8 --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java @@ -0,0 +1,43 @@ +package com.baeldung.spring.jdbc.batch; + +import com.baeldung.spring.jdbc.batch.service.ProductService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringJdbcBatchPerformanceApplication implements CommandLineRunner { + + @Autowired + @Qualifier("batchProductService") + private ProductService batchProductService; + @Autowired + @Qualifier("simpleProductService") + private ProductService simpleProductService; + + public static void main(String[] args) { + SpringApplication.run(SpringJdbcBatchPerformanceApplication.class, args); + } + + @Override + public void run(String... args) throws Exception { + int[] recordCounts = { 1, 10, 100, 1000, 10_000, 100_000, 1000_000 }; + + for (int recordCount : recordCounts) { + long regularElapsedTime = simpleProductService.createProducts(recordCount); + long batchElapsedTime = batchProductService.createProducts(recordCount); + + System.out.println("-".repeat(50)); + System.out.format("%-20s%-5s%-10s%-5s%8sms\n", "Regular inserts", "|", recordCount, "|", regularElapsedTime); + System.out.format("%-20s%-5s%-10s%-5s%8sms\n", "Batch inserts", "|", recordCount, "|", batchElapsedTime); + System.out.printf("Total gain: %d %s\n", calculateGainInPercent(regularElapsedTime, batchElapsedTime), "%"); + } + + } + + int calculateGainInPercent(long before, long after) { + return (int) Math.floor(100D * (before - after) / before); + } +} diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java new file mode 100644 index 0000000000..b0fd111ed2 --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java @@ -0,0 +1,24 @@ +package com.baeldung.spring.jdbc.batch.config; + +import com.baeldung.spring.jdbc.batch.repo.BatchProductRepository; +import com.baeldung.spring.jdbc.batch.repo.SimpleProductRepository; +import com.baeldung.spring.jdbc.batch.service.ProductService; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.time.Clock; +import java.util.Random; + +@Configuration +public class AppConfig { + + @Bean + public ProductService simpleProductService(SimpleProductRepository simpleProductRepository) { + return new ProductService(simpleProductRepository, new Random(), Clock.systemUTC()); + } + + @Bean + public ProductService batchProductService(BatchProductRepository batchProductRepository) { + return new ProductService(batchProductRepository, new Random(), Clock.systemUTC()); + } +} diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java new file mode 100644 index 0000000000..6454952fdc --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java @@ -0,0 +1,54 @@ +package com.baeldung.spring.jdbc.batch.model; + +import java.math.BigDecimal; +import java.time.LocalDateTime; + +public class Product { + private long id; + private String title; + private LocalDateTime createdTs; + private BigDecimal price; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public LocalDateTime getCreatedTs() { + return createdTs; + } + + public void setCreatedTs(LocalDateTime createdTs) { + this.createdTs = createdTs; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("Product{"); + sb.append("id=").append(id); + sb.append(", title='").append(title).append('\''); + sb.append(", createdTs=").append(createdTs); + sb.append(", price=").append(price); + sb.append('}'); + return sb.toString(); + } +} diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java new file mode 100644 index 0000000000..d4a4affd0a --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java @@ -0,0 +1,33 @@ +package com.baeldung.spring.jdbc.batch.repo; + +import com.baeldung.spring.jdbc.batch.model.Product; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.sql.PreparedStatement; +import java.sql.Timestamp; +import java.util.List; + +@Repository +public class BatchProductRepository implements ProductRepository { + + private final JdbcTemplate jdbcTemplate; + + public BatchProductRepository(JdbcTemplate jdbcTemplate) { + this.jdbcTemplate = jdbcTemplate; + } + + @Override + @Transactional + public void saveAll(List products) { + jdbcTemplate.batchUpdate("INSERT INTO PRODUCT (TITLE, CREATED_TS, PRICE) VALUES (?, ?, ?)", + products, + 100, + (PreparedStatement ps, Product product) -> { + ps.setString(1, product.getTitle()); + ps.setTimestamp(2, Timestamp.valueOf(product.getCreatedTs())); + ps.setBigDecimal(3, product.getPrice()); + }); + } +} diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java new file mode 100644 index 0000000000..ed193f87dd --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java @@ -0,0 +1,9 @@ +package com.baeldung.spring.jdbc.batch.repo; + +import com.baeldung.spring.jdbc.batch.model.Product; + +import java.util.List; + +public interface ProductRepository { + void saveAll(List products); +} diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java new file mode 100644 index 0000000000..3dfb998cba --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java @@ -0,0 +1,29 @@ +package com.baeldung.spring.jdbc.batch.repo; + +import com.baeldung.spring.jdbc.batch.model.Product; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Transactional; + +import java.sql.Timestamp; +import java.util.List; + +@Repository +public class SimpleProductRepository implements ProductRepository { + + private final JdbcTemplate jdbcTemplate; + + public SimpleProductRepository(JdbcTemplate jdbcTemplate) { + this.jdbcTemplate = jdbcTemplate; + } + + @Override + @Transactional + public void saveAll(List products) { + for (Product product : products) { + jdbcTemplate.update("INSERT INTO PRODUCT (TITLE, CREATED_TS, PRICE) VALUES (?, ?, ?)", + product.getTitle(), Timestamp.valueOf(product.getCreatedTs()), product.getPrice()); + } + } + +} diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java new file mode 100644 index 0000000000..6a3758c07a --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java @@ -0,0 +1,54 @@ +package com.baeldung.spring.jdbc.batch.service; + +import com.baeldung.spring.jdbc.batch.model.Product; +import com.baeldung.spring.jdbc.batch.repo.ProductRepository; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.Clock; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class ProductService { + + private final ProductRepository productRepository; + private final Random random; + private final Clock clock; + + public ProductService(ProductRepository productRepository, Random random, Clock clock) { + this.productRepository = productRepository; + this.random = random; + this.clock = clock; + } + + @Transactional + public long createProducts(int count) { + List products = generate(count); + long startTime = clock.millis(); + productRepository.saveAll(products); + return clock.millis() - startTime; + } + + protected List generate(int count) { + final String[] titles = { "car", "plane", "house", "yacht" }; + final BigDecimal[] prices = { + new BigDecimal("12483.12"), + new BigDecimal("8539.99"), + new BigDecimal("88894"), + new BigDecimal("458694") + }; + + final List products = new ArrayList<>(count); + + for (int i = 0; i < count; i++) { + Product product = new Product(); + product.setCreatedTs(LocalDateTime.now()); + product.setPrice(prices[random.nextInt(4)]); + product.setTitle(titles[random.nextInt(4)]); + products.add(product); + } + return products; + } +} diff --git a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java new file mode 100644 index 0000000000..b242eaa335 --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.spring.jdbc.batch.service; + +import com.baeldung.spring.jdbc.batch.repo.ProductRepository; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; + +import java.time.Clock; +import java.util.Random; + +class ProductServiceUnitTest { + + @Mock + ProductRepository productRepository; + @Mock + Random random; + @Mock + Clock clock; + @InjectMocks + ProductService productService; + + @Test + void testWhenThen() { + + } +} \ No newline at end of file From b2ebd89c053660b8f96dadd8c951723a3831e338 Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Fri, 8 Jul 2022 02:11:40 +0200 Subject: [PATCH 02/73] BAEL-5545: added unit test for ProductService --- .../jdbc/batch/service/ProductService.java | 4 +- .../batch/service/ProductServiceUnitTest.java | 47 ++++++++++++++++++- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java index 6a3758c07a..6d8808c21b 100644 --- a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java @@ -31,7 +31,7 @@ public class ProductService { return clock.millis() - startTime; } - protected List generate(int count) { + private List generate(int count) { final String[] titles = { "car", "plane", "house", "yacht" }; final BigDecimal[] prices = { new BigDecimal("12483.12"), @@ -44,7 +44,7 @@ public class ProductService { for (int i = 0; i < count; i++) { Product product = new Product(); - product.setCreatedTs(LocalDateTime.now()); + product.setCreatedTs(LocalDateTime.now(clock)); product.setPrice(prices[random.nextInt(4)]); product.setTitle(titles[random.nextInt(4)]); products.add(product); diff --git a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java index b242eaa335..43719e986d 100644 --- a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java +++ b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java @@ -1,13 +1,30 @@ package com.baeldung.spring.jdbc.batch.service; +import com.baeldung.spring.jdbc.batch.model.Product; import com.baeldung.spring.jdbc.batch.repo.ProductRepository; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import java.math.BigDecimal; import java.time.Clock; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.List; import java.util.Random; +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.tuple; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) class ProductServiceUnitTest { @Mock @@ -19,8 +36,34 @@ class ProductServiceUnitTest { @InjectMocks ProductService productService; - @Test - void testWhenThen() { + @Captor + ArgumentCaptor> proArgumentCaptor; + + @Test + void testWhenCreateProductsThenShouldSaveAndReturnElapsedTime() { + when(random.nextInt(4)) + .thenReturn(1, 3, 2, 0); + when(clock.instant()) + .thenReturn(Instant.parse("2022-04-09T10:15:30.00Z")); + when(clock.millis()) + .thenReturn(100L,500L); + when(clock.getZone()) + .thenReturn(ZoneId.systemDefault()); + + long actualElapsedTime = productService.createProducts(2); + + assertThat(actualElapsedTime) + .isEqualTo(400L); + verify(productRepository,times(1)) + .saveAll(proArgumentCaptor.capture()); + + assertThat(proArgumentCaptor.getValue()) + .hasSize(2) + .extracting("title","createdTs","price") + .containsExactly( + tuple("yacht", LocalDateTime.parse("2022-04-09T12:15:30"), new BigDecimal("8539.99")), + tuple("car", LocalDateTime.parse("2022-04-09T12:15:30"), new BigDecimal("88894")) + ); } } \ No newline at end of file From 551184076c26485898d43b145b40399c53a2467f Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Fri, 8 Jul 2022 02:24:58 +0200 Subject: [PATCH 03/73] BAEL-5545: fixed build issue for java 11 --- persistence-modules/pom.xml | 1 - pom.xml | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index 612070ea10..ee4807933a 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -105,7 +105,6 @@ spring-jooq spring-mybatis spring-persistence-simple - spring-jdbc-batch diff --git a/pom.xml b/pom.xml index 24aa678523..a10da85200 100644 --- a/pom.xml +++ b/pom.xml @@ -1260,6 +1260,7 @@ testing-modules/testing-assertions persistence-modules/fauna lightrun + persistence-modules/spring-jdbc-batch @@ -1327,6 +1328,7 @@ spring-boot-modules/spring-boot-camel testing-modules/testing-assertions persistence-modules/fauna + persistence-modules/spring-jdbc-batch lightrun From 0b5ffa01a70675c6047b8e69b93f46230046a103 Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Fri, 8 Jul 2022 12:56:50 +0200 Subject: [PATCH 04/73] BAEL-5545: fixed mockito mocking issue with Random class, added properties --- .../src/main/resources/application.properties | 5 +++++ .../batch/service/ProductServiceUnitTest.java | 17 +++++++++++++---- pom.xml | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 persistence-modules/spring-jdbc-batch/src/main/resources/application.properties diff --git a/persistence-modules/spring-jdbc-batch/src/main/resources/application.properties b/persistence-modules/spring-jdbc-batch/src/main/resources/application.properties new file mode 100644 index 0000000000..3f9b093013 --- /dev/null +++ b/persistence-modules/spring-jdbc-batch/src/main/resources/application.properties @@ -0,0 +1,5 @@ +spring.datasource.url=jdbc:postgresql://localhost:5432/sample-baeldung-db +spring.datasource.username=postgres +spring.datasource.password=root +spring.datasource.driver-class-name=org.postgresql.Driver +spring.datasource.hikari.data-source-properties.reWriteBatchedInserts=true diff --git a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java index 43719e986d..aaf9cd5f23 100644 --- a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java +++ b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java @@ -2,12 +2,14 @@ package com.baeldung.spring.jdbc.batch.service; import com.baeldung.spring.jdbc.batch.model.Product; import com.baeldung.spring.jdbc.batch.repo.ProductRepository; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.InjectMocks; import org.mockito.Mock; +import org.mockito.MockitoAnnotations; import org.mockito.junit.jupiter.MockitoExtension; import java.math.BigDecimal; @@ -20,26 +22,33 @@ import java.util.Random; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.tuple; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.mockito.Mockito.withSettings; @ExtendWith(MockitoExtension.class) class ProductServiceUnitTest { - @Mock ProductRepository productRepository; - @Mock Random random; - @Mock Clock clock; - @InjectMocks ProductService productService; @Captor ArgumentCaptor> proArgumentCaptor; + @BeforeEach + void setUp() { + this.productRepository = mock(ProductRepository.class); + this.random = mock(Random.class, withSettings().withoutAnnotations()); + this.clock = mock(Clock.class); + this.productService = new ProductService(this.productRepository, this.random, this.clock); + } + + @Test void testWhenCreateProductsThenShouldSaveAndReturnElapsedTime() { when(random.nextInt(4)) diff --git a/pom.xml b/pom.xml index a10da85200..23cc338d8b 100644 --- a/pom.xml +++ b/pom.xml @@ -1260,7 +1260,7 @@ testing-modules/testing-assertions persistence-modules/fauna lightrun - persistence-modules/spring-jdbc-batch + persistence-modules/spring-jdbc-batch From e934c96f6de468d9c5ca93ca74de3659336e820b Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Fri, 8 Jul 2022 16:17:37 +0200 Subject: [PATCH 05/73] BAEL-5545: fixed timezone issue --- .../batch/service/ProductServiceUnitTest.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java index aaf9cd5f23..12a0e70c1b 100644 --- a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java +++ b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java @@ -7,9 +7,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; import org.mockito.junit.jupiter.MockitoExtension; import java.math.BigDecimal; @@ -55,24 +52,28 @@ class ProductServiceUnitTest { .thenReturn(1, 3, 2, 0); when(clock.instant()) .thenReturn(Instant.parse("2022-04-09T10:15:30.00Z")); + when(clock.getZone()) + .thenReturn(ZoneId.of("UTC")); + when(clock.millis()) .thenReturn(100L,500L); - when(clock.getZone()) - .thenReturn(ZoneId.systemDefault()); - long actualElapsedTime = productService.createProducts(2); + + final long actualElapsedTime = productService.createProducts(2); + assertThat(actualElapsedTime) .isEqualTo(400L); + verify(productRepository,times(1)) .saveAll(proArgumentCaptor.capture()); assertThat(proArgumentCaptor.getValue()) .hasSize(2) - .extracting("title","createdTs","price") + .extracting("title", "createdTs", "price") .containsExactly( - tuple("yacht", LocalDateTime.parse("2022-04-09T12:15:30"), new BigDecimal("8539.99")), - tuple("car", LocalDateTime.parse("2022-04-09T12:15:30"), new BigDecimal("88894")) + tuple("yacht", LocalDateTime.parse("2022-04-09T10:15:30"), new BigDecimal("8539.99")), + tuple("car", LocalDateTime.parse("2022-04-09T10:15:30"), new BigDecimal("88894")) ); } } \ No newline at end of file From bce765b9594cc38ffaff6fec1d68af379e68ee4f Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Wed, 20 Jul 2022 20:47:28 +0200 Subject: [PATCH 06/73] BAEL-5545: fixed formatting issue --- .../jdbc/batch/SpringJdbcBatchPerformanceApplication.java | 1 + .../spring/jdbc/batch/service/ProductServiceUnitTest.java | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java index aef2100de8..008bf55024 100644 --- a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java +++ b/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java @@ -1,6 +1,7 @@ package com.baeldung.spring.jdbc.batch; import com.baeldung.spring.jdbc.batch.service.ProductService; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.CommandLineRunner; diff --git a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java index 12a0e70c1b..26a5f64dc0 100644 --- a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java +++ b/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java @@ -2,6 +2,7 @@ package com.baeldung.spring.jdbc.batch.service; import com.baeldung.spring.jdbc.batch.model.Product; import com.baeldung.spring.jdbc.batch.repo.ProductRepository; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -36,7 +37,6 @@ class ProductServiceUnitTest { @Captor ArgumentCaptor> proArgumentCaptor; - @BeforeEach void setUp() { this.productRepository = mock(ProductRepository.class); @@ -45,7 +45,6 @@ class ProductServiceUnitTest { this.productService = new ProductService(this.productRepository, this.random, this.clock); } - @Test void testWhenCreateProductsThenShouldSaveAndReturnElapsedTime() { when(random.nextInt(4)) @@ -58,10 +57,8 @@ class ProductServiceUnitTest { when(clock.millis()) .thenReturn(100L,500L); - final long actualElapsedTime = productService.createProducts(2); - assertThat(actualElapsedTime) .isEqualTo(400L); From 5ea3e49db0baa019ac980476699feb01a003912f Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Tue, 26 Jul 2022 22:43:37 +0200 Subject: [PATCH 07/73] BAEL-5545: moved batch performance related classes into existing spring-jdbc module --- persistence-modules/spring-jdbc-batch/pom.xml | 60 ------------------- persistence-modules/spring-jdbc/pom.xml | 5 ++ ...SpringJdbcBatchPerformanceApplication.java | 7 ++- .../spring/jdbc/batch/config/AppConfig.java | 2 + .../spring/jdbc/batch/model/Product.java | 0 .../batch/repo/BatchProductRepository.java | 0 .../jdbc/batch/repo/ProductRepository.java | 0 .../batch/repo/SimpleProductRepository.java | 0 .../jdbc/batch/service/ProductService.java | 0 .../spring/jdbc/batch}/application.properties | 2 +- .../batch/service/ProductServiceUnitTest.java | 1 - pom.xml | 2 - 12 files changed, 13 insertions(+), 66 deletions(-) delete mode 100644 persistence-modules/spring-jdbc-batch/pom.xml rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java (88%) rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java (85%) rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java (100%) rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java (100%) rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java (100%) rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java (100%) rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java (100%) rename persistence-modules/{spring-jdbc-batch/src/main/resources => spring-jdbc/src/main/resources/com/baeldung/spring/jdbc/batch}/application.properties (96%) rename persistence-modules/{spring-jdbc-batch => spring-jdbc}/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java (99%) diff --git a/persistence-modules/spring-jdbc-batch/pom.xml b/persistence-modules/spring-jdbc-batch/pom.xml deleted file mode 100644 index 0401044be1..0000000000 --- a/persistence-modules/spring-jdbc-batch/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - 4.0.0 - - spring-jdbc-batch - 0.0.1-SNAPSHOT - spring-jdbc-batch - Demo project for Spring Boot Jdbc batch support - - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 - - - - - 11 - - - - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.postgresql - postgresql - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - - diff --git a/persistence-modules/spring-jdbc/pom.xml b/persistence-modules/spring-jdbc/pom.xml index 28a858dd43..08e43e8292 100644 --- a/persistence-modules/spring-jdbc/pom.xml +++ b/persistence-modules/spring-jdbc/pom.xml @@ -31,6 +31,11 @@ mysql-connector-java runtime + + org.postgresql + postgresql + runtime + \ No newline at end of file diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java similarity index 88% rename from persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java rename to persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java index 008bf55024..280f9cf2be 100644 --- a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java +++ b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java @@ -1,14 +1,17 @@ package com.baeldung.spring.jdbc.batch; import com.baeldung.spring.jdbc.batch.service.ProductService; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +import java.util.Collections; @SpringBootApplication +@ComponentScan(basePackages = "com.baeldung.spring.jdbc.batch") public class SpringJdbcBatchPerformanceApplication implements CommandLineRunner { @Autowired @@ -30,7 +33,7 @@ public class SpringJdbcBatchPerformanceApplication implements CommandLineRunner long regularElapsedTime = simpleProductService.createProducts(recordCount); long batchElapsedTime = batchProductService.createProducts(recordCount); - System.out.println("-".repeat(50)); + System.out.println(String.join("", Collections.nCopies(50, "-"))); System.out.format("%-20s%-5s%-10s%-5s%8sms\n", "Regular inserts", "|", recordCount, "|", regularElapsedTime); System.out.format("%-20s%-5s%-10s%-5s%8sms\n", "Batch inserts", "|", recordCount, "|", batchElapsedTime); System.out.printf("Total gain: %d %s\n", calculateGainInPercent(regularElapsedTime, batchElapsedTime), "%"); diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java similarity index 85% rename from persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java rename to persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java index b0fd111ed2..45d80f924a 100644 --- a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java +++ b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java @@ -5,11 +5,13 @@ import com.baeldung.spring.jdbc.batch.repo.SimpleProductRepository; import com.baeldung.spring.jdbc.batch.service.ProductService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.PropertySource; import java.time.Clock; import java.util.Random; @Configuration +@PropertySource("classpath:com/baeldung/spring/jdbc/batch/application.properties") public class AppConfig { @Bean diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java similarity index 100% rename from persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java rename to persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/model/Product.java diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java similarity index 100% rename from persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java rename to persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java similarity index 100% rename from persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java rename to persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/ProductRepository.java diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java similarity index 100% rename from persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java rename to persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java diff --git a/persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java similarity index 100% rename from persistence-modules/spring-jdbc-batch/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java rename to persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java diff --git a/persistence-modules/spring-jdbc-batch/src/main/resources/application.properties b/persistence-modules/spring-jdbc/src/main/resources/com/baeldung/spring/jdbc/batch/application.properties similarity index 96% rename from persistence-modules/spring-jdbc-batch/src/main/resources/application.properties rename to persistence-modules/spring-jdbc/src/main/resources/com/baeldung/spring/jdbc/batch/application.properties index 3f9b093013..9898ae022b 100644 --- a/persistence-modules/spring-jdbc-batch/src/main/resources/application.properties +++ b/persistence-modules/spring-jdbc/src/main/resources/com/baeldung/spring/jdbc/batch/application.properties @@ -2,4 +2,4 @@ spring.datasource.url=jdbc:postgresql://localhost:5432/sample-baeldung-db spring.datasource.username=postgres spring.datasource.password=root spring.datasource.driver-class-name=org.postgresql.Driver -spring.datasource.hikari.data-source-properties.reWriteBatchedInserts=true +spring.datasource.hikari.data-source-properties.reWriteBatchedInserts=true \ No newline at end of file diff --git a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java b/persistence-modules/spring-jdbc/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java similarity index 99% rename from persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java rename to persistence-modules/spring-jdbc/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java index 26a5f64dc0..f19c2360f4 100644 --- a/persistence-modules/spring-jdbc-batch/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java +++ b/persistence-modules/spring-jdbc/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java @@ -2,7 +2,6 @@ package com.baeldung.spring.jdbc.batch.service; import com.baeldung.spring.jdbc.batch.model.Product; import com.baeldung.spring.jdbc.batch.repo.ProductRepository; - import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/pom.xml b/pom.xml index 23cc338d8b..24aa678523 100644 --- a/pom.xml +++ b/pom.xml @@ -1260,7 +1260,6 @@ testing-modules/testing-assertions persistence-modules/fauna lightrun - persistence-modules/spring-jdbc-batch @@ -1328,7 +1327,6 @@ spring-boot-modules/spring-boot-camel testing-modules/testing-assertions persistence-modules/fauna - persistence-modules/spring-jdbc-batch lightrun From 95211496d23547f781f267c3dced4f80ccc740c4 Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Sat, 30 Jul 2022 14:27:43 +0200 Subject: [PATCH 08/73] BAEL-5545: fixed import organization --- .../spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java | 1 + .../java/com/baeldung/spring/jdbc/batch/config/AppConfig.java | 1 + .../baeldung/spring/jdbc/batch/repo/BatchProductRepository.java | 1 + .../baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java | 1 + .../com/baeldung/spring/jdbc/batch/service/ProductService.java | 1 + 5 files changed, 5 insertions(+) diff --git a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java index 280f9cf2be..d523717118 100644 --- a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java +++ b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/SpringJdbcBatchPerformanceApplication.java @@ -1,6 +1,7 @@ package com.baeldung.spring.jdbc.batch; import com.baeldung.spring.jdbc.batch.service.ProductService; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.CommandLineRunner; diff --git a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java index 45d80f924a..1dd7c63adc 100644 --- a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java +++ b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/config/AppConfig.java @@ -3,6 +3,7 @@ package com.baeldung.spring.jdbc.batch.config; import com.baeldung.spring.jdbc.batch.repo.BatchProductRepository; import com.baeldung.spring.jdbc.batch.repo.SimpleProductRepository; import com.baeldung.spring.jdbc.batch.service.ProductService; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; diff --git a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java index d4a4affd0a..9b4f0208ab 100644 --- a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java +++ b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/BatchProductRepository.java @@ -1,6 +1,7 @@ package com.baeldung.spring.jdbc.batch.repo; import com.baeldung.spring.jdbc.batch.model.Product; + import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java index 3dfb998cba..4a381dd8b9 100644 --- a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java +++ b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/repo/SimpleProductRepository.java @@ -1,6 +1,7 @@ package com.baeldung.spring.jdbc.batch.repo; import com.baeldung.spring.jdbc.batch.model.Product; + import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; diff --git a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java index 6d8808c21b..436764ffcf 100644 --- a/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java +++ b/persistence-modules/spring-jdbc/src/main/java/com/baeldung/spring/jdbc/batch/service/ProductService.java @@ -2,6 +2,7 @@ package com.baeldung.spring.jdbc.batch.service; import com.baeldung.spring.jdbc.batch.model.Product; import com.baeldung.spring.jdbc.batch.repo.ProductRepository; + import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; From e4c941c0dd98e9ca677a4097f9594caf0052f775 Mon Sep 17 00:00:00 2001 From: Elmar Mammadov Date: Sat, 30 Jul 2022 14:30:07 +0200 Subject: [PATCH 09/73] BAEL-5545: fixed import organization --- .../spring/jdbc/batch/service/ProductServiceUnitTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-jdbc/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java b/persistence-modules/spring-jdbc/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java index f19c2360f4..26a5f64dc0 100644 --- a/persistence-modules/spring-jdbc/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java +++ b/persistence-modules/spring-jdbc/src/test/java/com/baeldung/spring/jdbc/batch/service/ProductServiceUnitTest.java @@ -2,6 +2,7 @@ package com.baeldung.spring.jdbc.batch.service; import com.baeldung.spring.jdbc.batch.model.Product; import com.baeldung.spring.jdbc.batch.repo.ProductRepository; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; From 536866c40b237f69aedfa3fecbe2d04fb5a3c652 Mon Sep 17 00:00:00 2001 From: emanueltrandafir1993 Date: Sat, 13 Aug 2022 18:44:03 +0200 Subject: [PATCH 10/73] BAEL-5674: added code examples for the article --- core-java-modules/core-java-streams-4/pom.xml | 6 + ...VsComplexConditionFilterOrderUnitTest.java | 89 ++++++++++++ ...itionFilterPerformanceIntegrationTest.java | 130 ++++++++++++++++++ ...VsComplexConditionReadabilityUnitTest.java | 65 +++++++++ .../streams/multiplefilters/Student.java | 60 ++++++++ 5 files changed, 350 insertions(+) create mode 100644 core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterOrderUnitTest.java create mode 100644 core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterPerformanceIntegrationTest.java create mode 100644 core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionReadabilityUnitTest.java create mode 100644 core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/Student.java diff --git a/core-java-modules/core-java-streams-4/pom.xml b/core-java-modules/core-java-streams-4/pom.xml index 65de1d666c..ed4603796d 100644 --- a/core-java-modules/core-java-streams-4/pom.xml +++ b/core-java-modules/core-java-streams-4/pom.xml @@ -53,6 +53,12 @@ jmh-generator-annprocess ${jmh-generator.version} + + org.apache.commons + commons-lang3 + 3.12.0 + test + diff --git a/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterOrderUnitTest.java b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterOrderUnitTest.java new file mode 100644 index 0000000000..fcecc36631 --- /dev/null +++ b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterOrderUnitTest.java @@ -0,0 +1,89 @@ +package com.baeldung.streams.multiplefilters; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.IntStream; + +import org.junit.Before; +import org.junit.Test; + +public class MultipleFiltersVsComplexConditionFilterOrderUnitTest { + + AtomicInteger numberOfOperations = new AtomicInteger(); + + @Before + public void beforeEach() { + numberOfOperations.set(0); + } + + @Test + public void givenWrongFilterOrder_whenUsingMultipleFilters_shouldEvaluateManyConditions() { + long filteredStreamSize = IntStream.range(0, 100) + .boxed() + .filter(this::isEvenNumber) + .filter(this::isSmallerThanTwenty) + .count(); + + assertThat(filteredStreamSize).isEqualTo(10); + assertThat(numberOfOperations).hasValue(150); + } + + @Test + public void givenWrongFilterOrder_whenUsingSingleFilters_shouldEvaluateManyConditions() { + long filteredStreamSize = IntStream.range(0, 100) + .boxed() + .filter(i -> isEvenNumber(i) && isSmallerThanTwenty(i)) + .count(); + + assertThat(filteredStreamSize).isEqualTo(10); + assertThat(numberOfOperations).hasValue(150); + } + + @Test + public void givenCorrectFilterOrder_whenUsingMultipleFilters_shouldEvaluateFewerConditions() { + long filteredStreamSize = IntStream.range(0, 100) + .boxed() + .filter(this::isSmallerThanTwenty) + .filter(this::isEvenNumber) + .count(); + + assertThat(filteredStreamSize).isEqualTo(10); + assertThat(numberOfOperations).hasValue(120); + } + + @Test + public void givenCorrectFilterOrder_whenUsingHavingASlowCondition_shouldEvaluateFewerConditions() { + long filteredStreamSize = IntStream.range(0, 100) + .boxed() + .filter(this::isSmallerThanTwenty) + .filter(this::isEvenNumber) + .filter(this::verySlowFilter) + .count(); + + assertThat(filteredStreamSize).isEqualTo(10); + assertThat(numberOfOperations).hasValue(130); + } + + private boolean isEvenNumber(int i) { + numberOfOperations.incrementAndGet(); + return i % 2 == 0; + } + + private boolean isSmallerThanTwenty(int i) { + numberOfOperations.incrementAndGet(); + return i < 20; + } + + private boolean verySlowFilter(int i) { + numberOfOperations.incrementAndGet(); + // commented the Thread.sleep() not to slow down the pipeline. + // try { + // Thread.sleep(1000); + // } catch (InterruptedException e) { + // throw new RuntimeException(e); + // } + return true; + } + +} \ No newline at end of file diff --git a/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterPerformanceIntegrationTest.java b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterPerformanceIntegrationTest.java new file mode 100644 index 0000000000..1362431b07 --- /dev/null +++ b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionFilterPerformanceIntegrationTest.java @@ -0,0 +1,130 @@ +package com.baeldung.streams.multiplefilters; + +import java.text.MessageFormat; +import java.util.function.Function; +import java.util.stream.IntStream; + +import org.apache.commons.lang3.time.StopWatch; +import org.junit.Test; + +public class MultipleFiltersVsComplexConditionFilterPerformanceIntegrationTest { + +// this test is slow, avoid running it on pipeline + @Test + public void measureProcessingTimeForEachSolution() { + + averageMultipleMeasurements("Stream with Multiple Filters", this::measureTimeForMultipleFilters, 10_000); + averageMultipleMeasurements("Stream with Multiple Filters", this::measureTimeForMultipleFilters, 100_000); + averageMultipleMeasurements("Stream with Multiple Filters", this::measureTimeForMultipleFilters, 10_00_000); + averageMultipleMeasurements("Stream with Multiple Filters", this::measureTimeForMultipleFilters, 1_0000_000); + + averageMultipleMeasurements("Stream with Complex Condition", this::measureTimeForComplexCondition, 10_000); + averageMultipleMeasurements("Stream with Complex Condition", this::measureTimeForComplexCondition, 100_000); + averageMultipleMeasurements("Stream with Complex Condition", this::measureTimeForComplexCondition, 10_00_000); + averageMultipleMeasurements("Stream with Complex Condition", this::measureTimeForComplexCondition, 1_0000_000); + + averageMultipleMeasurements("Parallel Stream with Multiple Filters", this::measureTimeForParallelStreamWithMultipleFilters, 10_000); + averageMultipleMeasurements("Parallel Stream with Multiple Filters", this::measureTimeForParallelStreamWithMultipleFilters, 100_000); + averageMultipleMeasurements("Parallel Stream with Multiple Filters", this::measureTimeForParallelStreamWithMultipleFilters, 10_00_000); + averageMultipleMeasurements("Parallel Stream with Multiple Filters", this::measureTimeForParallelStreamWithMultipleFilters, 1_0000_000); + + averageMultipleMeasurements("Parallel Stream with Complex Condition", this::measureTimeForParallelStreamWithComplexCondition, 10_000); + averageMultipleMeasurements("Parallel Stream with Complex Condition", this::measureTimeForParallelStreamWithComplexCondition, 100_000); + averageMultipleMeasurements("Parallel Stream with Complex Condition", this::measureTimeForParallelStreamWithComplexCondition, 10_00_000); + averageMultipleMeasurements("Parallel Stream with Complex Condition", this::measureTimeForParallelStreamWithComplexCondition, 1_0000_000); + + averageMultipleMeasurements("Old For Loop with Complex Condition", this::measureTimeForOlfForLoopWithComplexCondition, 10_000); + averageMultipleMeasurements("Old For Loop with Complex Condition", this::measureTimeForOlfForLoopWithComplexCondition, 100_000); + averageMultipleMeasurements("Old For Loop with Complex Condition", this::measureTimeForOlfForLoopWithComplexCondition, 10_00_000); + averageMultipleMeasurements("Old For Loop with Complex Condition", this::measureTimeForOlfForLoopWithComplexCondition, 1_0000_000); + + } + + private void averageMultipleMeasurements(String measurementName, Function measurement, int range) { + double avgTime = IntStream.range(0, 100) + .mapToLong(i -> measurement.apply(range)) + .average() + .orElseThrow(); + + System.out.println(MessageFormat.format("{0}; Stream size: {1}; Processing Time (ms): {2}", measurementName, range, avgTime)); + } + + public long measureTimeForMultipleFilters(int range) { + StopWatch watch = new StopWatch(); + watch.start(); + + IntStream.range(0, range) + .boxed() + .filter(i -> i != 10) + .filter(i -> i != 20) + .filter(i -> i != 30) + .filter(i -> i != 40) + .filter(i -> i != 50) + .filter(i -> i != 60) + .count(); + + watch.stop(); + return watch.getTime(); + } + + public long measureTimeForParallelStreamWithMultipleFilters(int range) { + StopWatch watch = new StopWatch(); + watch.start(); + + IntStream.range(0, range) + .boxed() + .parallel() + .filter(i -> i != 10) + .filter(i -> i != 20) + .filter(i -> i != 30) + .filter(i -> i != 40) + .filter(i -> i != 50) + .filter(i -> i != 60) + .count(); + + watch.stop(); + return watch.getTime(); + } + + public long measureTimeForComplexCondition(int range) { + StopWatch watch = new StopWatch(); + watch.start(); + + IntStream.range(0, range) + .boxed() + .filter(i -> i != 10 && i != 20 && i != 30 && i != 40 && i != 50 && i != 60) + .count(); + + watch.stop(); + return watch.getTime(); + } + + public long measureTimeForParallelStreamWithComplexCondition(int range) { + StopWatch watch = new StopWatch(); + watch.start(); + + IntStream.range(0, range) + .boxed() + .parallel() + .filter(i -> i != 10 && i != 20 && i != 30 && i != 40 && i != 50 && i != 60) + .count(); + + watch.stop(); + return watch.getTime(); + } + + public long measureTimeForOlfForLoopWithComplexCondition(int range) { + StopWatch watch = new StopWatch(); + watch.start(); + + int count = 0; + for (int i = 0; i <= range; i++) { + if (i != 10 && i != 20 && i != 30 && i != 40 && i != 50 && i != 60) { + count++; + } + } + + watch.stop(); + return watch.getTime(); + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionReadabilityUnitTest.java b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionReadabilityUnitTest.java new file mode 100644 index 0000000000..80fdb8a30a --- /dev/null +++ b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/MultipleFiltersVsComplexConditionReadabilityUnitTest.java @@ -0,0 +1,65 @@ +package com.baeldung.streams.multiplefilters; + +import static java.util.function.Predicate.not; +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.Before; +import org.junit.Test; + +public class MultipleFiltersVsComplexConditionReadabilityUnitTest { + + private List students; + private Student mathStudent; + + @Before + public void beforeEach() { + this.mathStudent = new Student(); + mathStudent.setName("John Doe"); + mathStudent.setYear(3); + mathStudent.setProfile(Student.Profile.MATH); + mathStudent.setMarks(List.of(80, 90, 77, 95, 100)); + + Student csStudent = new Student(); + csStudent.setName("Paul Atreides"); + csStudent.setYear(2); + csStudent.setProfile(Student.Profile.COMPUTER_SCIENCE); + csStudent.setMarks(List.of(30, 40, 60)); + + this.students = List.of(mathStudent, csStudent); + } + + @Test + public void whenUsingMultipleFilters_dataShouldBeFiltered() { + List filteredStream = students.stream() + .filter(s -> s.getMarksAverage() > 50) + .filter(s -> s.getMarks().size() > 3) + .filter(not(s -> s.getProfile() == Student.Profile.PHYSICS)) + .collect(Collectors.toList()); + + assertThat(filteredStream).containsExactly(mathStudent); + } + + @Test + public void whenUsingSingleComplexFilter_dataShouldBeFiltered() { + List filteredStream = students.stream() + .filter(s -> s.getMarksAverage() > 50 + && s.getMarks().size() > 3 + && s.getProfile() != Student.Profile.PHYSICS) + .collect(Collectors.toList()); + + assertThat(filteredStream).containsExactly(mathStudent); + } + + @Test + public void whenUsingSingleComplexFilterExtracted_dataShouldBeFiltered() { + List filteredStream = students.stream() + .filter(Student::isEligibleForScholarship) + .collect(Collectors.toList()); + + assertThat(filteredStream).containsExactly(mathStudent); + } + +} \ No newline at end of file diff --git a/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/Student.java b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/Student.java new file mode 100644 index 0000000000..0e6b77ae2c --- /dev/null +++ b/core-java-modules/core-java-streams-4/src/test/java/com/baeldung/streams/multiplefilters/Student.java @@ -0,0 +1,60 @@ +package com.baeldung.streams.multiplefilters; + +import java.util.List; +import java.util.stream.Collectors; + +public class Student { + + private String name; + private int year; + private List marks; + private Profile profile; + + public enum Profile { + COMPUTER_SCIENCE, + MATH, + PHYSICS + } + + public double getMarksAverage() { + return marks.stream().collect(Collectors.averagingInt(m -> m)); + } + + public boolean isEligibleForScholarship() { + return getMarksAverage() > 50 + && marks.size() > 3 + && profile != Profile.PHYSICS; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public List getMarks() { + return marks; + } + + public void setMarks(List marks) { + this.marks = marks; + } + + public Profile getProfile() { + return profile; + } + + public void setProfile(Profile profile) { + this.profile = profile; + } +} \ No newline at end of file From 90ccda2db3635f76313d7475f97482b7952ff878 Mon Sep 17 00:00:00 2001 From: "thibault.faure" Date: Mon, 15 Aug 2022 00:39:21 +0200 Subject: [PATCH 11/73] BAEL-5582 add code for the kafka message filtering improvement --- .../com/baeldung/spring/kafka/Farewell.java | 37 +++++++++++++++ .../kafka/KafkaApplicationMultiListener.java | 46 +++++++++++++++++++ .../spring/kafka/KafkaConsumerConfig.java | 35 ++++++++++++++ .../spring/kafka/KafkaProducerConfig.java | 21 +++++++-- .../spring/kafka/KafkaTopicConfig.java | 8 ++++ .../spring/kafka/MultiTypeKafkaListener.java | 26 +++++++++++ .../src/main/resources/application.properties | 4 +- 7 files changed, 172 insertions(+), 5 deletions(-) create mode 100644 spring-kafka/src/main/java/com/baeldung/spring/kafka/Farewell.java create mode 100644 spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaApplicationMultiListener.java create mode 100644 spring-kafka/src/main/java/com/baeldung/spring/kafka/MultiTypeKafkaListener.java diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/Farewell.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/Farewell.java new file mode 100644 index 0000000000..77b21e9ef8 --- /dev/null +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/Farewell.java @@ -0,0 +1,37 @@ +package com.baeldung.spring.kafka; + +public class Farewell { + + private String message; + private Integer remainingMinutes; + + public Farewell() { + } + + public Farewell(String message, Integer remainingMinutes) { + this.message = message; + this.remainingMinutes = remainingMinutes; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Integer getRemainingMinutes() { + return remainingMinutes; + } + + public void setRemainingMinutes(Integer remainingMinutes) { + this.remainingMinutes = remainingMinutes; + } + + @Override + public String toString() { + return message + ". In " + remainingMinutes + "!"; + } + +} diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaApplicationMultiListener.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaApplicationMultiListener.java new file mode 100644 index 0000000000..fa81488085 --- /dev/null +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaApplicationMultiListener.java @@ -0,0 +1,46 @@ +package com.baeldung.spring.kafka; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.kafka.core.KafkaTemplate; + +@SpringBootApplication +public class KafkaApplicationMultiListener { + + public static void main(String[] args) throws Exception { + + ConfigurableApplicationContext context = SpringApplication.run(KafkaApplicationMultiListener.class, args); + + MessageProducer producer = context.getBean(MessageProducer.class); + producer.sendMessages(); + + Thread.sleep(5000); + context.close(); + } + + @Bean + public MessageProducer MessageProducer() { + return new MessageProducer(); + } + + public static class MessageProducer { + + @Autowired + private KafkaTemplate multiTypeKafkaTemplate; + + @Value(value = "${multi.type.topic.name}") + private String multiTypeTopicName; + + public void sendMessages() { + multiTypeKafkaTemplate.send(multiTypeTopicName, new Greeting("Greetings", "World!")); + multiTypeKafkaTemplate.send(multiTypeTopicName, new Farewell("Farewell", 25)); + multiTypeKafkaTemplate.send(multiTypeTopicName, "Simple string message"); + } + + } + +} diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java index 9495fcf508..5873bf86ce 100644 --- a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaConsumerConfig.java @@ -12,6 +12,10 @@ import org.springframework.kafka.annotation.EnableKafka; import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory; import org.springframework.kafka.core.ConsumerFactory; import org.springframework.kafka.core.DefaultKafkaConsumerFactory; +import org.springframework.kafka.support.converter.RecordMessageConverter; +import org.springframework.kafka.support.converter.StringJsonMessageConverter; +import org.springframework.kafka.support.mapping.DefaultJackson2JavaTypeMapper; +import org.springframework.kafka.support.mapping.Jackson2JavaTypeMapper; import org.springframework.kafka.support.serializer.JsonDeserializer; @EnableKafka @@ -85,4 +89,35 @@ public class KafkaConsumerConfig { return factory; } + @Bean + public RecordMessageConverter multiTypeConverter() { + StringJsonMessageConverter converter = new StringJsonMessageConverter(); + DefaultJackson2JavaTypeMapper typeMapper = new DefaultJackson2JavaTypeMapper(); + typeMapper.setTypePrecedence(Jackson2JavaTypeMapper.TypePrecedence.TYPE_ID); + typeMapper.addTrustedPackages("com.baeldung.spring.kafka"); + Map> mappings = new HashMap<>(); + mappings.put("greeting", Greeting.class); + mappings.put("farewell", Farewell.class); + typeMapper.setIdClassMapping(mappings); + converter.setTypeMapper(typeMapper); + return converter; + } + + @Bean + public ConsumerFactory multiTypeConsumerFactory() { + HashMap props = new HashMap<>(); + props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress); + props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); + props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, JsonDeserializer.class); + return new DefaultKafkaConsumerFactory<>(props); + } + + @Bean + public ConcurrentKafkaListenerContainerFactory multiTypeKafkaListenerContainerFactory() { + ConcurrentKafkaListenerContainerFactory factory = new ConcurrentKafkaListenerContainerFactory<>(); + factory.setConsumerFactory(multiTypeConsumerFactory()); + factory.setMessageConverter(multiTypeConverter()); + return factory; + } + } diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java index 9dff81a09d..0612ade45d 100644 --- a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaProducerConfig.java @@ -1,5 +1,8 @@ package com.baeldung.spring.kafka; +import java.util.HashMap; +import java.util.Map; + import org.apache.kafka.clients.producer.ProducerConfig; import org.apache.kafka.common.serialization.StringSerializer; import org.springframework.beans.factory.annotation.Value; @@ -10,9 +13,6 @@ import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.core.ProducerFactory; import org.springframework.kafka.support.serializer.JsonSerializer; -import java.util.HashMap; -import java.util.Map; - @Configuration public class KafkaProducerConfig { @@ -49,4 +49,19 @@ public class KafkaProducerConfig { return new KafkaTemplate<>(greetingProducerFactory()); } + @Bean + public ProducerFactory multiTypeProducerFactory() { + Map configProps = new HashMap<>(); + configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress); + configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); + configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class); + configProps.put(JsonSerializer.TYPE_MAPPINGS, "greeting:com.baeldung.spring.kafka.Greeting, farewell:com.baeldung.spring.kafka.Farewell"); + return new DefaultKafkaProducerFactory<>(configProps); + } + + @Bean + public KafkaTemplate multiTypeKafkaTemplate() { + return new KafkaTemplate<>(multiTypeProducerFactory()); + } + } diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java index 8a006a72bc..9f14b5972d 100644 --- a/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaTopicConfig.java @@ -31,6 +31,9 @@ public class KafkaTopicConfig { @Value(value = "${greeting.topic.name}") private String greetingTopicName; + @Value(value = "${multi.type.topic.name}") + private String multiTypeTopicName; + @Bean public KafkaAdmin kafkaAdmin() { Map configs = new HashMap<>(); @@ -66,4 +69,9 @@ public class KafkaTopicConfig { newTopic.configs(configs); return newTopic; } + + @Bean + public NewTopic multiTypeTopic() { + return new NewTopic(multiTypeTopicName, 1, (short) 1); + } } diff --git a/spring-kafka/src/main/java/com/baeldung/spring/kafka/MultiTypeKafkaListener.java b/spring-kafka/src/main/java/com/baeldung/spring/kafka/MultiTypeKafkaListener.java new file mode 100644 index 0000000000..9afb5ff0b6 --- /dev/null +++ b/spring-kafka/src/main/java/com/baeldung/spring/kafka/MultiTypeKafkaListener.java @@ -0,0 +1,26 @@ +package com.baeldung.spring.kafka; + +import org.springframework.kafka.annotation.KafkaHandler; +import org.springframework.kafka.annotation.KafkaListener; +import org.springframework.stereotype.Component; + +@Component +@KafkaListener(id = "multiGroup", topics = "multitype") +public class MultiTypeKafkaListener { + + @KafkaHandler + public void handleGreeting(Greeting greeting) { + System.out.println("Greeting received: " + greeting); + } + + @KafkaHandler + public void handleF(Farewell farewell) { + System.out.println("Farewell received: " + farewell); + } + + @KafkaHandler(isDefault = true) + public void unknown(Object object) { + System.out.println("Unkown type received: " + object); + } + +} diff --git a/spring-kafka/src/main/resources/application.properties b/spring-kafka/src/main/resources/application.properties index 9a614cbafd..b1dc1ceaf5 100644 --- a/spring-kafka/src/main/resources/application.properties +++ b/spring-kafka/src/main/resources/application.properties @@ -4,14 +4,14 @@ long.message.topic.name=longMessage greeting.topic.name=greeting filtered.topic.name=filtered partitioned.topic.name=partitioned - +multi.type.topic.name=multitype # monitoring - lag analysis monitor.kafka.bootstrap.config=localhost:9092 monitor.kafka.consumer.groupid=baeldungGrp monitor.topic.name=baeldung - # monitoring - simulation monitor.producer.simulate=true monitor.consumer.simulate=true monitor.kafka.consumer.groupid.simulate=baeldungGrpSimulate test.topic=testtopic1 + From 38546b77ae5a570d0fc871799876ba422261c1b3 Mon Sep 17 00:00:00 2001 From: Chrys Exaucet Date: Tue, 16 Aug 2022 04:01:44 +0000 Subject: [PATCH 12/73] BAEL-5540: Sending Soap Request via Postman (#12581) * fix(build): remove jaxb2-maven-plugin plugin XCJ fails due to unresolved/conflicting dependencies. The project runs fine without jaxb2-maven-plugin plugin, given maven-jaxb2-plugin is already there. * fix(build): correct gen files imports maven-jaxb2-plugin generates in com.baeldung.springsoap.client.gen, not com.baeldung.springsoap.gen * chore: add postman collection * revert: set back jaxb2-maven-plugin Didn't run project with Java 1.8, that's why I was facing build errors reverts https://github.com/eugenp/tutorials/pull/12581/commits/cb3aed358c94b1e78d6cfdbdf8668b63f6fa1a14 & https://github.com/eugenp/tutorials/pull/12581/commits/56f2b1fd93f02912ab184e929e00ef5f8df04737 --- ...untriesPortService.postman_collection.json | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 spring-soap/src/main/resources/CountriesPortService.postman_collection.json diff --git a/spring-soap/src/main/resources/CountriesPortService.postman_collection.json b/spring-soap/src/main/resources/CountriesPortService.postman_collection.json new file mode 100644 index 0000000000..867186cf79 --- /dev/null +++ b/spring-soap/src/main/resources/CountriesPortService.postman_collection.json @@ -0,0 +1,93 @@ +{ + "info": { + "_postman_id": "46f8f766-3850-44bd-8f6f-58a6da4488de", + "name": "CountriesPortService", + "description": "\n", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "13842218" + }, + "item": [ + { + "name": "getCountry", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "text/xml; charset=utf-8" + } + ], + "body": { + "mode": "raw", + "raw": "\n\n \n \n Spain\n \n \n", + "options": { + "raw": { + "language": "xml" + } + } + }, + "url": { + "raw": "{{CountriesPortSoap11BaseUrl}}/ws", + "host": [ + "{{CountriesPortSoap11BaseUrl}}" + ], + "path": [ + "ws" + ] + } + }, + "response": [ + { + "name": "getCountry response", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "text/xml; charset=utf-8" + } + ], + "body": { + "mode": "raw", + "raw": "\n\n \n The element or type could not be found undefined\n \n\n", + "options": { + "raw": { + "language": "xml" + } + } + }, + "url": { + "raw": "http://localhost:8080/ws", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "ws" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "xml", + "header": [ + { + "key": "Content-Type", + "value": "text/xml; charset=utf-8" + } + ], + "cookie": [], + "body": "\n\n \n The element or type could not be found undefined\n \n\n" + } + ] + } + ], + "variable": [ + { + "key": "CountriesPortSoap11BaseUrl", + "value": "http://localhost:8080", + "type": "any" + } + ] +} \ No newline at end of file From e96af43f40fe2df0e2bfb4da89616b9961789454 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Tue, 16 Aug 2022 22:14:49 +0530 Subject: [PATCH 13/73] JAVA-12628 Rename CountdownLatchResetExampleUnitTest (#12602) --- ...eUnitTest.java => CountdownLatchResetExampleManualTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/{CountdownLatchResetExampleUnitTest.java => CountdownLatchResetExampleManualTest.java} (86%) diff --git a/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleManualTest.java similarity index 86% rename from core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java rename to core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleManualTest.java index d2d43f6312..45c5a93d02 100644 --- a/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleUnitTest.java +++ b/core-java-modules/core-java-concurrency-advanced-2/src/test/java/com/baeldung/concurrent/countdownlatch/CountdownLatchResetExampleManualTest.java @@ -4,7 +4,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; -public class CountdownLatchResetExampleUnitTest { +public class CountdownLatchResetExampleManualTest { @Test public void whenCountDownLatch_noReset() { From 2122565082982593ae1b86909162db6ca7ec6889 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Tue, 16 Aug 2022 22:16:34 +0530 Subject: [PATCH 14/73] JAVA-13734 Update article Introduction to JSON Schema in Java (#12565) * JAVA-13734 Update article Introduction to JSON Schema in Java * JAVA-13734 Corrected the code formatting --- json-modules/json/pom.xml | 18 +++----- .../json/schema/JSONSchemaUnitTest.java | 44 ++++++++++++------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/json-modules/json/pom.xml b/json-modules/json/pom.xml index 04a00598a3..8a9f4f2c45 100644 --- a/json-modules/json/pom.xml +++ b/json-modules/json/pom.xml @@ -15,17 +15,11 @@ - - org.everit.json - org.everit.json.schema - ${everit.json.schema.version} - - - commons-logging - commons-logging - - - + + com.networknt + json-schema-validator + ${networknt.json.schema.version} + org.json json @@ -72,7 +66,7 @@ - 1.4.1 + 1.0.72 1.0 1.0.1 20211205 diff --git a/json-modules/json/src/test/java/com/baeldung/json/schema/JSONSchemaUnitTest.java b/json-modules/json/src/test/java/com/baeldung/json/schema/JSONSchemaUnitTest.java index 393e052b95..491c320341 100644 --- a/json-modules/json/src/test/java/com/baeldung/json/schema/JSONSchemaUnitTest.java +++ b/json-modules/json/src/test/java/com/baeldung/json/schema/JSONSchemaUnitTest.java @@ -1,32 +1,44 @@ package com.baeldung.json.schema; -import org.everit.json.schema.Schema; -import org.everit.json.schema.ValidationException; -import org.everit.json.schema.loader.SchemaLoader; +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; +import java.util.Set; -import org.json.JSONObject; -import org.json.JSONTokener; import org.junit.Test; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.networknt.schema.JsonSchema; +import com.networknt.schema.JsonSchemaFactory; +import com.networknt.schema.SpecVersion; +import com.networknt.schema.ValidationMessage; + public class JSONSchemaUnitTest { - @Test(expected = ValidationException.class) - public void givenInvalidInput_whenValidating_thenInvalid() { + private ObjectMapper mapper = new ObjectMapper(); - JSONObject jsonSchema = new JSONObject(new JSONTokener(JSONSchemaUnitTest.class.getResourceAsStream("/schema.json"))); - JSONObject jsonSubject = new JSONObject(new JSONTokener(JSONSchemaUnitTest.class.getResourceAsStream("/product_invalid.json"))); + @Test + public void givenInvalidInput_whenValidating_thenInvalid() throws IOException { - Schema schema = SchemaLoader.load(jsonSchema); - schema.validate(jsonSubject); + JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4); + JsonSchema jsonSchema = factory.getSchema(JSONSchemaUnitTest.class.getResourceAsStream("/schema.json")); + + JsonNode jsonNode = mapper.readTree(JSONSchemaUnitTest.class.getResourceAsStream("/product_invalid.json")); + Set errors = jsonSchema.validate(jsonNode); + assertThat(errors).isNotEmpty() + .asString() + .contains("price: must have a minimum value of 0"); } @Test - public void givenValidInput_whenValidating_thenValid() { + public void givenValidInput_whenValidating_thenValid() throws IOException { - JSONObject jsonSchema = new JSONObject(new JSONTokener(JSONSchemaUnitTest.class.getResourceAsStream("/schema.json"))); - JSONObject jsonSubject = new JSONObject(new JSONTokener(JSONSchemaUnitTest.class.getResourceAsStream("/product_valid.json"))); + JsonSchemaFactory factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4); + JsonSchema jsonSchema = factory.getSchema(JSONSchemaUnitTest.class.getResourceAsStream("/schema.json")); - Schema schema = SchemaLoader.load(jsonSchema); - schema.validate(jsonSubject); + JsonNode jsonNode = mapper.readTree(JSONSchemaUnitTest.class.getResourceAsStream("/product_valid.json")); + Set errors = jsonSchema.validate(jsonNode); + assertThat(errors).isEmpty(); } } From 72409da6275dcc04cf4de5a6e2464076cbf5b4f4 Mon Sep 17 00:00:00 2001 From: Abhinav Pandey Date: Wed, 17 Aug 2022 09:35:59 +0530 Subject: [PATCH 15/73] BAEL-5677 - Logging to both file and console with log4j (#12550) * BAEL-5677 - Logging to both file and console with log4j * Moving from log4j to log4j2 * Correction in class name * Moving to log4j2 package --- .../consoleandfile/Log4j2ConsoleAndFile.java | 14 ++++++++++++++ .../log4j2/src/main/resources/log4j2.properties | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/consoleandfile/Log4j2ConsoleAndFile.java create mode 100644 logging-modules/log4j2/src/main/resources/log4j2.properties diff --git a/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/consoleandfile/Log4j2ConsoleAndFile.java b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/consoleandfile/Log4j2ConsoleAndFile.java new file mode 100644 index 0000000000..56119efd9e --- /dev/null +++ b/logging-modules/log4j2/src/main/java/com/baeldung/logging/log4j2/consoleandfile/Log4j2ConsoleAndFile.java @@ -0,0 +1,14 @@ +package com.baeldung.logging.log4j2.consoleandfile; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +public class Log4j2ConsoleAndFile { + + private static final Logger logger = LogManager.getLogger(Log4j2ConsoleAndFile.class); + + public static void main(String[] args) { + logger.info("Hello World!"); + logger.debug("Hello World!"); + } +} diff --git a/logging-modules/log4j2/src/main/resources/log4j2.properties b/logging-modules/log4j2/src/main/resources/log4j2.properties new file mode 100644 index 0000000000..1d31dd55b5 --- /dev/null +++ b/logging-modules/log4j2/src/main/resources/log4j2.properties @@ -0,0 +1,14 @@ +appender.console.type = Console +appender.console.name = STDOUT +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = [%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n + +appender.file.type = File +appender.file.name = LOGFILE +appender.file.fileName=logs/log4j.log +appender.file.layout.type=PatternLayout +appender.file.layout.pattern=[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n +appender.file.filter.threshold.type = ThresholdFilter +appender.file.filter.threshold.level = info + +rootLogger=debug, STDOUT, LOGFILE \ No newline at end of file From 84ae89a14cd43c6a17ba44cd91a0d97877a07401 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:18:06 +0500 Subject: [PATCH 16/73] Created README.md added link back to the article: https://www.baeldung.com/gradle-conditional-dependencies --- gradle-modules/gradle-7/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 gradle-modules/gradle-7/README.md diff --git a/gradle-modules/gradle-7/README.md b/gradle-modules/gradle-7/README.md new file mode 100644 index 0000000000..19dfc7b15c --- /dev/null +++ b/gradle-modules/gradle-7/README.md @@ -0,0 +1,4 @@ + +### Relevant Articles: + +- [How to Configure Conditional Dependencies in Gradle](https://www.baeldung.com/gradle-conditional-dependencies) From e731fdd59a2dfa80e3cfd3ff1edf1c0219a4e640 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:24:19 +0500 Subject: [PATCH 17/73] Updated README.md added link back to the article: https://www.baeldung.com/spring-data-mongodb-connection --- persistence-modules/spring-boot-persistence-mongodb-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/README.md b/persistence-modules/spring-boot-persistence-mongodb-2/README.md index 6a98f05520..d2cfb28843 100644 --- a/persistence-modules/spring-boot-persistence-mongodb-2/README.md +++ b/persistence-modules/spring-boot-persistence-mongodb-2/README.md @@ -5,4 +5,5 @@ - [MongoDB Composite Key With Spring Data](https://www.baeldung.com/spring-data-mongodb-composite-key) - [Unique Field in MongoDB Document in Spring Data](https://www.baeldung.com/spring-data-mongodb-unique) - [Count Documents Using Spring Data MongoDB Repository](https://www.baeldung.com/spring-data-mongodb-count) +- [Spring Data MongoDB – Configure Connection](https://www.baeldung.com/spring-data-mongodb-connection) - More articles: [[<--prev]](../spring-boot-persistence-mongodb) From 75d7bb2f554a99cbb2ced698ee458ca572e012a1 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:27:03 +0500 Subject: [PATCH 18/73] Updated README.md added link back to the article: https://www.baeldung.com/java-string-formatting-named-placeholders --- core-java-modules/core-java-string-operations-4/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-string-operations-4/README.md b/core-java-modules/core-java-string-operations-4/README.md index 07af6d23c9..d420edff52 100644 --- a/core-java-modules/core-java-string-operations-4/README.md +++ b/core-java-modules/core-java-string-operations-4/README.md @@ -9,3 +9,4 @@ - [Check if a Character is a Vowel in Java](https://www.baeldung.com/java-check-character-vowel) - [How to Truncate a String in Java](https://www.baeldung.com/java-truncating-strings) - [Remove Whitespace From a String in Java](https://www.baeldung.com/java-string-remove-whitespace) +- [Named Placeholders in String Formatting](https://www.baeldung.com/java-string-formatting-named-placeholders) From 589c347b1a554d1ad14ee96e18452f36f5339f91 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:29:50 +0500 Subject: [PATCH 19/73] Updated README.md added link back to the article: https://www.baeldung.com/ops/docker-mounting-multiple-volumes --- docker-modules/docker-compose/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-modules/docker-compose/README.md b/docker-modules/docker-compose/README.md index 10554a319d..abafe0d165 100644 --- a/docker-modules/docker-compose/README.md +++ b/docker-modules/docker-compose/README.md @@ -4,4 +4,5 @@ - [How to Get Docker-Compose to Always Use the Latest Image](https://www.baeldung.com/ops/docker-compose-latest-image) - [Communication Between Multiple Docker Compose Projects](https://www.baeldung.com/ops/docker-compose-communication) - [Difference Between links and depends_on in Docker Compose](https://www.baeldung.com/ops/docker-compose-links-depends-on) +- [Mounting Multiple Volumes on a Docker Container](https://www.baeldung.com/ops/docker-mounting-multiple-volumes) From 82346b90c8c61aa9cd165242dad607e9a56462b7 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:31:41 +0500 Subject: [PATCH 20/73] Updated README.md added link back to the article: https://www.baeldung.com/postman-soap-request --- spring-soap/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-soap/README.md b/spring-soap/README.md index ca5f58c67e..aac1845222 100644 --- a/spring-soap/README.md +++ b/spring-soap/README.md @@ -6,3 +6,4 @@ This module contains articles about SOAP APIs with Spring - [Creating a SOAP Web Service with Spring](https://www.baeldung.com/spring-boot-soap-web-service) - [Invoking a SOAP Web Service in Spring](https://www.baeldung.com/spring-soap-web-service) +- [Sending SOAP Request via Postman](https://www.baeldung.com/postman-soap-request) From b8dfb5701f5a7ed8b2d7979ba0e310b6f68df540 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:34:32 +0500 Subject: [PATCH 21/73] Updated README.md added link back to the article: https://www.baeldung.com/spring-openfeign-propagate-exception --- spring-cloud-modules/spring-cloud-openfeign/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-cloud-modules/spring-cloud-openfeign/README.md b/spring-cloud-modules/spring-cloud-openfeign/README.md index a369da96da..421fa0284f 100644 --- a/spring-cloud-modules/spring-cloud-openfeign/README.md +++ b/spring-cloud-modules/spring-cloud-openfeign/README.md @@ -7,3 +7,4 @@ - [Provide an OAuth2 Token to a Feign Client](https://www.baeldung.com/spring-cloud-feign-oauth-token) - [Retrieve Original Message From Feign ErrorDecoder](https://www.baeldung.com/feign-retrieve-original-message) - [RequestLine with Feign Client](https://www.baeldung.com/feign-requestline) +- [Propagating Exceptions With OpenFeign and Spring](https://www.baeldung.com/spring-openfeign-propagate-exception) From aba86e18191526a125fb3b6261fab3f898c46d16 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:37:28 +0500 Subject: [PATCH 22/73] Updated README.md added link back to the article: https://www.baeldung.com/java-streams-multiple-filters-vs-condition --- core-java-modules/core-java-streams-4/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-streams-4/README.md b/core-java-modules/core-java-streams-4/README.md index 80e4534b0f..212a42e362 100644 --- a/core-java-modules/core-java-streams-4/README.md +++ b/core-java-modules/core-java-streams-4/README.md @@ -3,3 +3,4 @@ - [Count Occurrences Using Java groupingBy Collector](https://www.baeldung.com/java-groupingby-count) - [How to Split a Stream into Multiple Streams](https://www.baeldung.com/java-split-stream) - [Filter Java Stream to 1 and Only 1 Element](https://www.baeldung.com/java-filter-stream-unique-element) +- [Java 8 Streams: Multiple Filters vs. Complex Condition](https://www.baeldung.com/java-streams-multiple-filters-vs-condition) From 4df68da1c6f961e98a9ded0502fe5e03e3ed4e7c Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:40:01 +0500 Subject: [PATCH 23/73] Updated README.md added link back to the article: https://www.baeldung.com/java-log4j2-file-and-console --- logging-modules/log4j2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/logging-modules/log4j2/README.md b/logging-modules/log4j2/README.md index f53df508bf..87e92e0d48 100644 --- a/logging-modules/log4j2/README.md +++ b/logging-modules/log4j2/README.md @@ -8,3 +8,4 @@ - [System.out.println vs Loggers](https://www.baeldung.com/java-system-out-println-vs-loggers) - [Log4j 2 Plugins](https://www.baeldung.com/log4j2-plugins) - [Printing Thread Info in Log File Using Log4j2](https://www.baeldung.com/log4j2-print-thread-info) +- [Log4j2 – Logging to Both File and Console](https://www.baeldung.com/java-log4j2-file-and-console) From 087a50b2e723d3ca2f8ce327129ad305d9519beb Mon Sep 17 00:00:00 2001 From: sdhiray7 Date: Wed, 17 Aug 2022 21:04:12 +0530 Subject: [PATCH 24/73] [BAEL-5661] Integer.toString(int i) vs String.valueOf(int i) (#12606) * Initial commit for Object copy in Java * review comments commit for Object copy in Java * Initial commit for parseInt vs valueOf java * Review comments commit for parseInt vs valueOf java * Modify readme * review comments * build failure * build failure retry * build failure retry remove parseInt(java.lang.String,int,int,int) * build failure add comment * change examples * review comments * review comments 2 * review comments 3 * Initial commit for get current stacktrace * Remove old files * Name updates * Jenkins error * changes to file name * Review comments * Create unit test file * Remove unnecessary files * Update package name --- .../java/com/baeldung/inttostring/IntToStringUnitTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/inttostring/IntToStringUnitTest.java b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/inttostring/IntToStringUnitTest.java index b865d0933d..34a4097d05 100644 --- a/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/inttostring/IntToStringUnitTest.java +++ b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/inttostring/IntToStringUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.chararraytostring; +package com.baeldung.inttostring; import static org.junit.Assert.assertEquals; @@ -23,7 +23,8 @@ public class IntToStringUnitTest { @Test(expected = NullPointerException.class) public void whenNullIntegerObjectIsPassed_thenShouldThrowException() { Integer i = null; - System.out.println(String.valueOf(i)); // it prints "null" - System.out.println(i.toString()); + // NOTE: primitive int can never be null, we are checking this example to check in what case the exception is thrown by these methods. + System.out.println(String.valueOf(i)); // prints "null" as the call goes to String.valueOf(Object obj) method + System.out.println(i.toString()); // throws NPE } } From 2d5e7da1fab3050b6998b94a7bc3bb1688248959 Mon Sep 17 00:00:00 2001 From: Eugene Kovko <37694937+eukovko@users.noreply.github.com> Date: Wed, 17 Aug 2022 22:14:47 +0200 Subject: [PATCH 25/73] BAEL-5646: String permutation improvements (#12613) --- .../{ArrayHelper.java => Helper.java} | 10 ++++-- .../StringPermutationsApache.java | 23 ++++++++---- .../StringPermutationsCombinatoricsLib.java | 20 ++++++----- .../StringPermutationsGuava.java | 20 ++++++----- .../stringpermutation/HelperUnitTest.java | 36 +++++++++++++++++++ .../StringPermutationsApacheUnitTest.java | 15 +++----- ...gPermutationsCombinatoricsLibUnitTest.java | 4 +-- .../StringPermutationsGuavaUnitTest.java | 5 ++- 8 files changed, 91 insertions(+), 42 deletions(-) rename algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/{ArrayHelper.java => Helper.java} (54%) create mode 100644 algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/HelperUnitTest.java diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/ArrayHelper.java b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/Helper.java similarity index 54% rename from algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/ArrayHelper.java rename to algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/Helper.java index 6b4f1fcb12..8d769b16af 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/ArrayHelper.java +++ b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/Helper.java @@ -1,14 +1,20 @@ package com.baeldung.algorithms.stringpermutation; +import java.util.Collection; import java.util.List; import java.util.stream.Collectors; -public class ArrayHelper { +public class Helper { - private ArrayHelper() { + private Helper() { } static List toCharacterList(final String string) { return string.chars().mapToObj(s -> ((char) s)).collect(Collectors.toList()); } + + static String toString(Collection collection) { + return collection.stream().map(Object::toString).collect(Collectors.joining()); + } + } diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApache.java b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApache.java index c2522a6ec5..97abca64cd 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApache.java +++ b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApache.java @@ -1,20 +1,29 @@ package com.baeldung.algorithms.stringpermutation; -import java.util.Collection; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.iterators.PermutationIterator; public class StringPermutationsApache { - public Collection> eagerPermutationWithRepetitions(final String string) { - final List characters = ArrayHelper.toCharacterList(string); - return CollectionUtils.permutations(characters); + public List eagerPermutationWithRepetitions(final String string) { + final List characters = Helper.toCharacterList(string); + return CollectionUtils.permutations(characters) + .stream() + .map(Helper::toString) + .collect(Collectors.toList()); } - public PermutationIterator lazyPermutationWithoutRepetitions(final String string) { - final List characters = ArrayHelper.toCharacterList(string); - return new PermutationIterator<>(characters); + public List lazyPermutationWithoutRepetitions(final String string) { + final List characters = Helper.toCharacterList(string); + final PermutationIterator permutationIterator = new PermutationIterator<>(characters); + final List result = new ArrayList<>(); + while (permutationIterator.hasNext()) { + result.add(Helper.toString(permutationIterator.next())); + } + return result; } } diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLib.java b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLib.java index 78182f8045..45e4aae1fb 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLib.java +++ b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLib.java @@ -7,19 +7,21 @@ import org.paukov.combinatorics3.PermutationGenerator.TreatDuplicatesAs; public class StringPermutationsCombinatoricsLib { - public List> permutationWithoutRepetitions(final String string) { - List chars = ArrayHelper.toCharacterList(string); - return Generator.permutation(chars) - .simple() - .stream() - .collect(Collectors.toList()); - } +public List permutationWithoutRepetitions(final String string) { + List chars = Helper.toCharacterList(string); + return Generator.permutation(chars) + .simple() + .stream() + .map(Helper::toString) + .collect(Collectors.toList()); +} - public List> permutationWithRepetitions(final String string) { - List chars = ArrayHelper.toCharacterList(string); + public List permutationWithRepetitions(final String string) { + List chars = Helper.toCharacterList(string); return Generator.permutation(chars) .simple(TreatDuplicatesAs.IDENTICAL) .stream() + .map(Helper::toString) .collect(Collectors.toList()); } diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuava.java b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuava.java index d055381bf1..07ac1a2abf 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuava.java +++ b/algorithms-modules/algorithms-miscellaneous-4/src/main/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuava.java @@ -1,18 +1,22 @@ package com.baeldung.algorithms.stringpermutation; import com.google.common.collect.Collections2; -import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; public class StringPermutationsGuava { - public Collection> permutationWithRepetitions(final String string) { - final List characters = ArrayHelper.toCharacterList(string); - return Collections2.permutations(characters); + public List permutationWithRepetitions(final String string) { + final List characters = Helper.toCharacterList(string); + return Collections2.permutations(characters).stream() + .map(Helper::toString) + .collect(Collectors.toList()); + } + public List permutationWithoutRepetitions(final String string) { + final List characters = Helper.toCharacterList(string); + return Collections2.orderedPermutations(characters).stream() + .map(Helper::toString) + .collect(Collectors.toList()); } -public Collection> permutationWithoutRepetitions(final String string) { - final List characters = ArrayHelper.toCharacterList(string); - return Collections2.orderedPermutations(characters); -} } diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/HelperUnitTest.java b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/HelperUnitTest.java new file mode 100644 index 0000000000..450713fac4 --- /dev/null +++ b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/HelperUnitTest.java @@ -0,0 +1,36 @@ +package com.baeldung.algorithms.stringpermutation; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class HelperUnitTest { + + @ParameterizedTest + @MethodSource("stringProvider") + void toListTest(String value, List expected) { + final List actual = Helper.toCharacterList(value); + assertThat(expected).isEqualTo(actual); + } + + @ParameterizedTest + @MethodSource("stringProvider") + void toStringTest(String expected, List value) { + final String actual = Helper.toString(value); + assertThat(expected).isEqualTo(actual); + } + + static Stream stringProvider() { + return Stream.of( + Arguments.of("hello", Arrays.asList('h', 'e', 'l', 'l', 'o')), + Arguments.of("abc", Arrays.asList('a','b','c')), + Arguments.of("12345", Arrays.asList('1', '2', '3', '4', '5')) + ); + } + +} \ No newline at end of file diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApacheUnitTest.java b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApacheUnitTest.java index d0deb85887..9686287721 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApacheUnitTest.java +++ b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsApacheUnitTest.java @@ -2,22 +2,19 @@ package com.baeldung.algorithms.stringpermutation; import static org.assertj.core.api.Assertions.assertThat; -import java.util.Collection; import java.util.List; -import org.apache.commons.collections4.iterators.PermutationIterator; -import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; class StringPermutationsApacheUnitTest { + @ParameterizedTest @CsvSource({"abc, 6", "hello, 120", "aaaaaa, 720"}) - @DisplayName("Apache permutation for ") void testPermutationsWithRepetitions(String string, int numberOfPermutations) { StringPermutationsApache permutationGenerator = new StringPermutationsApache(); - final Collection> permutations = permutationGenerator.eagerPermutationWithRepetitions(string); + final List permutations = permutationGenerator.eagerPermutationWithRepetitions(string); final int size = permutations.size(); assertThat(permutations) .as("\"%s\" should have %d permutation, but had %d", string, numberOfPermutations, size) @@ -30,12 +27,8 @@ class StringPermutationsApacheUnitTest { "aaaaaa, 720"}) void testPermutationsWithoutRepetitions(String string, int numberOfPermutations) { StringPermutationsApache permutationGenerator = new StringPermutationsApache(); - final PermutationIterator permutations = permutationGenerator.lazyPermutationWithoutRepetitions(string); - int size = 0; - while (permutations.hasNext()) { - permutations.next(); - ++size; - } + final List permutations = permutationGenerator.lazyPermutationWithoutRepetitions(string); + int size = permutations.size(); assertThat(size) .as("\"%s\" should have %d permutation, but had %d", string, numberOfPermutations, size) .isEqualTo(numberOfPermutations); diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLibUnitTest.java b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLibUnitTest.java index faca3d8f30..8911ef559c 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLibUnitTest.java +++ b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsCombinatoricsLibUnitTest.java @@ -14,7 +14,7 @@ class StringPermutationsCombinatoricsLibUnitTest { "aaaaaa, 720"}) void testPermutationsWithRepetitions(String string, int numberOfPermutations) { StringPermutationsCombinatoricsLib permutationGenerator = new StringPermutationsCombinatoricsLib(); - final List> permutations = permutationGenerator.permutationWithRepetitions(string); + final List permutations = permutationGenerator.permutationWithRepetitions(string); final int size = permutations.size(); assertThat(permutations) .as("\"%s\" should have %d permutation, but had %d", string, numberOfPermutations, size) @@ -27,7 +27,7 @@ class StringPermutationsCombinatoricsLibUnitTest { "aaaaaa, 1"}) void testPermutationsWithoutRepetitions(String string, int numberOfPermutations) { StringPermutationsCombinatoricsLib permutationGenerator = new StringPermutationsCombinatoricsLib(); - final List> permutations = permutationGenerator.permutationWithoutRepetitions(string); + final List permutations = permutationGenerator.permutationWithoutRepetitions(string); final int size = permutations.size(); assertThat(permutations) .as("\"%s\" should have %d permutation, but had %d", string, numberOfPermutations, size) diff --git a/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuavaUnitTest.java b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuavaUnitTest.java index d2da100997..31c3ce8d12 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuavaUnitTest.java +++ b/algorithms-modules/algorithms-miscellaneous-4/src/test/java/com/baeldung/algorithms/stringpermutation/StringPermutationsGuavaUnitTest.java @@ -2,7 +2,6 @@ package com.baeldung.algorithms.stringpermutation; import static org.assertj.core.api.Assertions.assertThat; -import java.util.Collection; import java.util.List; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -15,7 +14,7 @@ class StringPermutationsGuavaUnitTest { "aaaaaa, 720"}) void testPermutationsWithRepetitions(String string, int numberOfPermutations) { StringPermutationsGuava permutationGenerator = new StringPermutationsGuava(); - final Collection> permutations = permutationGenerator.permutationWithRepetitions(string); + final List permutations = permutationGenerator.permutationWithRepetitions(string); final int size = permutations.size(); assertThat(permutations) .as("\"%s\" should have %d permutation, but had %d", string, numberOfPermutations, size) @@ -28,7 +27,7 @@ class StringPermutationsGuavaUnitTest { "aaaaaa, 1"}) void testPermutationsWithoutRepetitions(String string, int numberOfPermutations) { StringPermutationsGuava permutationGenerator = new StringPermutationsGuava(); - final Collection> permutations = permutationGenerator.permutationWithoutRepetitions(string); + final List permutations = permutationGenerator.permutationWithoutRepetitions(string); final int size = permutations.size(); assertThat(permutations) .as("\"%s\" should have %d permutation, but had %d", string, numberOfPermutations, size) From 4e18fd0aa988f80e00576658ba73cd7debb9ba1d Mon Sep 17 00:00:00 2001 From: Tapan Avasthi Date: Thu, 18 Aug 2022 08:22:06 +0530 Subject: [PATCH 26/73] BAEL-5680: Guide to Check if Apache Kafka Server is Running (#12600) Co-authored-by: Tapan Avasthi --- apache-kafka-2/README.md | 6 ++ apache-kafka-2/log4j.properties | 1 + apache-kafka-2/pom.xml | 69 +++++++++++++++++++ .../com/baeldung/kafka/KafkaAdminClient.java | 35 ++++++++++ .../kafka/KafkaConnectionLiveTest.java | 39 +++++++++++ pom.xml | 2 + 6 files changed, 152 insertions(+) create mode 100644 apache-kafka-2/README.md create mode 100644 apache-kafka-2/log4j.properties create mode 100644 apache-kafka-2/pom.xml create mode 100644 apache-kafka-2/src/main/java/com/baeldung/kafka/KafkaAdminClient.java create mode 100644 apache-kafka-2/src/test/java/com/baeldung/kafka/KafkaConnectionLiveTest.java diff --git a/apache-kafka-2/README.md b/apache-kafka-2/README.md new file mode 100644 index 0000000000..f43d51c20c --- /dev/null +++ b/apache-kafka-2/README.md @@ -0,0 +1,6 @@ +## Apache Kafka + +This module contains articles about Apache Kafka. + +##### Building the project +You can build the project from the command line using: *mvn clean install*, or in an IDE. diff --git a/apache-kafka-2/log4j.properties b/apache-kafka-2/log4j.properties new file mode 100644 index 0000000000..2173c5d96f --- /dev/null +++ b/apache-kafka-2/log4j.properties @@ -0,0 +1 @@ +log4j.rootLogger=INFO, stdout diff --git a/apache-kafka-2/pom.xml b/apache-kafka-2/pom.xml new file mode 100644 index 0000000000..2d81e9110a --- /dev/null +++ b/apache-kafka-2/pom.xml @@ -0,0 +1,69 @@ + + + 4.0.0 + apache-kafka-2 + apache-kafka-2 + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + org.apache.kafka + kafka-clients + ${kafka.version} + + + org.slf4j + slf4j-api + ${org.slf4j.version} + + + org.slf4j + slf4j-log4j12 + ${org.slf4j.version} + + + com.google.guava + guava + ${guava.version} + + + org.testcontainers + kafka + ${testcontainers-kafka.version} + test + + + org.testcontainers + junit-jupiter + ${testcontainers-jupiter.version} + test + + + net.java.dev.jna + jna + 5.7.0 + test + + + org.projectlombok + lombok + ${lombok.version} + provided + + + + + 2.8.0 + 1.15.3 + 1.15.3 + 1.18.20 + + + \ No newline at end of file diff --git a/apache-kafka-2/src/main/java/com/baeldung/kafka/KafkaAdminClient.java b/apache-kafka-2/src/main/java/com/baeldung/kafka/KafkaAdminClient.java new file mode 100644 index 0000000000..e86dd74bda --- /dev/null +++ b/apache-kafka-2/src/main/java/com/baeldung/kafka/KafkaAdminClient.java @@ -0,0 +1,35 @@ +package com.baeldung.kafka; + +import java.util.Collection; +import java.util.Properties; +import java.util.concurrent.ExecutionException; + +import org.apache.kafka.clients.admin.AdminClient; +import org.apache.kafka.common.Node; + +public class KafkaAdminClient { + private final AdminClient client; + + public KafkaAdminClient(String bootstrap) { + Properties props = new Properties(); + props.put("bootstrap.servers", bootstrap); + props.put("request.timeout.ms", 3000); + props.put("connections.max.idle.ms", 5000); + + this.client = AdminClient.create(props); + } + + public boolean verifyConnection() throws ExecutionException, InterruptedException { + Collection nodes = this.client.describeCluster() + .nodes() + .get(); + return nodes != null && nodes.size() > 0; + } + + public static void main(String[] args) throws ExecutionException, InterruptedException { + String defaultBootStrapServer = "localhost:9092"; + KafkaAdminClient kafkaAdminClient = new KafkaAdminClient(defaultBootStrapServer); + System.out.println(kafkaAdminClient.verifyConnection()); + } + +} diff --git a/apache-kafka-2/src/test/java/com/baeldung/kafka/KafkaConnectionLiveTest.java b/apache-kafka-2/src/test/java/com/baeldung/kafka/KafkaConnectionLiveTest.java new file mode 100644 index 0000000000..8ce604c37f --- /dev/null +++ b/apache-kafka-2/src/test/java/com/baeldung/kafka/KafkaConnectionLiveTest.java @@ -0,0 +1,39 @@ +package com.baeldung.kafka; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.testcontainers.containers.KafkaContainer; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; +import org.testcontainers.utility.DockerImageName; + +import static org.assertj.core.api.Assertions.assertThat; + +// This live test needs a running Docker instance so that a kafka container can be created + +@Testcontainers +class KafkaConnectionLiveTest { + + @Container + private static final KafkaContainer KAFKA_CONTAINER = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:5.4.3")); + private KafkaAdminClient kafkaAdminClient; + + @BeforeEach + void setup() { + KAFKA_CONTAINER.addExposedPort(9092); + this.kafkaAdminClient = new KafkaAdminClient(KAFKA_CONTAINER.getBootstrapServers()); + } + + @AfterEach + void destroy() { + KAFKA_CONTAINER.stop(); + } + + @Test + void givenKafkaIsRunning_whenCheckedForConnection_thenConnectionIsVerified() throws Exception { + boolean alive = kafkaAdminClient.verifyConnection(); + assertThat(alive).isTrue(); + } + +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2264caa99f..3918250d85 100644 --- a/pom.xml +++ b/pom.xml @@ -338,6 +338,7 @@ apache-cxf-modules apache-kafka + apache-kafka-2 apache-libraries apache-olingo apache-poi @@ -769,6 +770,7 @@ apache-cxf-modules apache-kafka + apache-kafka-2 apache-libraries apache-olingo apache-poi From 4e0ea2972f419e8557cc4b29a03c61da153be1be Mon Sep 17 00:00:00 2001 From: dupliaka Date: Thu, 18 Aug 2022 06:32:25 +0200 Subject: [PATCH 27/73] Update optaplanner example (#12467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update optaplanner example Moved to 8.24.0.Final version Removed deprecated drools calculation Added constraints stream solver Updated to solver config java api * Update optaplanner/pom.xml Co-authored-by: Jiří Locker * PR feedback * Move OptaPlanner module to jdk9-and-above Moved to default-jdk9-and-above and integration-jdk9-and-above Co-authored-by: Jiří Locker --- optaplanner/pom.xml | 8 ++++- .../baeldung/optaplanner/CourseSchedule.java | 28 ++++++++++----- .../CourseScheduleConstraintProvider.java | 24 +++++++++++++ .../com/baeldung/optaplanner/Lecture.java | 10 ++++++ .../baeldung/optaplanner/ScoreCalculator.java | 9 +++-- .../src/main/resources/courseSchedule.drl | 14 -------- .../courseScheduleSolverConfigDrools.xml | 12 ------- .../courseScheduleSolverConfiguration.xml | 12 ------- optaplanner/src/main/resources/logback.xml | 15 +++++++- ...rseScheduleConstraintProviderUnitTest.java | 28 +++++++++++++++ .../optaplanner/test/OptaPlannerUnitTest.java | 36 +++++++++++++++---- pom.xml | 4 +-- 12 files changed, 139 insertions(+), 61 deletions(-) create mode 100644 optaplanner/src/main/java/com/baeldung/optaplanner/CourseScheduleConstraintProvider.java delete mode 100644 optaplanner/src/main/resources/courseSchedule.drl delete mode 100644 optaplanner/src/main/resources/courseScheduleSolverConfigDrools.xml delete mode 100644 optaplanner/src/main/resources/courseScheduleSolverConfiguration.xml create mode 100644 optaplanner/src/test/java/com/baeldung/optaplanner/test/CourseScheduleConstraintProviderUnitTest.java diff --git a/optaplanner/pom.xml b/optaplanner/pom.xml index 0e5fa9050e..e1653fd749 100644 --- a/optaplanner/pom.xml +++ b/optaplanner/pom.xml @@ -18,10 +18,16 @@ optaplanner-core ${optaplanner-core.version} + + org.optaplanner + optaplanner-test + ${optaplanner-core.version} + test + - 7.9.0.Final + 8.24.0.Final \ No newline at end of file diff --git a/optaplanner/src/main/java/com/baeldung/optaplanner/CourseSchedule.java b/optaplanner/src/main/java/com/baeldung/optaplanner/CourseSchedule.java index 8a820ab56e..357dfe809f 100644 --- a/optaplanner/src/main/java/com/baeldung/optaplanner/CourseSchedule.java +++ b/optaplanner/src/main/java/com/baeldung/optaplanner/CourseSchedule.java @@ -3,7 +3,7 @@ package com.baeldung.optaplanner; import org.optaplanner.core.api.domain.solution.PlanningEntityCollectionProperty; import org.optaplanner.core.api.domain.solution.PlanningScore; import org.optaplanner.core.api.domain.solution.PlanningSolution; -import org.optaplanner.core.api.domain.solution.drools.ProblemFactCollectionProperty; +import org.optaplanner.core.api.domain.solution.ProblemFactCollectionProperty; import org.optaplanner.core.api.domain.valuerange.ValueRangeProvider; import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore; import org.slf4j.Logger; @@ -16,36 +16,36 @@ import java.util.List; public class CourseSchedule { Logger logger = LoggerFactory.getLogger("CourseSchedule"); - + @ValueRangeProvider(id = "availableRooms") + @ProblemFactCollectionProperty private List roomList; + @ValueRangeProvider(id = "availablePeriods") + @ProblemFactCollectionProperty private List periodList; + @PlanningEntityCollectionProperty private List lectureList; + @PlanningScore private HardSoftScore score; + public CourseSchedule(){ roomList = new ArrayList<>(); periodList = new ArrayList<>(); lectureList = new ArrayList<>(); } - @ValueRangeProvider(id = "availableRooms") - @ProblemFactCollectionProperty public List getRoomList() { return roomList; } - @ValueRangeProvider(id = "availablePeriods") - @ProblemFactCollectionProperty public List getPeriodList() { return periodList; } - @PlanningEntityCollectionProperty public List getLectureList() { return lectureList; } - @PlanningScore public HardSoftScore getScore() { return score; } @@ -54,6 +54,18 @@ public class CourseSchedule { this.score = score; } + public void setRoomList(List roomList) { + this.roomList = roomList; + } + + public void setPeriodList(List periodList) { + this.periodList = periodList; + } + + public void setLectureList(List lectureList) { + this.lectureList = lectureList; + } + public void printCourseSchedule() { lectureList.stream() .map(c -> "Lecture in Room " + c.getRoomNumber().toString() + " during Period " + c.getPeriod().toString()) diff --git a/optaplanner/src/main/java/com/baeldung/optaplanner/CourseScheduleConstraintProvider.java b/optaplanner/src/main/java/com/baeldung/optaplanner/CourseScheduleConstraintProvider.java new file mode 100644 index 0000000000..2733806d16 --- /dev/null +++ b/optaplanner/src/main/java/com/baeldung/optaplanner/CourseScheduleConstraintProvider.java @@ -0,0 +1,24 @@ +package com.baeldung.optaplanner; + +import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore; +import org.optaplanner.core.api.score.stream.Constraint; +import org.optaplanner.core.api.score.stream.ConstraintFactory; +import org.optaplanner.core.api.score.stream.ConstraintProvider; +import org.optaplanner.core.api.score.stream.Joiners; + +public class CourseScheduleConstraintProvider implements ConstraintProvider { + + @Override + public Constraint[] defineConstraints(ConstraintFactory constraintFactory) { + return new Constraint[]{ + roomConflict(constraintFactory) + }; + } + + public Constraint roomConflict(ConstraintFactory constraintFactory){ + return constraintFactory + .forEachUniquePair(Lecture.class, + Joiners.equal(Lecture::getRoomNumber), Joiners.equal(Lecture::getPeriod)) + .penalize("Room conflict", HardSoftScore.ONE_HARD); + } +} diff --git a/optaplanner/src/main/java/com/baeldung/optaplanner/Lecture.java b/optaplanner/src/main/java/com/baeldung/optaplanner/Lecture.java index 48af4e89d1..b63bd21030 100644 --- a/optaplanner/src/main/java/com/baeldung/optaplanner/Lecture.java +++ b/optaplanner/src/main/java/com/baeldung/optaplanner/Lecture.java @@ -1,14 +1,24 @@ package com.baeldung.optaplanner; import org.optaplanner.core.api.domain.entity.PlanningEntity; +import org.optaplanner.core.api.domain.lookup.PlanningId; import org.optaplanner.core.api.domain.variable.PlanningVariable; @PlanningEntity public class Lecture { + @PlanningId + private Long id; private Integer roomNumber; private Integer period; + public Lecture(Long i) { + this.id = i; + } + + public Lecture() { + } + @PlanningVariable(valueRangeProviderRefs = {"availablePeriods"}) public Integer getPeriod() { return period; diff --git a/optaplanner/src/main/java/com/baeldung/optaplanner/ScoreCalculator.java b/optaplanner/src/main/java/com/baeldung/optaplanner/ScoreCalculator.java index 11e5e4a5be..3e3747f764 100644 --- a/optaplanner/src/main/java/com/baeldung/optaplanner/ScoreCalculator.java +++ b/optaplanner/src/main/java/com/baeldung/optaplanner/ScoreCalculator.java @@ -1,15 +1,14 @@ package com.baeldung.optaplanner; -import org.optaplanner.core.api.score.Score; import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore; -import org.optaplanner.core.impl.score.director.easy.EasyScoreCalculator; +import org.optaplanner.core.api.score.calculator.EasyScoreCalculator; import java.util.HashSet; -public class ScoreCalculator implements EasyScoreCalculator { +public class ScoreCalculator implements EasyScoreCalculator { @Override - public Score calculateScore(CourseSchedule courseSchedule) { + public HardSoftScore calculateScore(CourseSchedule courseSchedule) { int hardScore = 0; int softScore = 0; @@ -27,6 +26,6 @@ public class ScoreCalculator implements EasyScoreCalculator { } } - return HardSoftScore.valueOf(hardScore, softScore); + return HardSoftScore.of(hardScore, softScore); } } diff --git a/optaplanner/src/main/resources/courseSchedule.drl b/optaplanner/src/main/resources/courseSchedule.drl deleted file mode 100644 index 9372a24976..0000000000 --- a/optaplanner/src/main/resources/courseSchedule.drl +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.optaplanner - -import com.baeldung.optaplanner.Lecture; -import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScoreHolder; - -global HardSoftScoreHolder scoreHolder; - -rule "noNullRoomPeriod" - when - Lecture( roomNumber == null ); - Lecture( period == null ); - then - scoreHolder.addHardConstraintMatch(kcontext, -1); -end \ No newline at end of file diff --git a/optaplanner/src/main/resources/courseScheduleSolverConfigDrools.xml b/optaplanner/src/main/resources/courseScheduleSolverConfigDrools.xml deleted file mode 100644 index 7cf95fdcd3..0000000000 --- a/optaplanner/src/main/resources/courseScheduleSolverConfigDrools.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - courseSchedule.drl - - - - 10 - - \ No newline at end of file diff --git a/optaplanner/src/main/resources/courseScheduleSolverConfiguration.xml b/optaplanner/src/main/resources/courseScheduleSolverConfiguration.xml deleted file mode 100644 index 0ad2264dcd..0000000000 --- a/optaplanner/src/main/resources/courseScheduleSolverConfiguration.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - com.baeldung.optaplanner.ScoreCalculator - - - - 10 - - \ No newline at end of file diff --git a/optaplanner/src/main/resources/logback.xml b/optaplanner/src/main/resources/logback.xml index c109aa19e2..34da901079 100644 --- a/optaplanner/src/main/resources/logback.xml +++ b/optaplanner/src/main/resources/logback.xml @@ -1,3 +1,16 @@ + + + + + %d{HH:mm:ss.SSS} [%-12.12t] %-5p %m%n + + + - \ No newline at end of file + + + + + + diff --git a/optaplanner/src/test/java/com/baeldung/optaplanner/test/CourseScheduleConstraintProviderUnitTest.java b/optaplanner/src/test/java/com/baeldung/optaplanner/test/CourseScheduleConstraintProviderUnitTest.java new file mode 100644 index 0000000000..22de095ce9 --- /dev/null +++ b/optaplanner/src/test/java/com/baeldung/optaplanner/test/CourseScheduleConstraintProviderUnitTest.java @@ -0,0 +1,28 @@ +package com.baeldung.optaplanner.test; + +import com.baeldung.optaplanner.CourseSchedule; +import com.baeldung.optaplanner.CourseScheduleConstraintProvider; +import com.baeldung.optaplanner.Lecture; +import org.junit.jupiter.api.Test; +import org.optaplanner.test.api.score.stream.ConstraintVerifier; + +public class CourseScheduleConstraintProviderUnitTest { + + private final ConstraintVerifier constraintVerifier = + ConstraintVerifier.build(new CourseScheduleConstraintProvider(), CourseSchedule.class, Lecture.class); + + @Test + public void testCourseScheduleConstraint() { + + Lecture lecture = new Lecture(0L); + lecture.setPeriod(1); + lecture.setRoomNumber(1); + Lecture conflictedLecture = new Lecture(1L); + conflictedLecture.setPeriod(1); + conflictedLecture.setRoomNumber(1); + + constraintVerifier.verifyThat(CourseScheduleConstraintProvider::roomConflict) + .given(lecture, conflictedLecture) + .penalizesBy(1); + } +} diff --git a/optaplanner/src/test/java/com/baeldung/optaplanner/test/OptaPlannerUnitTest.java b/optaplanner/src/test/java/com/baeldung/optaplanner/test/OptaPlannerUnitTest.java index 2847a233a5..2b72765074 100644 --- a/optaplanner/src/test/java/com/baeldung/optaplanner/test/OptaPlannerUnitTest.java +++ b/optaplanner/src/test/java/com/baeldung/optaplanner/test/OptaPlannerUnitTest.java @@ -1,16 +1,26 @@ package com.baeldung.optaplanner.test; import com.baeldung.optaplanner.CourseSchedule; +import com.baeldung.optaplanner.CourseScheduleConstraintProvider; import com.baeldung.optaplanner.Lecture; +import com.baeldung.optaplanner.ScoreCalculator; import org.junit.Assert; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.optaplanner.core.api.score.ScoreManager; import org.optaplanner.core.api.solver.Solver; import org.optaplanner.core.api.solver.SolverFactory; +import org.optaplanner.core.config.solver.SolverConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.time.Duration; import java.util.Arrays; public class OptaPlannerUnitTest { + Logger logger = LoggerFactory.getLogger("OptaPlannerUnitTest"); + static CourseSchedule unsolvedCourseSchedule; @BeforeAll @@ -18,8 +28,8 @@ public class OptaPlannerUnitTest { unsolvedCourseSchedule = new CourseSchedule(); - for(int i = 0; i < 10; i++){ - unsolvedCourseSchedule.getLectureList().add(new Lecture()); + for(long i = 0; i < 10; i++) { + unsolvedCourseSchedule.getLectureList().add(new Lecture(i)); } unsolvedCourseSchedule.getPeriodList().addAll(Arrays.asList(new Integer[] { 1, 2, 3 })); @@ -29,7 +39,12 @@ public class OptaPlannerUnitTest { @Test public void test_whenCustomJavaSolver() { - SolverFactory solverFactory = SolverFactory.createFromXmlResource("courseScheduleSolverConfiguration.xml"); + SolverFactory solverFactory = SolverFactory.create(new SolverConfig() + .withSolutionClass(CourseSchedule.class) + .withEntityClasses(Lecture.class) + .withEasyScoreCalculatorClass(ScoreCalculator.class) + .withTerminationSpentLimit(Duration.ofSeconds(1))); + Solver solver = solverFactory.buildSolver(); CourseSchedule solvedCourseSchedule = solver.solve(unsolvedCourseSchedule); @@ -38,13 +53,22 @@ public class OptaPlannerUnitTest { } @Test - public void test_whenDroolsSolver() { + public void test_whenConstraintStreamSolver() { + + SolverFactory solverFactory = SolverFactory.create(new SolverConfig() + .withSolutionClass(CourseSchedule.class) + .withEntityClasses(Lecture.class) + .withConstraintProviderClass(CourseScheduleConstraintProvider.class) + .withTerminationSpentLimit(Duration.ofSeconds(1))); - SolverFactory solverFactory = SolverFactory.createFromXmlResource("courseScheduleSolverConfigDrools.xml"); Solver solver = solverFactory.buildSolver(); CourseSchedule solvedCourseSchedule = solver.solve(unsolvedCourseSchedule); + logger.info(ScoreManager.create(solverFactory).explainScore(solvedCourseSchedule).getSummary()); + Assert.assertNotNull(solvedCourseSchedule.getScore()); - Assert.assertEquals(0, solvedCourseSchedule.getScore().getHardScore()); + Assert.assertEquals(-4, solvedCourseSchedule.getScore().getHardScore()); + } + } diff --git a/pom.xml b/pom.xml index 3918250d85..da9a18bd3d 100644 --- a/pom.xml +++ b/pom.xml @@ -492,7 +492,6 @@ open-liberty oauth2-framework-impl - optaplanner orika osgi @@ -926,7 +925,6 @@ open-liberty oauth2-framework-impl - optaplanner orika osgi @@ -1248,6 +1246,7 @@ apache-httpclient-2 libraries-concurrency maven-modules/multimodulemavenproject + optaplanner persistence-modules/sirix persistence-modules/spring-data-cassandra-2 quarkus-modules/quarkus-vs-springboot @@ -1317,6 +1316,7 @@ apache-httpclient-2 libraries-concurrency maven-modules/multimodulemavenproject + optaplanner persistence-modules/sirix persistence-modules/spring-data-cassandra-2 quarkus-modules/quarkus-vs-springboot From a0942e5c536745ee4ccdda6109f03795d8418126 Mon Sep 17 00:00:00 2001 From: psevestre Date: Thu, 18 Aug 2022 03:25:19 -0300 Subject: [PATCH 28/73] [BAEL-2765] PKCE Support for Secret Clients (#12605) * [BAEL-4849] Article code * [BAEL-4968] Article code * [BAEL-4968] Article code * [BAEL-4968] Article code * [BAEL-4968] Remove extra comments * [BAEL-5258] Article Code * [BAEL-2765] PKCE Support for Secret Clients --- .../spring-security-pkce/.gitignore | 33 +++++++ .../spring-security-pkce/client/pom.xml | 24 +++++ .../pkce/client/PkceClientApplication.java | 13 +++ .../config/OAuth2ClientConfiguration.java | 30 ++++++ .../src/main/resources/application.yaml | 13 +++ .../src/main/resources/static/index.html | 10 ++ .../spring-security-pkce/pom.xml | 76 ++++++++++++++ .../spring-security-pkce/server/pom.xml | 25 +++++ .../authserver/PkceAuthServerApplication.java | 13 +++ .../conf/AuthServerConfiguration.java | 99 +++++++++++++++++++ .../authserver/conf/JwksConfiguration.java | 53 ++++++++++ .../conf/UserDetailsConfiguration.java | 26 +++++ .../src/main/resources/application.properties | 1 + .../SpringSecurityPkceApplicationTests.java | 13 +++ 14 files changed, 429 insertions(+) create mode 100644 spring-security-modules/spring-security-pkce/.gitignore create mode 100644 spring-security-modules/spring-security-pkce/client/pom.xml create mode 100644 spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java create mode 100644 spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java create mode 100644 spring-security-modules/spring-security-pkce/client/src/main/resources/application.yaml create mode 100644 spring-security-modules/spring-security-pkce/client/src/main/resources/static/index.html create mode 100644 spring-security-modules/spring-security-pkce/pom.xml create mode 100644 spring-security-modules/spring-security-pkce/server/pom.xml create mode 100644 spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java create mode 100644 spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java create mode 100644 spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java create mode 100644 spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java create mode 100644 spring-security-modules/spring-security-pkce/server/src/main/resources/application.properties create mode 100644 spring-security-modules/spring-security-pkce/server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java diff --git a/spring-security-modules/spring-security-pkce/.gitignore b/spring-security-modules/spring-security-pkce/.gitignore new file mode 100644 index 0000000000..549e00a2a9 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/spring-security-modules/spring-security-pkce/client/pom.xml b/spring-security-modules/spring-security-pkce/client/pom.xml new file mode 100644 index 0000000000..6961167716 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/client/pom.xml @@ -0,0 +1,24 @@ + + 4.0.0 + + com.baeldung + spring-security-pkce + 0.0.1-SNAPSHOT + + pkce-client + + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-oauth2-client + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + \ No newline at end of file diff --git a/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java b/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java new file mode 100644 index 0000000000..2a23b32fc8 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.security.pkce.client; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PkceClientApplication { + + public static void main(String[] args) { + SpringApplication.run(PkceClientApplication.class, args); + } + +} diff --git a/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java b/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java new file mode 100644 index 0000000000..6863c13fa7 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java @@ -0,0 +1,30 @@ +package com.baeldung.security.pkce.client.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository; +import org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestCustomizers; +import org.springframework.security.oauth2.client.web.server.DefaultServerOAuth2AuthorizationRequestResolver; +import org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizationRequestResolver; +import org.springframework.security.web.server.SecurityWebFilterChain; + +@Configuration +public class OAuth2ClientConfiguration { + + @Bean + public SecurityWebFilterChain pkceFilterChain(ServerHttpSecurity http, ServerOAuth2AuthorizationRequestResolver resolver) { + http.authorizeExchange(r -> r.anyExchange().authenticated()); + http.oauth2Login(auth -> auth.authorizationRequestResolver(resolver)); + return http.build(); + } + + @Bean + public ServerOAuth2AuthorizationRequestResolver pkceResolver(ReactiveClientRegistrationRepository repo) { + var resolver = new DefaultServerOAuth2AuthorizationRequestResolver(repo); + resolver.setAuthorizationRequestCustomizer(OAuth2AuthorizationRequestCustomizers.withPkce()); + return resolver; + } + + +} diff --git a/spring-security-modules/spring-security-pkce/client/src/main/resources/application.yaml b/spring-security-modules/spring-security-pkce/client/src/main/resources/application.yaml new file mode 100644 index 0000000000..544f8254eb --- /dev/null +++ b/spring-security-modules/spring-security-pkce/client/src/main/resources/application.yaml @@ -0,0 +1,13 @@ +spring: + security: + oauth2: + client: + provider: + baeldung: + issuer-uri: http://localhost:8085 + registration: + pkce: + provider: baeldung + client-id: pkce-client + client-secret: obscura + scope: openid,email \ No newline at end of file diff --git a/spring-security-modules/spring-security-pkce/client/src/main/resources/static/index.html b/spring-security-modules/spring-security-pkce/client/src/main/resources/static/index.html new file mode 100644 index 0000000000..9f2232ae9c --- /dev/null +++ b/spring-security-modules/spring-security-pkce/client/src/main/resources/static/index.html @@ -0,0 +1,10 @@ + + + + +Baeldung :: PKCE-Client + + +

Hello from PKCE-Client

+ + \ No newline at end of file diff --git a/spring-security-modules/spring-security-pkce/pom.xml b/spring-security-modules/spring-security-pkce/pom.xml new file mode 100644 index 0000000000..7631d54354 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/pom.xml @@ -0,0 +1,76 @@ + + + 4.0.0 + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + spring-security-pkce + pom + spring-security-pkce + Demo project for Spring Boot + + + 2.7.2 + 11 + + + + org.springframework.boot + spring-boot-starter-security + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + org.springframework.security + spring-security-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + + server + client + + diff --git a/spring-security-modules/spring-security-pkce/server/pom.xml b/spring-security-modules/spring-security-pkce/server/pom.xml new file mode 100644 index 0000000000..973b29f473 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/server/pom.xml @@ -0,0 +1,25 @@ + + 4.0.0 + + com.baeldung + spring-security-pkce + 0.0.1-SNAPSHOT + + pkce-auth-server + + + 0.3.1 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.security + spring-security-oauth2-authorization-server + ${spring-authorization-server.version} + + + \ No newline at end of file diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java new file mode 100644 index 0000000000..e568743838 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.security.pkce.authserver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PkceAuthServerApplication { + + public static void main(String[] args) { + SpringApplication.run(PkceAuthServerApplication.class, args); + } + +} diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java new file mode 100644 index 0000000000..1f6484478d --- /dev/null +++ b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java @@ -0,0 +1,99 @@ +package com.baeldung.security.pkce.authserver.conf; + +import java.util.UUID; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OAuth2AuthorizationServerConfigurer; +import org.springframework.security.config.annotation.web.configurers.oauth2.server.resource.OAuth2ResourceServerConfigurer; +import org.springframework.security.crypto.password.NoOpPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.oauth2.core.AuthorizationGrantType; +import org.springframework.security.oauth2.core.ClientAuthenticationMethod; +import org.springframework.security.oauth2.core.oidc.OidcScopes; +import org.springframework.security.oauth2.server.authorization.client.InMemoryRegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; +import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository; +import org.springframework.security.oauth2.server.authorization.config.ClientSettings; +import org.springframework.security.oauth2.server.authorization.config.ProviderSettings; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint; +import org.springframework.security.web.util.matcher.RequestMatcher; + +@Configuration +public class AuthServerConfiguration { + + @Bean + @Order(1) + public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { + + var authorizationServerConfigurer = new OAuth2AuthorizationServerConfigurer(); + var endpointsMatcher = authorizationServerConfigurer.getEndpointsMatcher(); + + // @formatter:off + http + .requestMatcher(endpointsMatcher) + .authorizeRequests(authorize -> + authorize + .anyRequest() + .authenticated()); + http + .exceptionHandling(exceptions -> + exceptions.authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/login"))) + .csrf( csrf -> + csrf + .ignoringRequestMatchers(endpointsMatcher)) + .apply(authorizationServerConfigurer); + + // Required by /userinfo endpoint + http.oauth2ResourceServer(OAuth2ResourceServerConfigurer::jwt); + return http.build(); + // @formatter:on + } + + @Bean + @Order(2) + public SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws Exception { + // @formatter:off + return http + .formLogin(Customizer.withDefaults()) + .build(); + // @formatter:on + } + + @Bean + public RegisteredClientRepository registeredClientRepository() { + + var pkceClient = RegisteredClient + .withId(UUID.randomUUID().toString()) + .clientId("pkce-client") + .clientSecret("{noop}obscura") + .clientAuthenticationMethod(ClientAuthenticationMethod.CLIENT_SECRET_BASIC) + .authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE) + .authorizationGrantType(AuthorizationGrantType.REFRESH_TOKEN) + .authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS) + .scope(OidcScopes.OPENID) + .scope(OidcScopes.EMAIL) + .scope(OidcScopes.PROFILE) + .clientSettings(ClientSettings.builder() + .requireAuthorizationConsent(false) + .requireProofKey(true) + .build()) + .redirectUri("http://127.0.0.1:8080/login/oauth2/code/pkce") // Localhost not allowed + .build(); + + return new InMemoryRegisteredClientRepository(pkceClient); + } + + @Bean + public ProviderSettings providerSettings() { + return ProviderSettings + .builder() + .build(); + } + +} diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java new file mode 100644 index 0000000000..a253141101 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java @@ -0,0 +1,53 @@ +package com.baeldung.security.pkce.authserver.conf; + +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.util.UUID; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration; +import org.springframework.security.oauth2.jwt.JwtDecoder; + +import com.nimbusds.jose.jwk.JWKSet; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jose.jwk.source.ImmutableJWKSet; +import com.nimbusds.jose.jwk.source.JWKSource; +import com.nimbusds.jose.proc.SecurityContext; + +@Configuration +public class JwksConfiguration { + + @Bean + public JwtDecoder jwtDecoder(JWKSource jwkSource) { + return OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource); + } + + @Bean + public JWKSource jwkSource() { + KeyPair keyPair = generateRsaKey(); + RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); + RSAKey rsaKey = new RSAKey.Builder(publicKey) + .privateKey(privateKey) + .keyID(UUID.randomUUID().toString()) + .build(); + JWKSet jwkSet = new JWKSet(rsaKey); + return new ImmutableJWKSet<>(jwkSet); + } + + private static KeyPair generateRsaKey() { + KeyPair keyPair; + try { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(2048); + keyPair = keyPairGenerator.generateKeyPair(); + } + catch (Exception ex) { + throw new IllegalStateException(ex); + } + return keyPair; + } +} diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java new file mode 100644 index 0000000000..6877524508 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java @@ -0,0 +1,26 @@ +package com.baeldung.security.pkce.authserver.conf; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.provisioning.InMemoryUserDetailsManager; + +@Configuration +public class UserDetailsConfiguration { + + @Bean + public UserDetailsService userDetailsService() { + // @formatter:off + UserDetails userDetails = User.withDefaultPasswordEncoder() + .username("user") + .password("password") + .roles("USER") + .build(); + + return new InMemoryUserDetailsManager(userDetails); + // @formatter:on + } + +} diff --git a/spring-security-modules/spring-security-pkce/server/src/main/resources/application.properties b/spring-security-modules/spring-security-pkce/server/src/main/resources/application.properties new file mode 100644 index 0000000000..cd2d02be7c --- /dev/null +++ b/spring-security-modules/spring-security-pkce/server/src/main/resources/application.properties @@ -0,0 +1 @@ +server.port=8085 diff --git a/spring-security-modules/spring-security-pkce/server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java b/spring-security-modules/spring-security-pkce/server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java new file mode 100644 index 0000000000..1a91420808 --- /dev/null +++ b/spring-security-modules/spring-security-pkce/server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java @@ -0,0 +1,13 @@ +package com.baeldung.security.pkce; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class SpringSecurityPkceApplicationLiveTest { + + @Test + void whenContextLoads_thenSuccess() { + } + +} From 172f9fb592cfae90ce040ff4662573b81f8c5078 Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:09:05 +0100 Subject: [PATCH 29/73] [JAVA-13946] Upgrade byte-buddy to 1.12.13 (#12607) Co-authored-by: panagiotiskakos --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da9a18bd3d..3fdb4458e6 100644 --- a/pom.xml +++ b/pom.xml @@ -1357,7 +1357,7 @@ 2.2 1.3 4.4.0 - 1.11.20 + 1.12.13 1.7.32 From 7bbcb552906a6fec598f620f8acbfb5fc85e78b7 Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Thu, 18 Aug 2022 08:10:34 +0100 Subject: [PATCH 30/73] Java 13943 (#12609) * [JAVA-13943] Upgrade commons-cli version to 1.5 * [JAVA-13943] Upgrade commons-cli version to 1.5.0 Co-authored-by: panagiotiskakos --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3fdb4458e6..3bf6eda3f4 100644 --- a/pom.xml +++ b/pom.xml @@ -1377,7 +1377,7 @@ 2.11.0 2.6 3.12.0 - 1.4 + 1.5.0 3.0.0 3.1.0 1.2 From 941d6701f37ab59759dff1acf2ba2e1426ab81f2 Mon Sep 17 00:00:00 2001 From: Ulisses Lima Date: Thu, 18 Aug 2022 19:00:45 -0300 Subject: [PATCH 31/73] BAEL-5657 - Reading JSON from a URL in Java (#12584) * moving SpringBootPersistenceApplication class to its own package * from com.baeldung to com.baeldung.logging to prevent it from loading contexts from other applications. * moving SpringBootPersistenceApplication class to its own package * from com.baeldung to com.baeldung.logging to prevent it from loading contexts from other applications. * Spring Data MongoDB - Configure Connection Ready for revision. * fixed tests to reflect article changes * BAEL-5657 * reverting BAEL-5657 * reverting BAEL-5657 * done * reverting bael-5366 * revert bael-5366 * revert bael-3366 * including section 3 3. Using commons-io and org.json * replacing tabs with spaces --- jackson-modules/jackson-conversions-2/pom.xml | 17 +++++ .../jackson/jsonurlreader/JsonUrlReader.java | 62 +++++++++++++++++++ .../jackson/jsonurlreader/data/Example.java | 40 ++++++++++++ .../jackson/jsonurlreader/JsonMockServer.java | 62 +++++++++++++++++++ .../JsonUrlReaderIntegrationTest.java | 50 +++++++++++++++ 5 files changed, 231 insertions(+) create mode 100644 jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/JsonUrlReader.java create mode 100644 jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/data/Example.java create mode 100644 jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonMockServer.java create mode 100644 jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonUrlReaderIntegrationTest.java diff --git a/jackson-modules/jackson-conversions-2/pom.xml b/jackson-modules/jackson-conversions-2/pom.xml index 7e994fb52b..984d9b3a18 100644 --- a/jackson-modules/jackson-conversions-2/pom.xml +++ b/jackson-modules/jackson-conversions-2/pom.xml @@ -32,6 +32,18 @@ jackson-dataformat-csv ${jackson.version} + + + org.mock-server + mockserver-netty + ${mockserver-netty.version} + test + + + org.json + json + ${json.version} + @@ -44,4 +56,9 @@ + + 5.13.2 + 20220320 + + \ No newline at end of file diff --git a/jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/JsonUrlReader.java b/jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/JsonUrlReader.java new file mode 100644 index 0000000000..9c9f1fd7c4 --- /dev/null +++ b/jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/JsonUrlReader.java @@ -0,0 +1,62 @@ +package com.baeldung.jackson.jsonurlreader; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.nio.charset.Charset; + +import org.apache.commons.io.IOUtils; +import org.json.JSONObject; + +import com.fasterxml.jackson.core.exc.StreamReadException; +import com.fasterxml.jackson.databind.DatabindException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class JsonUrlReader { + + public static void main(String[] args) throws StreamReadException, DatabindException, MalformedURLException, IOException { + String url = args[0]; + + JsonNode node = JsonUrlReader.get(url); + System.out.println(node.toPrettyString()); + } + + public static String stream(String url) throws IOException { + try (InputStream input = new URL(url).openStream()) { + InputStreamReader isr = new InputStreamReader(input, Charset.forName("UTF-8")); + BufferedReader reader = new BufferedReader(isr); + StringBuilder json = new StringBuilder(); + int c; + while ((c = reader.read()) != -1) { + json.append((char) c); + } + return json.toString(); + } + } + + public static JsonNode get(String url) throws StreamReadException, DatabindException, MalformedURLException, IOException { + ObjectMapper mapper = new ObjectMapper(); + JsonNode json = mapper.readTree(new URL(url)); + return json; + } + + public static T get(String url, Class type) throws StreamReadException, DatabindException, MalformedURLException, IOException { + ObjectMapper mapper = new ObjectMapper(); + T entity = mapper.readValue(new URL(url), type); + return entity; + } + + public static String getString(String url) throws StreamReadException, DatabindException, MalformedURLException, IOException { + return get(url).toPrettyString(); + } + + public static JSONObject getJson(String url) throws MalformedURLException, IOException { + String json = IOUtils.toString(new URL(url), Charset.forName("UTF-8")); + JSONObject object = new JSONObject(json); + return object; + } +} diff --git a/jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/data/Example.java b/jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/data/Example.java new file mode 100644 index 0000000000..062ee51b20 --- /dev/null +++ b/jackson-modules/jackson-conversions-2/src/main/java/com/baeldung/jackson/jsonurlreader/data/Example.java @@ -0,0 +1,40 @@ +package com.baeldung.jackson.jsonurlreader.data; + +public class Example { + private String name; + private Integer n; + private Boolean real; + + public Example() { + } + + public Example(String name, Integer n, Boolean real) { + this.name = name; + this.n = n; + this.real = real; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getN() { + return n; + } + + public void setN(Integer n) { + this.n = n; + } + + public Boolean getReal() { + return real; + } + + public void setReal(Boolean real) { + this.real = real; + } +} diff --git a/jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonMockServer.java b/jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonMockServer.java new file mode 100644 index 0000000000..5debc73e0f --- /dev/null +++ b/jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonMockServer.java @@ -0,0 +1,62 @@ +package com.baeldung.jackson.jsonurlreader; + +import static org.mockserver.integration.ClientAndServer.startClientAndServer; +import static org.mockserver.model.HttpRequest.request; +import static org.mockserver.model.HttpResponse.response; + +import java.io.IOException; +import java.net.ServerSocket; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.mockserver.client.MockServerClient; +import org.mockserver.integration.ClientAndServer; +import org.mockserver.model.HttpStatusCode; + +import com.baeldung.jackson.jsonurlreader.data.Example; + +public class JsonMockServer { + protected static final String JSON_RESPONSE = "{ \"name\": \"A\", \"n\": 1, \"real\": true }"; + protected static final Example OBJECT_RESPONSE = new Example("A", 1, true); + + protected static String serviceUrl; + + private static final String SERVER_ADDRESS = "127.0.0.1"; + private static final String PATH = "/sample-json"; + + private static ClientAndServer mockServer; + private static int serverPort; + + @BeforeAll + static void startServer() throws IOException { + serverPort = getFreePort(); + serviceUrl = "http://" + SERVER_ADDRESS + ":" + serverPort + PATH; + + mockServer = startClientAndServer(serverPort); + + mockJsonRequest(); + } + + @AfterAll + static void stopServer() { + mockServer.stop(); + } + + @SuppressWarnings("resource") + private static void mockJsonRequest() { + new MockServerClient(SERVER_ADDRESS, serverPort) + .when(request() + .withPath(PATH) + .withMethod("GET")) + .respond(response() + .withStatusCode(HttpStatusCode.OK_200.code()) + .withBody(JSON_RESPONSE) + ); + } + + private static int getFreePort() throws IOException { + try (ServerSocket serverSocket = new ServerSocket(0)) { + return serverSocket.getLocalPort(); + } + } +} diff --git a/jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonUrlReaderIntegrationTest.java b/jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonUrlReaderIntegrationTest.java new file mode 100644 index 0000000000..b450ed5a83 --- /dev/null +++ b/jackson-modules/jackson-conversions-2/src/test/java/com/baeldung/jackson/jsonurlreader/JsonUrlReaderIntegrationTest.java @@ -0,0 +1,50 @@ +package com.baeldung.jackson.jsonurlreader; + +import static org.junit.Assert.assertEquals; + +import org.json.JSONObject; +import org.junit.jupiter.api.Test; + +import com.baeldung.jackson.jsonurlreader.data.Example; +import com.fasterxml.jackson.databind.JsonNode; + +public class JsonUrlReaderIntegrationTest extends JsonMockServer { + + @Test + public void whenStreamUrl_thenJsonStringReturned() throws Exception { + String jsonNode = JsonUrlReader.stream(serviceUrl); + + assertEquals(jsonNode, JSON_RESPONSE); + } + + @Test + public void whenGetUrl_thenJsonNodeReturned() throws Exception { + JsonNode jsonNode = JsonUrlReader.get(serviceUrl); + + assertEquals(jsonNode.get("name") + .textValue(), "A"); + assertEquals(jsonNode.get("n") + .intValue(), 1); + assertEquals(jsonNode.get("real") + .booleanValue(), true); + } + + @Test + public void givenType_whenGetUrl_thenTypeReturned() throws Exception { + Example object = JsonUrlReader.get(serviceUrl, Example.class); + + Integer n = 1; + assertEquals(object.getName(), "A"); + assertEquals(object.getN(), n); + assertEquals(object.getReal(), true); + } + + @Test + public void whenGetJsonUrl_thenJsonObjectReturned() throws Exception { + JSONObject jsonObject = JsonUrlReader.getJson(serviceUrl); + + assertEquals(jsonObject.getString("name"), "A"); + assertEquals(jsonObject.getInt("n"), 1); + assertEquals(jsonObject.getBoolean("real"), true); + } +} From 23f33d32fe09ff4833c1856badd6cf30882efdcb Mon Sep 17 00:00:00 2001 From: freelansam <79205526+freelansam@users.noreply.github.com> Date: Fri, 19 Aug 2022 12:04:58 +0530 Subject: [PATCH 32/73] JAVA-13826: Align module names, folder names and artifact id (#12601) --- apache-cxf-modules/pom.xml | 2 +- core-java-modules/core-java-concurrency-simple/pom.xml | 6 +++--- jhipster-modules/jhipster-microservice/pom.xml | 2 +- jhipster-modules/jhipster-monolithic/pom.xml | 2 +- jhipster-modules/jhipster-uaa/pom.xml | 2 +- jhipster-modules/pom.xml | 4 ++-- .../maven-repositories/maven-download-artifacts/pom.xml | 4 ++-- .../maven-repositories/maven-release-repository/pom.xml | 2 +- .../maven-repositories/maven-snapshot-repository/pom.xml | 2 +- maven-modules/maven-repositories/pom.xml | 2 +- spring-boot-modules/spring-boot-3/pom.xml | 4 ++-- spring-remoting-modules/pom.xml | 2 +- spring-security-modules/spring-security-oauth2/pom.xml | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apache-cxf-modules/pom.xml b/apache-cxf-modules/pom.xml index fc1cf4fa0f..63c4e16747 100644 --- a/apache-cxf-modules/pom.xml +++ b/apache-cxf-modules/pom.xml @@ -5,7 +5,7 @@ 4.0.0 apache-cxf-modules 0.0.1-SNAPSHOT - apache-cxf + apache-cxf-modules pom diff --git a/core-java-modules/core-java-concurrency-simple/pom.xml b/core-java-modules/core-java-concurrency-simple/pom.xml index 153d76d0d5..bbb65f96d4 100644 --- a/core-java-modules/core-java-concurrency-simple/pom.xml +++ b/core-java-modules/core-java-concurrency-simple/pom.xml @@ -2,9 +2,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - java-concurrency-simple + core-java-concurrency-simple 0.1.0-SNAPSHOT - java-concurrency-simple + core-java-concurrency-simple jar @@ -14,7 +14,7 @@ - java-concurrency-simple + core-java-concurrency-simple src/main/resources diff --git a/jhipster-modules/jhipster-microservice/pom.xml b/jhipster-modules/jhipster-microservice/pom.xml index 3d2d682d8e..ae58ad2203 100644 --- a/jhipster-modules/jhipster-microservice/pom.xml +++ b/jhipster-modules/jhipster-microservice/pom.xml @@ -7,7 +7,7 @@ pom - jhipster + jhipster-modules com.baeldung.jhipster 1.0.0-SNAPSHOT diff --git a/jhipster-modules/jhipster-monolithic/pom.xml b/jhipster-modules/jhipster-monolithic/pom.xml index 28cfc16859..ac483fdae6 100644 --- a/jhipster-modules/jhipster-monolithic/pom.xml +++ b/jhipster-modules/jhipster-monolithic/pom.xml @@ -7,7 +7,7 @@ JHipster Monolithic Application - jhipster + jhipster-modules com.baeldung.jhipster 1.0.0-SNAPSHOT diff --git a/jhipster-modules/jhipster-uaa/pom.xml b/jhipster-modules/jhipster-uaa/pom.xml index a59b19d1fd..b90b59047d 100644 --- a/jhipster-modules/jhipster-uaa/pom.xml +++ b/jhipster-modules/jhipster-uaa/pom.xml @@ -7,7 +7,7 @@ pom - jhipster + jhipster-modules com.baeldung.jhipster 1.0.0-SNAPSHOT diff --git a/jhipster-modules/pom.xml b/jhipster-modules/pom.xml index 8954ef0703..789666ffb6 100644 --- a/jhipster-modules/pom.xml +++ b/jhipster-modules/pom.xml @@ -3,9 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.jhipster - jhipster + jhipster-modules 1.0.0-SNAPSHOT - jhipster + jhipster-modules pom diff --git a/maven-modules/maven-repositories/maven-download-artifacts/pom.xml b/maven-modules/maven-repositories/maven-download-artifacts/pom.xml index 678fc32bec..3cf4598ec5 100644 --- a/maven-modules/maven-repositories/maven-download-artifacts/pom.xml +++ b/maven-modules/maven-repositories/maven-download-artifacts/pom.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - maven-repository-download - Maven Release Repository + maven-download-artifacts + maven-download-artifacts 1.0.0-SNAPSHOT diff --git a/maven-modules/maven-repositories/maven-release-repository/pom.xml b/maven-modules/maven-repositories/maven-release-repository/pom.xml index bd7adcbcce..c65c456d3a 100644 --- a/maven-modules/maven-repositories/maven-release-repository/pom.xml +++ b/maven-modules/maven-repositories/maven-release-repository/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 maven-release-repository - Maven Release Repository + maven-release-repository 1.0.0 diff --git a/maven-modules/maven-repositories/maven-snapshot-repository/pom.xml b/maven-modules/maven-repositories/maven-snapshot-repository/pom.xml index 5409e47b8e..9f618c7659 100644 --- a/maven-modules/maven-repositories/maven-snapshot-repository/pom.xml +++ b/maven-modules/maven-repositories/maven-snapshot-repository/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 maven-snapshot-repository - Maven Snapshot Repository + maven-snapshot-repository 1.0.0-SNAPSHOT diff --git a/maven-modules/maven-repositories/pom.xml b/maven-modules/maven-repositories/pom.xml index ba39d00d65..4a64e6a0b2 100644 --- a/maven-modules/maven-repositories/pom.xml +++ b/maven-modules/maven-repositories/pom.xml @@ -5,7 +5,7 @@ 4.0.0 maven-repositories 1.0.0-SNAPSHOT - Maven Repositories + maven-repositories pom diff --git a/spring-boot-modules/spring-boot-3/pom.xml b/spring-boot-modules/spring-boot-3/pom.xml index 556168e205..5b1256551c 100644 --- a/spring-boot-modules/spring-boot-3/pom.xml +++ b/spring-boot-modules/spring-boot-3/pom.xml @@ -8,9 +8,9 @@ 0.0.1-SNAPSHOT ../../parent-boot-3 - spring-boot-3-sample + spring-boot-3 0.0.1-SNAPSHOT - spring-boot-3-sample + spring-boot-3 Demo project for Spring Boot diff --git a/spring-remoting-modules/pom.xml b/spring-remoting-modules/pom.xml index 1981278db8..dc7afa7cc1 100644 --- a/spring-remoting-modules/pom.xml +++ b/spring-remoting-modules/pom.xml @@ -5,7 +5,7 @@ 4.0.0 spring-remoting-modules 1.0-SNAPSHOT - spring-remoting + spring-remoting-modules pom Parent for all projects related to Spring Remoting, except remoting-hessian-burlap 4.13.2 5.8.1 From e703663759812336ccb2c0c4c4c09800eb6b60f8 Mon Sep 17 00:00:00 2001 From: apeterlic Date: Fri, 19 Aug 2022 12:55:36 +0200 Subject: [PATCH 35/73] Add @ApiOperation vs @ApiResponse in Swagger (#12570) * Add @ApiOperation vs @ApiResponse in Swagger * Minor fixes * Fix - rename package --- .../SwaggerDemoApplication.java | 13 +++++++ .../config/SwaggerConfiguration.java | 23 +++++++++++ .../controller/CustomerController.java | 38 +++++++++++++++++++ .../response/CustomerResponse.java | 27 +++++++++++++ .../response/ErrorResponse.java | 23 +++++++++++ .../service/CustomerService.java | 8 ++++ .../service/DefaultCustomerService.java | 13 +++++++ 7 files changed, 145 insertions(+) create mode 100644 spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/SwaggerDemoApplication.java create mode 100644 spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/config/SwaggerConfiguration.java create mode 100644 spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/controller/CustomerController.java create mode 100644 spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/CustomerResponse.java create mode 100644 spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/ErrorResponse.java create mode 100644 spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/CustomerService.java create mode 100644 spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/DefaultCustomerService.java diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/SwaggerDemoApplication.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/SwaggerDemoApplication.java new file mode 100644 index 0000000000..8dec139917 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/SwaggerDemoApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.swaggerresponses; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SwaggerDemoApplication { + + public static void main(String[] args) { + SpringApplication.run(SwaggerDemoApplication.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/config/SwaggerConfiguration.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/config/SwaggerConfiguration.java new file mode 100644 index 0000000000..5a4d237d97 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/config/SwaggerConfiguration.java @@ -0,0 +1,23 @@ +package com.baeldung.swaggerresponses.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; + +@Configuration +public class SwaggerConfiguration { + + @Bean + public Docket api() { + return new Docket(DocumentationType.SWAGGER_2).select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build(); + } + +} + diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/controller/CustomerController.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/controller/CustomerController.java new file mode 100644 index 0000000000..0811af56ec --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/controller/CustomerController.java @@ -0,0 +1,38 @@ +package com.baeldung.swaggerresponses.controller; + +import com.baeldung.swaggerresponses.response.CustomerResponse; +import com.baeldung.swaggerresponses.response.ErrorResponse; +import com.baeldung.swaggerresponses.service.CustomerService; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; + +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Api("Customer Controller") +@RestController +@RequestMapping("/customers") +public class CustomerController { + + private final CustomerService customerService; + + public CustomerController(CustomerService customerService) { + this.customerService = customerService; + } + + @ApiOperation(value = "Gets customer by ID", response = CustomerResponse.class, notes = "Customer must exist") + @ApiResponses(value = { + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Customer not found"), + @ApiResponse(code = 500, message = "Internal server error", response = ErrorResponse.class) }) + @GetMapping("/{id}") + public ResponseEntity getCustomer(@PathVariable("id") Long id) { + return ResponseEntity.ok(customerService.getById(id)); + } +} diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/CustomerResponse.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/CustomerResponse.java new file mode 100644 index 0000000000..9ec96dd4ac --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/CustomerResponse.java @@ -0,0 +1,27 @@ +package com.baeldung.swaggerresponses.response; + +public class CustomerResponse { + + private final Long id; + private final String firstName; + private final String lastName; + + public CustomerResponse(Long id, String firstName, String lastName) { + this.id = id; + this.firstName = firstName; + this.lastName = lastName; + } + + public Long getId() { + return id; + } + + public String getFirstName() { + return firstName; + } + + public String getLastName() { + return lastName; + } + +} diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/ErrorResponse.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/ErrorResponse.java new file mode 100644 index 0000000000..7779712e6f --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/response/ErrorResponse.java @@ -0,0 +1,23 @@ +package com.baeldung.swaggerresponses.response; + +public class ErrorResponse { + + private String error; + private String message; + + public String getError() { + return error; + } + + public void setError(String error) { + this.error = error; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/CustomerService.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/CustomerService.java new file mode 100644 index 0000000000..92ba1037d3 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/CustomerService.java @@ -0,0 +1,8 @@ +package com.baeldung.swaggerresponses.service; + +import com.baeldung.swaggerresponses.response.CustomerResponse; + +public interface CustomerService { + + CustomerResponse getById(Long id); +} diff --git a/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/DefaultCustomerService.java b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/DefaultCustomerService.java new file mode 100644 index 0000000000..ecced541ae --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger/src/main/java/com/baeldung/swaggerresponses/service/DefaultCustomerService.java @@ -0,0 +1,13 @@ +package com.baeldung.swaggerresponses.service; + +import com.baeldung.swaggerresponses.response.CustomerResponse; + +import org.springframework.stereotype.Service; + +@Service +public class DefaultCustomerService implements CustomerService { + @Override + public CustomerResponse getById(Long id) { + return new CustomerResponse(1L, "Jane", "Doe"); + } +} From b38eb760d189db3bf0ce4d4f8768efa0eb510424 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 19 Aug 2022 23:09:28 +0530 Subject: [PATCH 36/73] JAVA-13941 Incremented version of esapi (#12621) --- .../src/test/java/com/baeldung/jar/JarAppUnitTest.java | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/JarAppUnitTest.java b/core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/JarAppUnitTest.java index dc8c54eb31..707ce79624 100644 --- a/core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/JarAppUnitTest.java +++ b/core-java-modules/core-java-jar/src/test/java/com/baeldung/jar/JarAppUnitTest.java @@ -7,6 +7,6 @@ public class JarAppUnitTest { @Test public void findClassTest(){ - Assert.assertTrue(JarApp.findObjectMapperClass().endsWith("jackson-databind-2.13.0.jar")); + Assert.assertTrue(JarApp.findObjectMapperClass().endsWith("jackson-databind-2.13.3.jar")); } } diff --git a/pom.xml b/pom.xml index 8d821cdca5..683d6e6a1c 100644 --- a/pom.xml +++ b/pom.xml @@ -1369,7 +1369,7 @@ 3.0.0 1.8 1.2.17 - 2.2.2.0 + 2.5.0.0 1.33 1.33 2.21.0 @@ -1400,4 +1400,4 @@ 3.2.2
- \ No newline at end of file + From 14c998c3ac7567df1a82eabb0e7bdd8e7265480f Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Sat, 20 Aug 2022 13:47:25 +0530 Subject: [PATCH 37/73] JAVA-13856 Create new security-modules (#12622) --- pom.xml | 22 +- .../apache-shiro}/.gitignore | 0 .../apache-shiro}/README.md | 0 .../apache-shiro}/pom.xml | 2 +- .../comparison/shiro/CustomRealm.java | 0 .../comparison/shiro/ShiroApplication.java | 0 .../shiro/controllers/ShiroController.java | 0 .../shiro/models/UserCredentials.java | 0 .../springsecurity/Application.java | 0 .../springsecurity/config/SecurityConfig.java | 0 .../springsecurity/web/SpringController.java | 0 .../main/java/com/baeldung/intro/Main.java | 0 .../com/baeldung/intro/MyCustomRealm.java | 0 .../intro/ShiroSpringApplication.java | 0 .../controllers/ShiroSpringController.java | 0 .../intro/models/UserCredentials.java | 0 .../com/baeldung/permissions/custom/Main.java | 0 .../permissions/custom/PathPermission.java | 0 .../custom/PathPermissionResolver.java | 0 .../src/main/resources/application.properties | 0 .../shiro/permissions/custom/shiro.ini | 0 .../src/main/resources/log4j.properties | 0 .../src/main/resources/logback.xml | 0 .../src/main/resources/shiro.ini | 0 .../resources/templates/comparison/home.ftl | 0 .../resources/templates/comparison/index.ftl | 0 .../resources/templates/comparison/login.ftl | 0 .../src/main/resources/templates/index.ftl | 0 .../src/main/resources/templates/login.ftl | 0 .../src/main/resources/templates/secure.ftl | 0 .../comparison/shiro/SpringContextTest.java | 0 .../springsecurity/SpringContextTest.java | 0 .../src/test/resources/logback-test.xml | 0 {cas => security-modules/cas}/README.md | 0 .../cas}/cas-secured-app/.gitignore | 0 .../cas}/cas-secured-app/README.md | 0 .../cas}/cas-secured-app/pom.xml | 0 .../cassecuredapp/CasSecuredApplication.java | 0 .../config/WebSecurityConfig.java | 0 .../controllers/AuthController.java | 0 .../controllers/IndexController.java | 0 .../controllers/SecuredController.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logback.xml | 0 .../main/resources/templates/auth/logout.ftl | 0 .../src/main/resources/templates/index.ftl | 0 .../main/resources/templates/secure/index.ftl | 0 .../CasSecuredApplicationIntegrationTest.java | 0 .../cas}/cas-server/.gitignore | 0 .../cas}/cas-server/.mergify.yml | 0 .../cas}/cas-server/.travis.yml | 0 .../cas}/cas-server/Dockerfile | 0 .../cas}/cas-server/LICENSE.txt | 0 .../cas}/cas-server/build.gradle | 0 .../cas}/cas-server/docker-build.sh | 0 .../cas}/cas-server/docker-compose.yml | 0 .../cas}/cas-server/docker-push.sh | 0 .../cas}/cas-server/docker-run.sh | 0 .../cas-server/etc/cas/config/cas.properties | 0 .../cas}/cas-server/etc/cas/config/log4j2.xml | 0 .../cas}/cas-server/etc/cas/saml/.gitkeep | 0 .../cas-server/etc/cas/services/.donotdel | 0 .../cas}/cas-server/etc/cas/thekeystore | Bin .../cas}/cas-server/gradle.properties | 0 .../cas}/cas-server/gradle/dockerjib.gradle | 0 .../cas}/cas-server/gradle/springboot.gradle | 0 .../cas}/cas-server/gradle/tasks.gradle | 0 .../gradle/wrapper/gradle-wrapper.properties | 0 .../cas}/cas-server/gradlew | 0 .../cas}/cas-server/gradlew.bat | 200 +++++----- .../cas}/cas-server/settings.gradle | 0 .../src/main/jib/docker/entrypoint.sh | 0 .../src/main/resources/application.properties | 0 .../create_test_db_and_users_tbl.sql | 0 .../resources/etc/cas/config/cas.properties | 0 .../etc/cas/services/casSecuredApp-8900.json | 0 .../src/main/resources/etc/cas/thekeystore | Bin {cas => security-modules/cas}/pom.xml | 2 +- .../cloud-foundry-uaa}/README.md | 0 .../cloud-foundry-uaa}/cf-uaa-config/uaa.yml | 0 .../cf-uaa-oauth2-client/pom.xml | 0 .../client/CFUAAOAuth2ClientApplication.java | 0 .../client/CFUAAOAuth2ClientController.java | 158 ++++---- .../src/main/resources/application.properties | 0 .../src/main/resources/templates/index.html | 0 .../cf-uaa-oauth2-resource-server/pom.xml | 0 .../CFUAAOAuth2ResourceServerApplication.java | 0 ...UAAOAuth2ResourceServerRestController.java | 56 +-- ...h2ResourceServerSecurityConfiguration.java | 40 +- .../src/main/resources/application.properties | 0 .../cloud-foundry-uaa}/pom.xml | 2 +- .../java-ee-8-security-api}/README.md | 0 .../app-auth-basic-store-db/pom.xml | 0 .../javaee/security/AdminServlet.java | 0 .../baeldung/javaee/security/AppConfig.java | 0 .../javaee/security/DatabaseSetupServlet.java | 0 .../baeldung/javaee/security/UserServlet.java | 0 .../src/main/liberty/config/server.xml | 0 .../src/main/resources/logback.xml | 0 .../app-auth-custom-form-store-custom/pom.xml | 0 .../baeldung/javaee/security/AppConfig.java | 0 .../InMemoryIdentityStore4Authentication.java | 0 .../InMemoryIdentityStore4Authorization.java | 0 .../baeldung/javaee/security/LoginBean.java | 0 .../javaee/security/WelcomeServlet.java | 0 .../src/main/liberty/config/server.xml | 0 .../src/main/resources/logback.xml | 0 .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/login-error.html | 0 .../src/main/webapp/login.xhtml | 0 .../src/main/webapp/welcome.xhtml | 0 .../app-auth-custom-no-store/pom.xml | 0 .../javaee/security/AdminServlet.java | 0 .../baeldung/javaee/security/AppConfig.java | 0 .../javaee/security/CustomAuthentication.java | 0 .../javaee/security/CustomPrincipal.java | 0 .../baeldung/javaee/security/UserDetail.java | 0 .../src/main/liberty/config/server.xml | 0 .../src/main/resources/logback.xml | 0 .../src/main/webapp/login-error.html | 0 .../src/main/webapp/login.html | 0 .../app-auth-form-store-ldap/pom.xml | 0 .../javaee/security/AdminServlet.java | 0 .../baeldung/javaee/security/AppConfig.java | 0 .../javaee/security/LdapSetupServlet.java | 0 .../baeldung/javaee/security/UserServlet.java | 0 .../src/main/liberty/config/server.xml | 0 .../src/main/resources/logback.xml | 0 .../src/main/resources/users.ldif | 0 .../src/main/webapp/login-error.html | 0 .../src/main/webapp/login.html | 0 .../java-ee-8-security-api}/pom.xml | 2 +- .../jee-7-security}/README.md | 0 .../jee-7-security}/pom.xml | 2 +- .../SecurityWebApplicationInitializer.java | 0 .../springsecurity/SpringSecurityConfig.java | 0 .../controller/HomeController.java | 0 .../controller/LoginController.java | 0 .../src/main/resources/logback.xml | 0 .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/faces-config.xml | 0 .../main/webapp/WEB-INF/spring/security.xml | 0 .../src/main/webapp/WEB-INF/views/admin.jsp | 0 .../src/main/webapp/WEB-INF/views/home.jsp | 0 .../src/main/webapp/WEB-INF/views/login.jsp | 0 .../src/main/webapp/WEB-INF/views/user.jsp | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../jee-7-security}/src/main/webapp/index.jsp | 0 .../src/main/webapp/secure.jsp | 0 {jjwt => security-modules/jjwt}/.gitignore | 0 {jjwt => security-modules/jjwt}/README.md | 0 {jjwt => security-modules/jjwt}/pom.xml | 2 +- .../jjwtfun/JJWTFunApplication.java | 0 .../jjwtfun/config/CSRFConfig.java | 0 .../config/JWTCsrfTokenRepository.java | 0 .../jjwtfun/config/WebSecurityConfig.java | 0 .../jjwtfun/controller/BaseController.java | 0 .../controller/DynamicJWTController.java | 0 .../jjwtfun/controller/FormController.java | 0 .../jjwtfun/controller/HomeController.java | 0 .../jjwtfun/controller/SecretsController.java | 0 .../controller/StaticJWTController.java | 0 .../jjwtfun/model/JwtResponse.java | 0 .../jjwtfun/service/SecretService.java | 0 .../jjwtfun/util/JWTDecoderUtil.java | 0 .../src/main/resources/application.properties | 0 .../jjwt}/src/main/resources/logback.xml | 0 .../main/resources/templates/expired-jwt.html | 0 .../resources/templates/fragments/head.html | 0 .../templates/jwt-csrf-form-result.html | 0 .../resources/templates/jwt-csrf-form.html | 0 .../DemoApplicationIntegrationTest.java | 0 .../jjwtfun/util/JWTDecoderUtilUnitTest.java | 0 .../oauth2-framework-impl}/README.md | 0 .../oauth2-authorization-server/pom.xml | 0 .../server/OAuth2ServerApplication.java | 0 .../authorization/server/PEMKeyUtils.java | 34 +- .../server/api/AuthorizationEndpoint.java | 370 +++++++++--------- .../authorization/server/api/JWKEndpoint.java | 76 ++-- .../server/api/TokenEndpoint.java | 0 .../handler/AbstractGrantTypeHandler.java | 174 ++++---- .../AuthorizationCodeGrantTypeHandler.java | 108 ++--- .../AuthorizationGrantTypeHandler.java | 16 +- .../handler/RefreshTokenGrantTypeHandler.java | 144 +++---- .../server/model/AppDataRepository.java | 54 +-- .../server/model/AuthorizationCode.java | 146 +++---- .../authorization/server/model/Client.java | 124 +++--- .../authorization/server/model/User.java | 116 +++--- .../server/security/UserIdentityStore.java | 72 ++-- .../src/main/liberty/config/server.xml | 0 .../META-INF/microprofile-config.properties | 0 .../main/resources/META-INF/persistence.xml | 26 +- .../main/resources/META-INF/private-key.pem | 0 .../main/resources/META-INF/public-key.pem | 0 .../src/main/resources/data.sql | 4 +- .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/authorize.jsp | 108 ++--- .../src/main/webapp/error.jsp | 48 +-- .../src/main/webapp/login-error.jsp | 0 .../src/main/webapp/login.jsp | 96 ++--- .../oauth2-client/pom.xml | 0 .../oauth2/client/AbstractServlet.java | 46 +-- .../client/AuthorizationCodeServlet.java | 78 ++-- .../oauth2/client/CallbackServlet.java | 134 +++---- .../oauth2/client/DownstreamCallServlet.java | 98 ++--- .../oauth2/client/RefreshTokenServlet.java | 114 +++--- .../src/main/liberty/config/server.xml | 0 .../META-INF/microprofile-config.properties | 0 .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 8 +- .../oauth2-client/src/main/webapp/index.jsp | 0 .../oauth2-resource-server/pom.xml | 82 ++-- .../OAuth2ResourceServerApplication.java | 0 .../server/secure/ProtectedResource.java | 0 .../src/main/liberty/config/server.xml | 0 .../META-INF/microprofile-config.properties | 2 +- .../main/resources/META-INF/public-key.pem | 0 .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/index.html | 0 .../oauth2-framework-impl}/pom.xml | 6 + security-modules/pom.xml | 27 ++ .../sql-injection-samples/.gitignore | 0 .../sql-injection-samples/README.md | 0 .../sql-injection-samples/derby.log | 13 + .../sql-injection-samples/pom.xml | 0 .../examples/security/sql/Account.java | 0 .../examples/security/sql/AccountDAO.java | 0 .../examples/security/sql/AccountDTO.java | 0 .../sql/SqlInjectionSamplesApplication.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/logback.xml | 0 ...qlInjectionSamplesApplicationUnitTest.java | 0 .../src/test/resources/application-test.yml | 0 .../src/test/resources/data.sql | 0 .../src/test/resources/logback-test.xml | 0 .../src/test/resources/schema.sql | 0 237 files changed, 1420 insertions(+), 1392 deletions(-) rename {apache-shiro => security-modules/apache-shiro}/.gitignore (100%) rename {apache-shiro => security-modules/apache-shiro}/README.md (100%) rename {apache-shiro => security-modules/apache-shiro}/pom.xml (97%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/comparison/springsecurity/Application.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/intro/Main.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/intro/MyCustomRealm.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/intro/ShiroSpringApplication.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/intro/models/UserCredentials.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/permissions/custom/Main.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/permissions/custom/PathPermission.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/application.properties (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/com/baeldung/shiro/permissions/custom/shiro.ini (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/log4j.properties (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/logback.xml (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/shiro.ini (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/templates/comparison/home.ftl (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/templates/comparison/index.ftl (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/templates/comparison/login.ftl (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/templates/index.ftl (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/templates/login.ftl (100%) rename {apache-shiro => security-modules/apache-shiro}/src/main/resources/templates/secure.ftl (100%) rename {apache-shiro => security-modules/apache-shiro}/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java (100%) rename {apache-shiro => security-modules/apache-shiro}/src/test/resources/logback-test.xml (100%) rename {cas => security-modules/cas}/README.md (100%) rename {cas => security-modules/cas}/cas-secured-app/.gitignore (100%) rename {cas => security-modules/cas}/cas-secured-app/README.md (100%) rename {cas => security-modules/cas}/cas-secured-app/pom.xml (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredApplication.java (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/config/WebSecurityConfig.java (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/AuthController.java (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/IndexController.java (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/SecuredController.java (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/resources/application.properties (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/resources/logback.xml (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/resources/templates/auth/logout.ftl (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/resources/templates/index.ftl (100%) rename {cas => security-modules/cas}/cas-secured-app/src/main/resources/templates/secure/index.ftl (100%) rename {cas => security-modules/cas}/cas-secured-app/src/test/java/com/baeldung/cassecuredapp/CasSecuredApplicationIntegrationTest.java (100%) rename {cas => security-modules/cas}/cas-server/.gitignore (100%) mode change 100755 => 100644 rename {cas => security-modules/cas}/cas-server/.mergify.yml (100%) rename {cas => security-modules/cas}/cas-server/.travis.yml (100%) rename {cas => security-modules/cas}/cas-server/Dockerfile (100%) rename {cas => security-modules/cas}/cas-server/LICENSE.txt (100%) rename {cas => security-modules/cas}/cas-server/build.gradle (100%) rename {cas => security-modules/cas}/cas-server/docker-build.sh (100%) mode change 100755 => 100644 rename {cas => security-modules/cas}/cas-server/docker-compose.yml (100%) rename {cas => security-modules/cas}/cas-server/docker-push.sh (100%) mode change 100755 => 100644 rename {cas => security-modules/cas}/cas-server/docker-run.sh (100%) mode change 100755 => 100644 rename {cas => security-modules/cas}/cas-server/etc/cas/config/cas.properties (100%) rename {cas => security-modules/cas}/cas-server/etc/cas/config/log4j2.xml (100%) rename {cas => security-modules/cas}/cas-server/etc/cas/saml/.gitkeep (100%) rename {cas => security-modules/cas}/cas-server/etc/cas/services/.donotdel (100%) rename {cas => security-modules/cas}/cas-server/etc/cas/thekeystore (100%) rename {cas => security-modules/cas}/cas-server/gradle.properties (100%) rename {cas => security-modules/cas}/cas-server/gradle/dockerjib.gradle (100%) rename {cas => security-modules/cas}/cas-server/gradle/springboot.gradle (100%) rename {cas => security-modules/cas}/cas-server/gradle/tasks.gradle (100%) rename {cas => security-modules/cas}/cas-server/gradle/wrapper/gradle-wrapper.properties (100%) rename {cas => security-modules/cas}/cas-server/gradlew (100%) mode change 100755 => 100644 rename {cas => security-modules/cas}/cas-server/gradlew.bat (96%) rename {cas => security-modules/cas}/cas-server/settings.gradle (100%) rename {cas => security-modules/cas}/cas-server/src/main/jib/docker/entrypoint.sh (100%) mode change 100755 => 100644 rename {cas => security-modules/cas}/cas-server/src/main/resources/application.properties (100%) rename {cas => security-modules/cas}/cas-server/src/main/resources/create_test_db_and_users_tbl.sql (100%) rename {cas => security-modules/cas}/cas-server/src/main/resources/etc/cas/config/cas.properties (100%) rename {cas => security-modules/cas}/cas-server/src/main/resources/etc/cas/services/casSecuredApp-8900.json (100%) rename {cas => security-modules/cas}/cas-server/src/main/resources/etc/cas/thekeystore (100%) rename {cas => security-modules/cas}/pom.xml (91%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/README.md (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-config/uaa.yml (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-client/pom.xml (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientApplication.java (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientController.java (97%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-client/src/main/resources/application.properties (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-client/src/main/resources/templates/index.html (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-resource-server/pom.xml (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerApplication.java (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java (97%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerSecurityConfiguration.java (97%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/cf-uaa-oauth2-resource-server/src/main/resources/application.properties (100%) rename {cloud-foundry-uaa => security-modules/cloud-foundry-uaa}/pom.xml (92%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/README.md (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-basic-store-db/pom.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AdminServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AppConfig.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/DatabaseSetupServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/UserServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-basic-store-db/src/main/liberty/config/server.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-basic-store-db/src/main/resources/logback.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/pom.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/AppConfig.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authentication.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authorization.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/LoginBean.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/WelcomeServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/liberty/config/server.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/resources/logback.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/beans.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/web.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/webapp/login-error.html (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/webapp/login.xhtml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-form-store-custom/src/main/webapp/welcome.xhtml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/pom.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AdminServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AppConfig.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomAuthentication.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomPrincipal.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/UserDetail.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/liberty/config/server.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/resources/logback.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/webapp/login-error.html (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-custom-no-store/src/main/webapp/login.html (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/pom.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AdminServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AppConfig.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/LdapSetupServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/UserServlet.java (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/liberty/config/server.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/resources/logback.xml (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/resources/users.ldif (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/webapp/login-error.html (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/app-auth-form-store-ldap/src/main/webapp/login.html (100%) rename {java-ee-8-security-api => security-modules/java-ee-8-security-api}/pom.xml (98%) rename {jee-7-security => security-modules/jee-7-security}/README.md (100%) rename {jee-7-security => security-modules/jee-7-security}/pom.xml (97%) rename {jee-7-security => security-modules/jee-7-security}/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/java/com/baeldung/springsecurity/controller/HomeController.java (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/java/com/baeldung/springsecurity/controller/LoginController.java (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/resources/logback.xml (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/beans.xml (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/faces-config.xml (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/spring/security.xml (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/views/admin.jsp (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/views/home.jsp (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/views/login.jsp (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/views/user.jsp (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/WEB-INF/web.xml (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/index.jsp (100%) rename {jee-7-security => security-modules/jee-7-security}/src/main/webapp/secure.jsp (100%) rename {jjwt => security-modules/jjwt}/.gitignore (100%) rename {jjwt => security-modules/jjwt}/README.md (100%) rename {jjwt => security-modules/jjwt}/pom.xml (96%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/JJWTFunApplication.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/config/CSRFConfig.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/config/JWTCsrfTokenRepository.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/config/WebSecurityConfig.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/controller/BaseController.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/controller/DynamicJWTController.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/controller/FormController.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/controller/HomeController.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/controller/SecretsController.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/controller/StaticJWTController.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/model/JwtResponse.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/service/SecretService.java (100%) rename {jjwt => security-modules/jjwt}/src/main/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtil.java (100%) rename {jjwt => security-modules/jjwt}/src/main/resources/application.properties (100%) rename {jjwt => security-modules/jjwt}/src/main/resources/logback.xml (100%) rename {jjwt => security-modules/jjwt}/src/main/resources/templates/expired-jwt.html (100%) rename {jjwt => security-modules/jjwt}/src/main/resources/templates/fragments/head.html (100%) rename {jjwt => security-modules/jjwt}/src/main/resources/templates/jwt-csrf-form-result.html (100%) rename {jjwt => security-modules/jjwt}/src/main/resources/templates/jwt-csrf-form.html (100%) rename {jjwt => security-modules/jjwt}/src/test/java/io/jsonwebtoken/jjwtfun/DemoApplicationIntegrationTest.java (100%) rename {jjwt => security-modules/jjwt}/src/test/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtilUnitTest.java (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/README.md (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/pom.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/OAuth2ServerApplication.java (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/PEMKeyUtils.java (96%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/AuthorizationEndpoint.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/JWKEndpoint.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/TokenEndpoint.java (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AbstractGrantTypeHandler.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationCodeGrantTypeHandler.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationGrantTypeHandler.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/RefreshTokenGrantTypeHandler.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AppDataRepository.java (96%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AuthorizationCode.java (95%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/Client.java (95%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/User.java (95%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/security/UserIdentityStore.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/liberty/config/server.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/resources/META-INF/microprofile-config.properties (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/resources/META-INF/persistence.xml (98%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/resources/META-INF/private-key.pem (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/resources/META-INF/public-key.pem (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/resources/data.sql (99%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/webapp/WEB-INF/beans.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/webapp/authorize.jsp (96%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/webapp/error.jsp (94%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/webapp/login-error.jsp (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-authorization-server/src/main/webapp/login.jsp (96%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/pom.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/java/com/baeldung/oauth2/client/AbstractServlet.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/java/com/baeldung/oauth2/client/AuthorizationCodeServlet.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/java/com/baeldung/oauth2/client/CallbackServlet.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/java/com/baeldung/oauth2/client/DownstreamCallServlet.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/java/com/baeldung/oauth2/client/RefreshTokenServlet.java (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/liberty/config/server.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/resources/META-INF/microprofile-config.properties (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/webapp/WEB-INF/beans.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/webapp/WEB-INF/web.xml (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-client/src/main/webapp/index.jsp (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/pom.xml (97%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/OAuth2ResourceServerApplication.java (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/secure/ProtectedResource.java (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/src/main/liberty/config/server.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/src/main/resources/META-INF/microprofile-config.properties (99%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/src/main/resources/META-INF/public-key.pem (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/src/main/webapp/WEB-INF/beans.xml (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/oauth2-resource-server/src/main/webapp/index.html (100%) rename {oauth2-framework-impl => security-modules/oauth2-framework-impl}/pom.xml (96%) create mode 100644 security-modules/pom.xml rename {software-security => security-modules}/sql-injection-samples/.gitignore (100%) rename {software-security => security-modules}/sql-injection-samples/README.md (100%) create mode 100644 security-modules/sql-injection-samples/derby.log rename {software-security => security-modules}/sql-injection-samples/pom.xml (100%) rename {software-security => security-modules}/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/Account.java (100%) rename {software-security => security-modules}/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDAO.java (100%) rename {software-security => security-modules}/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDTO.java (100%) rename {software-security => security-modules}/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplication.java (100%) rename {software-security => security-modules}/sql-injection-samples/src/main/resources/application.properties (100%) rename {software-security => security-modules}/sql-injection-samples/src/main/resources/logback.xml (100%) rename {software-security => security-modules}/sql-injection-samples/src/test/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplicationUnitTest.java (100%) rename {software-security => security-modules}/sql-injection-samples/src/test/resources/application-test.yml (100%) rename {software-security => security-modules}/sql-injection-samples/src/test/resources/data.sql (100%) rename {software-security => security-modules}/sql-injection-samples/src/test/resources/logback-test.xml (100%) rename {software-security => security-modules}/sql-injection-samples/src/test/resources/schema.sql (100%) diff --git a/pom.xml b/pom.xml index 683d6e6a1c..178e852f5b 100644 --- a/pom.xml +++ b/pom.xml @@ -344,7 +344,6 @@ apache-poi apache-poi-2 apache-rocketmq - apache-shiro apache-spark apache-tapestry apache-thrift @@ -365,11 +364,9 @@ bazel blade bootique - cas cdi checker-plugin - cloud-foundry-uaa code-generation core-groovy-modules @@ -415,9 +412,6 @@ jackson-modules jackson-simple java-blockchain - - - javafx java-jdi java-lite @@ -431,14 +425,12 @@ javaxval jaxb jee-7 - jee-7-security jakarta-ee jersey jgit jgroups jhipster-5 jib - jjwt jmeter jmh java-native @@ -491,7 +483,6 @@ ninja open-liberty - oauth2-framework-impl orika osgi @@ -515,6 +506,7 @@ rxjava-modules atomikos reactive-systems + security-modules slack @@ -561,7 +553,6 @@ parent-java saas - software-security/sql-injection-samples spark-java spf4j @@ -775,7 +766,6 @@ apache-poi apache-poi-2 apache-rocketmq - apache-shiro apache-spark apache-tapestry apache-thrift @@ -796,11 +786,9 @@ bazel blade bootique - cas cdi checker-plugin - cloud-foundry-uaa code-generation core-groovy-modules @@ -846,9 +834,6 @@ jackson-modules jackson-simple java-blockchain - - - javafx java-jdi java-lite @@ -862,14 +847,12 @@ javaxval jaxb jee-7 - jee-7-security jakarta-ee jersey jgit jgroups jhipster-5 jib - jjwt jmeter jmh java-native @@ -924,7 +907,6 @@ ninja open-liberty - oauth2-framework-impl orika osgi @@ -948,6 +930,7 @@ rxjava-modules atomikos reactive-systems + security-modules slack @@ -986,7 +969,6 @@ parent-java saas - software-security/sql-injection-samples spark-java spf4j diff --git a/apache-shiro/.gitignore b/security-modules/apache-shiro/.gitignore similarity index 100% rename from apache-shiro/.gitignore rename to security-modules/apache-shiro/.gitignore diff --git a/apache-shiro/README.md b/security-modules/apache-shiro/README.md similarity index 100% rename from apache-shiro/README.md rename to security-modules/apache-shiro/README.md diff --git a/apache-shiro/pom.xml b/security-modules/apache-shiro/pom.xml similarity index 97% rename from apache-shiro/pom.xml rename to security-modules/apache-shiro/pom.xml index 850653ef98..2ab168ded5 100644 --- a/apache-shiro/pom.xml +++ b/security-modules/apache-shiro/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java b/security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/CustomRealm.java diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java b/security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/ShiroApplication.java diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java b/security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/controllers/ShiroController.java diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java b/security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/comparison/shiro/models/UserCredentials.java diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/Application.java b/security-modules/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/Application.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/Application.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/Application.java diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java b/security-modules/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/config/SecurityConfig.java diff --git a/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java b/security-modules/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/comparison/springsecurity/web/SpringController.java diff --git a/apache-shiro/src/main/java/com/baeldung/intro/Main.java b/security-modules/apache-shiro/src/main/java/com/baeldung/intro/Main.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/intro/Main.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/intro/Main.java diff --git a/apache-shiro/src/main/java/com/baeldung/intro/MyCustomRealm.java b/security-modules/apache-shiro/src/main/java/com/baeldung/intro/MyCustomRealm.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/intro/MyCustomRealm.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/intro/MyCustomRealm.java diff --git a/apache-shiro/src/main/java/com/baeldung/intro/ShiroSpringApplication.java b/security-modules/apache-shiro/src/main/java/com/baeldung/intro/ShiroSpringApplication.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/intro/ShiroSpringApplication.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/intro/ShiroSpringApplication.java diff --git a/apache-shiro/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java b/security-modules/apache-shiro/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/intro/controllers/ShiroSpringController.java diff --git a/apache-shiro/src/main/java/com/baeldung/intro/models/UserCredentials.java b/security-modules/apache-shiro/src/main/java/com/baeldung/intro/models/UserCredentials.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/intro/models/UserCredentials.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/intro/models/UserCredentials.java diff --git a/apache-shiro/src/main/java/com/baeldung/permissions/custom/Main.java b/security-modules/apache-shiro/src/main/java/com/baeldung/permissions/custom/Main.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/permissions/custom/Main.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/permissions/custom/Main.java diff --git a/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermission.java b/security-modules/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermission.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermission.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermission.java diff --git a/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java b/security-modules/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java similarity index 100% rename from apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java rename to security-modules/apache-shiro/src/main/java/com/baeldung/permissions/custom/PathPermissionResolver.java diff --git a/apache-shiro/src/main/resources/application.properties b/security-modules/apache-shiro/src/main/resources/application.properties similarity index 100% rename from apache-shiro/src/main/resources/application.properties rename to security-modules/apache-shiro/src/main/resources/application.properties diff --git a/apache-shiro/src/main/resources/com/baeldung/shiro/permissions/custom/shiro.ini b/security-modules/apache-shiro/src/main/resources/com/baeldung/shiro/permissions/custom/shiro.ini similarity index 100% rename from apache-shiro/src/main/resources/com/baeldung/shiro/permissions/custom/shiro.ini rename to security-modules/apache-shiro/src/main/resources/com/baeldung/shiro/permissions/custom/shiro.ini diff --git a/apache-shiro/src/main/resources/log4j.properties b/security-modules/apache-shiro/src/main/resources/log4j.properties similarity index 100% rename from apache-shiro/src/main/resources/log4j.properties rename to security-modules/apache-shiro/src/main/resources/log4j.properties diff --git a/apache-shiro/src/main/resources/logback.xml b/security-modules/apache-shiro/src/main/resources/logback.xml similarity index 100% rename from apache-shiro/src/main/resources/logback.xml rename to security-modules/apache-shiro/src/main/resources/logback.xml diff --git a/apache-shiro/src/main/resources/shiro.ini b/security-modules/apache-shiro/src/main/resources/shiro.ini similarity index 100% rename from apache-shiro/src/main/resources/shiro.ini rename to security-modules/apache-shiro/src/main/resources/shiro.ini diff --git a/apache-shiro/src/main/resources/templates/comparison/home.ftl b/security-modules/apache-shiro/src/main/resources/templates/comparison/home.ftl similarity index 100% rename from apache-shiro/src/main/resources/templates/comparison/home.ftl rename to security-modules/apache-shiro/src/main/resources/templates/comparison/home.ftl diff --git a/apache-shiro/src/main/resources/templates/comparison/index.ftl b/security-modules/apache-shiro/src/main/resources/templates/comparison/index.ftl similarity index 100% rename from apache-shiro/src/main/resources/templates/comparison/index.ftl rename to security-modules/apache-shiro/src/main/resources/templates/comparison/index.ftl diff --git a/apache-shiro/src/main/resources/templates/comparison/login.ftl b/security-modules/apache-shiro/src/main/resources/templates/comparison/login.ftl similarity index 100% rename from apache-shiro/src/main/resources/templates/comparison/login.ftl rename to security-modules/apache-shiro/src/main/resources/templates/comparison/login.ftl diff --git a/apache-shiro/src/main/resources/templates/index.ftl b/security-modules/apache-shiro/src/main/resources/templates/index.ftl similarity index 100% rename from apache-shiro/src/main/resources/templates/index.ftl rename to security-modules/apache-shiro/src/main/resources/templates/index.ftl diff --git a/apache-shiro/src/main/resources/templates/login.ftl b/security-modules/apache-shiro/src/main/resources/templates/login.ftl similarity index 100% rename from apache-shiro/src/main/resources/templates/login.ftl rename to security-modules/apache-shiro/src/main/resources/templates/login.ftl diff --git a/apache-shiro/src/main/resources/templates/secure.ftl b/security-modules/apache-shiro/src/main/resources/templates/secure.ftl similarity index 100% rename from apache-shiro/src/main/resources/templates/secure.ftl rename to security-modules/apache-shiro/src/main/resources/templates/secure.ftl diff --git a/apache-shiro/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java b/security-modules/apache-shiro/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java similarity index 100% rename from apache-shiro/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java rename to security-modules/apache-shiro/src/test/java/com/baeldung/comparison/shiro/SpringContextTest.java diff --git a/apache-shiro/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java b/security-modules/apache-shiro/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java similarity index 100% rename from apache-shiro/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java rename to security-modules/apache-shiro/src/test/java/com/baeldung/comparison/springsecurity/SpringContextTest.java diff --git a/apache-shiro/src/test/resources/logback-test.xml b/security-modules/apache-shiro/src/test/resources/logback-test.xml similarity index 100% rename from apache-shiro/src/test/resources/logback-test.xml rename to security-modules/apache-shiro/src/test/resources/logback-test.xml diff --git a/cas/README.md b/security-modules/cas/README.md similarity index 100% rename from cas/README.md rename to security-modules/cas/README.md diff --git a/cas/cas-secured-app/.gitignore b/security-modules/cas/cas-secured-app/.gitignore similarity index 100% rename from cas/cas-secured-app/.gitignore rename to security-modules/cas/cas-secured-app/.gitignore diff --git a/cas/cas-secured-app/README.md b/security-modules/cas/cas-secured-app/README.md similarity index 100% rename from cas/cas-secured-app/README.md rename to security-modules/cas/cas-secured-app/README.md diff --git a/cas/cas-secured-app/pom.xml b/security-modules/cas/cas-secured-app/pom.xml similarity index 100% rename from cas/cas-secured-app/pom.xml rename to security-modules/cas/cas-secured-app/pom.xml diff --git a/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredApplication.java b/security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredApplication.java similarity index 100% rename from cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredApplication.java rename to security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/CasSecuredApplication.java diff --git a/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/config/WebSecurityConfig.java b/security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/config/WebSecurityConfig.java similarity index 100% rename from cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/config/WebSecurityConfig.java rename to security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/config/WebSecurityConfig.java diff --git a/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/AuthController.java b/security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/AuthController.java similarity index 100% rename from cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/AuthController.java rename to security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/AuthController.java diff --git a/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/IndexController.java b/security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/IndexController.java similarity index 100% rename from cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/IndexController.java rename to security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/IndexController.java diff --git a/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/SecuredController.java b/security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/SecuredController.java similarity index 100% rename from cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/SecuredController.java rename to security-modules/cas/cas-secured-app/src/main/java/com/baeldung/cassecuredapp/controllers/SecuredController.java diff --git a/cas/cas-secured-app/src/main/resources/application.properties b/security-modules/cas/cas-secured-app/src/main/resources/application.properties similarity index 100% rename from cas/cas-secured-app/src/main/resources/application.properties rename to security-modules/cas/cas-secured-app/src/main/resources/application.properties diff --git a/cas/cas-secured-app/src/main/resources/logback.xml b/security-modules/cas/cas-secured-app/src/main/resources/logback.xml similarity index 100% rename from cas/cas-secured-app/src/main/resources/logback.xml rename to security-modules/cas/cas-secured-app/src/main/resources/logback.xml diff --git a/cas/cas-secured-app/src/main/resources/templates/auth/logout.ftl b/security-modules/cas/cas-secured-app/src/main/resources/templates/auth/logout.ftl similarity index 100% rename from cas/cas-secured-app/src/main/resources/templates/auth/logout.ftl rename to security-modules/cas/cas-secured-app/src/main/resources/templates/auth/logout.ftl diff --git a/cas/cas-secured-app/src/main/resources/templates/index.ftl b/security-modules/cas/cas-secured-app/src/main/resources/templates/index.ftl similarity index 100% rename from cas/cas-secured-app/src/main/resources/templates/index.ftl rename to security-modules/cas/cas-secured-app/src/main/resources/templates/index.ftl diff --git a/cas/cas-secured-app/src/main/resources/templates/secure/index.ftl b/security-modules/cas/cas-secured-app/src/main/resources/templates/secure/index.ftl similarity index 100% rename from cas/cas-secured-app/src/main/resources/templates/secure/index.ftl rename to security-modules/cas/cas-secured-app/src/main/resources/templates/secure/index.ftl diff --git a/cas/cas-secured-app/src/test/java/com/baeldung/cassecuredapp/CasSecuredApplicationIntegrationTest.java b/security-modules/cas/cas-secured-app/src/test/java/com/baeldung/cassecuredapp/CasSecuredApplicationIntegrationTest.java similarity index 100% rename from cas/cas-secured-app/src/test/java/com/baeldung/cassecuredapp/CasSecuredApplicationIntegrationTest.java rename to security-modules/cas/cas-secured-app/src/test/java/com/baeldung/cassecuredapp/CasSecuredApplicationIntegrationTest.java diff --git a/cas/cas-server/.gitignore b/security-modules/cas/cas-server/.gitignore old mode 100755 new mode 100644 similarity index 100% rename from cas/cas-server/.gitignore rename to security-modules/cas/cas-server/.gitignore diff --git a/cas/cas-server/.mergify.yml b/security-modules/cas/cas-server/.mergify.yml similarity index 100% rename from cas/cas-server/.mergify.yml rename to security-modules/cas/cas-server/.mergify.yml diff --git a/cas/cas-server/.travis.yml b/security-modules/cas/cas-server/.travis.yml similarity index 100% rename from cas/cas-server/.travis.yml rename to security-modules/cas/cas-server/.travis.yml diff --git a/cas/cas-server/Dockerfile b/security-modules/cas/cas-server/Dockerfile similarity index 100% rename from cas/cas-server/Dockerfile rename to security-modules/cas/cas-server/Dockerfile diff --git a/cas/cas-server/LICENSE.txt b/security-modules/cas/cas-server/LICENSE.txt similarity index 100% rename from cas/cas-server/LICENSE.txt rename to security-modules/cas/cas-server/LICENSE.txt diff --git a/cas/cas-server/build.gradle b/security-modules/cas/cas-server/build.gradle similarity index 100% rename from cas/cas-server/build.gradle rename to security-modules/cas/cas-server/build.gradle diff --git a/cas/cas-server/docker-build.sh b/security-modules/cas/cas-server/docker-build.sh old mode 100755 new mode 100644 similarity index 100% rename from cas/cas-server/docker-build.sh rename to security-modules/cas/cas-server/docker-build.sh diff --git a/cas/cas-server/docker-compose.yml b/security-modules/cas/cas-server/docker-compose.yml similarity index 100% rename from cas/cas-server/docker-compose.yml rename to security-modules/cas/cas-server/docker-compose.yml diff --git a/cas/cas-server/docker-push.sh b/security-modules/cas/cas-server/docker-push.sh old mode 100755 new mode 100644 similarity index 100% rename from cas/cas-server/docker-push.sh rename to security-modules/cas/cas-server/docker-push.sh diff --git a/cas/cas-server/docker-run.sh b/security-modules/cas/cas-server/docker-run.sh old mode 100755 new mode 100644 similarity index 100% rename from cas/cas-server/docker-run.sh rename to security-modules/cas/cas-server/docker-run.sh diff --git a/cas/cas-server/etc/cas/config/cas.properties b/security-modules/cas/cas-server/etc/cas/config/cas.properties similarity index 100% rename from cas/cas-server/etc/cas/config/cas.properties rename to security-modules/cas/cas-server/etc/cas/config/cas.properties diff --git a/cas/cas-server/etc/cas/config/log4j2.xml b/security-modules/cas/cas-server/etc/cas/config/log4j2.xml similarity index 100% rename from cas/cas-server/etc/cas/config/log4j2.xml rename to security-modules/cas/cas-server/etc/cas/config/log4j2.xml diff --git a/cas/cas-server/etc/cas/saml/.gitkeep b/security-modules/cas/cas-server/etc/cas/saml/.gitkeep similarity index 100% rename from cas/cas-server/etc/cas/saml/.gitkeep rename to security-modules/cas/cas-server/etc/cas/saml/.gitkeep diff --git a/cas/cas-server/etc/cas/services/.donotdel b/security-modules/cas/cas-server/etc/cas/services/.donotdel similarity index 100% rename from cas/cas-server/etc/cas/services/.donotdel rename to security-modules/cas/cas-server/etc/cas/services/.donotdel diff --git a/cas/cas-server/etc/cas/thekeystore b/security-modules/cas/cas-server/etc/cas/thekeystore similarity index 100% rename from cas/cas-server/etc/cas/thekeystore rename to security-modules/cas/cas-server/etc/cas/thekeystore diff --git a/cas/cas-server/gradle.properties b/security-modules/cas/cas-server/gradle.properties similarity index 100% rename from cas/cas-server/gradle.properties rename to security-modules/cas/cas-server/gradle.properties diff --git a/cas/cas-server/gradle/dockerjib.gradle b/security-modules/cas/cas-server/gradle/dockerjib.gradle similarity index 100% rename from cas/cas-server/gradle/dockerjib.gradle rename to security-modules/cas/cas-server/gradle/dockerjib.gradle diff --git a/cas/cas-server/gradle/springboot.gradle b/security-modules/cas/cas-server/gradle/springboot.gradle similarity index 100% rename from cas/cas-server/gradle/springboot.gradle rename to security-modules/cas/cas-server/gradle/springboot.gradle diff --git a/cas/cas-server/gradle/tasks.gradle b/security-modules/cas/cas-server/gradle/tasks.gradle similarity index 100% rename from cas/cas-server/gradle/tasks.gradle rename to security-modules/cas/cas-server/gradle/tasks.gradle diff --git a/cas/cas-server/gradle/wrapper/gradle-wrapper.properties b/security-modules/cas/cas-server/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from cas/cas-server/gradle/wrapper/gradle-wrapper.properties rename to security-modules/cas/cas-server/gradle/wrapper/gradle-wrapper.properties diff --git a/cas/cas-server/gradlew b/security-modules/cas/cas-server/gradlew old mode 100755 new mode 100644 similarity index 100% rename from cas/cas-server/gradlew rename to security-modules/cas/cas-server/gradlew diff --git a/cas/cas-server/gradlew.bat b/security-modules/cas/cas-server/gradlew.bat similarity index 96% rename from cas/cas-server/gradlew.bat rename to security-modules/cas/cas-server/gradlew.bat index 24467a141f..9618d8d960 100644 --- a/cas/cas-server/gradlew.bat +++ b/security-modules/cas/cas-server/gradlew.bat @@ -1,100 +1,100 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/cas/cas-server/settings.gradle b/security-modules/cas/cas-server/settings.gradle similarity index 100% rename from cas/cas-server/settings.gradle rename to security-modules/cas/cas-server/settings.gradle diff --git a/cas/cas-server/src/main/jib/docker/entrypoint.sh b/security-modules/cas/cas-server/src/main/jib/docker/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from cas/cas-server/src/main/jib/docker/entrypoint.sh rename to security-modules/cas/cas-server/src/main/jib/docker/entrypoint.sh diff --git a/cas/cas-server/src/main/resources/application.properties b/security-modules/cas/cas-server/src/main/resources/application.properties similarity index 100% rename from cas/cas-server/src/main/resources/application.properties rename to security-modules/cas/cas-server/src/main/resources/application.properties diff --git a/cas/cas-server/src/main/resources/create_test_db_and_users_tbl.sql b/security-modules/cas/cas-server/src/main/resources/create_test_db_and_users_tbl.sql similarity index 100% rename from cas/cas-server/src/main/resources/create_test_db_and_users_tbl.sql rename to security-modules/cas/cas-server/src/main/resources/create_test_db_and_users_tbl.sql diff --git a/cas/cas-server/src/main/resources/etc/cas/config/cas.properties b/security-modules/cas/cas-server/src/main/resources/etc/cas/config/cas.properties similarity index 100% rename from cas/cas-server/src/main/resources/etc/cas/config/cas.properties rename to security-modules/cas/cas-server/src/main/resources/etc/cas/config/cas.properties diff --git a/cas/cas-server/src/main/resources/etc/cas/services/casSecuredApp-8900.json b/security-modules/cas/cas-server/src/main/resources/etc/cas/services/casSecuredApp-8900.json similarity index 100% rename from cas/cas-server/src/main/resources/etc/cas/services/casSecuredApp-8900.json rename to security-modules/cas/cas-server/src/main/resources/etc/cas/services/casSecuredApp-8900.json diff --git a/cas/cas-server/src/main/resources/etc/cas/thekeystore b/security-modules/cas/cas-server/src/main/resources/etc/cas/thekeystore similarity index 100% rename from cas/cas-server/src/main/resources/etc/cas/thekeystore rename to security-modules/cas/cas-server/src/main/resources/etc/cas/thekeystore diff --git a/cas/pom.xml b/security-modules/cas/pom.xml similarity index 91% rename from cas/pom.xml rename to security-modules/cas/pom.xml index 2f24e41453..d40f303717 100644 --- a/cas/pom.xml +++ b/security-modules/cas/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/cloud-foundry-uaa/README.md b/security-modules/cloud-foundry-uaa/README.md similarity index 100% rename from cloud-foundry-uaa/README.md rename to security-modules/cloud-foundry-uaa/README.md diff --git a/cloud-foundry-uaa/cf-uaa-config/uaa.yml b/security-modules/cloud-foundry-uaa/cf-uaa-config/uaa.yml similarity index 100% rename from cloud-foundry-uaa/cf-uaa-config/uaa.yml rename to security-modules/cloud-foundry-uaa/cf-uaa-config/uaa.yml diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml similarity index 100% rename from cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientApplication.java b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientApplication.java similarity index 100% rename from cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientApplication.java rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientApplication.java diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientController.java b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientController.java similarity index 97% rename from cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientController.java rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientController.java index b1631ed327..bc745fc436 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientController.java +++ b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/java/com/baeldung/cfuaa/oauth2/client/CFUAAOAuth2ClientController.java @@ -1,80 +1,80 @@ -package com.baeldung.cfuaa.oauth2.client; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; -import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; -import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; -import org.springframework.security.oauth2.core.OAuth2AccessToken; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.RestTemplate; - -@RestController -public class CFUAAOAuth2ClientController { - - @Value("${resource.server.url}") - private String remoteResourceServer; - - private RestTemplate restTemplate; - - private OAuth2AuthorizedClientService authorizedClientService; - - public CFUAAOAuth2ClientController(OAuth2AuthorizedClientService authorizedClientService) { - this.authorizedClientService = authorizedClientService; - this.restTemplate = new RestTemplate(); - } - - @RequestMapping("/") - public String index(OAuth2AuthenticationToken authenticationToken) { - OAuth2AuthorizedClient oAuth2AuthorizedClient = this.authorizedClientService.loadAuthorizedClient(authenticationToken.getAuthorizedClientRegistrationId(), authenticationToken.getName()); - OAuth2AccessToken oAuth2AccessToken = oAuth2AuthorizedClient.getAccessToken(); - - String response = "Hello, " + authenticationToken.getPrincipal().getName(); - response += "

"; - response += "Here is your accees token :
" + oAuth2AccessToken.getTokenValue(); - response += "
"; - response += "
You can use it to call these Resource Server APIs:"; - response += "

"; - response += "Call Resource Server Read API"; - response += "
"; - response += "Call Resource Server Write API"; - return response; - } - - @RequestMapping("/read") - public String read(OAuth2AuthenticationToken authenticationToken) { - String url = remoteResourceServer + "/read"; - return callResourceServer(authenticationToken, url); - } - - @RequestMapping("/write") - public String write(OAuth2AuthenticationToken authenticationToken) { - String url = remoteResourceServer + "/write"; - return callResourceServer(authenticationToken, url); - } - - private String callResourceServer(OAuth2AuthenticationToken authenticationToken, String url) { - OAuth2AuthorizedClient oAuth2AuthorizedClient = this.authorizedClientService.loadAuthorizedClient(authenticationToken.getAuthorizedClientRegistrationId(), authenticationToken.getName()); - OAuth2AccessToken oAuth2AccessToken = oAuth2AuthorizedClient.getAccessToken(); - - HttpHeaders headers = new HttpHeaders(); - headers.add("Authorization", "Bearer " + oAuth2AccessToken.getTokenValue()); - - HttpEntity entity = new HttpEntity<>("parameters", headers); - ResponseEntity responseEntity = null; - - String response = null; - try { - responseEntity = restTemplate.exchange(url, HttpMethod.GET, entity, String.class); - response = responseEntity.getBody(); - } catch (HttpClientErrorException e) { - response = e.getMessage(); - } - return response; - } +package com.baeldung.cfuaa.oauth2.client; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClient; +import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService; +import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken; +import org.springframework.security.oauth2.core.OAuth2AccessToken; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; + +@RestController +public class CFUAAOAuth2ClientController { + + @Value("${resource.server.url}") + private String remoteResourceServer; + + private RestTemplate restTemplate; + + private OAuth2AuthorizedClientService authorizedClientService; + + public CFUAAOAuth2ClientController(OAuth2AuthorizedClientService authorizedClientService) { + this.authorizedClientService = authorizedClientService; + this.restTemplate = new RestTemplate(); + } + + @RequestMapping("/") + public String index(OAuth2AuthenticationToken authenticationToken) { + OAuth2AuthorizedClient oAuth2AuthorizedClient = this.authorizedClientService.loadAuthorizedClient(authenticationToken.getAuthorizedClientRegistrationId(), authenticationToken.getName()); + OAuth2AccessToken oAuth2AccessToken = oAuth2AuthorizedClient.getAccessToken(); + + String response = "Hello, " + authenticationToken.getPrincipal().getName(); + response += "

"; + response += "Here is your accees token :
" + oAuth2AccessToken.getTokenValue(); + response += "
"; + response += "
You can use it to call these Resource Server APIs:"; + response += "

"; + response += "Call Resource Server Read API"; + response += "
"; + response += "Call Resource Server Write API"; + return response; + } + + @RequestMapping("/read") + public String read(OAuth2AuthenticationToken authenticationToken) { + String url = remoteResourceServer + "/read"; + return callResourceServer(authenticationToken, url); + } + + @RequestMapping("/write") + public String write(OAuth2AuthenticationToken authenticationToken) { + String url = remoteResourceServer + "/write"; + return callResourceServer(authenticationToken, url); + } + + private String callResourceServer(OAuth2AuthenticationToken authenticationToken, String url) { + OAuth2AuthorizedClient oAuth2AuthorizedClient = this.authorizedClientService.loadAuthorizedClient(authenticationToken.getAuthorizedClientRegistrationId(), authenticationToken.getName()); + OAuth2AccessToken oAuth2AccessToken = oAuth2AuthorizedClient.getAccessToken(); + + HttpHeaders headers = new HttpHeaders(); + headers.add("Authorization", "Bearer " + oAuth2AccessToken.getTokenValue()); + + HttpEntity entity = new HttpEntity<>("parameters", headers); + ResponseEntity responseEntity = null; + + String response = null; + try { + responseEntity = restTemplate.exchange(url, HttpMethod.GET, entity, String.class); + response = responseEntity.getBody(); + } catch (HttpClientErrorException e) { + response = e.getMessage(); + } + return response; + } } \ No newline at end of file diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/application.properties b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/application.properties similarity index 100% rename from cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/application.properties rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/application.properties diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/templates/index.html b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/templates/index.html similarity index 100% rename from cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/templates/index.html rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-client/src/main/resources/templates/index.html diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml similarity index 100% rename from cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerApplication.java b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerApplication.java similarity index 100% rename from cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerApplication.java rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerApplication.java diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java similarity index 97% rename from cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java index 75d8507451..614a92aeb4 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java +++ b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerRestController.java @@ -1,28 +1,28 @@ -package com.baeldung.cfuaa.oauth2.resourceserver; - -import org.springframework.security.core.annotation.AuthenticationPrincipal; -import org.springframework.security.oauth2.jwt.Jwt; -import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.security.Principal; - -@RestController -public class CFUAAOAuth2ResourceServerRestController { - - @GetMapping("/") - public String index(@AuthenticationPrincipal Jwt jwt) { - return String.format("Hello, %s!", jwt.getSubject()); - } - - @GetMapping("/read") - public String read(JwtAuthenticationToken jwtAuthenticationToken) { - return "Hello read: " + jwtAuthenticationToken.getTokenAttributes(); - } - - @GetMapping("/write") - public String write(Principal principal) { - return "Hello write: " + principal.getName(); - } -} +package com.baeldung.cfuaa.oauth2.resourceserver; + +import org.springframework.security.core.annotation.AuthenticationPrincipal; +import org.springframework.security.oauth2.jwt.Jwt; +import org.springframework.security.oauth2.server.resource.authentication.JwtAuthenticationToken; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.security.Principal; + +@RestController +public class CFUAAOAuth2ResourceServerRestController { + + @GetMapping("/") + public String index(@AuthenticationPrincipal Jwt jwt) { + return String.format("Hello, %s!", jwt.getSubject()); + } + + @GetMapping("/read") + public String read(JwtAuthenticationToken jwtAuthenticationToken) { + return "Hello read: " + jwtAuthenticationToken.getTokenAttributes(); + } + + @GetMapping("/write") + public String write(Principal principal) { + return "Hello write: " + principal.getName(); + } +} diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerSecurityConfiguration.java b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerSecurityConfiguration.java similarity index 97% rename from cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerSecurityConfiguration.java rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerSecurityConfiguration.java index d04d51cda3..95bde8aa8a 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerSecurityConfiguration.java +++ b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/java/com/baeldung/cfuaa/oauth2/resourceserver/CFUAAOAuth2ResourceServerSecurityConfiguration.java @@ -1,21 +1,21 @@ -package com.baeldung.cfuaa.oauth2.resourceserver; - -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; - -@EnableWebSecurity -public class CFUAAOAuth2ResourceServerSecurityConfiguration extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - http - .authorizeRequests() - .antMatchers("/read/**").hasAuthority("SCOPE_resource.read") - .antMatchers("/write/**").hasAuthority("SCOPE_resource.write") - .anyRequest().authenticated() - .and() - .oauth2ResourceServer() - .jwt(); - } +package com.baeldung.cfuaa.oauth2.resourceserver; + +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; + +@EnableWebSecurity +public class CFUAAOAuth2ResourceServerSecurityConfiguration extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http + .authorizeRequests() + .antMatchers("/read/**").hasAuthority("SCOPE_resource.read") + .antMatchers("/write/**").hasAuthority("SCOPE_resource.write") + .anyRequest().authenticated() + .and() + .oauth2ResourceServer() + .jwt(); + } } \ No newline at end of file diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/resources/application.properties b/security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/resources/application.properties similarity index 100% rename from cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/resources/application.properties rename to security-modules/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/src/main/resources/application.properties diff --git a/cloud-foundry-uaa/pom.xml b/security-modules/cloud-foundry-uaa/pom.xml similarity index 92% rename from cloud-foundry-uaa/pom.xml rename to security-modules/cloud-foundry-uaa/pom.xml index 6ae43b2c08..ff26d56dc3 100644 --- a/cloud-foundry-uaa/pom.xml +++ b/security-modules/cloud-foundry-uaa/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/java-ee-8-security-api/README.md b/security-modules/java-ee-8-security-api/README.md similarity index 100% rename from java-ee-8-security-api/README.md rename to security-modules/java-ee-8-security-api/README.md diff --git a/java-ee-8-security-api/app-auth-basic-store-db/pom.xml b/security-modules/java-ee-8-security-api/app-auth-basic-store-db/pom.xml similarity index 100% rename from java-ee-8-security-api/app-auth-basic-store-db/pom.xml rename to security-modules/java-ee-8-security-api/app-auth-basic-store-db/pom.xml diff --git a/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AdminServlet.java b/security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AdminServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AdminServlet.java rename to security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AdminServlet.java diff --git a/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AppConfig.java b/security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AppConfig.java similarity index 100% rename from java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AppConfig.java rename to security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/AppConfig.java diff --git a/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/DatabaseSetupServlet.java b/security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/DatabaseSetupServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/DatabaseSetupServlet.java rename to security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/DatabaseSetupServlet.java diff --git a/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/UserServlet.java b/security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/UserServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/UserServlet.java rename to security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/java/com/baeldung/javaee/security/UserServlet.java diff --git a/java-ee-8-security-api/app-auth-basic-store-db/src/main/liberty/config/server.xml b/security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/liberty/config/server.xml similarity index 100% rename from java-ee-8-security-api/app-auth-basic-store-db/src/main/liberty/config/server.xml rename to security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/liberty/config/server.xml diff --git a/java-ee-8-security-api/app-auth-basic-store-db/src/main/resources/logback.xml b/security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/resources/logback.xml similarity index 100% rename from java-ee-8-security-api/app-auth-basic-store-db/src/main/resources/logback.xml rename to security-modules/java-ee-8-security-api/app-auth-basic-store-db/src/main/resources/logback.xml diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/AppConfig.java b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/AppConfig.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/AppConfig.java rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/AppConfig.java diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authentication.java b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authentication.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authentication.java rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authentication.java diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authorization.java b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authorization.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authorization.java rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/InMemoryIdentityStore4Authorization.java diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/LoginBean.java b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/LoginBean.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/LoginBean.java rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/LoginBean.java diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/WelcomeServlet.java b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/WelcomeServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/WelcomeServlet.java rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/java/com/baeldung/javaee/security/WelcomeServlet.java diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/liberty/config/server.xml b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/liberty/config/server.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/liberty/config/server.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/liberty/config/server.xml diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/resources/logback.xml b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/resources/logback.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/resources/logback.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/resources/logback.xml diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/beans.xml b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/beans.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/beans.xml diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/web.xml b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/web.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/WEB-INF/web.xml diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login-error.html b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login-error.html similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login-error.html rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login-error.html diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login.xhtml b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login.xhtml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login.xhtml rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/login.xhtml diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/welcome.xhtml b/security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/welcome.xhtml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/welcome.xhtml rename to security-modules/java-ee-8-security-api/app-auth-custom-form-store-custom/src/main/webapp/welcome.xhtml diff --git a/java-ee-8-security-api/app-auth-custom-no-store/pom.xml b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/pom.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/pom.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/pom.xml diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AdminServlet.java b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AdminServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AdminServlet.java rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AdminServlet.java diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AppConfig.java b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AppConfig.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AppConfig.java rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/AppConfig.java diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomAuthentication.java b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomAuthentication.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomAuthentication.java rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomAuthentication.java diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomPrincipal.java b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomPrincipal.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomPrincipal.java rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/CustomPrincipal.java diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/UserDetail.java b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/UserDetail.java similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/UserDetail.java rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/java/com/baeldung/javaee/security/UserDetail.java diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/liberty/config/server.xml b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/liberty/config/server.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/liberty/config/server.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/liberty/config/server.xml diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/resources/logback.xml b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/resources/logback.xml similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/resources/logback.xml rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/resources/logback.xml diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login-error.html b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login-error.html similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login-error.html rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login-error.html diff --git a/java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login.html b/security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login.html similarity index 100% rename from java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login.html rename to security-modules/java-ee-8-security-api/app-auth-custom-no-store/src/main/webapp/login.html diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/pom.xml rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AdminServlet.java b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AdminServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AdminServlet.java rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AdminServlet.java diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AppConfig.java b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AppConfig.java similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AppConfig.java rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/AppConfig.java diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/LdapSetupServlet.java b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/LdapSetupServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/LdapSetupServlet.java rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/LdapSetupServlet.java diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/UserServlet.java b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/UserServlet.java similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/UserServlet.java rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/java/com/baeldung/javaee/security/UserServlet.java diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/liberty/config/server.xml b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/liberty/config/server.xml similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/liberty/config/server.xml rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/liberty/config/server.xml diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/logback.xml b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/logback.xml similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/logback.xml rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/logback.xml diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/users.ldif b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/users.ldif similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/users.ldif rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/resources/users.ldif diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login-error.html b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login-error.html similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login-error.html rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login-error.html diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login.html b/security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login.html similarity index 100% rename from java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login.html rename to security-modules/java-ee-8-security-api/app-auth-form-store-ldap/src/main/webapp/login.html diff --git a/java-ee-8-security-api/pom.xml b/security-modules/java-ee-8-security-api/pom.xml similarity index 98% rename from java-ee-8-security-api/pom.xml rename to security-modules/java-ee-8-security-api/pom.xml index c01bedbeee..bcd15ed685 100644 --- a/java-ee-8-security-api/pom.xml +++ b/security-modules/java-ee-8-security-api/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + security-modules 1.0.0-SNAPSHOT diff --git a/jee-7-security/README.md b/security-modules/jee-7-security/README.md similarity index 100% rename from jee-7-security/README.md rename to security-modules/jee-7-security/README.md diff --git a/jee-7-security/pom.xml b/security-modules/jee-7-security/pom.xml similarity index 97% rename from jee-7-security/pom.xml rename to security-modules/jee-7-security/pom.xml index a8ceee8704..71084d6cd1 100644 --- a/jee-7-security/pom.xml +++ b/security-modules/jee-7-security/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + security-modules 1.0.0-SNAPSHOT diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java b/security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java similarity index 100% rename from jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java rename to security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/SecurityWebApplicationInitializer.java diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java b/security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java similarity index 100% rename from jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java rename to security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/SpringSecurityConfig.java diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java b/security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java similarity index 100% rename from jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java rename to security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/HomeController.java diff --git a/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java b/security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java similarity index 100% rename from jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java rename to security-modules/jee-7-security/src/main/java/com/baeldung/springsecurity/controller/LoginController.java diff --git a/jee-7-security/src/main/resources/logback.xml b/security-modules/jee-7-security/src/main/resources/logback.xml similarity index 100% rename from jee-7-security/src/main/resources/logback.xml rename to security-modules/jee-7-security/src/main/resources/logback.xml diff --git a/jee-7-security/src/main/webapp/WEB-INF/beans.xml b/security-modules/jee-7-security/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/beans.xml rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/beans.xml diff --git a/jee-7-security/src/main/webapp/WEB-INF/faces-config.xml b/security-modules/jee-7-security/src/main/webapp/WEB-INF/faces-config.xml similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/faces-config.xml rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/faces-config.xml diff --git a/jee-7-security/src/main/webapp/WEB-INF/spring/security.xml b/security-modules/jee-7-security/src/main/webapp/WEB-INF/spring/security.xml similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/spring/security.xml rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/spring/security.xml diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp b/security-modules/jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/views/admin.jsp diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/home.jsp b/security-modules/jee-7-security/src/main/webapp/WEB-INF/views/home.jsp similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/views/home.jsp rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/views/home.jsp diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/login.jsp b/security-modules/jee-7-security/src/main/webapp/WEB-INF/views/login.jsp similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/views/login.jsp rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/views/login.jsp diff --git a/jee-7-security/src/main/webapp/WEB-INF/views/user.jsp b/security-modules/jee-7-security/src/main/webapp/WEB-INF/views/user.jsp similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/views/user.jsp rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/views/user.jsp diff --git a/jee-7-security/src/main/webapp/WEB-INF/web.xml b/security-modules/jee-7-security/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from jee-7-security/src/main/webapp/WEB-INF/web.xml rename to security-modules/jee-7-security/src/main/webapp/WEB-INF/web.xml diff --git a/jee-7-security/src/main/webapp/index.jsp b/security-modules/jee-7-security/src/main/webapp/index.jsp similarity index 100% rename from jee-7-security/src/main/webapp/index.jsp rename to security-modules/jee-7-security/src/main/webapp/index.jsp diff --git a/jee-7-security/src/main/webapp/secure.jsp b/security-modules/jee-7-security/src/main/webapp/secure.jsp similarity index 100% rename from jee-7-security/src/main/webapp/secure.jsp rename to security-modules/jee-7-security/src/main/webapp/secure.jsp diff --git a/jjwt/.gitignore b/security-modules/jjwt/.gitignore similarity index 100% rename from jjwt/.gitignore rename to security-modules/jjwt/.gitignore diff --git a/jjwt/README.md b/security-modules/jjwt/README.md similarity index 100% rename from jjwt/README.md rename to security-modules/jjwt/README.md diff --git a/jjwt/pom.xml b/security-modules/jjwt/pom.xml similarity index 96% rename from jjwt/pom.xml rename to security-modules/jjwt/pom.xml index cc169ba9fc..3ea4a46b8a 100644 --- a/jjwt/pom.xml +++ b/security-modules/jjwt/pom.xml @@ -13,7 +13,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/JJWTFunApplication.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/JJWTFunApplication.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/JJWTFunApplication.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/JJWTFunApplication.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/CSRFConfig.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/CSRFConfig.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/CSRFConfig.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/CSRFConfig.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/JWTCsrfTokenRepository.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/JWTCsrfTokenRepository.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/JWTCsrfTokenRepository.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/JWTCsrfTokenRepository.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/WebSecurityConfig.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/WebSecurityConfig.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/WebSecurityConfig.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/config/WebSecurityConfig.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/BaseController.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/BaseController.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/BaseController.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/BaseController.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/DynamicJWTController.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/DynamicJWTController.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/DynamicJWTController.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/DynamicJWTController.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/FormController.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/FormController.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/FormController.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/FormController.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/HomeController.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/HomeController.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/HomeController.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/HomeController.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/SecretsController.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/SecretsController.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/SecretsController.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/SecretsController.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/StaticJWTController.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/StaticJWTController.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/StaticJWTController.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/controller/StaticJWTController.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/model/JwtResponse.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/model/JwtResponse.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/model/JwtResponse.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/model/JwtResponse.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/service/SecretService.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/service/SecretService.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/service/SecretService.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/service/SecretService.java diff --git a/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtil.java b/security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtil.java similarity index 100% rename from jjwt/src/main/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtil.java rename to security-modules/jjwt/src/main/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtil.java diff --git a/jjwt/src/main/resources/application.properties b/security-modules/jjwt/src/main/resources/application.properties similarity index 100% rename from jjwt/src/main/resources/application.properties rename to security-modules/jjwt/src/main/resources/application.properties diff --git a/jjwt/src/main/resources/logback.xml b/security-modules/jjwt/src/main/resources/logback.xml similarity index 100% rename from jjwt/src/main/resources/logback.xml rename to security-modules/jjwt/src/main/resources/logback.xml diff --git a/jjwt/src/main/resources/templates/expired-jwt.html b/security-modules/jjwt/src/main/resources/templates/expired-jwt.html similarity index 100% rename from jjwt/src/main/resources/templates/expired-jwt.html rename to security-modules/jjwt/src/main/resources/templates/expired-jwt.html diff --git a/jjwt/src/main/resources/templates/fragments/head.html b/security-modules/jjwt/src/main/resources/templates/fragments/head.html similarity index 100% rename from jjwt/src/main/resources/templates/fragments/head.html rename to security-modules/jjwt/src/main/resources/templates/fragments/head.html diff --git a/jjwt/src/main/resources/templates/jwt-csrf-form-result.html b/security-modules/jjwt/src/main/resources/templates/jwt-csrf-form-result.html similarity index 100% rename from jjwt/src/main/resources/templates/jwt-csrf-form-result.html rename to security-modules/jjwt/src/main/resources/templates/jwt-csrf-form-result.html diff --git a/jjwt/src/main/resources/templates/jwt-csrf-form.html b/security-modules/jjwt/src/main/resources/templates/jwt-csrf-form.html similarity index 100% rename from jjwt/src/main/resources/templates/jwt-csrf-form.html rename to security-modules/jjwt/src/main/resources/templates/jwt-csrf-form.html diff --git a/jjwt/src/test/java/io/jsonwebtoken/jjwtfun/DemoApplicationIntegrationTest.java b/security-modules/jjwt/src/test/java/io/jsonwebtoken/jjwtfun/DemoApplicationIntegrationTest.java similarity index 100% rename from jjwt/src/test/java/io/jsonwebtoken/jjwtfun/DemoApplicationIntegrationTest.java rename to security-modules/jjwt/src/test/java/io/jsonwebtoken/jjwtfun/DemoApplicationIntegrationTest.java diff --git a/jjwt/src/test/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtilUnitTest.java b/security-modules/jjwt/src/test/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtilUnitTest.java similarity index 100% rename from jjwt/src/test/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtilUnitTest.java rename to security-modules/jjwt/src/test/java/io/jsonwebtoken/jjwtfun/util/JWTDecoderUtilUnitTest.java diff --git a/oauth2-framework-impl/README.md b/security-modules/oauth2-framework-impl/README.md similarity index 100% rename from oauth2-framework-impl/README.md rename to security-modules/oauth2-framework-impl/README.md diff --git a/oauth2-framework-impl/oauth2-authorization-server/pom.xml b/security-modules/oauth2-framework-impl/oauth2-authorization-server/pom.xml similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/pom.xml rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/pom.xml diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/OAuth2ServerApplication.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/OAuth2ServerApplication.java similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/OAuth2ServerApplication.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/OAuth2ServerApplication.java diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/PEMKeyUtils.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/PEMKeyUtils.java similarity index 96% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/PEMKeyUtils.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/PEMKeyUtils.java index dab57b91a7..3947874179 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/PEMKeyUtils.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/PEMKeyUtils.java @@ -1,17 +1,17 @@ -package com.baeldung.oauth2.authorization.server; - -import java.net.URI; -import java.nio.file.Files; -import java.nio.file.Paths; - -import static java.lang.Thread.currentThread; - - -public class PEMKeyUtils { - - public static String readKeyAsString(String keyLocation) throws Exception { - URI uri = currentThread().getContextClassLoader().getResource(keyLocation).toURI(); - byte[] byteArray = Files.readAllBytes(Paths.get(uri)); - return new String(byteArray); - } -} +package com.baeldung.oauth2.authorization.server; + +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static java.lang.Thread.currentThread; + + +public class PEMKeyUtils { + + public static String readKeyAsString(String keyLocation) throws Exception { + URI uri = currentThread().getContextClassLoader().getResource(keyLocation).toURI(); + byte[] byteArray = Files.readAllBytes(Paths.get(uri)); + return new String(byteArray); + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/AuthorizationEndpoint.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/AuthorizationEndpoint.java similarity index 97% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/AuthorizationEndpoint.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/AuthorizationEndpoint.java index ba5e1ec359..618363c7e1 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/AuthorizationEndpoint.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/AuthorizationEndpoint.java @@ -1,185 +1,185 @@ -package com.baeldung.oauth2.authorization.server.api; - -import com.baeldung.oauth2.authorization.server.handler.AuthorizationGrantTypeHandler; -import com.baeldung.oauth2.authorization.server.model.AppDataRepository; -import com.baeldung.oauth2.authorization.server.model.AuthorizationCode; -import com.baeldung.oauth2.authorization.server.model.Client; -import com.baeldung.oauth2.authorization.server.model.User; - -import javax.annotation.security.RolesAllowed; -import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Instance; -import javax.enterprise.inject.literal.NamedLiteral; -import javax.inject.Inject; -import javax.json.JsonObject; -import javax.security.enterprise.SecurityContext; -import javax.security.enterprise.authentication.mechanism.http.FormAuthenticationMechanismDefinition; -import javax.security.enterprise.authentication.mechanism.http.LoginToContinue; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.*; -import javax.ws.rs.core.*; -import java.io.IOException; -import java.net.URI; -import java.security.Principal; -import java.time.LocalDateTime; -import java.util.*; - -@FormAuthenticationMechanismDefinition( - loginToContinue = @LoginToContinue(loginPage = "/login.jsp", errorPage = "/login.jsp") -) -@RolesAllowed("USER") -@RequestScoped -@Path("authorize") -public class AuthorizationEndpoint { - - @Inject - private SecurityContext securityContext; - - @Inject - private AppDataRepository appDataRepository; - - @Inject - Instance authorizationGrantTypeHandlers; - - @GET - @Produces(MediaType.TEXT_HTML) - public Response doGet(@Context HttpServletRequest request, - @Context HttpServletResponse response, - @Context UriInfo uriInfo) throws ServletException, IOException { - MultivaluedMap params = uriInfo.getQueryParameters(); - Principal principal = securityContext.getCallerPrincipal(); - - //error about redirect_uri && client_id ==> forward user, thus to error.jsp. - //otherwise ==> sendRedirect redirect_uri?error=error&error_description=error_description - //1. client_id - String clientId = params.getFirst("client_id"); - if (clientId == null || clientId.isEmpty()) { - return informUserAboutError(request, response, "Invalid client_id :" + clientId); - } - Client client = appDataRepository.getClient(clientId); - if (client == null) { - return informUserAboutError(request, response, "Invalid client_id :" + clientId); - } - //2. Client Authorized Grant Type - String clientError = ""; - if (client.getAuthorizedGrantTypes() != null && !client.getAuthorizedGrantTypes().contains("authorization_code")) { - return informUserAboutError(request, response, "Authorization Grant type, authorization_code, is not allowed for this client :" + clientId); - } - - //3. redirectUri - String redirectUri = params.getFirst("redirect_uri"); - if (client.getRedirectUri() != null && !client.getRedirectUri().isEmpty()) { - if (redirectUri != null && !redirectUri.isEmpty() && !client.getRedirectUri().equals(redirectUri)) { - //sould be in the client.redirectUri - return informUserAboutError(request, response, "redirect_uri is pre-registred and should match"); - } - redirectUri = client.getRedirectUri(); - params.putSingle("resolved_redirect_uri", redirectUri); - } else { - if (redirectUri == null || redirectUri.isEmpty()) { - return informUserAboutError(request, response, "redirect_uri is not pre-registred and should be provided"); - } - params.putSingle("resolved_redirect_uri", redirectUri); - } - request.setAttribute("client", client); - - //4. response_type - String responseType = params.getFirst("response_type"); - if (!"code".equals(responseType) && !"token".equals(responseType)) { - //error = "invalid_grant :" + responseType + ", response_type params should be code or token:"; - //return informUserAboutError(error); - } - - //Save params in session - request.getSession().setAttribute("ORIGINAL_PARAMS", params); - - //4.scope: Optional - String requestedScope = request.getParameter("scope"); - if (requestedScope == null || requestedScope.isEmpty()) { - requestedScope = client.getScope(); - } - User user = appDataRepository.getUser(principal.getName()); - String allowedScopes = checkUserScopes(user.getScopes(), requestedScope); - request.setAttribute("scopes", allowedScopes); - - request.getRequestDispatcher("/authorize.jsp").forward(request, response); - return null; - } - - @POST - @Consumes(MediaType.APPLICATION_FORM_URLENCODED) - @Produces(MediaType.TEXT_HTML) - public Response doPost(@Context HttpServletRequest request, - @Context HttpServletResponse response, - MultivaluedMap params) throws Exception { - MultivaluedMap originalParams = (MultivaluedMap) request.getSession().getAttribute("ORIGINAL_PARAMS"); - if (originalParams == null) { - return informUserAboutError(request, response, "No pending authorization request."); - } - String redirectUri = originalParams.getFirst("resolved_redirect_uri"); - StringBuilder sb = new StringBuilder(redirectUri); - - String approvalStatus = params.getFirst("approval_status"); - if ("NO".equals(approvalStatus)) { - URI location = UriBuilder.fromUri(sb.toString()) - .queryParam("error", "User doesn't approved the request.") - .queryParam("error_description", "User doesn't approved the request.") - .build(); - return Response.seeOther(location).build(); - } - //==> YES - List approvedScopes = params.get("scope"); - if (approvedScopes == null || approvedScopes.isEmpty()) { - URI location = UriBuilder.fromUri(sb.toString()) - .queryParam("error", "User doesn't approved the request.") - .queryParam("error_description", "User doesn't approved the request.") - .build(); - return Response.seeOther(location).build(); - } - - String responseType = originalParams.getFirst("response_type"); - String clientId = originalParams.getFirst("client_id"); - if ("code".equals(responseType)) { - String userId = securityContext.getCallerPrincipal().getName(); - AuthorizationCode authorizationCode = new AuthorizationCode(); - authorizationCode.setClientId(clientId); - authorizationCode.setUserId(userId); - authorizationCode.setApprovedScopes(String.join(" ", approvedScopes)); - authorizationCode.setExpirationDate(LocalDateTime.now().plusMinutes(10)); - authorizationCode.setRedirectUri(redirectUri); - appDataRepository.save(authorizationCode); - String code = authorizationCode.getCode(); - sb.append("?code=").append(code); - } else { - //Implicit: responseType=token - AuthorizationGrantTypeHandler authorizationGrantTypeHandler = authorizationGrantTypeHandlers.select(NamedLiteral.of("implicit")).get(); - JsonObject tokenResponse = authorizationGrantTypeHandler.createAccessToken(clientId, params); - sb.append("#access_token=").append(tokenResponse.getString("access_token")) - .append("&token_type=").append(tokenResponse.getString("token_type")) - .append("&scope=").append(tokenResponse.getString("scope")); - } - String state = originalParams.getFirst("state"); - if (state != null) { - sb.append("&state=").append(state); - } - return Response.seeOther(UriBuilder.fromUri(sb.toString()).build()).build(); - } - - private String checkUserScopes(String userScopes, String requestedScope) { - Set allowedScopes = new LinkedHashSet<>(); - Set rScopes = new HashSet(Arrays.asList(requestedScope.split(" "))); - Set uScopes = new HashSet(Arrays.asList(userScopes.split(" "))); - for (String scope : uScopes) { - if (rScopes.contains(scope)) allowedScopes.add(scope); - } - return String.join(" ", allowedScopes); - } - - private Response informUserAboutError(HttpServletRequest request, HttpServletResponse response, String error) throws ServletException, IOException { - request.setAttribute("error", error); - request.getRequestDispatcher("/error.jsp").forward(request, response); - return null; - } -} +package com.baeldung.oauth2.authorization.server.api; + +import com.baeldung.oauth2.authorization.server.handler.AuthorizationGrantTypeHandler; +import com.baeldung.oauth2.authorization.server.model.AppDataRepository; +import com.baeldung.oauth2.authorization.server.model.AuthorizationCode; +import com.baeldung.oauth2.authorization.server.model.Client; +import com.baeldung.oauth2.authorization.server.model.User; + +import javax.annotation.security.RolesAllowed; +import javax.enterprise.context.RequestScoped; +import javax.enterprise.inject.Instance; +import javax.enterprise.inject.literal.NamedLiteral; +import javax.inject.Inject; +import javax.json.JsonObject; +import javax.security.enterprise.SecurityContext; +import javax.security.enterprise.authentication.mechanism.http.FormAuthenticationMechanismDefinition; +import javax.security.enterprise.authentication.mechanism.http.LoginToContinue; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.*; +import javax.ws.rs.core.*; +import java.io.IOException; +import java.net.URI; +import java.security.Principal; +import java.time.LocalDateTime; +import java.util.*; + +@FormAuthenticationMechanismDefinition( + loginToContinue = @LoginToContinue(loginPage = "/login.jsp", errorPage = "/login.jsp") +) +@RolesAllowed("USER") +@RequestScoped +@Path("authorize") +public class AuthorizationEndpoint { + + @Inject + private SecurityContext securityContext; + + @Inject + private AppDataRepository appDataRepository; + + @Inject + Instance authorizationGrantTypeHandlers; + + @GET + @Produces(MediaType.TEXT_HTML) + public Response doGet(@Context HttpServletRequest request, + @Context HttpServletResponse response, + @Context UriInfo uriInfo) throws ServletException, IOException { + MultivaluedMap params = uriInfo.getQueryParameters(); + Principal principal = securityContext.getCallerPrincipal(); + + //error about redirect_uri && client_id ==> forward user, thus to error.jsp. + //otherwise ==> sendRedirect redirect_uri?error=error&error_description=error_description + //1. client_id + String clientId = params.getFirst("client_id"); + if (clientId == null || clientId.isEmpty()) { + return informUserAboutError(request, response, "Invalid client_id :" + clientId); + } + Client client = appDataRepository.getClient(clientId); + if (client == null) { + return informUserAboutError(request, response, "Invalid client_id :" + clientId); + } + //2. Client Authorized Grant Type + String clientError = ""; + if (client.getAuthorizedGrantTypes() != null && !client.getAuthorizedGrantTypes().contains("authorization_code")) { + return informUserAboutError(request, response, "Authorization Grant type, authorization_code, is not allowed for this client :" + clientId); + } + + //3. redirectUri + String redirectUri = params.getFirst("redirect_uri"); + if (client.getRedirectUri() != null && !client.getRedirectUri().isEmpty()) { + if (redirectUri != null && !redirectUri.isEmpty() && !client.getRedirectUri().equals(redirectUri)) { + //sould be in the client.redirectUri + return informUserAboutError(request, response, "redirect_uri is pre-registred and should match"); + } + redirectUri = client.getRedirectUri(); + params.putSingle("resolved_redirect_uri", redirectUri); + } else { + if (redirectUri == null || redirectUri.isEmpty()) { + return informUserAboutError(request, response, "redirect_uri is not pre-registred and should be provided"); + } + params.putSingle("resolved_redirect_uri", redirectUri); + } + request.setAttribute("client", client); + + //4. response_type + String responseType = params.getFirst("response_type"); + if (!"code".equals(responseType) && !"token".equals(responseType)) { + //error = "invalid_grant :" + responseType + ", response_type params should be code or token:"; + //return informUserAboutError(error); + } + + //Save params in session + request.getSession().setAttribute("ORIGINAL_PARAMS", params); + + //4.scope: Optional + String requestedScope = request.getParameter("scope"); + if (requestedScope == null || requestedScope.isEmpty()) { + requestedScope = client.getScope(); + } + User user = appDataRepository.getUser(principal.getName()); + String allowedScopes = checkUserScopes(user.getScopes(), requestedScope); + request.setAttribute("scopes", allowedScopes); + + request.getRequestDispatcher("/authorize.jsp").forward(request, response); + return null; + } + + @POST + @Consumes(MediaType.APPLICATION_FORM_URLENCODED) + @Produces(MediaType.TEXT_HTML) + public Response doPost(@Context HttpServletRequest request, + @Context HttpServletResponse response, + MultivaluedMap params) throws Exception { + MultivaluedMap originalParams = (MultivaluedMap) request.getSession().getAttribute("ORIGINAL_PARAMS"); + if (originalParams == null) { + return informUserAboutError(request, response, "No pending authorization request."); + } + String redirectUri = originalParams.getFirst("resolved_redirect_uri"); + StringBuilder sb = new StringBuilder(redirectUri); + + String approvalStatus = params.getFirst("approval_status"); + if ("NO".equals(approvalStatus)) { + URI location = UriBuilder.fromUri(sb.toString()) + .queryParam("error", "User doesn't approved the request.") + .queryParam("error_description", "User doesn't approved the request.") + .build(); + return Response.seeOther(location).build(); + } + //==> YES + List approvedScopes = params.get("scope"); + if (approvedScopes == null || approvedScopes.isEmpty()) { + URI location = UriBuilder.fromUri(sb.toString()) + .queryParam("error", "User doesn't approved the request.") + .queryParam("error_description", "User doesn't approved the request.") + .build(); + return Response.seeOther(location).build(); + } + + String responseType = originalParams.getFirst("response_type"); + String clientId = originalParams.getFirst("client_id"); + if ("code".equals(responseType)) { + String userId = securityContext.getCallerPrincipal().getName(); + AuthorizationCode authorizationCode = new AuthorizationCode(); + authorizationCode.setClientId(clientId); + authorizationCode.setUserId(userId); + authorizationCode.setApprovedScopes(String.join(" ", approvedScopes)); + authorizationCode.setExpirationDate(LocalDateTime.now().plusMinutes(10)); + authorizationCode.setRedirectUri(redirectUri); + appDataRepository.save(authorizationCode); + String code = authorizationCode.getCode(); + sb.append("?code=").append(code); + } else { + //Implicit: responseType=token + AuthorizationGrantTypeHandler authorizationGrantTypeHandler = authorizationGrantTypeHandlers.select(NamedLiteral.of("implicit")).get(); + JsonObject tokenResponse = authorizationGrantTypeHandler.createAccessToken(clientId, params); + sb.append("#access_token=").append(tokenResponse.getString("access_token")) + .append("&token_type=").append(tokenResponse.getString("token_type")) + .append("&scope=").append(tokenResponse.getString("scope")); + } + String state = originalParams.getFirst("state"); + if (state != null) { + sb.append("&state=").append(state); + } + return Response.seeOther(UriBuilder.fromUri(sb.toString()).build()).build(); + } + + private String checkUserScopes(String userScopes, String requestedScope) { + Set allowedScopes = new LinkedHashSet<>(); + Set rScopes = new HashSet(Arrays.asList(requestedScope.split(" "))); + Set uScopes = new HashSet(Arrays.asList(userScopes.split(" "))); + for (String scope : uScopes) { + if (rScopes.contains(scope)) allowedScopes.add(scope); + } + return String.join(" ", allowedScopes); + } + + private Response informUserAboutError(HttpServletRequest request, HttpServletResponse response, String error) throws ServletException, IOException { + request.setAttribute("error", error); + request.getRequestDispatcher("/error.jsp").forward(request, response); + return null; + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/JWKEndpoint.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/JWKEndpoint.java similarity index 97% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/JWKEndpoint.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/JWKEndpoint.java index 9d38c823b9..0fbdbb1891 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/JWKEndpoint.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/JWKEndpoint.java @@ -1,38 +1,38 @@ -package com.baeldung.oauth2.authorization.server.api; - -import com.baeldung.oauth2.authorization.server.PEMKeyUtils; -import com.nimbusds.jose.jwk.JWK; -import org.eclipse.microprofile.config.Config; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.util.Arrays; - -@Path("jwk") -@ApplicationScoped -public class JWKEndpoint { - - @Inject - private Config config; - - @GET - public Response getKey(@QueryParam("format") String format) throws Exception { - if (format != null && !Arrays.asList("jwk", "pem").contains(format)) { - return Response.status(Response.Status.BAD_REQUEST).entity("Public Key Format should be : jwk or pem").build(); - } - String verificationkey = config.getValue("verificationkey", String.class); - String pemEncodedRSAPublicKey = PEMKeyUtils.readKeyAsString(verificationkey); - if (format == null || format.equals("jwk")) { - JWK jwk = JWK.parseFromPEMEncodedObjects(pemEncodedRSAPublicKey); - return Response.ok(jwk.toJSONString()).type(MediaType.APPLICATION_JSON).build(); - } else if (format.equals("pem")) { - return Response.ok(pemEncodedRSAPublicKey).build(); - } - return null; - } -} +package com.baeldung.oauth2.authorization.server.api; + +import com.baeldung.oauth2.authorization.server.PEMKeyUtils; +import com.nimbusds.jose.jwk.JWK; +import org.eclipse.microprofile.config.Config; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.util.Arrays; + +@Path("jwk") +@ApplicationScoped +public class JWKEndpoint { + + @Inject + private Config config; + + @GET + public Response getKey(@QueryParam("format") String format) throws Exception { + if (format != null && !Arrays.asList("jwk", "pem").contains(format)) { + return Response.status(Response.Status.BAD_REQUEST).entity("Public Key Format should be : jwk or pem").build(); + } + String verificationkey = config.getValue("verificationkey", String.class); + String pemEncodedRSAPublicKey = PEMKeyUtils.readKeyAsString(verificationkey); + if (format == null || format.equals("jwk")) { + JWK jwk = JWK.parseFromPEMEncodedObjects(pemEncodedRSAPublicKey); + return Response.ok(jwk.toJSONString()).type(MediaType.APPLICATION_JSON).build(); + } else if (format.equals("pem")) { + return Response.ok(pemEncodedRSAPublicKey).build(); + } + return null; + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/TokenEndpoint.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/TokenEndpoint.java similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/TokenEndpoint.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/api/TokenEndpoint.java diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AbstractGrantTypeHandler.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AbstractGrantTypeHandler.java similarity index 97% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AbstractGrantTypeHandler.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AbstractGrantTypeHandler.java index 324bacb33f..021ab6bfb8 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AbstractGrantTypeHandler.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AbstractGrantTypeHandler.java @@ -1,87 +1,87 @@ -package com.baeldung.oauth2.authorization.server.handler; - -import com.baeldung.oauth2.authorization.server.PEMKeyUtils; -import com.nimbusds.jose.*; -import com.nimbusds.jose.crypto.RSASSASigner; -import com.nimbusds.jose.crypto.RSASSAVerifier; -import com.nimbusds.jose.jwk.JWK; -import com.nimbusds.jose.jwk.RSAKey; -import com.nimbusds.jwt.JWTClaimsSet; -import com.nimbusds.jwt.SignedJWT; -import org.eclipse.microprofile.config.Config; - -import javax.inject.Inject; -import java.time.Instant; -import java.time.temporal.ChronoUnit; -import java.util.Arrays; -import java.util.Date; -import java.util.UUID; - -public abstract class AbstractGrantTypeHandler implements AuthorizationGrantTypeHandler { - - //Always RSA 256, but could be parametrized - protected JWSHeader jwsHeader = new JWSHeader.Builder(JWSAlgorithm.RS256).type(JOSEObjectType.JWT).build(); - - @Inject - protected Config config; - - //30 min - protected Long expiresInMin = 30L; - - protected JWSVerifier getJWSVerifier() throws Exception { - String verificationkey = config.getValue("verificationkey", String.class); - String pemEncodedRSAPublicKey = PEMKeyUtils.readKeyAsString(verificationkey); - RSAKey rsaPublicKey = (RSAKey) JWK.parseFromPEMEncodedObjects(pemEncodedRSAPublicKey); - return new RSASSAVerifier(rsaPublicKey); - } - - protected JWSSigner getJwsSigner() throws Exception { - String signingkey = config.getValue("signingkey", String.class); - String pemEncodedRSAPrivateKey = PEMKeyUtils.readKeyAsString(signingkey); - RSAKey rsaKey = (RSAKey) JWK.parseFromPEMEncodedObjects(pemEncodedRSAPrivateKey); - return new RSASSASigner(rsaKey.toRSAPrivateKey()); - } - - protected String getAccessToken(String clientId, String subject, String approvedScope) throws Exception { - //4. Signing - JWSSigner jwsSigner = getJwsSigner(); - - Instant now = Instant.now(); - //Long expiresInMin = 30L; - Date expirationTime = Date.from(now.plus(expiresInMin, ChronoUnit.MINUTES)); - - //3. JWT Payload or claims - JWTClaimsSet jwtClaims = new JWTClaimsSet.Builder() - .issuer("http://localhost:9080") - .subject(subject) - .claim("upn", subject) - .claim("client_id", clientId) - .audience("http://localhost:9280") - .claim("scope", approvedScope) - .claim("groups", Arrays.asList(approvedScope.split(" "))) - .expirationTime(expirationTime) // expires in 30 minutes - .notBeforeTime(Date.from(now)) - .issueTime(Date.from(now)) - .jwtID(UUID.randomUUID().toString()) - .build(); - SignedJWT signedJWT = new SignedJWT(jwsHeader, jwtClaims); - signedJWT.sign(jwsSigner); - return signedJWT.serialize(); - } - - protected String getRefreshToken(String clientId, String subject, String approvedScope) throws Exception { - JWSSigner jwsSigner = getJwsSigner(); - Instant now = Instant.now(); - //6.Build refresh token - JWTClaimsSet refreshTokenClaims = new JWTClaimsSet.Builder() - .subject(subject) - .claim("client_id", clientId) - .claim("scope", approvedScope) - //refresh token for 1 day. - .expirationTime(Date.from(now.plus(1, ChronoUnit.DAYS))) - .build(); - SignedJWT signedRefreshToken = new SignedJWT(jwsHeader, refreshTokenClaims); - signedRefreshToken.sign(jwsSigner); - return signedRefreshToken.serialize(); - } -} +package com.baeldung.oauth2.authorization.server.handler; + +import com.baeldung.oauth2.authorization.server.PEMKeyUtils; +import com.nimbusds.jose.*; +import com.nimbusds.jose.crypto.RSASSASigner; +import com.nimbusds.jose.crypto.RSASSAVerifier; +import com.nimbusds.jose.jwk.JWK; +import com.nimbusds.jose.jwk.RSAKey; +import com.nimbusds.jwt.JWTClaimsSet; +import com.nimbusds.jwt.SignedJWT; +import org.eclipse.microprofile.config.Config; + +import javax.inject.Inject; +import java.time.Instant; +import java.time.temporal.ChronoUnit; +import java.util.Arrays; +import java.util.Date; +import java.util.UUID; + +public abstract class AbstractGrantTypeHandler implements AuthorizationGrantTypeHandler { + + //Always RSA 256, but could be parametrized + protected JWSHeader jwsHeader = new JWSHeader.Builder(JWSAlgorithm.RS256).type(JOSEObjectType.JWT).build(); + + @Inject + protected Config config; + + //30 min + protected Long expiresInMin = 30L; + + protected JWSVerifier getJWSVerifier() throws Exception { + String verificationkey = config.getValue("verificationkey", String.class); + String pemEncodedRSAPublicKey = PEMKeyUtils.readKeyAsString(verificationkey); + RSAKey rsaPublicKey = (RSAKey) JWK.parseFromPEMEncodedObjects(pemEncodedRSAPublicKey); + return new RSASSAVerifier(rsaPublicKey); + } + + protected JWSSigner getJwsSigner() throws Exception { + String signingkey = config.getValue("signingkey", String.class); + String pemEncodedRSAPrivateKey = PEMKeyUtils.readKeyAsString(signingkey); + RSAKey rsaKey = (RSAKey) JWK.parseFromPEMEncodedObjects(pemEncodedRSAPrivateKey); + return new RSASSASigner(rsaKey.toRSAPrivateKey()); + } + + protected String getAccessToken(String clientId, String subject, String approvedScope) throws Exception { + //4. Signing + JWSSigner jwsSigner = getJwsSigner(); + + Instant now = Instant.now(); + //Long expiresInMin = 30L; + Date expirationTime = Date.from(now.plus(expiresInMin, ChronoUnit.MINUTES)); + + //3. JWT Payload or claims + JWTClaimsSet jwtClaims = new JWTClaimsSet.Builder() + .issuer("http://localhost:9080") + .subject(subject) + .claim("upn", subject) + .claim("client_id", clientId) + .audience("http://localhost:9280") + .claim("scope", approvedScope) + .claim("groups", Arrays.asList(approvedScope.split(" "))) + .expirationTime(expirationTime) // expires in 30 minutes + .notBeforeTime(Date.from(now)) + .issueTime(Date.from(now)) + .jwtID(UUID.randomUUID().toString()) + .build(); + SignedJWT signedJWT = new SignedJWT(jwsHeader, jwtClaims); + signedJWT.sign(jwsSigner); + return signedJWT.serialize(); + } + + protected String getRefreshToken(String clientId, String subject, String approvedScope) throws Exception { + JWSSigner jwsSigner = getJwsSigner(); + Instant now = Instant.now(); + //6.Build refresh token + JWTClaimsSet refreshTokenClaims = new JWTClaimsSet.Builder() + .subject(subject) + .claim("client_id", clientId) + .claim("scope", approvedScope) + //refresh token for 1 day. + .expirationTime(Date.from(now.plus(1, ChronoUnit.DAYS))) + .build(); + SignedJWT signedRefreshToken = new SignedJWT(jwsHeader, refreshTokenClaims); + signedRefreshToken.sign(jwsSigner); + return signedRefreshToken.serialize(); + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationCodeGrantTypeHandler.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationCodeGrantTypeHandler.java similarity index 97% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationCodeGrantTypeHandler.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationCodeGrantTypeHandler.java index 78128aead6..bd7dbb0d31 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationCodeGrantTypeHandler.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationCodeGrantTypeHandler.java @@ -1,54 +1,54 @@ -package com.baeldung.oauth2.authorization.server.handler; - -import com.baeldung.oauth2.authorization.server.model.AuthorizationCode; - -import javax.inject.Named; -import javax.json.Json; -import javax.json.JsonObject; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MultivaluedMap; -import java.time.LocalDateTime; - -@Named("authorization_code") -public class AuthorizationCodeGrantTypeHandler extends AbstractGrantTypeHandler { - - @PersistenceContext - private EntityManager entityManager; - - @Override - public JsonObject createAccessToken(String clientId, MultivaluedMap params) throws Exception { - //1. code is required - String code = params.getFirst("code"); - if (code == null || "".equals(code)) { - throw new WebApplicationException("invalid_grant"); - } - AuthorizationCode authorizationCode = entityManager.find(AuthorizationCode.class, code); - if (!authorizationCode.getExpirationDate().isAfter(LocalDateTime.now())) { - throw new WebApplicationException("code Expired !"); - } - String redirectUri = params.getFirst("redirect_uri"); - //redirecturi match - if (authorizationCode.getRedirectUri() != null && !authorizationCode.getRedirectUri().equals(redirectUri)) { - //redirectUri params should be the same as the requested redirectUri. - throw new WebApplicationException("invalid_grant"); - } - //client match - if (!clientId.equals(authorizationCode.getClientId())) { - throw new WebApplicationException("invalid_grant"); - } - - //3. JWT Payload or claims - String accessToken = getAccessToken(clientId, authorizationCode.getUserId(), authorizationCode.getApprovedScopes()); - String refreshToken = getRefreshToken(clientId, authorizationCode.getUserId(), authorizationCode.getApprovedScopes()); - - return Json.createObjectBuilder() - .add("token_type", "Bearer") - .add("access_token", accessToken) - .add("expires_in", expiresInMin * 60) - .add("scope", authorizationCode.getApprovedScopes()) - .add("refresh_token", refreshToken) - .build(); - } -} +package com.baeldung.oauth2.authorization.server.handler; + +import com.baeldung.oauth2.authorization.server.model.AuthorizationCode; + +import javax.inject.Named; +import javax.json.Json; +import javax.json.JsonObject; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MultivaluedMap; +import java.time.LocalDateTime; + +@Named("authorization_code") +public class AuthorizationCodeGrantTypeHandler extends AbstractGrantTypeHandler { + + @PersistenceContext + private EntityManager entityManager; + + @Override + public JsonObject createAccessToken(String clientId, MultivaluedMap params) throws Exception { + //1. code is required + String code = params.getFirst("code"); + if (code == null || "".equals(code)) { + throw new WebApplicationException("invalid_grant"); + } + AuthorizationCode authorizationCode = entityManager.find(AuthorizationCode.class, code); + if (!authorizationCode.getExpirationDate().isAfter(LocalDateTime.now())) { + throw new WebApplicationException("code Expired !"); + } + String redirectUri = params.getFirst("redirect_uri"); + //redirecturi match + if (authorizationCode.getRedirectUri() != null && !authorizationCode.getRedirectUri().equals(redirectUri)) { + //redirectUri params should be the same as the requested redirectUri. + throw new WebApplicationException("invalid_grant"); + } + //client match + if (!clientId.equals(authorizationCode.getClientId())) { + throw new WebApplicationException("invalid_grant"); + } + + //3. JWT Payload or claims + String accessToken = getAccessToken(clientId, authorizationCode.getUserId(), authorizationCode.getApprovedScopes()); + String refreshToken = getRefreshToken(clientId, authorizationCode.getUserId(), authorizationCode.getApprovedScopes()); + + return Json.createObjectBuilder() + .add("token_type", "Bearer") + .add("access_token", accessToken) + .add("expires_in", expiresInMin * 60) + .add("scope", authorizationCode.getApprovedScopes()) + .add("refresh_token", refreshToken) + .build(); + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationGrantTypeHandler.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationGrantTypeHandler.java similarity index 97% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationGrantTypeHandler.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationGrantTypeHandler.java index a5afe293ef..0568db1b5c 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationGrantTypeHandler.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/AuthorizationGrantTypeHandler.java @@ -1,8 +1,8 @@ -package com.baeldung.oauth2.authorization.server.handler; - -import javax.json.JsonObject; -import javax.ws.rs.core.MultivaluedMap; - -public interface AuthorizationGrantTypeHandler { - JsonObject createAccessToken(String clientId, MultivaluedMap params) throws Exception; -} +package com.baeldung.oauth2.authorization.server.handler; + +import javax.json.JsonObject; +import javax.ws.rs.core.MultivaluedMap; + +public interface AuthorizationGrantTypeHandler { + JsonObject createAccessToken(String clientId, MultivaluedMap params) throws Exception; +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/RefreshTokenGrantTypeHandler.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/RefreshTokenGrantTypeHandler.java similarity index 97% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/RefreshTokenGrantTypeHandler.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/RefreshTokenGrantTypeHandler.java index 63e3552353..433371f0d2 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/RefreshTokenGrantTypeHandler.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/handler/RefreshTokenGrantTypeHandler.java @@ -1,72 +1,72 @@ -package com.baeldung.oauth2.authorization.server.handler; - -import com.nimbusds.jose.JWSVerifier; -import com.nimbusds.jwt.SignedJWT; - -import javax.inject.Named; -import javax.json.Json; -import javax.json.JsonObject; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import java.util.Arrays; -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - -@Named("refresh_token") -public class RefreshTokenGrantTypeHandler extends AbstractGrantTypeHandler { - - @Override - public JsonObject createAccessToken(String clientId, MultivaluedMap params) throws Exception { - String refreshToken = params.getFirst("refresh_token"); - if (refreshToken == null || "".equals(refreshToken)) { - throw new WebApplicationException("invalid_grant"); - } - - //Decode refresh token - SignedJWT signedRefreshToken = SignedJWT.parse(refreshToken); - JWSVerifier verifier = getJWSVerifier(); - - if (!signedRefreshToken.verify(verifier)) { - throw new WebApplicationException("Invalid refresh token."); - } - if (!(new Date().before(signedRefreshToken.getJWTClaimsSet().getExpirationTime()))) { - throw new WebApplicationException("Refresh token expired."); - } - String refreshTokenClientId = signedRefreshToken.getJWTClaimsSet().getStringClaim("client_id"); - if (!clientId.equals(refreshTokenClientId)) { - throw new WebApplicationException("Invalid client_id."); - } - - //At this point, the refresh token is valid and not yet expired - //So create a new access token from it. - String subject = signedRefreshToken.getJWTClaimsSet().getSubject(); - String approvedScopes = signedRefreshToken.getJWTClaimsSet().getStringClaim("scope"); - - String requestedScopes = params.getFirst("scope"); - if (requestedScopes != null && !requestedScopes.isEmpty()) { - Set rScopes = new HashSet(Arrays.asList(requestedScopes.split(" "))); - Set aScopes = new HashSet(Arrays.asList(approvedScopes.split(" "))); - if (!aScopes.containsAll(rScopes)) { - JsonObject error = Json.createObjectBuilder() - .add("error", "Invalid_request") - .add("error_description", "Requested scopes should be a subset of the original scopes.") - .build(); - Response response = Response.status(Response.Status.BAD_REQUEST).entity(error).build(); - throw new WebApplicationException(response); - } - } else { - requestedScopes = approvedScopes; - } - - String accessToken = getAccessToken(clientId, subject, requestedScopes); - return Json.createObjectBuilder() - .add("token_type", "Bearer") - .add("access_token", accessToken) - .add("expires_in", expiresInMin * 60) - .add("scope", requestedScopes) - .add("refresh_token", refreshToken) - .build(); - } -} +package com.baeldung.oauth2.authorization.server.handler; + +import com.nimbusds.jose.JWSVerifier; +import com.nimbusds.jwt.SignedJWT; + +import javax.inject.Named; +import javax.json.Json; +import javax.json.JsonObject; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +@Named("refresh_token") +public class RefreshTokenGrantTypeHandler extends AbstractGrantTypeHandler { + + @Override + public JsonObject createAccessToken(String clientId, MultivaluedMap params) throws Exception { + String refreshToken = params.getFirst("refresh_token"); + if (refreshToken == null || "".equals(refreshToken)) { + throw new WebApplicationException("invalid_grant"); + } + + //Decode refresh token + SignedJWT signedRefreshToken = SignedJWT.parse(refreshToken); + JWSVerifier verifier = getJWSVerifier(); + + if (!signedRefreshToken.verify(verifier)) { + throw new WebApplicationException("Invalid refresh token."); + } + if (!(new Date().before(signedRefreshToken.getJWTClaimsSet().getExpirationTime()))) { + throw new WebApplicationException("Refresh token expired."); + } + String refreshTokenClientId = signedRefreshToken.getJWTClaimsSet().getStringClaim("client_id"); + if (!clientId.equals(refreshTokenClientId)) { + throw new WebApplicationException("Invalid client_id."); + } + + //At this point, the refresh token is valid and not yet expired + //So create a new access token from it. + String subject = signedRefreshToken.getJWTClaimsSet().getSubject(); + String approvedScopes = signedRefreshToken.getJWTClaimsSet().getStringClaim("scope"); + + String requestedScopes = params.getFirst("scope"); + if (requestedScopes != null && !requestedScopes.isEmpty()) { + Set rScopes = new HashSet(Arrays.asList(requestedScopes.split(" "))); + Set aScopes = new HashSet(Arrays.asList(approvedScopes.split(" "))); + if (!aScopes.containsAll(rScopes)) { + JsonObject error = Json.createObjectBuilder() + .add("error", "Invalid_request") + .add("error_description", "Requested scopes should be a subset of the original scopes.") + .build(); + Response response = Response.status(Response.Status.BAD_REQUEST).entity(error).build(); + throw new WebApplicationException(response); + } + } else { + requestedScopes = approvedScopes; + } + + String accessToken = getAccessToken(clientId, subject, requestedScopes); + return Json.createObjectBuilder() + .add("token_type", "Bearer") + .add("access_token", accessToken) + .add("expires_in", expiresInMin * 60) + .add("scope", requestedScopes) + .add("refresh_token", refreshToken) + .build(); + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AppDataRepository.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AppDataRepository.java similarity index 96% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AppDataRepository.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AppDataRepository.java index 6b827d6a3d..00f506fb41 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AppDataRepository.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AppDataRepository.java @@ -1,27 +1,27 @@ -package com.baeldung.oauth2.authorization.server.model; - -import javax.enterprise.context.ApplicationScoped; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.transaction.Transactional; - -@ApplicationScoped -public class AppDataRepository { - - @PersistenceContext - private EntityManager entityManager; - - public Client getClient(String clientId) { - return entityManager.find(Client.class, clientId); - } - - public User getUser(String userId) { - return entityManager.find(User.class, userId); - } - - @Transactional - public AuthorizationCode save(AuthorizationCode authorizationCode) { - entityManager.persist(authorizationCode); - return authorizationCode; - } -} +package com.baeldung.oauth2.authorization.server.model; + +import javax.enterprise.context.ApplicationScoped; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.transaction.Transactional; + +@ApplicationScoped +public class AppDataRepository { + + @PersistenceContext + private EntityManager entityManager; + + public Client getClient(String clientId) { + return entityManager.find(Client.class, clientId); + } + + public User getUser(String userId) { + return entityManager.find(User.class, userId); + } + + @Transactional + public AuthorizationCode save(AuthorizationCode authorizationCode) { + entityManager.persist(authorizationCode); + return authorizationCode; + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AuthorizationCode.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AuthorizationCode.java similarity index 95% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AuthorizationCode.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AuthorizationCode.java index a2ec088eb9..c830c561a6 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AuthorizationCode.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/AuthorizationCode.java @@ -1,73 +1,73 @@ -package com.baeldung.oauth2.authorization.server.model; - -import javax.persistence.*; -import java.time.LocalDateTime; - -@Entity -@Table(name = "authorization_code") -public class AuthorizationCode { - @Id - @GeneratedValue(strategy = GenerationType.AUTO) - @Column(name = "code") - private String code; - @Column(name = "client_id") - private String clientId; - @Column(name = "user_id") - private String userId; - @Column(name = "approved_scopes") - private String approvedScopes; - - @Column(name = "redirect_uri") - private String redirectUri; - - @Column(name = "expiration_date") - private LocalDateTime expirationDate; - - public String getUserId() { - return userId; - } - - public void setUserId(String username) { - this.userId = username; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getApprovedScopes() { - return approvedScopes; - } - - public void setApprovedScopes(String approvedScopes) { - this.approvedScopes = approvedScopes; - } - - public String getRedirectUri() { - return redirectUri; - } - - public void setRedirectUri(String redirectUri) { - this.redirectUri = redirectUri; - } - - public LocalDateTime getExpirationDate() { - return expirationDate; - } - - public void setExpirationDate(LocalDateTime expirationDate) { - this.expirationDate = expirationDate; - } -} +package com.baeldung.oauth2.authorization.server.model; + +import javax.persistence.*; +import java.time.LocalDateTime; + +@Entity +@Table(name = "authorization_code") +public class AuthorizationCode { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "code") + private String code; + @Column(name = "client_id") + private String clientId; + @Column(name = "user_id") + private String userId; + @Column(name = "approved_scopes") + private String approvedScopes; + + @Column(name = "redirect_uri") + private String redirectUri; + + @Column(name = "expiration_date") + private LocalDateTime expirationDate; + + public String getUserId() { + return userId; + } + + public void setUserId(String username) { + this.userId = username; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getApprovedScopes() { + return approvedScopes; + } + + public void setApprovedScopes(String approvedScopes) { + this.approvedScopes = approvedScopes; + } + + public String getRedirectUri() { + return redirectUri; + } + + public void setRedirectUri(String redirectUri) { + this.redirectUri = redirectUri; + } + + public LocalDateTime getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(LocalDateTime expirationDate) { + this.expirationDate = expirationDate; + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/Client.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/Client.java similarity index 95% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/Client.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/Client.java index 9b5ad2f904..cb9276d99d 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/Client.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/Client.java @@ -1,62 +1,62 @@ -package com.baeldung.oauth2.authorization.server.model; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; - -@Entity -@Table(name = "clients") -public class Client { - @Id - @Column(name = "client_id") - private String clientId; - @Column(name = "client_secret") - private String clientSecret; - @Column(name = "redirect_uri") - private String redirectUri; - @Column(name = "scope") - private String scope; - @Column(name = "authorized_grant_types") - private String authorizedGrantTypes; - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - public String getRedirectUri() { - return redirectUri; - } - - public void setRedirectUri(String redirectUri) { - this.redirectUri = redirectUri; - } - - public String getScope() { - return scope; - } - - public void setScope(String scope) { - this.scope = scope; - } - - public String getAuthorizedGrantTypes() { - return authorizedGrantTypes; - } - - public void setAuthorizedGrantTypes(String authorizedGrantTypes) { - this.authorizedGrantTypes = authorizedGrantTypes; - } -} +package com.baeldung.oauth2.authorization.server.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name = "clients") +public class Client { + @Id + @Column(name = "client_id") + private String clientId; + @Column(name = "client_secret") + private String clientSecret; + @Column(name = "redirect_uri") + private String redirectUri; + @Column(name = "scope") + private String scope; + @Column(name = "authorized_grant_types") + private String authorizedGrantTypes; + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public String getRedirectUri() { + return redirectUri; + } + + public void setRedirectUri(String redirectUri) { + this.redirectUri = redirectUri; + } + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public String getAuthorizedGrantTypes() { + return authorizedGrantTypes; + } + + public void setAuthorizedGrantTypes(String authorizedGrantTypes) { + this.authorizedGrantTypes = authorizedGrantTypes; + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/User.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/User.java similarity index 95% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/User.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/User.java index b3821715f4..55a60b2009 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/User.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/model/User.java @@ -1,58 +1,58 @@ -package com.baeldung.oauth2.authorization.server.model; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; -import java.security.Principal; - -@Entity -@Table(name = "users") -public class User implements Principal { - @Id - @Column(name = "user_id") - private String userId; - @Column(name = "password") - private String password; - @Column(name = "roles") - private String roles; - @Column(name = "scopes") - private String scopes; - - public String getUserId() { - return userId; - } - - public void setUserId(String username) { - this.userId = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getRoles() { - return roles; - } - - public void setRoles(String roles) { - this.roles = roles; - } - - public String getScopes() { - return scopes; - } - - public void setScopes(String scopes) { - this.scopes = scopes; - } - - @Override - public String getName() { - return getUserId(); - } -} +package com.baeldung.oauth2.authorization.server.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import java.security.Principal; + +@Entity +@Table(name = "users") +public class User implements Principal { + @Id + @Column(name = "user_id") + private String userId; + @Column(name = "password") + private String password; + @Column(name = "roles") + private String roles; + @Column(name = "scopes") + private String scopes; + + public String getUserId() { + return userId; + } + + public void setUserId(String username) { + this.userId = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getRoles() { + return roles; + } + + public void setRoles(String roles) { + this.roles = roles; + } + + public String getScopes() { + return scopes; + } + + public void setScopes(String scopes) { + this.scopes = scopes; + } + + @Override + public String getName() { + return getUserId(); + } +} diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/security/UserIdentityStore.java b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/security/UserIdentityStore.java similarity index 97% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/security/UserIdentityStore.java rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/security/UserIdentityStore.java index a32ab32cd4..f1e07c7602 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/security/UserIdentityStore.java +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/java/com/baeldung/oauth2/authorization/server/security/UserIdentityStore.java @@ -1,37 +1,37 @@ -package com.baeldung.oauth2.authorization.server.security; - -import com.baeldung.oauth2.authorization.server.model.AppDataRepository; -import com.baeldung.oauth2.authorization.server.model.User; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; -import javax.security.enterprise.credential.Credential; -import javax.security.enterprise.credential.UsernamePasswordCredential; -import javax.security.enterprise.identitystore.CredentialValidationResult; -import javax.security.enterprise.identitystore.IdentityStore; -import javax.transaction.Transactional; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Objects; - -import static javax.security.enterprise.identitystore.CredentialValidationResult.INVALID_RESULT; - -@ApplicationScoped -@Transactional -public class UserIdentityStore implements IdentityStore { - - @Inject - private AppDataRepository appDataRepository; - - @Override - public CredentialValidationResult validate(Credential credential) { - UsernamePasswordCredential usernamePasswordCredential = (UsernamePasswordCredential) credential; - String userId = usernamePasswordCredential.getCaller(); - User user = appDataRepository.getUser(userId); - Objects.requireNonNull(user, "User should be not null"); - if (usernamePasswordCredential.getPasswordAsString().equals(user.getPassword())) { - return new CredentialValidationResult(userId, new HashSet<>(Arrays.asList(user.getRoles().split(",")))); - } - return INVALID_RESULT; - } +package com.baeldung.oauth2.authorization.server.security; + +import com.baeldung.oauth2.authorization.server.model.AppDataRepository; +import com.baeldung.oauth2.authorization.server.model.User; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.security.enterprise.credential.Credential; +import javax.security.enterprise.credential.UsernamePasswordCredential; +import javax.security.enterprise.identitystore.CredentialValidationResult; +import javax.security.enterprise.identitystore.IdentityStore; +import javax.transaction.Transactional; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; + +import static javax.security.enterprise.identitystore.CredentialValidationResult.INVALID_RESULT; + +@ApplicationScoped +@Transactional +public class UserIdentityStore implements IdentityStore { + + @Inject + private AppDataRepository appDataRepository; + + @Override + public CredentialValidationResult validate(Credential credential) { + UsernamePasswordCredential usernamePasswordCredential = (UsernamePasswordCredential) credential; + String userId = usernamePasswordCredential.getCaller(); + User user = appDataRepository.getUser(userId); + Objects.requireNonNull(user, "User should be not null"); + if (usernamePasswordCredential.getPasswordAsString().equals(user.getPassword())) { + return new CredentialValidationResult(userId, new HashSet<>(Arrays.asList(user.getRoles().split(",")))); + } + return INVALID_RESULT; + } } \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/liberty/config/server.xml b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/liberty/config/server.xml similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/liberty/config/server.xml rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/liberty/config/server.xml diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/microprofile-config.properties b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/microprofile-config.properties similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/microprofile-config.properties rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/microprofile-config.properties diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/persistence.xml b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/persistence.xml similarity index 98% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/persistence.xml rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/persistence.xml index a10ad3c886..9d7fc96426 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/persistence.xml +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/persistence.xml @@ -1,14 +1,14 @@ - - - - jdbc/OAuth2_DS - - - - - + + + + jdbc/OAuth2_DS + + + + + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/private-key.pem b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/private-key.pem similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/private-key.pem rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/private-key.pem diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/public-key.pem b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/public-key.pem similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/public-key.pem rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/META-INF/public-key.pem diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/data.sql b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/data.sql similarity index 99% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/resources/data.sql rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/data.sql index ecda0fa2ad..b3342a2168 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/data.sql +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/resources/data.sql @@ -1,3 +1,3 @@ -INSERT INTO `users` (`user_id`, `password`, `roles`, `scopes`) VALUES ('appuser', 'appusersecret', 'USER', 'resource.read resource.write'); - +INSERT INTO `users` (`user_id`, `password`, `roles`, `scopes`) VALUES ('appuser', 'appusersecret', 'USER', 'resource.read resource.write'); + INSERT INTO `clients` (`client_id`, `client_secret`, `redirect_uri`,`scope`,`authorized_grant_types`) VALUES ('webappclient', 'webappclientsecret', 'http://localhost:9180/callback', 'resource.read resource.write', 'authorization_code refresh_token'); \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/WEB-INF/beans.xml b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/WEB-INF/beans.xml rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/WEB-INF/beans.xml diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/authorize.jsp b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/authorize.jsp similarity index 96% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/authorize.jsp rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/authorize.jsp index 41b0582c03..51bad3565e 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/authorize.jsp +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/authorize.jsp @@ -1,54 +1,54 @@ -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - Authorization - - - - -
-

Want to Authorize scopes for client : ${client.clientId} ?

-
- -
- - - - - - - - - -
Scopes : - - ${scope}
-
-
- - -
-
- -
- - - +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + Authorization + + + + +
+

Want to Authorize scopes for client : ${client.clientId} ?

+
+ +
+ + + + + + + + + +
Scopes : + + ${scope}
+
+
+ + +
+
+ +
+ + + diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/error.jsp b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/error.jsp similarity index 94% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/error.jsp rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/error.jsp index edb0bf28b7..db996ea814 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/error.jsp +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/error.jsp @@ -1,25 +1,25 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> - - - - - - Error - - - - - - -
-

${error}

-
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> + + + + + + Error + + + + + + +
+

${error}

+
+ + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login-error.jsp b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login-error.jsp similarity index 100% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login-error.jsp rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login-error.jsp diff --git a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login.jsp b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login.jsp similarity index 96% rename from oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login.jsp rename to security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login.jsp index 1d2dd93fd0..c2caed961f 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login.jsp +++ b/security-modules/oauth2-framework-impl/oauth2-authorization-server/src/main/webapp/login.jsp @@ -1,49 +1,49 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> - - - - - Login Form - - - - -
-

Login Form

-
-
- - - - - - - - - - - - - -
Username
Password
-
- -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> + + + + + Login Form + + + + +
+

Login Form

+
+
+ + + + + + + + + + + + + +
Username
Password
+
+ +
+ + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-client/pom.xml b/security-modules/oauth2-framework-impl/oauth2-client/pom.xml similarity index 100% rename from oauth2-framework-impl/oauth2-client/pom.xml rename to security-modules/oauth2-framework-impl/oauth2-client/pom.xml diff --git a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AbstractServlet.java b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AbstractServlet.java similarity index 97% rename from oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AbstractServlet.java rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AbstractServlet.java index 7059c4f7e1..6e3d958dbd 100644 --- a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AbstractServlet.java +++ b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AbstractServlet.java @@ -1,23 +1,23 @@ -package com.baeldung.oauth2.client; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Base64; - -public abstract class AbstractServlet extends HttpServlet { - - protected void dispatch(String location, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - RequestDispatcher requestDispatcher = request.getRequestDispatcher(location); - requestDispatcher.forward(request, response); - } - - protected String getAuthorizationHeaderValue(String clientId, String clientSecret) { - String token = clientId + ":" + clientSecret; - String encodedString = Base64.getEncoder().encodeToString(token.getBytes()); - return "Basic " + encodedString; - } -} +package com.baeldung.oauth2.client; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Base64; + +public abstract class AbstractServlet extends HttpServlet { + + protected void dispatch(String location, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + RequestDispatcher requestDispatcher = request.getRequestDispatcher(location); + requestDispatcher.forward(request, response); + } + + protected String getAuthorizationHeaderValue(String clientId, String clientSecret) { + String token = clientId + ":" + clientSecret; + String encodedString = Base64.getEncoder().encodeToString(token.getBytes()); + return "Basic " + encodedString; + } +} diff --git a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AuthorizationCodeServlet.java b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AuthorizationCodeServlet.java similarity index 97% rename from oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AuthorizationCodeServlet.java rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AuthorizationCodeServlet.java index a5fdaf07f2..56a72586c8 100644 --- a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AuthorizationCodeServlet.java +++ b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/AuthorizationCodeServlet.java @@ -1,39 +1,39 @@ -package com.baeldung.oauth2.client; - -import org.eclipse.microprofile.config.Config; - -import javax.inject.Inject; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.UUID; - -@WebServlet(urlPatterns = "/authorize") -public class AuthorizationCodeServlet extends HttpServlet { - - @Inject - private Config config; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - //... - request.getSession().removeAttribute("tokenResponse"); - String state = UUID.randomUUID().toString(); - request.getSession().setAttribute("CLIENT_LOCAL_STATE", state); - - String authorizationUri = config.getValue("provider.authorizationUri", String.class); - String clientId = config.getValue("client.clientId", String.class); - String redirectUri = config.getValue("client.redirectUri", String.class); - String scope = config.getValue("client.scope", String.class); - - String authorizationLocation = authorizationUri + "?response_type=code" - + "&client_id=" + clientId - + "&redirect_uri=" + redirectUri - + "&scope=" + scope - + "&state=" + state; - response.sendRedirect(authorizationLocation); - } -} +package com.baeldung.oauth2.client; + +import org.eclipse.microprofile.config.Config; + +import javax.inject.Inject; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.UUID; + +@WebServlet(urlPatterns = "/authorize") +public class AuthorizationCodeServlet extends HttpServlet { + + @Inject + private Config config; + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + //... + request.getSession().removeAttribute("tokenResponse"); + String state = UUID.randomUUID().toString(); + request.getSession().setAttribute("CLIENT_LOCAL_STATE", state); + + String authorizationUri = config.getValue("provider.authorizationUri", String.class); + String clientId = config.getValue("client.clientId", String.class); + String redirectUri = config.getValue("client.redirectUri", String.class); + String scope = config.getValue("client.scope", String.class); + + String authorizationLocation = authorizationUri + "?response_type=code" + + "&client_id=" + clientId + + "&redirect_uri=" + redirectUri + + "&scope=" + scope + + "&state=" + state; + response.sendRedirect(authorizationLocation); + } +} diff --git a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/CallbackServlet.java b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/CallbackServlet.java similarity index 97% rename from oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/CallbackServlet.java rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/CallbackServlet.java index e72877076c..77f8197b9b 100644 --- a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/CallbackServlet.java +++ b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/CallbackServlet.java @@ -1,67 +1,67 @@ -package com.baeldung.oauth2.client; - -import org.eclipse.microprofile.config.Config; - -import javax.inject.Inject; -import javax.json.JsonObject; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import java.io.IOException; - -@WebServlet(urlPatterns = "/callback") -public class CallbackServlet extends AbstractServlet { - - @Inject - private Config config; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String clientId = config.getValue("client.clientId", String.class); - String clientSecret = config.getValue("client.clientSecret", String.class); - - //Error: - String error = request.getParameter("error"); - if (error != null) { - request.setAttribute("error", error); - dispatch("/", request, response); - return; - } - String localState = (String) request.getSession().getAttribute("CLIENT_LOCAL_STATE"); - if (!localState.equals(request.getParameter("state"))) { - request.setAttribute("error", "The state attribute doesn't match !!"); - dispatch("/", request, response); - return; - } - - String code = request.getParameter("code"); - - Client client = ClientBuilder.newClient(); - WebTarget target = client.target(config.getValue("provider.tokenUri", String.class)); - - Form form = new Form(); - form.param("grant_type", "authorization_code"); - form.param("code", code); - form.param("redirect_uri", config.getValue("client.redirectUri", String.class)); - - try { - JsonObject tokenResponse = target.request(MediaType.APPLICATION_JSON_TYPE) - .header(HttpHeaders.AUTHORIZATION, getAuthorizationHeaderValue(clientId, clientSecret)) - .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), JsonObject.class); - request.getSession().setAttribute("tokenResponse", tokenResponse); - } catch (Exception ex) { - System.out.println(ex.getMessage()); - request.setAttribute("error", ex.getMessage()); - } - dispatch("/", request, response); - } -} +package com.baeldung.oauth2.client; + +import org.eclipse.microprofile.config.Config; + +import javax.inject.Inject; +import javax.json.JsonObject; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import java.io.IOException; + +@WebServlet(urlPatterns = "/callback") +public class CallbackServlet extends AbstractServlet { + + @Inject + private Config config; + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + String clientId = config.getValue("client.clientId", String.class); + String clientSecret = config.getValue("client.clientSecret", String.class); + + //Error: + String error = request.getParameter("error"); + if (error != null) { + request.setAttribute("error", error); + dispatch("/", request, response); + return; + } + String localState = (String) request.getSession().getAttribute("CLIENT_LOCAL_STATE"); + if (!localState.equals(request.getParameter("state"))) { + request.setAttribute("error", "The state attribute doesn't match !!"); + dispatch("/", request, response); + return; + } + + String code = request.getParameter("code"); + + Client client = ClientBuilder.newClient(); + WebTarget target = client.target(config.getValue("provider.tokenUri", String.class)); + + Form form = new Form(); + form.param("grant_type", "authorization_code"); + form.param("code", code); + form.param("redirect_uri", config.getValue("client.redirectUri", String.class)); + + try { + JsonObject tokenResponse = target.request(MediaType.APPLICATION_JSON_TYPE) + .header(HttpHeaders.AUTHORIZATION, getAuthorizationHeaderValue(clientId, clientSecret)) + .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), JsonObject.class); + request.getSession().setAttribute("tokenResponse", tokenResponse); + } catch (Exception ex) { + System.out.println(ex.getMessage()); + request.setAttribute("error", ex.getMessage()); + } + dispatch("/", request, response); + } +} diff --git a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/DownstreamCallServlet.java b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/DownstreamCallServlet.java similarity index 97% rename from oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/DownstreamCallServlet.java rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/DownstreamCallServlet.java index bbe850917b..c6a7f8b08b 100644 --- a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/DownstreamCallServlet.java +++ b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/DownstreamCallServlet.java @@ -1,49 +1,49 @@ -package com.baeldung.oauth2.client; - -import org.eclipse.microprofile.config.Config; - -import javax.inject.Inject; -import javax.json.JsonObject; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.client.*; -import java.io.IOException; -import java.io.PrintWriter; - -@WebServlet(urlPatterns = "/downstream") -public class DownstreamCallServlet extends HttpServlet { - - @Inject - private Config config; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException { - resp.setContentType("text/html;charset=UTF-8"); - String action = request.getParameter("action"); - Client client = ClientBuilder.newClient(); - WebTarget webTarget = client.target(config.getValue("resourceServerUri", String.class)); - WebTarget resourceWebTarget; - String response = null; - JsonObject tokenResponse = (JsonObject) request.getSession().getAttribute("tokenResponse"); - if ("read".equals(action)) { - resourceWebTarget = webTarget.path("resource/read"); - Invocation.Builder invocationBuilder = resourceWebTarget.request(); - response = invocationBuilder - .header("authorization", tokenResponse.getString("access_token")) - .get(String.class); - } else if ("write".equals(action)) { - resourceWebTarget = webTarget.path("resource/write"); - Invocation.Builder invocationBuilder = resourceWebTarget.request(); - response = invocationBuilder - .header("authorization", tokenResponse.getString("access_token")) - .post(Entity.text("body string"), String.class); - } - PrintWriter out = resp.getWriter(); - out.println(response); - out.flush(); - out.close(); - } -} +package com.baeldung.oauth2.client; + +import org.eclipse.microprofile.config.Config; + +import javax.inject.Inject; +import javax.json.JsonObject; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.client.*; +import java.io.IOException; +import java.io.PrintWriter; + +@WebServlet(urlPatterns = "/downstream") +public class DownstreamCallServlet extends HttpServlet { + + @Inject + private Config config; + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException { + resp.setContentType("text/html;charset=UTF-8"); + String action = request.getParameter("action"); + Client client = ClientBuilder.newClient(); + WebTarget webTarget = client.target(config.getValue("resourceServerUri", String.class)); + WebTarget resourceWebTarget; + String response = null; + JsonObject tokenResponse = (JsonObject) request.getSession().getAttribute("tokenResponse"); + if ("read".equals(action)) { + resourceWebTarget = webTarget.path("resource/read"); + Invocation.Builder invocationBuilder = resourceWebTarget.request(); + response = invocationBuilder + .header("authorization", tokenResponse.getString("access_token")) + .get(String.class); + } else if ("write".equals(action)) { + resourceWebTarget = webTarget.path("resource/write"); + Invocation.Builder invocationBuilder = resourceWebTarget.request(); + response = invocationBuilder + .header("authorization", tokenResponse.getString("access_token")) + .post(Entity.text("body string"), String.class); + } + PrintWriter out = resp.getWriter(); + out.println(response); + out.flush(); + out.close(); + } +} diff --git a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/RefreshTokenServlet.java b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/RefreshTokenServlet.java similarity index 97% rename from oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/RefreshTokenServlet.java rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/RefreshTokenServlet.java index a519a53070..af01beaa28 100644 --- a/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/RefreshTokenServlet.java +++ b/security-modules/oauth2-framework-impl/oauth2-client/src/main/java/com/baeldung/oauth2/client/RefreshTokenServlet.java @@ -1,57 +1,57 @@ -package com.baeldung.oauth2.client; - -import org.eclipse.microprofile.config.Config; - -import javax.inject.Inject; -import javax.json.JsonObject; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import java.io.IOException; - -@WebServlet(urlPatterns = "/refreshtoken") -public class RefreshTokenServlet extends AbstractServlet { - - @Inject - private Config config; - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String clientId = config.getValue("client.clientId", String.class); - String clientSecret = config.getValue("client.clientSecret", String.class); - - JsonObject actualTokenResponse = (JsonObject) request.getSession().getAttribute("tokenResponse"); - Client client = ClientBuilder.newClient(); - WebTarget target = client.target(config.getValue("provider.tokenUri", String.class)); - - Form form = new Form(); - form.param("grant_type", "refresh_token"); - form.param("refresh_token", actualTokenResponse.getString("refresh_token")); - - String scope = request.getParameter("scope"); - if (scope != null && !scope.isEmpty()) { - form.param("scope", scope); - } - - Response jaxrsResponse = target.request(MediaType.APPLICATION_JSON_TYPE) - .header(HttpHeaders.AUTHORIZATION, getAuthorizationHeaderValue(clientId, clientSecret)) - .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), Response.class); - JsonObject tokenResponse = jaxrsResponse.readEntity(JsonObject.class); - if (jaxrsResponse.getStatus() == 200) { - request.getSession().setAttribute("tokenResponse", tokenResponse); - } else { - request.setAttribute("error", tokenResponse.getString("error_description", "error!")); - } - dispatch("/", request, response); - } -} +package com.baeldung.oauth2.client; + +import org.eclipse.microprofile.config.Config; + +import javax.inject.Inject; +import javax.json.JsonObject; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.io.IOException; + +@WebServlet(urlPatterns = "/refreshtoken") +public class RefreshTokenServlet extends AbstractServlet { + + @Inject + private Config config; + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + String clientId = config.getValue("client.clientId", String.class); + String clientSecret = config.getValue("client.clientSecret", String.class); + + JsonObject actualTokenResponse = (JsonObject) request.getSession().getAttribute("tokenResponse"); + Client client = ClientBuilder.newClient(); + WebTarget target = client.target(config.getValue("provider.tokenUri", String.class)); + + Form form = new Form(); + form.param("grant_type", "refresh_token"); + form.param("refresh_token", actualTokenResponse.getString("refresh_token")); + + String scope = request.getParameter("scope"); + if (scope != null && !scope.isEmpty()) { + form.param("scope", scope); + } + + Response jaxrsResponse = target.request(MediaType.APPLICATION_JSON_TYPE) + .header(HttpHeaders.AUTHORIZATION, getAuthorizationHeaderValue(clientId, clientSecret)) + .post(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE), Response.class); + JsonObject tokenResponse = jaxrsResponse.readEntity(JsonObject.class); + if (jaxrsResponse.getStatus() == 200) { + request.getSession().setAttribute("tokenResponse", tokenResponse); + } else { + request.setAttribute("error", tokenResponse.getString("error_description", "error!")); + } + dispatch("/", request, response); + } +} diff --git a/oauth2-framework-impl/oauth2-client/src/main/liberty/config/server.xml b/security-modules/oauth2-framework-impl/oauth2-client/src/main/liberty/config/server.xml similarity index 100% rename from oauth2-framework-impl/oauth2-client/src/main/liberty/config/server.xml rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/liberty/config/server.xml diff --git a/oauth2-framework-impl/oauth2-client/src/main/resources/META-INF/microprofile-config.properties b/security-modules/oauth2-framework-impl/oauth2-client/src/main/resources/META-INF/microprofile-config.properties similarity index 100% rename from oauth2-framework-impl/oauth2-client/src/main/resources/META-INF/microprofile-config.properties rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/resources/META-INF/microprofile-config.properties diff --git a/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/beans.xml b/security-modules/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/beans.xml rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/beans.xml diff --git a/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/web.xml b/security-modules/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/web.xml similarity index 97% rename from oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/web.xml rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/web.xml index 0203894c1b..c9e4658ab4 100644 --- a/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/web.xml +++ b/security-modules/oauth2-framework-impl/oauth2-client/src/main/webapp/WEB-INF/web.xml @@ -1,5 +1,5 @@ - - - index.jsp - + + + index.jsp + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-client/src/main/webapp/index.jsp b/security-modules/oauth2-framework-impl/oauth2-client/src/main/webapp/index.jsp similarity index 100% rename from oauth2-framework-impl/oauth2-client/src/main/webapp/index.jsp rename to security-modules/oauth2-framework-impl/oauth2-client/src/main/webapp/index.jsp diff --git a/oauth2-framework-impl/oauth2-resource-server/pom.xml b/security-modules/oauth2-framework-impl/oauth2-resource-server/pom.xml similarity index 97% rename from oauth2-framework-impl/oauth2-resource-server/pom.xml rename to security-modules/oauth2-framework-impl/oauth2-resource-server/pom.xml index d3af2cfd80..d9146c7522 100644 --- a/oauth2-framework-impl/oauth2-resource-server/pom.xml +++ b/security-modules/oauth2-framework-impl/oauth2-resource-server/pom.xml @@ -1,42 +1,42 @@ - - - 4.0.0 - oauth2-resource-server - oauth2-resource-server - war - - - com.baeldung.oauth2 - oauth2-framework-impl - 1.0-SNAPSHOT - - - - - org.eclipse.microprofile.jwt - microprofile-jwt-auth-api - ${microprofile-jwt-auth-api.version} - provided - - - - - - - net.wasdev.wlp.maven.plugins - liberty-maven-plugin - - - - - - 9280 - 8643 - http://localhost:9080 - http://localhost:9280 - 1.1 - - + + + 4.0.0 + oauth2-resource-server + oauth2-resource-server + war + + + com.baeldung.oauth2 + oauth2-framework-impl + 1.0-SNAPSHOT + + + + + org.eclipse.microprofile.jwt + microprofile-jwt-auth-api + ${microprofile-jwt-auth-api.version} + provided + + + + + + + net.wasdev.wlp.maven.plugins + liberty-maven-plugin + + + + + + 9280 + 8643 + http://localhost:9080 + http://localhost:9280 + 1.1 + + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/OAuth2ResourceServerApplication.java b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/OAuth2ResourceServerApplication.java similarity index 100% rename from oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/OAuth2ResourceServerApplication.java rename to security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/OAuth2ResourceServerApplication.java diff --git a/oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/secure/ProtectedResource.java b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/secure/ProtectedResource.java similarity index 100% rename from oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/secure/ProtectedResource.java rename to security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/java/com/baeldung/oauth2/resource/server/secure/ProtectedResource.java diff --git a/oauth2-framework-impl/oauth2-resource-server/src/main/liberty/config/server.xml b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/liberty/config/server.xml similarity index 100% rename from oauth2-framework-impl/oauth2-resource-server/src/main/liberty/config/server.xml rename to security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/liberty/config/server.xml diff --git a/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/microprofile-config.properties b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/microprofile-config.properties similarity index 99% rename from oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/microprofile-config.properties rename to security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/microprofile-config.properties index be6919ec50..b6811fa8a3 100644 --- a/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/microprofile-config.properties +++ b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/microprofile-config.properties @@ -1,2 +1,2 @@ -mp.jwt.verify.publickey.location=/META-INF/public-key.pem +mp.jwt.verify.publickey.location=/META-INF/public-key.pem mp.jwt.verify.issuer=http://localhost:9080 \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/public-key.pem b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/public-key.pem similarity index 100% rename from oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/public-key.pem rename to security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/resources/META-INF/public-key.pem diff --git a/oauth2-framework-impl/oauth2-resource-server/src/main/webapp/WEB-INF/beans.xml b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from oauth2-framework-impl/oauth2-resource-server/src/main/webapp/WEB-INF/beans.xml rename to security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/webapp/WEB-INF/beans.xml diff --git a/oauth2-framework-impl/oauth2-resource-server/src/main/webapp/index.html b/security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/webapp/index.html similarity index 100% rename from oauth2-framework-impl/oauth2-resource-server/src/main/webapp/index.html rename to security-modules/oauth2-framework-impl/oauth2-resource-server/src/main/webapp/index.html diff --git a/oauth2-framework-impl/pom.xml b/security-modules/oauth2-framework-impl/pom.xml similarity index 96% rename from oauth2-framework-impl/pom.xml rename to security-modules/oauth2-framework-impl/pom.xml index 5cfcb22fab..78567c14fd 100644 --- a/oauth2-framework-impl/pom.xml +++ b/security-modules/oauth2-framework-impl/pom.xml @@ -9,6 +9,12 @@ oauth2-framework-impl pom + + com.baeldung + security-modules + 1.0.0-SNAPSHOT + + oauth2-authorization-server oauth2-resource-server diff --git a/security-modules/pom.xml b/security-modules/pom.xml new file mode 100644 index 0000000000..480ee0819e --- /dev/null +++ b/security-modules/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + security-modules + security-modules + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + apache-shiro + cas + cloud-foundry-uaa + + jee-7-security + jjwt + oauth2-framework-impl + sql-injection-samples + + + \ No newline at end of file diff --git a/software-security/sql-injection-samples/.gitignore b/security-modules/sql-injection-samples/.gitignore similarity index 100% rename from software-security/sql-injection-samples/.gitignore rename to security-modules/sql-injection-samples/.gitignore diff --git a/software-security/sql-injection-samples/README.md b/security-modules/sql-injection-samples/README.md similarity index 100% rename from software-security/sql-injection-samples/README.md rename to security-modules/sql-injection-samples/README.md diff --git a/security-modules/sql-injection-samples/derby.log b/security-modules/sql-injection-samples/derby.log new file mode 100644 index 0000000000..67eaae4238 --- /dev/null +++ b/security-modules/sql-injection-samples/derby.log @@ -0,0 +1,13 @@ +---------------------------------------------------------------- +Fri Aug 19 19:44:34 IST 2022: +Booting Derby version The Apache Software Foundation - Apache Derby - 10.14.2.0 - (1828579): instance a816c00e-0182-b674-a779-000005b040a8 +on database directory memory:E:\tutorials\security-modules\sql-injection-samples\cea8e259-4b4e-438e-8ffc-52ce09fc5b49 with class loader sun.misc.Launcher$AppClassLoader@42a57993 +Loaded from file:/C:/Users/DELL/.m2/repository/org/apache/derby/derby/10.14.2.0/derby-10.14.2.0.jar +java.vendor=Oracle Corporation +java.runtime.version=1.8.0_311-b11 +user.dir=E:\tutorials\security-modules\sql-injection-samples +os.name=Windows 10 +os.arch=amd64 +os.version=10.0 +derby.system.home=null +Database Class Loader started - derby.database.classpath='' diff --git a/software-security/sql-injection-samples/pom.xml b/security-modules/sql-injection-samples/pom.xml similarity index 100% rename from software-security/sql-injection-samples/pom.xml rename to security-modules/sql-injection-samples/pom.xml diff --git a/software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/Account.java b/security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/Account.java similarity index 100% rename from software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/Account.java rename to security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/Account.java diff --git a/software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDAO.java b/security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDAO.java similarity index 100% rename from software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDAO.java rename to security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDAO.java diff --git a/software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDTO.java b/security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDTO.java similarity index 100% rename from software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDTO.java rename to security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/AccountDTO.java diff --git a/software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplication.java b/security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplication.java similarity index 100% rename from software-security/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplication.java rename to security-modules/sql-injection-samples/src/main/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplication.java diff --git a/software-security/sql-injection-samples/src/main/resources/application.properties b/security-modules/sql-injection-samples/src/main/resources/application.properties similarity index 100% rename from software-security/sql-injection-samples/src/main/resources/application.properties rename to security-modules/sql-injection-samples/src/main/resources/application.properties diff --git a/software-security/sql-injection-samples/src/main/resources/logback.xml b/security-modules/sql-injection-samples/src/main/resources/logback.xml similarity index 100% rename from software-security/sql-injection-samples/src/main/resources/logback.xml rename to security-modules/sql-injection-samples/src/main/resources/logback.xml diff --git a/software-security/sql-injection-samples/src/test/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplicationUnitTest.java b/security-modules/sql-injection-samples/src/test/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplicationUnitTest.java similarity index 100% rename from software-security/sql-injection-samples/src/test/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplicationUnitTest.java rename to security-modules/sql-injection-samples/src/test/java/com/baeldung/examples/security/sql/SqlInjectionSamplesApplicationUnitTest.java diff --git a/software-security/sql-injection-samples/src/test/resources/application-test.yml b/security-modules/sql-injection-samples/src/test/resources/application-test.yml similarity index 100% rename from software-security/sql-injection-samples/src/test/resources/application-test.yml rename to security-modules/sql-injection-samples/src/test/resources/application-test.yml diff --git a/software-security/sql-injection-samples/src/test/resources/data.sql b/security-modules/sql-injection-samples/src/test/resources/data.sql similarity index 100% rename from software-security/sql-injection-samples/src/test/resources/data.sql rename to security-modules/sql-injection-samples/src/test/resources/data.sql diff --git a/software-security/sql-injection-samples/src/test/resources/logback-test.xml b/security-modules/sql-injection-samples/src/test/resources/logback-test.xml similarity index 100% rename from software-security/sql-injection-samples/src/test/resources/logback-test.xml rename to security-modules/sql-injection-samples/src/test/resources/logback-test.xml diff --git a/software-security/sql-injection-samples/src/test/resources/schema.sql b/security-modules/sql-injection-samples/src/test/resources/schema.sql similarity index 100% rename from software-security/sql-injection-samples/src/test/resources/schema.sql rename to security-modules/sql-injection-samples/src/test/resources/schema.sql From 6bc1d484ca5740f5a728ad1d0054e6bde3b4e247 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Sat, 20 Aug 2022 14:20:24 +0530 Subject: [PATCH 38/73] JAVA-13855 Create new microservices-modules (#12612) --- micronaut/.mvn/wrapper/maven-wrapper.jar | Bin 48336 -> 0 bytes .../helidon}/README.md | 0 .../helidon}/helidon-mp/pom.xml | 0 .../microprofile/LibraryApplication.java | 0 .../com/baeldung/microprofile/model/Book.java | 0 .../providers/BookListMessageBodyWriter.java | 0 .../providers/BookMessageBodyReader.java | 0 .../providers/BookMessageBodyWriter.java | 0 .../microprofile/repo/BookManager.java | 0 .../microprofile/util/BookMapper.java | 0 .../microprofile/web/BookEndpoint.java | 0 .../src/main/resources/META-INF/beans.xml | 14 +- .../helidon-mp/src/main/resources/logback.xml | 0 .../helidon}/helidon-se/pom.xml | 0 .../helidon/se/config/ConfigApplication.java | 58 ++-- .../com/baeldung/helidon/se/routing/Book.java | 96 +++--- .../helidon/se/routing/BookManager.java | 96 +++--- .../helidon/se/routing/BookResource.java | 116 +++---- .../se/routing/WebApplicationRouting.java | 58 ++-- .../baeldung/helidon/se/security/MyUser.java | 66 ++-- .../se/security/WebApplicationSecurity.java | 122 +++---- .../se/webserver/SimpleWebApplication.java | 52 +-- .../src/main/resources/application.json | 0 .../src/main/resources/application.properties | 6 +- .../src/main/resources/application.yaml | 0 .../helidon}/pom.xml | 2 +- .../micronaut}/.mvn/jvm.config | 0 .../.mvn/wrapper/MavenWrapperDownloader.java | 0 .../.mvn/wrapper/maven-wrapper.properties | 0 .../micronaut}/Dockerfile | 0 .../micronaut}/README.md | 0 .../micronaut}/micronaut-cli.yml | 0 .../micronaut}/mvnw | 0 .../micronaut}/mvnw.cmd | 322 +++++++++--------- .../micronaut}/pom.xml | 2 +- .../client/ConcreteGreetingClient.java | 0 .../helloworld/client/GreetingClient.java | 0 .../helloworld/server/ServerApplication.java | 0 .../controller/AsyncGreetController.java | 0 .../server/controller/GreetController.java | 0 .../service/EnglishGreetingService.java | 0 .../server/service/GreetingService.java | 0 .../service/SpanishGreetingService.java | 0 .../vs/springboot/CompareApplication.java | 0 .../springboot/client/ArithmeticClient.java | 0 .../client/ArithmeticClientImpl.java | 0 .../controller/ArithmeticController.java | 0 .../springboot/service/ArithmeticService.java | 0 .../src/main/resources/application.yml | 0 .../micronaut}/src/main/resources/logback.xml | 0 .../ConcreteGreetingClientUnitTest.java | 0 .../client/GreetingClientUnitTest.java | 0 .../springboot/ArithmeticClientUnitTest.java | 0 .../microprofile}/README.md | 0 .../microprofile}/pom.xml | 2 +- .../microprofile/LibraryApplication.java | 0 .../com/baeldung/microprofile/model/Book.java | 0 .../providers/BookListMessageBodyWriter.java | 0 .../providers/BookMessageBodyReader.java | 0 .../providers/BookMessageBodyWriter.java | 0 .../microprofile/repo/BookManager.java | 0 .../microprofile/util/BookMapper.java | 0 .../microprofile/web/BookEndpoint.java | 0 .../src/main/liberty/config/server.xml | 0 .../src/main/resources/logback.xml | 0 .../msf4j}/README.md | 0 .../msf4j}/pom.xml | 2 +- .../baeldung/msf4j/msf4japi/Application.java | 0 .../com/baeldung/msf4j/msf4japi/Meal.java | 0 .../baeldung/msf4j/msf4japi/MenuService.java | 0 .../msf4j/msf4jintro/Application.java | 0 .../msf4j/msf4jintro/SimpleService.java | 0 .../msf4j/msf4jspring/Application.java | 0 .../configuration/PortConfiguration.java | 0 .../msf4j/msf4jspring/domain/Meal.java | 0 .../repositories/MealRepository.java | 0 .../msf4jspring/resources/MealResource.java | 0 .../msf4jspring/services/MealService.java | 0 .../src/main/resources/application.properties | 0 .../msf4j}/src/main/resources/logback.xml | 0 .../main/resources/templates/meals.mustache | 0 .../open-liberty}/README.md | 0 microservices-modules/open-liberty/pom.xml | 127 +++++++ .../openliberty/person/dao/PersonDao.java | 0 .../openliberty/person/model/Person.java | 0 .../person/resource/PersonResource.java | 0 .../openliberty/rest/ApiApplication.java | 0 .../rest/consumes/RestConsumer.java | 0 .../openliberty/servlet/AppServlet.java | 0 .../src/main/liberty/config/server.xml | 0 .../main/resources/META-INF/persistence.xml | 0 .../openliberty/RestClientLiveTest.java | 2 +- microservices-modules/pom.xml | 24 ++ open-liberty/pom.xml | 121 ------- pom.xml | 12 +- 95 files changed, 661 insertions(+), 639 deletions(-) delete mode 100644 micronaut/.mvn/wrapper/maven-wrapper.jar rename {helidon => microservices-modules/helidon}/README.md (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/pom.xml (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java (100%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/resources/META-INF/beans.xml (97%) rename {helidon => microservices-modules/helidon}/helidon-mp/src/main/resources/logback.xml (100%) rename {helidon => microservices-modules/helidon}/helidon-se/pom.xml (100%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java (97%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java (94%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java (96%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java (96%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java (96%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java (95%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java (97%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java (96%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/resources/application.json (100%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/resources/application.properties (95%) rename {helidon => microservices-modules/helidon}/helidon-se/src/main/resources/application.yaml (100%) rename {helidon => microservices-modules/helidon}/pom.xml (92%) rename {micronaut => microservices-modules/micronaut}/.mvn/jvm.config (100%) rename {micronaut => microservices-modules/micronaut}/.mvn/wrapper/MavenWrapperDownloader.java (100%) rename {micronaut => microservices-modules/micronaut}/.mvn/wrapper/maven-wrapper.properties (100%) rename {micronaut => microservices-modules/micronaut}/Dockerfile (100%) rename {micronaut => microservices-modules/micronaut}/README.md (100%) rename {micronaut => microservices-modules/micronaut}/micronaut-cli.yml (100%) rename {micronaut => microservices-modules/micronaut}/mvnw (100%) mode change 100755 => 100644 rename {micronaut => microservices-modules/micronaut}/mvnw.cmd (97%) mode change 100755 => 100644 rename {micronaut => microservices-modules/micronaut}/pom.xml (99%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClient.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/client/GreetingClient.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/server/ServerApplication.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/server/controller/AsyncGreetController.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/server/controller/GreetController.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/server/service/EnglishGreetingService.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/server/service/GreetingService.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/helloworld/server/service/SpanishGreetingService.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/vs/springboot/CompareApplication.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClient.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClientImpl.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/vs/springboot/controller/ArithmeticController.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/java/com/baeldung/micronaut/vs/springboot/service/ArithmeticService.java (100%) rename {micronaut => microservices-modules/micronaut}/src/main/resources/application.yml (100%) rename {micronaut => microservices-modules/micronaut}/src/main/resources/logback.xml (100%) rename {micronaut => microservices-modules/micronaut}/src/test/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClientUnitTest.java (100%) rename {micronaut => microservices-modules/micronaut}/src/test/java/com/baeldung/micronaut/helloworld/client/GreetingClientUnitTest.java (100%) rename {micronaut => microservices-modules/micronaut}/src/test/java/com/baeldung/micronaut/vs/springboot/ArithmeticClientUnitTest.java (100%) rename {microprofile => microservices-modules/microprofile}/README.md (100%) rename {microprofile => microservices-modules/microprofile}/pom.xml (98%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/LibraryApplication.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/model/Book.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/repo/BookManager.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/util/BookMapper.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java (100%) rename {microprofile => microservices-modules/microprofile}/src/main/liberty/config/server.xml (100%) rename {microprofile => microservices-modules/microprofile}/src/main/resources/logback.xml (100%) rename {msf4j => microservices-modules/msf4j}/README.md (100%) rename {msf4j => microservices-modules/msf4j}/pom.xml (96%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4japi/Application.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4japi/Meal.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4japi/MenuService.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jintro/Application.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jintro/SimpleService.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jspring/Application.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jspring/configuration/PortConfiguration.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jspring/domain/Meal.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jspring/repositories/MealRepository.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jspring/resources/MealResource.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/java/com/baeldung/msf4j/msf4jspring/services/MealService.java (100%) rename {msf4j => microservices-modules/msf4j}/src/main/resources/application.properties (100%) rename {msf4j => microservices-modules/msf4j}/src/main/resources/logback.xml (100%) rename {msf4j => microservices-modules/msf4j}/src/main/resources/templates/meals.mustache (100%) rename {open-liberty => microservices-modules/open-liberty}/README.md (100%) create mode 100644 microservices-modules/open-liberty/pom.xml rename {open-liberty => microservices-modules/open-liberty}/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java (100%) rename {open-liberty => microservices-modules/open-liberty}/src/main/java/com/baeldung/openliberty/person/model/Person.java (100%) rename {open-liberty => microservices-modules/open-liberty}/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java (100%) rename {open-liberty => microservices-modules/open-liberty}/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java (100%) rename {open-liberty => microservices-modules/open-liberty}/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java (100%) rename {open-liberty => microservices-modules/open-liberty}/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java (100%) rename {open-liberty => microservices-modules/open-liberty}/src/main/liberty/config/server.xml (100%) rename {open-liberty => microservices-modules/open-liberty}/src/main/resources/META-INF/persistence.xml (100%) rename open-liberty/src/test/java/com/baeldung/openliberty/RestClientTest.java => microservices-modules/open-liberty/src/test/java/com/baeldung/openliberty/RestClientLiveTest.java (96%) create mode 100644 microservices-modules/pom.xml delete mode 100644 open-liberty/pom.xml diff --git a/micronaut/.mvn/wrapper/maven-wrapper.jar b/micronaut/.mvn/wrapper/maven-wrapper.jar deleted file mode 100644 index 08ebbb67f088c53eac9a4e2cb019b93f69a1e49c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48336 zcmbTe1CVCTvMxMr+qUiQY1_8@ZQJIwjcMDqjcHHYwr%^)#=(F7yT3U5z7Z9%BGxKo zRaWJbnNPh6(jcIy-yk6&zkT~g^r!sS59-gOtf-10our%?1IRZ8X^6jl^9}f)Unu;` zim3m+qO72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|>o-v~sBcmELy+9_S#1e_erK$O7dhX17ox!-|K4o^r~Q0z<}h^U0| zP6t{+^Yza=@cTjbzV_F4$H=81t&5<4syo_kKt&z?Ui*K>_19`Y1-;jL09w3=_@Gi) zchowA9twY}7Q~z4sBiV3ilO&A%PLc#e-2uI)}W~+yQ6iG}dAn#m z!yT0b#s*~yO!Z~_17B#f)jE7MDzXo z{Z1{|`@O$iHtp^*w&wo{#vd~PI%3?fk$4~AcBzu<>T5Rw1UC`>HNf3kY`^LLo1OBy z*vWrI5fm8ux2C@?eR98>w@WizbBo^y5Ip@?s(xMg@P!^!`m-#1|Y z}}>fftyi*u0ZfwgZ~Zo_d))_H+diK zHYe9Lo!^ZB!Rw9xHQZ0g{qE!5=2ud>0R>%w;0PA~8uuUZf8FoFZEA??^qd<3f;U+G z>mK}!)#*O)?F{_8Ciijt*T6sFp}3EGJFWTdfMZ?$HSX^>mB3$S``-t?oewH;wC_bc1p&d=b#F)Zi`1fTW$*TBED>g`ze>zt1p0fMs!{%f?KXMo(d@aKbI@F(B-UnAUhHD3P^z7Zh!RMx*m_}OlG+o^T!xV#Y{ zI3~z7@$&=OKX+r^pP}2%6tNpf&=m-dp8pHf`)B1_=bS$sJ)l6ZI>5l_L4UcRpWUd1 H*Ps3mB7Q<; diff --git a/helidon/README.md b/microservices-modules/helidon/README.md similarity index 100% rename from helidon/README.md rename to microservices-modules/helidon/README.md diff --git a/helidon/helidon-mp/pom.xml b/microservices-modules/helidon/helidon-mp/pom.xml similarity index 100% rename from helidon/helidon-mp/pom.xml rename to microservices-modules/helidon/helidon-mp/pom.xml diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/LibraryApplication.java diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/model/Book.java diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/repo/BookManager.java diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/util/BookMapper.java diff --git a/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java b/microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java similarity index 100% rename from helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java rename to microservices-modules/helidon/helidon-mp/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java diff --git a/helidon/helidon-mp/src/main/resources/META-INF/beans.xml b/microservices-modules/helidon/helidon-mp/src/main/resources/META-INF/beans.xml similarity index 97% rename from helidon/helidon-mp/src/main/resources/META-INF/beans.xml rename to microservices-modules/helidon/helidon-mp/src/main/resources/META-INF/beans.xml index faae50dfc2..2ac599bc6b 100644 --- a/helidon/helidon-mp/src/main/resources/META-INF/beans.xml +++ b/microservices-modules/helidon/helidon-mp/src/main/resources/META-INF/beans.xml @@ -1,7 +1,7 @@ - - + + diff --git a/helidon/helidon-mp/src/main/resources/logback.xml b/microservices-modules/helidon/helidon-mp/src/main/resources/logback.xml similarity index 100% rename from helidon/helidon-mp/src/main/resources/logback.xml rename to microservices-modules/helidon/helidon-mp/src/main/resources/logback.xml diff --git a/helidon/helidon-se/pom.xml b/microservices-modules/helidon/helidon-se/pom.xml similarity index 100% rename from helidon/helidon-se/pom.xml rename to microservices-modules/helidon/helidon-se/pom.xml diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java similarity index 97% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java index acfcdb2373..beac5511c1 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/config/ConfigApplication.java @@ -1,29 +1,29 @@ -package com.baeldung.helidon.se.config; - -import io.helidon.config.Config; -import io.helidon.config.ConfigSources; -import io.helidon.config.spi.ConfigSource; - -public class ConfigApplication { - - public static void main(String... args) throws Exception { - - ConfigSource configSource = ConfigSources.classpath("application.yaml").build(); - Config config = Config.builder() - .disableSystemPropertiesSource() - .disableEnvironmentVariablesSource() - .sources(configSource) - .build(); - - int port = config.get("server.port").asInt(); - int pageSize = config.get("web.page-size").asInt(); - boolean debug = config.get("web.debug").asBoolean(); - String userHome = config.get("user.home").asString(); - - System.out.println("port: " + port); - System.out.println("pageSize: " + pageSize); - System.out.println("debug: " + debug); - System.out.println("userHome: " + userHome); - } - -} +package com.baeldung.helidon.se.config; + +import io.helidon.config.Config; +import io.helidon.config.ConfigSources; +import io.helidon.config.spi.ConfigSource; + +public class ConfigApplication { + + public static void main(String... args) throws Exception { + + ConfigSource configSource = ConfigSources.classpath("application.yaml").build(); + Config config = Config.builder() + .disableSystemPropertiesSource() + .disableEnvironmentVariablesSource() + .sources(configSource) + .build(); + + int port = config.get("server.port").asInt(); + int pageSize = config.get("web.page-size").asInt(); + boolean debug = config.get("web.debug").asBoolean(); + String userHome = config.get("user.home").asString(); + + System.out.println("port: " + port); + System.out.println("pageSize: " + pageSize); + System.out.println("debug: " + debug); + System.out.println("userHome: " + userHome); + } + +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java similarity index 94% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java index 9a591bcc73..90de266717 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/Book.java @@ -1,49 +1,49 @@ -package com.baeldung.helidon.se.routing; - -public class Book { - private String id; - private String isbn; - private String name; - private String author; - private Integer pages; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getIsbn() { - return isbn; - } - - public void setIsbn(String isbn) { - this.isbn = isbn; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public Integer getPages() { - return pages; - } - - public void setPages(Integer pages) { - this.pages = pages; - } +package com.baeldung.helidon.se.routing; + +public class Book { + private String id; + private String isbn; + private String name; + private String author; + private Integer pages; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIsbn() { + return isbn; + } + + public void setIsbn(String isbn) { + this.isbn = isbn; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public Integer getPages() { + return pages; + } + + public void setPages(Integer pages) { + this.pages = pages; + } } \ No newline at end of file diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java similarity index 96% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java index 2e6e694041..1ac77c49c9 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookManager.java @@ -1,49 +1,49 @@ -package com.baeldung.helidon.se.routing; - -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.atomic.AtomicInteger; - -public class BookManager { - - private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); - private AtomicInteger bookIdGenerator = new AtomicInteger(0); - - private ConcurrentMap inMemoryStore = new ConcurrentHashMap<>(); - - public BookManager() { - Book book = new Book(); - book.setId(getNextId()); - book.setName("Building Microservice With Oracle Helidon"); - book.setIsbn("11223344"); - book.setAuthor("baeldung"); - book.setPages(560); - inMemoryStore.put(book.getId(), book); - } - - private String getNextId() { - String date = LocalDate.now().format(formatter); - return String.format("%04d-%s", bookIdGenerator.incrementAndGet(), date); - } - - public String add(Book book) { - String id = getNextId(); - book.setId(id); - inMemoryStore.put(id, book); - return id; - } - - public Book get(String id) { - return inMemoryStore.get(id); - } - - public List getAll() { - List books = new ArrayList<>(); - books.addAll(inMemoryStore.values()); - return books; - } +package com.baeldung.helidon.se.routing; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicInteger; + +public class BookManager { + + private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); + private AtomicInteger bookIdGenerator = new AtomicInteger(0); + + private ConcurrentMap inMemoryStore = new ConcurrentHashMap<>(); + + public BookManager() { + Book book = new Book(); + book.setId(getNextId()); + book.setName("Building Microservice With Oracle Helidon"); + book.setIsbn("11223344"); + book.setAuthor("baeldung"); + book.setPages(560); + inMemoryStore.put(book.getId(), book); + } + + private String getNextId() { + String date = LocalDate.now().format(formatter); + return String.format("%04d-%s", bookIdGenerator.incrementAndGet(), date); + } + + public String add(Book book) { + String id = getNextId(); + book.setId(id); + inMemoryStore.put(id, book); + return id; + } + + public Book get(String id) { + return inMemoryStore.get(id); + } + + public List getAll() { + List books = new ArrayList<>(); + books.addAll(inMemoryStore.values()); + return books; + } } \ No newline at end of file diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java similarity index 96% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java index 0648930841..b0db191851 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/BookResource.java @@ -1,58 +1,58 @@ -package com.baeldung.helidon.se.routing; - -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonArrayBuilder; -import javax.json.JsonObject; -import java.util.List; - -public class BookResource implements Service { - - private BookManager bookManager = new BookManager(); - - @Override - public void update(Routing.Rules rules) { - rules - .get("/", this::books) - .get("/{id}", this::bookById); - } - - private void bookById(ServerRequest serverRequest, ServerResponse serverResponse) { - //get the book with the given id - String id = serverRequest.path().param("id"); - Book book = bookManager.get(id); - JsonObject jsonObject = from(book); - serverResponse.send(jsonObject); - } - - private void books(ServerRequest serverRequest, ServerResponse serverResponse) { - //get all books - List books = bookManager.getAll(); - JsonArray jsonArray = from(books); - serverResponse.send(jsonArray); - } - - private JsonObject from(Book book) { - JsonObject jsonObject = Json.createObjectBuilder() - .add("id", book.getId()) - .add("isbn", book.getIsbn()) - .add("name", book.getName()) - .add("author", book.getAuthor()) - .add("pages", book.getPages()) - .build(); - return jsonObject; - } - - private JsonArray from(List books) { - JsonArrayBuilder jsonArrayBuilder = Json.createArrayBuilder(); - books.forEach(book -> { - jsonArrayBuilder.add(from(book)); - }); - return jsonArrayBuilder.build(); - } -} +package com.baeldung.helidon.se.routing; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerRequest; +import io.helidon.webserver.ServerResponse; +import io.helidon.webserver.Service; + +import javax.json.Json; +import javax.json.JsonArray; +import javax.json.JsonArrayBuilder; +import javax.json.JsonObject; +import java.util.List; + +public class BookResource implements Service { + + private BookManager bookManager = new BookManager(); + + @Override + public void update(Routing.Rules rules) { + rules + .get("/", this::books) + .get("/{id}", this::bookById); + } + + private void bookById(ServerRequest serverRequest, ServerResponse serverResponse) { + //get the book with the given id + String id = serverRequest.path().param("id"); + Book book = bookManager.get(id); + JsonObject jsonObject = from(book); + serverResponse.send(jsonObject); + } + + private void books(ServerRequest serverRequest, ServerResponse serverResponse) { + //get all books + List books = bookManager.getAll(); + JsonArray jsonArray = from(books); + serverResponse.send(jsonArray); + } + + private JsonObject from(Book book) { + JsonObject jsonObject = Json.createObjectBuilder() + .add("id", book.getId()) + .add("isbn", book.getIsbn()) + .add("name", book.getName()) + .add("author", book.getAuthor()) + .add("pages", book.getPages()) + .build(); + return jsonObject; + } + + private JsonArray from(List books) { + JsonArrayBuilder jsonArrayBuilder = Json.createArrayBuilder(); + books.forEach(book -> { + jsonArrayBuilder.add(from(book)); + }); + return jsonArrayBuilder.build(); + } +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java similarity index 96% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java index 1f32d3c528..17bf2bcc8f 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/routing/WebApplicationRouting.java @@ -1,29 +1,29 @@ -package com.baeldung.helidon.se.routing; - -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerConfiguration; -import io.helidon.webserver.WebServer; -import io.helidon.webserver.json.JsonSupport; - -public class WebApplicationRouting { - - public static void main(String... args) throws Exception { - - ServerConfiguration serverConfig = ServerConfiguration.builder() - .port(9080) - .build(); - - Routing routing = Routing.builder() - .register(JsonSupport.get()) - .register("/books", new BookResource()) - .get("/greet", (request, response) -> response.send("Hello World !")) - .build(); - - WebServer.create(serverConfig, routing) - .start() - .thenAccept(ws -> - System.out.println("Server started at: http://localhost:" + ws.port()) - ); - } - -} +package com.baeldung.helidon.se.routing; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerConfiguration; +import io.helidon.webserver.WebServer; +import io.helidon.webserver.json.JsonSupport; + +public class WebApplicationRouting { + + public static void main(String... args) throws Exception { + + ServerConfiguration serverConfig = ServerConfiguration.builder() + .port(9080) + .build(); + + Routing routing = Routing.builder() + .register(JsonSupport.get()) + .register("/books", new BookResource()) + .get("/greet", (request, response) -> response.send("Hello World !")) + .build(); + + WebServer.create(serverConfig, routing) + .start() + .thenAccept(ws -> + System.out.println("Server started at: http://localhost:" + ws.port()) + ); + } + +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java similarity index 95% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java index e8009a98ad..d1a8446f6a 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/MyUser.java @@ -1,33 +1,33 @@ -package com.baeldung.helidon.se.security; - -import io.helidon.security.provider.httpauth.UserStore; - -import java.util.Collection; - -public class MyUser implements UserStore.User { - - private String login; - private char[] password; - private Collection roles; - - public MyUser(String login, char[] password, Collection roles) { - this.login = login; - this.password = password; - this.roles = roles; - } - - @Override - public String getLogin() { - return login; - } - - @Override - public char[] getPassword() { - return password; - } - - @Override - public Collection getRoles() { - return roles; - } -} +package com.baeldung.helidon.se.security; + +import io.helidon.security.provider.httpauth.UserStore; + +import java.util.Collection; + +public class MyUser implements UserStore.User { + + private String login; + private char[] password; + private Collection roles; + + public MyUser(String login, char[] password, Collection roles) { + this.login = login; + this.password = password; + this.roles = roles; + } + + @Override + public String getLogin() { + return login; + } + + @Override + public char[] getPassword() { + return password; + } + + @Override + public Collection getRoles() { + return roles; + } +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java similarity index 97% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java index 9a67f3d716..4eb7c6c01f 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/security/WebApplicationSecurity.java @@ -1,61 +1,61 @@ -package com.baeldung.helidon.se.security; - -import io.helidon.config.Config; -import io.helidon.security.Security; -import io.helidon.security.SubjectType; -import io.helidon.security.provider.httpauth.HttpBasicAuthProvider; -import io.helidon.security.provider.httpauth.UserStore; -import io.helidon.security.webserver.WebSecurity; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerConfiguration; -import io.helidon.webserver.WebServer; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -public class WebApplicationSecurity { - - public static void main(String... args) throws Exception { - - Config config = Config.create(); - ServerConfiguration serverConfig = - ServerConfiguration.fromConfig(config.get("server")); - - Map users = new HashMap<>(); - users.put("user", new MyUser("user", "user".toCharArray(), Arrays.asList("ROLE_USER"))); - users.put("admin", new MyUser("admin", "admin".toCharArray(), Arrays.asList("ROLE_USER", "ROLE_ADMIN"))); - UserStore store = user -> Optional.ofNullable(users.get(user)); - - HttpBasicAuthProvider httpBasicAuthProvider = HttpBasicAuthProvider.builder() - .realm("myRealm") - .subjectType(SubjectType.USER) - .userStore(store) - .build(); - - //1. Using Builder Pattern or Config Pattern - Security security = Security.builder() - .addAuthenticationProvider(httpBasicAuthProvider) - .build(); - //Security security = Security.fromConfig(config); - - //2. WebSecurity from Security or from Config - // WebSecurity webSecurity = WebSecurity.from(security) - // .securityDefaults(WebSecurity.authenticate()); - - WebSecurity webSecurity = WebSecurity.from(config); - - Routing routing = Routing.builder() - .register(webSecurity) - .get("/user", (request, response) -> response.send("Hello, I'm a Helidon SE user with ROLE_USER")) - .get("/admin", (request, response) -> response.send("Hello, I'm a Helidon SE user with ROLE_ADMIN")) - .build(); - - WebServer webServer = WebServer.create(serverConfig, routing); - - webServer.start().thenAccept(ws -> - System.out.println("Server started at: http://localhost:" + ws.port()) - ); - } -} +package com.baeldung.helidon.se.security; + +import io.helidon.config.Config; +import io.helidon.security.Security; +import io.helidon.security.SubjectType; +import io.helidon.security.provider.httpauth.HttpBasicAuthProvider; +import io.helidon.security.provider.httpauth.UserStore; +import io.helidon.security.webserver.WebSecurity; +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerConfiguration; +import io.helidon.webserver.WebServer; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class WebApplicationSecurity { + + public static void main(String... args) throws Exception { + + Config config = Config.create(); + ServerConfiguration serverConfig = + ServerConfiguration.fromConfig(config.get("server")); + + Map users = new HashMap<>(); + users.put("user", new MyUser("user", "user".toCharArray(), Arrays.asList("ROLE_USER"))); + users.put("admin", new MyUser("admin", "admin".toCharArray(), Arrays.asList("ROLE_USER", "ROLE_ADMIN"))); + UserStore store = user -> Optional.ofNullable(users.get(user)); + + HttpBasicAuthProvider httpBasicAuthProvider = HttpBasicAuthProvider.builder() + .realm("myRealm") + .subjectType(SubjectType.USER) + .userStore(store) + .build(); + + //1. Using Builder Pattern or Config Pattern + Security security = Security.builder() + .addAuthenticationProvider(httpBasicAuthProvider) + .build(); + //Security security = Security.fromConfig(config); + + //2. WebSecurity from Security or from Config + // WebSecurity webSecurity = WebSecurity.from(security) + // .securityDefaults(WebSecurity.authenticate()); + + WebSecurity webSecurity = WebSecurity.from(config); + + Routing routing = Routing.builder() + .register(webSecurity) + .get("/user", (request, response) -> response.send("Hello, I'm a Helidon SE user with ROLE_USER")) + .get("/admin", (request, response) -> response.send("Hello, I'm a Helidon SE user with ROLE_ADMIN")) + .build(); + + WebServer webServer = WebServer.create(serverConfig, routing); + + webServer.start().thenAccept(ws -> + System.out.println("Server started at: http://localhost:" + ws.port()) + ); + } +} diff --git a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java similarity index 96% rename from helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java rename to microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java index 0a603a5123..a9a92cf1b9 100644 --- a/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java +++ b/microservices-modules/helidon/helidon-se/src/main/java/com/baeldung/helidon/se/webserver/SimpleWebApplication.java @@ -1,26 +1,26 @@ -package com.baeldung.helidon.se.webserver; - -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerConfiguration; -import io.helidon.webserver.WebServer; - -public class SimpleWebApplication { - - public static void main(String... args) throws Exception { - - ServerConfiguration serverConfig = ServerConfiguration.builder() - .port(9001) - .build(); - - Routing routing = Routing.builder() - .get("/greet", (request, response) -> response.send("Hello World !")) - .build(); - - WebServer.create(serverConfig, routing) - .start() - .thenAccept(ws -> - System.out.println("Server started at: http://localhost:" + ws.port()) - ); - } - -} +package com.baeldung.helidon.se.webserver; + +import io.helidon.webserver.Routing; +import io.helidon.webserver.ServerConfiguration; +import io.helidon.webserver.WebServer; + +public class SimpleWebApplication { + + public static void main(String... args) throws Exception { + + ServerConfiguration serverConfig = ServerConfiguration.builder() + .port(9001) + .build(); + + Routing routing = Routing.builder() + .get("/greet", (request, response) -> response.send("Hello World !")) + .build(); + + WebServer.create(serverConfig, routing) + .start() + .thenAccept(ws -> + System.out.println("Server started at: http://localhost:" + ws.port()) + ); + } + +} diff --git a/helidon/helidon-se/src/main/resources/application.json b/microservices-modules/helidon/helidon-se/src/main/resources/application.json similarity index 100% rename from helidon/helidon-se/src/main/resources/application.json rename to microservices-modules/helidon/helidon-se/src/main/resources/application.json diff --git a/helidon/helidon-se/src/main/resources/application.properties b/microservices-modules/helidon/helidon-se/src/main/resources/application.properties similarity index 95% rename from helidon/helidon-se/src/main/resources/application.properties rename to microservices-modules/helidon/helidon-se/src/main/resources/application.properties index 062047de4a..2074c4a836 100644 --- a/helidon/helidon-se/src/main/resources/application.properties +++ b/microservices-modules/helidon/helidon-se/src/main/resources/application.properties @@ -1,4 +1,4 @@ -server.port=9080 -web.debug=true -web.page-size=15 +server.port=9080 +web.debug=true +web.page-size=15 user.home=C:/Users/app \ No newline at end of file diff --git a/helidon/helidon-se/src/main/resources/application.yaml b/microservices-modules/helidon/helidon-se/src/main/resources/application.yaml similarity index 100% rename from helidon/helidon-se/src/main/resources/application.yaml rename to microservices-modules/helidon/helidon-se/src/main/resources/application.yaml diff --git a/helidon/pom.xml b/microservices-modules/helidon/pom.xml similarity index 92% rename from helidon/pom.xml rename to microservices-modules/helidon/pom.xml index 36466203a8..ca2cafb7d3 100644 --- a/helidon/pom.xml +++ b/microservices-modules/helidon/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + microservices-modules 1.0.0-SNAPSHOT diff --git a/micronaut/.mvn/jvm.config b/microservices-modules/micronaut/.mvn/jvm.config similarity index 100% rename from micronaut/.mvn/jvm.config rename to microservices-modules/micronaut/.mvn/jvm.config diff --git a/micronaut/.mvn/wrapper/MavenWrapperDownloader.java b/microservices-modules/micronaut/.mvn/wrapper/MavenWrapperDownloader.java similarity index 100% rename from micronaut/.mvn/wrapper/MavenWrapperDownloader.java rename to microservices-modules/micronaut/.mvn/wrapper/MavenWrapperDownloader.java diff --git a/micronaut/.mvn/wrapper/maven-wrapper.properties b/microservices-modules/micronaut/.mvn/wrapper/maven-wrapper.properties similarity index 100% rename from micronaut/.mvn/wrapper/maven-wrapper.properties rename to microservices-modules/micronaut/.mvn/wrapper/maven-wrapper.properties diff --git a/micronaut/Dockerfile b/microservices-modules/micronaut/Dockerfile similarity index 100% rename from micronaut/Dockerfile rename to microservices-modules/micronaut/Dockerfile diff --git a/micronaut/README.md b/microservices-modules/micronaut/README.md similarity index 100% rename from micronaut/README.md rename to microservices-modules/micronaut/README.md diff --git a/micronaut/micronaut-cli.yml b/microservices-modules/micronaut/micronaut-cli.yml similarity index 100% rename from micronaut/micronaut-cli.yml rename to microservices-modules/micronaut/micronaut-cli.yml diff --git a/micronaut/mvnw b/microservices-modules/micronaut/mvnw old mode 100755 new mode 100644 similarity index 100% rename from micronaut/mvnw rename to microservices-modules/micronaut/mvnw diff --git a/micronaut/mvnw.cmd b/microservices-modules/micronaut/mvnw.cmd old mode 100755 new mode 100644 similarity index 97% rename from micronaut/mvnw.cmd rename to microservices-modules/micronaut/mvnw.cmd index 03d90e960b..830073a17e --- a/micronaut/mvnw.cmd +++ b/microservices-modules/micronaut/mvnw.cmd @@ -1,161 +1,161 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar" -FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - echo Found %WRAPPER_JAR% -) else ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" - echo Finished downloading %WRAPPER_JAR% -) -@REM End of extension - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.0/maven-wrapper-0.4.0.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/micronaut/pom.xml b/microservices-modules/micronaut/pom.xml similarity index 99% rename from micronaut/pom.xml rename to microservices-modules/micronaut/pom.xml index a04fc5c99c..8647d1a3a7 100644 --- a/micronaut/pom.xml +++ b/microservices-modules/micronaut/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + microservices-modules 1.0.0-SNAPSHOT diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClient.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClient.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClient.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClient.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/GreetingClient.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/GreetingClient.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/GreetingClient.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/client/GreetingClient.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/ServerApplication.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/ServerApplication.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/ServerApplication.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/ServerApplication.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/AsyncGreetController.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/AsyncGreetController.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/AsyncGreetController.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/AsyncGreetController.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/GreetController.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/GreetController.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/GreetController.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/controller/GreetController.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/EnglishGreetingService.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/EnglishGreetingService.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/EnglishGreetingService.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/EnglishGreetingService.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/GreetingService.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/GreetingService.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/GreetingService.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/GreetingService.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/SpanishGreetingService.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/SpanishGreetingService.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/SpanishGreetingService.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/helloworld/server/service/SpanishGreetingService.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/CompareApplication.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/CompareApplication.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/CompareApplication.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/CompareApplication.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClient.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClient.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClient.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClient.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClientImpl.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClientImpl.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClientImpl.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/client/ArithmeticClientImpl.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/controller/ArithmeticController.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/controller/ArithmeticController.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/controller/ArithmeticController.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/controller/ArithmeticController.java diff --git a/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/service/ArithmeticService.java b/microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/service/ArithmeticService.java similarity index 100% rename from micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/service/ArithmeticService.java rename to microservices-modules/micronaut/src/main/java/com/baeldung/micronaut/vs/springboot/service/ArithmeticService.java diff --git a/micronaut/src/main/resources/application.yml b/microservices-modules/micronaut/src/main/resources/application.yml similarity index 100% rename from micronaut/src/main/resources/application.yml rename to microservices-modules/micronaut/src/main/resources/application.yml diff --git a/micronaut/src/main/resources/logback.xml b/microservices-modules/micronaut/src/main/resources/logback.xml similarity index 100% rename from micronaut/src/main/resources/logback.xml rename to microservices-modules/micronaut/src/main/resources/logback.xml diff --git a/micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClientUnitTest.java b/microservices-modules/micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClientUnitTest.java similarity index 100% rename from micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClientUnitTest.java rename to microservices-modules/micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/ConcreteGreetingClientUnitTest.java diff --git a/micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/GreetingClientUnitTest.java b/microservices-modules/micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/GreetingClientUnitTest.java similarity index 100% rename from micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/GreetingClientUnitTest.java rename to microservices-modules/micronaut/src/test/java/com/baeldung/micronaut/helloworld/client/GreetingClientUnitTest.java diff --git a/micronaut/src/test/java/com/baeldung/micronaut/vs/springboot/ArithmeticClientUnitTest.java b/microservices-modules/micronaut/src/test/java/com/baeldung/micronaut/vs/springboot/ArithmeticClientUnitTest.java similarity index 100% rename from micronaut/src/test/java/com/baeldung/micronaut/vs/springboot/ArithmeticClientUnitTest.java rename to microservices-modules/micronaut/src/test/java/com/baeldung/micronaut/vs/springboot/ArithmeticClientUnitTest.java diff --git a/microprofile/README.md b/microservices-modules/microprofile/README.md similarity index 100% rename from microprofile/README.md rename to microservices-modules/microprofile/README.md diff --git a/microprofile/pom.xml b/microservices-modules/microprofile/pom.xml similarity index 98% rename from microprofile/pom.xml rename to microservices-modules/microprofile/pom.xml index 54ed3a9930..24803cb4a4 100644 --- a/microprofile/pom.xml +++ b/microservices-modules/microprofile/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + microservices-modules 1.0.0-SNAPSHOT diff --git a/microprofile/src/main/java/com/baeldung/microprofile/LibraryApplication.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/LibraryApplication.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/LibraryApplication.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/LibraryApplication.java diff --git a/microprofile/src/main/java/com/baeldung/microprofile/model/Book.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/model/Book.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/model/Book.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/model/Book.java diff --git a/microprofile/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/providers/BookListMessageBodyWriter.java diff --git a/microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyReader.java diff --git a/microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/providers/BookMessageBodyWriter.java diff --git a/microprofile/src/main/java/com/baeldung/microprofile/repo/BookManager.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/repo/BookManager.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/repo/BookManager.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/repo/BookManager.java diff --git a/microprofile/src/main/java/com/baeldung/microprofile/util/BookMapper.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/util/BookMapper.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/util/BookMapper.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/util/BookMapper.java diff --git a/microprofile/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java b/microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java similarity index 100% rename from microprofile/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java rename to microservices-modules/microprofile/src/main/java/com/baeldung/microprofile/web/BookEndpoint.java diff --git a/microprofile/src/main/liberty/config/server.xml b/microservices-modules/microprofile/src/main/liberty/config/server.xml similarity index 100% rename from microprofile/src/main/liberty/config/server.xml rename to microservices-modules/microprofile/src/main/liberty/config/server.xml diff --git a/microprofile/src/main/resources/logback.xml b/microservices-modules/microprofile/src/main/resources/logback.xml similarity index 100% rename from microprofile/src/main/resources/logback.xml rename to microservices-modules/microprofile/src/main/resources/logback.xml diff --git a/msf4j/README.md b/microservices-modules/msf4j/README.md similarity index 100% rename from msf4j/README.md rename to microservices-modules/msf4j/README.md diff --git a/msf4j/pom.xml b/microservices-modules/msf4j/pom.xml similarity index 96% rename from msf4j/pom.xml rename to microservices-modules/msf4j/pom.xml index 99e25dbcbf..642795e5fe 100644 --- a/msf4j/pom.xml +++ b/microservices-modules/msf4j/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + microservices-modules 1.0.0-SNAPSHOT diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Application.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Application.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Application.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Application.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Meal.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Meal.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Meal.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/Meal.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/MenuService.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/MenuService.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4japi/MenuService.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4japi/MenuService.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/Application.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/Application.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/Application.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/Application.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/SimpleService.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/SimpleService.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/SimpleService.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jintro/SimpleService.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/Application.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/Application.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/Application.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/Application.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/configuration/PortConfiguration.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/configuration/PortConfiguration.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/configuration/PortConfiguration.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/configuration/PortConfiguration.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/domain/Meal.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/domain/Meal.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/domain/Meal.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/domain/Meal.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/repositories/MealRepository.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/repositories/MealRepository.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/repositories/MealRepository.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/repositories/MealRepository.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/resources/MealResource.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/resources/MealResource.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/resources/MealResource.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/resources/MealResource.java diff --git a/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/services/MealService.java b/microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/services/MealService.java similarity index 100% rename from msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/services/MealService.java rename to microservices-modules/msf4j/src/main/java/com/baeldung/msf4j/msf4jspring/services/MealService.java diff --git a/msf4j/src/main/resources/application.properties b/microservices-modules/msf4j/src/main/resources/application.properties similarity index 100% rename from msf4j/src/main/resources/application.properties rename to microservices-modules/msf4j/src/main/resources/application.properties diff --git a/msf4j/src/main/resources/logback.xml b/microservices-modules/msf4j/src/main/resources/logback.xml similarity index 100% rename from msf4j/src/main/resources/logback.xml rename to microservices-modules/msf4j/src/main/resources/logback.xml diff --git a/msf4j/src/main/resources/templates/meals.mustache b/microservices-modules/msf4j/src/main/resources/templates/meals.mustache similarity index 100% rename from msf4j/src/main/resources/templates/meals.mustache rename to microservices-modules/msf4j/src/main/resources/templates/meals.mustache diff --git a/open-liberty/README.md b/microservices-modules/open-liberty/README.md similarity index 100% rename from open-liberty/README.md rename to microservices-modules/open-liberty/README.md diff --git a/microservices-modules/open-liberty/pom.xml b/microservices-modules/open-liberty/pom.xml new file mode 100644 index 0000000000..e7a94eab39 --- /dev/null +++ b/microservices-modules/open-liberty/pom.xml @@ -0,0 +1,127 @@ + + + 4.0.0 + com.baeldung + open-liberty + 1.0-SNAPSHOT + war + + + com.baeldung + microservices-modules + 1.0.0-SNAPSHOT + + + + + jakarta.platform + jakarta.jakartaee-web-api + ${version.jakarta.jakartaee-web-api} + provided + + + org.eclipse.microprofile + microprofile + ${version.microprofile} + pom + provided + + + org.apache.derby + derby + ${version.derby} + provided + + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.vintage + junit-vintage-engine + ${junit-jupiter.version} + test + + + org.eclipse + yasson + ${version.yasson} + test + + + org.apache.cxf + cxf-rt-rs-client + ${version.cxf-rt-rs-client} + test + + + org.glassfish + javax.json + ${version.javax.json} + test + + + org.apache.cxf + cxf-rt-rs-mp-client + ${version.cxf-rt-rs-mp-client} + test + + + + + ${project.artifactId} + + + + io.openliberty.tools + liberty-maven-plugin + ${version.liberty-maven-plugin} + + + ${project.build.directory}/liberty/wlp/usr/shared/resources/ + + org.apache.derby + derby + ${version.derby} + + + + + + org.apache.maven.plugins + maven-war-plugin + ${version.maven-war-plugin} + + + + + + 1.8 + 1.8 + UTF-8 + UTF-8 + false + + 8.0.0 + 3.2 + 10.14.2.0 + 3.3-M3 + 3.2.3 + 1.0.5 + 3.2.6 + 1.0.4 + 3.3.1 + + openliberty + 9080 + 9443 + 7070 + 5.8.1 + + + \ No newline at end of file diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java b/microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java similarity index 100% rename from open-liberty/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java rename to microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/person/dao/PersonDao.java diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/person/model/Person.java b/microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/person/model/Person.java similarity index 100% rename from open-liberty/src/main/java/com/baeldung/openliberty/person/model/Person.java rename to microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/person/model/Person.java diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java b/microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java similarity index 100% rename from open-liberty/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java rename to microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/person/resource/PersonResource.java diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java b/microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java similarity index 100% rename from open-liberty/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java rename to microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/rest/ApiApplication.java diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java b/microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java similarity index 100% rename from open-liberty/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java rename to microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/rest/consumes/RestConsumer.java diff --git a/open-liberty/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java b/microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java similarity index 100% rename from open-liberty/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java rename to microservices-modules/open-liberty/src/main/java/com/baeldung/openliberty/servlet/AppServlet.java diff --git a/open-liberty/src/main/liberty/config/server.xml b/microservices-modules/open-liberty/src/main/liberty/config/server.xml similarity index 100% rename from open-liberty/src/main/liberty/config/server.xml rename to microservices-modules/open-liberty/src/main/liberty/config/server.xml diff --git a/open-liberty/src/main/resources/META-INF/persistence.xml b/microservices-modules/open-liberty/src/main/resources/META-INF/persistence.xml similarity index 100% rename from open-liberty/src/main/resources/META-INF/persistence.xml rename to microservices-modules/open-liberty/src/main/resources/META-INF/persistence.xml diff --git a/open-liberty/src/test/java/com/baeldung/openliberty/RestClientTest.java b/microservices-modules/open-liberty/src/test/java/com/baeldung/openliberty/RestClientLiveTest.java similarity index 96% rename from open-liberty/src/test/java/com/baeldung/openliberty/RestClientTest.java rename to microservices-modules/open-liberty/src/test/java/com/baeldung/openliberty/RestClientLiveTest.java index 4978483ca0..f328d61a57 100644 --- a/open-liberty/src/test/java/com/baeldung/openliberty/RestClientTest.java +++ b/microservices-modules/open-liberty/src/test/java/com/baeldung/openliberty/RestClientLiveTest.java @@ -10,7 +10,7 @@ import org.junit.Test; import com.baeldung.openliberty.person.model.Person; import com.baeldung.openliberty.rest.consumes.RestConsumer; -public class RestClientTest { +public class RestClientLiveTest { private static String BASE_URL; diff --git a/microservices-modules/pom.xml b/microservices-modules/pom.xml new file mode 100644 index 0000000000..3f8eddcdb7 --- /dev/null +++ b/microservices-modules/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + microservices-modules + microservices-modules + pom + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + helidon + micronaut + microprofile + msf4j + open-liberty + + + \ No newline at end of file diff --git a/open-liberty/pom.xml b/open-liberty/pom.xml deleted file mode 100644 index df54d9f136..0000000000 --- a/open-liberty/pom.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - 4.0.0 - com.baeldung - open-liberty - 1.0-SNAPSHOT - war - - - - jakarta.platform - jakarta.jakartaee-web-api - ${version.jakarta.jakartaee-web-api} - provided - - - org.eclipse.microprofile - microprofile - ${version.microprofile} - pom - provided - - - org.apache.derby - derby - ${version.derby} - provided - - - - org.junit.jupiter - junit-jupiter - ${junit-jupiter.version} - test - - - org.junit.vintage - junit-vintage-engine - ${junit-jupiter.version} - test - - - org.eclipse - yasson - ${version.yasson} - test - - - org.apache.cxf - cxf-rt-rs-client - ${version.cxf-rt-rs-client} - test - - - org.glassfish - javax.json - ${version.javax.json} - test - - - org.apache.cxf - cxf-rt-rs-mp-client - ${version.cxf-rt-rs-mp-client} - test - - - - - ${project.artifactId} - - - - io.openliberty.tools - liberty-maven-plugin - ${version.liberty-maven-plugin} - - - ${project.build.directory}/liberty/wlp/usr/shared/resources/ - - org.apache.derby - derby - ${version.derby} - - - - - - org.apache.maven.plugins - maven-war-plugin - ${version.maven-war-plugin} - - - - - - 1.8 - 1.8 - UTF-8 - UTF-8 - false - - 8.0.0 - 3.2 - 10.14.2.0 - 3.3-M3 - 3.2.3 - 1.0.5 - 3.2.6 - 1.0.4 - 3.3.1 - - openliberty - 9080 - 9443 - 7070 - 5.8.1 - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 178e852f5b..cdee542d12 100644 --- a/pom.xml +++ b/pom.xml @@ -404,7 +404,6 @@ guice hazelcast - helidon apache-httpclient httpclient-simple hystrix @@ -471,9 +470,7 @@ mesos-marathon metrics - micronaut - microprofile - msf4j + microservices-modules muleesb mustache mybatis @@ -481,7 +478,6 @@ netflix-modules netty ninja - open-liberty orika osgi @@ -826,7 +822,6 @@ guice hazelcast - helidon apache-httpclient httpclient-simple hystrix @@ -895,9 +890,7 @@ mesos-marathon metrics - micronaut - microprofile - msf4j + microservices-modules muleesb mustache mybatis @@ -905,7 +898,6 @@ netflix-modules netty ninja - open-liberty orika osgi From 3f1f6bd34b0fca99d447ea88d02f4fefee52d015 Mon Sep 17 00:00:00 2001 From: freelansam <79205526+freelansam@users.noreply.github.com> Date: Sat, 20 Aug 2022 23:54:43 +0530 Subject: [PATCH 39/73] JAVA-13826: Align module names, folder names and artifact id (#12624) --- .../spring-security-pkce/{server => pkce-auth-server}/pom.xml | 0 .../security/pkce/authserver/PkceAuthServerApplication.java | 0 .../pkce/authserver/conf/AuthServerConfiguration.java | 0 .../security/pkce/authserver/conf/JwksConfiguration.java | 0 .../pkce/authserver/conf/UserDetailsConfiguration.java | 0 .../src/main/resources/application.properties | 0 .../security/pkce/SpringSecurityPkceApplicationTests.java | 0 .../spring-security-pkce/{client => pkce-client}/pom.xml | 0 .../baeldung/security/pkce/client/PkceClientApplication.java | 0 .../pkce/client/config/OAuth2ClientConfiguration.java | 0 .../src/main/resources/application.yaml | 0 .../src/main/resources/static/index.html | 0 spring-security-modules/spring-security-pkce/pom.xml | 4 ++-- 13 files changed, 2 insertions(+), 2 deletions(-) rename spring-security-modules/spring-security-pkce/{server => pkce-auth-server}/pom.xml (100%) rename spring-security-modules/spring-security-pkce/{server => pkce-auth-server}/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java (100%) rename spring-security-modules/spring-security-pkce/{server => pkce-auth-server}/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java (100%) rename spring-security-modules/spring-security-pkce/{server => pkce-auth-server}/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java (100%) rename spring-security-modules/spring-security-pkce/{server => pkce-auth-server}/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java (100%) rename spring-security-modules/spring-security-pkce/{server => pkce-auth-server}/src/main/resources/application.properties (100%) rename spring-security-modules/spring-security-pkce/{server => pkce-auth-server}/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java (100%) rename spring-security-modules/spring-security-pkce/{client => pkce-client}/pom.xml (100%) rename spring-security-modules/spring-security-pkce/{client => pkce-client}/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java (100%) rename spring-security-modules/spring-security-pkce/{client => pkce-client}/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java (100%) rename spring-security-modules/spring-security-pkce/{client => pkce-client}/src/main/resources/application.yaml (100%) rename spring-security-modules/spring-security-pkce/{client => pkce-client}/src/main/resources/static/index.html (100%) diff --git a/spring-security-modules/spring-security-pkce/server/pom.xml b/spring-security-modules/spring-security-pkce/pkce-auth-server/pom.xml similarity index 100% rename from spring-security-modules/spring-security-pkce/server/pom.xml rename to spring-security-modules/spring-security-pkce/pkce-auth-server/pom.xml diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java similarity index 100% rename from spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java rename to spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/PkceAuthServerApplication.java diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java similarity index 100% rename from spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java rename to spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java similarity index 100% rename from spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java rename to spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/JwksConfiguration.java diff --git a/spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java similarity index 100% rename from spring-security-modules/spring-security-pkce/server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java rename to spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/UserDetailsConfiguration.java diff --git a/spring-security-modules/spring-security-pkce/server/src/main/resources/application.properties b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/resources/application.properties similarity index 100% rename from spring-security-modules/spring-security-pkce/server/src/main/resources/application.properties rename to spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/resources/application.properties diff --git a/spring-security-modules/spring-security-pkce/server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java similarity index 100% rename from spring-security-modules/spring-security-pkce/server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java rename to spring-security-modules/spring-security-pkce/pkce-auth-server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java diff --git a/spring-security-modules/spring-security-pkce/client/pom.xml b/spring-security-modules/spring-security-pkce/pkce-client/pom.xml similarity index 100% rename from spring-security-modules/spring-security-pkce/client/pom.xml rename to spring-security-modules/spring-security-pkce/pkce-client/pom.xml diff --git a/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java b/spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java similarity index 100% rename from spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java rename to spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/PkceClientApplication.java diff --git a/spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java b/spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java similarity index 100% rename from spring-security-modules/spring-security-pkce/client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java rename to spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java diff --git a/spring-security-modules/spring-security-pkce/client/src/main/resources/application.yaml b/spring-security-modules/spring-security-pkce/pkce-client/src/main/resources/application.yaml similarity index 100% rename from spring-security-modules/spring-security-pkce/client/src/main/resources/application.yaml rename to spring-security-modules/spring-security-pkce/pkce-client/src/main/resources/application.yaml diff --git a/spring-security-modules/spring-security-pkce/client/src/main/resources/static/index.html b/spring-security-modules/spring-security-pkce/pkce-client/src/main/resources/static/index.html similarity index 100% rename from spring-security-modules/spring-security-pkce/client/src/main/resources/static/index.html rename to spring-security-modules/spring-security-pkce/pkce-client/src/main/resources/static/index.html diff --git a/spring-security-modules/spring-security-pkce/pom.xml b/spring-security-modules/spring-security-pkce/pom.xml index 7631d54354..a90a0d5c1d 100644 --- a/spring-security-modules/spring-security-pkce/pom.xml +++ b/spring-security-modules/spring-security-pkce/pom.xml @@ -70,7 +70,7 @@
- server - client + pkce-auth-server + pkce-client From 842a71ad92fc29fc7383cf125f42a23a6b9a690a Mon Sep 17 00:00:00 2001 From: Kai Yuan Date: Sun, 21 Aug 2022 04:46:14 +0200 Subject: [PATCH 40/73] Check if a number is positive or negative in Java (#12604) * Check if a number is positive or negative in Java * reformat single line if/else statements * Check if a number is positive or negative in Java --- .../positivenegative/PositiveOrNegative.java | 38 +++++++++++++++++++ .../PositiveOrNegativeUnitTest.java | 29 ++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/positivenegative/PositiveOrNegative.java create mode 100644 core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/positivenegative/PositiveOrNegativeUnitTest.java diff --git a/core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/positivenegative/PositiveOrNegative.java b/core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/positivenegative/PositiveOrNegative.java new file mode 100644 index 0000000000..a580aa5ac5 --- /dev/null +++ b/core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/positivenegative/PositiveOrNegative.java @@ -0,0 +1,38 @@ +package com.baeldung.positivenegative; + +public class PositiveOrNegative { + enum Result { + POSITIVE, NEGATIVE, ZERO + } + + public static Result byOperator(Integer integer) { + if (integer > 0) { + return Result.POSITIVE; + } else if (integer < 0) { + return Result.NEGATIVE; + } + return Result.ZERO; + } + + public static Result bySignum(Integer integer) { + int result = Integer.signum(integer); + + if (result == 1) { + return Result.POSITIVE; + } else if (result == -1) { + return Result.NEGATIVE; + } + return Result.ZERO; + } + + public static Result bySignum(Float floatNumber) { + float result = Math.signum(floatNumber); + + if (result == 1.0f) { + return Result.POSITIVE; + } else if (result == -1.0f) { + return Result.NEGATIVE; + } + return Result.ZERO; + } +} diff --git a/core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/positivenegative/PositiveOrNegativeUnitTest.java b/core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/positivenegative/PositiveOrNegativeUnitTest.java new file mode 100644 index 0000000000..4807e8b928 --- /dev/null +++ b/core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/positivenegative/PositiveOrNegativeUnitTest.java @@ -0,0 +1,29 @@ +package com.baeldung.positivenegative; + +import org.junit.jupiter.api.Test; + +import static com.baeldung.positivenegative.PositiveOrNegative.Result.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + +class PositiveOrNegativeUnitTest { + @Test + void givenIntegers_whenChkPositiveOrNegativeByOperator_thenReturnExpectedResult() { + assertEquals(POSITIVE, PositiveOrNegative.byOperator(42)); + assertEquals(ZERO, PositiveOrNegative.byOperator(0)); + assertEquals(NEGATIVE, PositiveOrNegative.byOperator(-700)); + } + + @Test + void givenIntegers_whenChkPositiveOrNegativeBySignum_thenReturnExpectedResult() { + assertEquals(POSITIVE, PositiveOrNegative.bySignum(42)); + assertEquals(ZERO, PositiveOrNegative.bySignum(0)); + assertEquals(NEGATIVE, PositiveOrNegative.bySignum(-700)); + } + + @Test + void givenFloats_whenChkPositiveOrNegativeBySignum_thenReturnExpectedResult() { + assertEquals(POSITIVE, PositiveOrNegative.bySignum(4.2f)); + assertEquals(ZERO, PositiveOrNegative.bySignum(0f)); + assertEquals(NEGATIVE, PositiveOrNegative.bySignum(-7.7f)); + } +} From 0b9549bd3ee48f247a1223db490a07ff390b6197 Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Sun, 21 Aug 2022 10:14:00 +0100 Subject: [PATCH 41/73] [JAVA-13854] Half list moved (#12598) * [JAVA-13854] added parent module * [JAVA-13854] moved apache-tapestry(submodule) to web-modules(parent) * [JAVA-13854] moved bootique(submodule) to web-modules(parent) * [JAVA-13854] moved dropwizard(submodule) to web-modules(parent) * [JAVA-13854] moved blade(submodule) to web-modules(parent) * [JAVA-13854] moved java-lite(submodule) to web-modules(parent) * [JAVA-13854] moved jooby(submodule) to web-modules(parent) * [JAVA-13854] moved linkrest(submodule) to web-modules(parent) * [JAVA-13854] moved ninja(submodule) to web-modules(parent) * [JAVA-13854] moved ratpack(submodule) to web-modules(parent) * [JAVA-13854] moved resteasy(submodule) to web-modules(parent) * [JAVA-13854] moved restx(submodule) to web-modules(parent) * [JAVA-13854] moved spark-java(submodule) to web-modules(parent) * [JAVA-13854] moved vraptor(submodule) to web-modules(parent) * [JAVA-13854] delete modules that were moved * [JAVA-13854] * [JAVA-13854] * [JAVA-13854] delete ninja submodule + moved raml(submodule) to web-modules(parent) * [JAVA-13854] moved gwt(submodule) to web-modules(parent) * [JAVA-13854] moved jakarta-ee(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets(submodule) to web-modules(parent) * [JAVA-13854] moved javax-servlets-2(submodule) to web-modules(parent) * [JAVA-13854] moved jee-7(submodule) to web-modules(parent) * [JAVA-13854] moved play-framework(not a module) to web-modules * [JAVA-13854] fix failing test * [JAVA-13854] moved struts-2(submodule) to web-modules(parent) * [JAVA-13854] moved wicket(submodule) to web-modules(parent) * [JAVA-13854] deleted modules that were moved to web-modules * JAVA-13854 Removed moved modules from the main pom.xml Co-authored-by: panagiotiskakos Co-authored-by: Dhawal Kapil --- pom.xml | 42 +---- web-modules/README.md | 3 + .../apache-tapestry}/README.md | 0 .../apache-tapestry}/pom.xml | 2 +- .../baeldung/tapestry/components/Layout.java | 0 .../com/baeldung/tapestry/pages/Error404.java | 0 .../com/baeldung/tapestry/pages/Home.java | 0 .../com/baeldung/tapestry/pages/Index.java | 0 .../com/baeldung/tapestry/pages/Login.java | 0 .../baeldung/tapestry/services/AppModule.java | 0 .../tapestry/services/DevelopmentModule.java | 0 .../baeldung/tapestry/services/QaModule.java | 0 .../baeldung/tapestry/components/Layout.tml | 0 .../com/baeldung/tapestry/logback.xml | 0 .../com/baeldung/tapestry/pages/Error404.tml | 0 .../baeldung/tapestry/pages/Home.properties | 0 .../com/baeldung/tapestry/pages/Home.tml | 0 .../baeldung/tapestry/pages/Index.properties | 0 .../com/baeldung/tapestry/pages/Index.tml | 0 .../com/baeldung/tapestry/pages/Login.tml | 0 .../src/main/resources/log4j.properties | 0 .../src/main/webapp/WEB-INF/app.properties | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/favicon.ico | Bin .../src/main/webapp/images/tapestry.png | Bin .../mybootstrap/css/bootstrap-theme.css | 0 .../main/webapp/mybootstrap/css/bootstrap.css | 0 .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin .../src/main/webapp/mybootstrap/js/affix.js | 0 .../src/main/webapp/mybootstrap/js/alert.js | 0 .../src/main/webapp/mybootstrap/js/button.js | 0 .../main/webapp/mybootstrap/js/carousel.js | 0 .../main/webapp/mybootstrap/js/collapse.js | 0 .../main/webapp/mybootstrap/js/dropdown.js | 0 .../src/main/webapp/mybootstrap/js/modal.js | 0 .../src/main/webapp/mybootstrap/js/popover.js | 0 .../main/webapp/mybootstrap/js/scrollspy.js | 0 .../src/main/webapp/mybootstrap/js/tab.js | 0 .../src/main/webapp/mybootstrap/js/tooltip.js | 0 .../main/webapp/mybootstrap/js/transition.js | 0 .../apache-tapestry}/src/site/apt/index.apt | 0 .../apache-tapestry}/src/site/site.xml | 0 .../apache-tapestry}/src/test/conf/testng.xml | 0 .../src/test/conf/webdefault.xml | 0 {blade => web-modules/blade}/README.md | 0 {blade => web-modules/blade}/pom.xml | 2 +- .../java/com/baeldung/blade/sample/App.java | 0 .../sample/AttributesExampleController.java | 0 .../blade/sample/LogExampleController.java | 0 .../ParameterInjectionExampleController.java | 0 .../blade/sample/RouteExampleController.java | 0 .../configuration/BaeldungException.java | 0 .../configuration/GlobalExceptionHandler.java | 0 .../sample/configuration/LoadConfig.java | 0 .../sample/configuration/ScheduleExample.java | 0 .../sample/interceptors/BaeldungHook.java | 0 .../interceptors/BaeldungMiddleware.java | 0 .../com/baeldung/blade/sample/vo/User.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/custom-static/icon.png | Bin .../blade}/src/main/resources/favicon.ico | Bin .../blade}/src/main/resources/static/app.css | 0 .../blade}/src/main/resources/static/app.js | 0 .../main/resources/static/file-upload.html | 0 .../src/main/resources/static/user-post.html | 0 .../main/resources/templates/allmatch.html | 0 .../src/main/resources/templates/delete.html | 0 .../src/main/resources/templates/get.html | 0 .../src/main/resources/templates/index.html | 0 .../src/main/resources/templates/my-404.html | 0 .../src/main/resources/templates/my-500.html | 0 .../src/main/resources/templates/post.html | 0 .../src/main/resources/templates/put.html | 0 .../templates/template-output-test.html | 0 .../baeldung/blade/sample/AppLiveTest.java | 0 .../AttributesExampleControllerLiveTest.java | 0 ...terInjectionExampleControllerLiveTest.java | 0 .../RouteExampleControllerLiveTest.java | 0 {bootique => web-modules/bootique}/README.md | 0 {bootique => web-modules/bootique}/config.yml | 0 {bootique => web-modules/bootique}/pom.xml | 2 +- .../main/java/com/baeldung/bootique/App.java | 0 .../bootique/module/ModuleBinder.java | 0 .../bootique/module/ModuleProvider.java | 0 .../bootique/router/IndexController.java | 0 .../bootique/router/SaveController.java | 0 .../bootique/service/HelloService.java | 0 .../service/impl/HelloServiceImpl.java | 0 .../services/io.bootique.BQModuleProvider | 0 .../bootique}/src/main/resources/logback.xml | 0 .../com/baeldung/bootique/AppUnitTest.java | 0 .../dropwizard}/README.md | 0 .../dropwizard}/pom.xml | 2 +- .../introduction/IntroductionApplication.java | 0 .../configuration/ApplicationHealthCheck.java | 0 .../configuration/BasicConfiguration.java | 0 .../dropwizard/introduction/domain/Brand.java | 0 .../repository/BrandRepository.java | 0 .../introduction/resource/BrandResource.java | 0 .../main/resources/introduction-config.yml | 0 .../repository/BrandRepositoryUnitTest.java | 0 .../google-web-toolkit}/README.md | 0 .../google-web-toolkit}/pom.xml | 2 +- .../com/baeldung/Google_web_toolkit.gwt.xml | 0 .../baeldung/client/Google_web_toolkit.java | 0 .../baeldung/server/MessageServiceImpl.java | 0 .../com/baeldung/shared/MessageService.java | 0 .../baeldung/shared/MessageServiceAsync.java | 0 .../src/main/resources/logback.xml | 0 .../src/main/webapp/Google_web_toolkit.css | 0 .../src/main/webapp/Google_web_toolkit.html | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/favicon.ico | Bin .../jakarta-ee}/README.md | 0 .../jakarta-ee}/pom.xml | 0 .../java/com/baeldung/eclipse/krazo/User.java | 0 .../eclipse/krazo/UserApplication.java | 0 .../eclipse/krazo/UserController.java | 0 .../src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/views/success.jsp | 0 .../src/main/webapp/WEB-INF/views/user.jsp | 0 .../jakarta-ee}/src/main/webapp/styles.css | 0 .../com/baeldung/eclipse/krazo/AppTest.java | 0 .../eclipse/krazo/UserControllerUnitTest.java | 0 .../java-lite}/README.md | 0 {java-lite => web-modules/java-lite}/pom.xml | 2 +- .../main/java/app/config/AppBootstrap.java | 0 .../java/app/config/AppControllerConfig.java | 0 .../src/main/java/app/config/DbConfig.java | 0 .../app/controllers/ArticleController.java | 0 .../java/app/controllers/HomeController.java | 0 .../app/controllers/ProductsController.java | 0 .../src/main/java/app/models/Article.java | 0 .../src/main/java/app/models/Product.java | 0 .../java/app/services/ArticleService.java | 0 .../java/app/services/ArticleServiceImpl.java | 0 .../app/services/ArticleServiceModule.java | 0 .../src/main/resources/database.properties | 0 .../java-lite}/src/main/resources/logback.xml | 0 .../webapp/WEB-INF/views/article/index.ftl | 0 .../webapp/WEB-INF/views/article/search.ftl | 32 ++-- .../webapp/WEB-INF/views/common/error.ftl | 0 .../main/webapp/WEB-INF/views/home/index.ftl | 0 .../WEB-INF/views/layouts/default_layout.ftl | 0 .../webapp/WEB-INF/views/layouts/footer.ftl | 0 .../webapp/WEB-INF/views/layouts/header.ftl | 0 .../webapp/WEB-INF/views/products/_comma.ftl | 0 .../WEB-INF/views/products/_product.ftl | 0 .../webapp/WEB-INF/views/products/index.ftl | 0 .../webapp/WEB-INF/views/products/message.ftl | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../controllers/ArticleControllerSpec.java | 0 .../test/java/app/models/ProductUnitTest.java | 0 .../javax-servlets-2}/README.md | 0 .../javax-servlets-2}/pom.xml | 2 +- .../com/baeldung/servlets/UserServlet.java | 0 .../java/com/baeldung/user/check/User.java | 0 .../baeldung/user/check/UserCheckFilter.java | 0 .../user/check/UserCheckLoginServlet.java | 0 .../user/check/UserCheckLogoutServlet.java | 0 .../baeldung/user/check/UserCheckServlet.java | 0 .../src/main/resources/logback.xml | 0 .../main/webapp/WEB-INF/user.check/home.jsp | 0 .../main/webapp/WEB-INF/user.check/login.jsp | 0 .../java/com/baeldung/servlets/TestUtil.java | 0 .../servlets/UserServletUnitTest.java | 0 .../user/check/UserCheckServletLiveTest.java | 0 .../javax-servlets}/.gitignore | 0 .../javax-servlets}/README.md | 0 .../javax-servlets}/pom.xml | 2 +- .../src/main/java/com/baeldung/Constants.java | 0 .../baeldung/controller/StudentServlet.java | 0 .../java/com/baeldung/model/Employee.java | 0 .../main/java/com/baeldung/model/Student.java | 0 .../com/baeldung/service/StudentService.java | 0 .../com/baeldung/servlets/CookieReader.java | 0 .../baeldung/servlets/DownloadServlet.java | 0 .../baeldung/servlets/EmployeeServlet.java | 0 .../servlets/ErrorHandlerServlet.java | 0 .../com/baeldung/servlets/FormServlet.java | 0 .../com/baeldung/servlets/LoginServlet.java | 0 .../com/baeldung/servlets/MainServlet.java | 42 ++--- .../baeldung/servlets/MultipartServlet.java | 0 .../com/baeldung/servlets/MyHttpServlet.java | 0 .../baeldung/servlets/RandomErrorServlet.java | 0 .../com/baeldung/servlets/UpdateServlet.java | 62 +++---- .../com/baeldung/servlets/UploadServlet.java | 0 .../servlets/UploadWelcomeServlet.java | 0 .../baeldung/servlets/UserLoginServlet.java | 56 +++--- .../com/baeldung/servlets/UserServlet.java | 96 +++++------ .../com/baeldung/servlets/WelcomeServlet.java | 0 .../src/main/resources/logback.xml | 0 .../src/main/webapp/WEB-INF/jsp/index.jsp | 0 .../src/main/webapp/WEB-INF/jsp/login.jsp | 0 .../src/main/webapp/WEB-INF/jsp/main.jsp | 28 +-- .../src/main/webapp/WEB-INF/jsp/result.jsp | 0 .../webapp/WEB-INF/jsp/student-record.jsp | 0 .../src/main/webapp/WEB-INF/jsp/update.jsp | 32 ++-- .../src/main/webapp/WEB-INF/jsp/userlogin.jsp | 34 ++-- .../src/main/webapp/WEB-INF/jsp/welcome.jsp | 0 .../src/main/webapp/WEB-INF/sample.txt | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/error-404.html | 0 .../src/main/webapp/result.jsp | 0 .../src/main/webapp/upload.jsp | 0 .../javax-servlets}/src/main/webapp/user.jsp | 0 .../EmployeeServletIntegrationTest.java | 0 .../baeldung/test/FormServletLiveTest.java | 0 .../baeldung/test/UserServletUnitTest.java | 102 +++++------ {jee-7 => web-modules/jee-7}/.gitignore | 0 {jee-7 => web-modules/jee-7}/README.md | 0 {jee-7 => web-modules/jee-7}/pom.xml | 2 +- .../baeldung/arquillian/CapsConvertor.java | 0 .../com/baeldung/arquillian/CapsService.java | 0 .../java/com/baeldung/arquillian/Car.java | 0 .../java/com/baeldung/arquillian/CarEJB.java | 0 .../com/baeldung/arquillian/Component.java | 0 .../arquillian/ConvertToLowerCase.java | 0 .../ChunkExceptionSkipReadListener.java | 0 .../batch/understanding/CustomCheckPoint.java | 0 .../understanding/DeciderJobSequence.java | 0 .../understanding/InjectSimpleBatchLet.java | 0 .../batch/understanding/SimpleBatchLet.java | 0 .../SimpleChunkItemProcessor.java | 0 .../understanding/SimpleChunkItemReader.java | 0 .../SimpleChunkItemReaderError.java | 0 .../understanding/SimpleChunkWriter.java | 0 .../exception/MyInputRecord.java | 0 .../exception/MyItemProcessor.java | 0 .../understanding/exception/MyItemReader.java | 0 .../understanding/exception/MyItemWriter.java | 0 .../exception/MyOutputRecord.java | 0 .../exception/MyRetryProcessorListener.java | 0 .../exception/MyRetryReadListener.java | 0 .../exception/MyRetryWriteListener.java | 0 .../exception/MySkipProcessorListener.java | 0 .../exception/MySkipReadListener.java | 0 .../exception/MySkipWriteListener.java | 0 .../com/baeldung/convListVal/ConvListVal.java | 0 .../com/baeldung/convListVal/MyListener.java | 0 .../javaeeannotations/AccountServlet.java | 0 .../BankAppServletContextListener.java | 0 .../javaeeannotations/LogInFilter.java | 0 .../UploadCustomerDocumentsServlet.java | 0 .../baeldung/jaxws/client/AddEmployee.java | 0 .../jaxws/client/AddEmployeeResponse.java | 0 .../baeldung/jaxws/client/CountEmployees.java | 0 .../jaxws/client/CountEmployeesResponse.java | 0 .../baeldung/jaxws/client/DeleteEmployee.java | 0 .../jaxws/client/DeleteEmployeeResponse.java | 0 .../com/baeldung/jaxws/client/Employee.java | 0 .../jaxws/client/EmployeeAlreadyExists.java | 0 .../EmployeeAlreadyExists_Exception.java | 0 .../jaxws/client/EmployeeNotFound.java | 0 .../client/EmployeeNotFound_Exception.java | 0 .../jaxws/client/EmployeeService.java | 0 .../jaxws/client/EmployeeServiceClient.java | 0 .../jaxws/client/EmployeeService_Service.java | 0 .../jaxws/client/GetAllEmployees.java | 0 .../jaxws/client/GetAllEmployeesResponse.java | 0 .../baeldung/jaxws/client/GetEmployee.java | 0 .../jaxws/client/GetEmployeeResponse.java | 0 .../baeldung/jaxws/client/ObjectFactory.java | 0 .../baeldung/jaxws/client/UpdateEmployee.java | 0 .../jaxws/client/UpdateEmployeeResponse.java | 0 .../baeldung/jaxws/client/package-info.java | 0 .../server/bottomup/EmployeeService.java | 0 .../server/bottomup/EmployeeServiceImpl.java | 0 .../exception/EmployeeAlreadyExists.java | 0 .../bottomup/exception/EmployeeNotFound.java | 0 .../jaxws/server/bottomup/model/Employee.java | 0 .../config/EmployeeServicePublisher.java | 0 .../server/repository/EmployeeRepository.java | 0 .../repository/EmployeeRepositoryImpl.java | 0 .../topdown/EmployeeServiceTopDown.java | 0 .../topdown/EmployeeServiceTopDownImpl.java | 0 .../EmployeeServiceTopDown_Service.java | 0 .../jaxws/server/topdown/ObjectFactory.java | 0 .../jaxws/wsdl/employeeservicetopdown.wsdl | 0 .../main/java/com/baeldung/json/Person.java | 0 .../java/com/baeldung/json/PersonBuilder.java | 0 .../java/com/baeldung/json/PersonWriter.java | 0 .../main/java/com/baeldung/singleton/Car.java | 0 .../baeldung/singleton/CarServiceBean.java | 0 .../singleton/CarServiceEjbSingleton.java | 0 .../singleton/CarServiceSingleton.java | 0 .../soap/ws/client/generated/Country.java | 0 .../ws/client/generated/CountryService.java | 0 .../generated/CountryServiceImplService.java | 0 .../soap/ws/client/generated/Currency.java | 0 .../ws/client/generated/ObjectFactory.java | 0 .../ws/client/generated/package-info.java | 0 .../com/baeldung/soap/ws/server/Country.java | 0 .../soap/ws/server/CountryRepository.java | 0 .../soap/ws/server/CountryService.java | 0 .../soap/ws/server/CountryServiceImpl.java | 0 .../ws/server/CountryServicePublisher.java | 0 .../com/baeldung/soap/ws/server/Currency.java | 0 .../baeldung/timer/AutomaticTimerBean.java | 0 .../baeldung/timer/FixedDelayTimerBean.java | 0 .../ProgrammaticAtFixedRateTimerBean.java | 0 .../baeldung/timer/ProgrammaticTimerBean.java | 0 ...ammaticWithInitialFixedDelayTimerBean.java | 0 .../com/baeldung/timer/ScheduleTimerBean.java | 0 .../java/com/baeldung/timer/TimerEvent.java | 0 .../baeldung/timer/TimerEventListener.java | 0 .../java/com/baeldung/timer/WorkerBean.java | 0 .../META-INF/batch-jobs/customCheckPoint.xml | 0 .../META-INF/batch-jobs/decideJobSequence.xml | 0 .../META-INF/batch-jobs/flowJobSequence.xml | 0 .../batch-jobs/injectionSimpleBatchLet.xml | 0 .../batch-jobs/partitionSimpleBatchLet.xml | 0 .../META-INF/batch-jobs/simpleBatchLet.xml | 0 .../META-INF/batch-jobs/simpleChunk.xml | 0 .../META-INF/batch-jobs/simpleErrorChunk.xml | 0 .../batch-jobs/simpleErrorSkipChunk.xml | 0 .../META-INF/batch-jobs/simpleJobSequence.xml | 0 .../META-INF/batch-jobs/splitJobSequence.xml | 0 .../src/main/resources/META-INF/beans.xml | 0 .../main/resources/META-INF/persistence.xml | 0 .../jee-7}/src/main/resources/country.xsd | 0 .../jee-7}/src/main/resources/logback.xml | 0 .../jee-7}/src/main/webapp/ConvListVal.xhtml | 0 .../jee-7}/src/main/webapp/WEB-INF/beans.xml | 0 .../src/main/webapp/WEB-INF/faces-config.xml | 0 .../jee-7}/src/main/webapp/WEB-INF/web.xml | 0 .../jee-7}/src/main/webapp/account.jsp | 0 .../jee-7}/src/main/webapp/upload.jsp | 0 .../java/com/baeldug/json/JsonUnitTest.java | 0 .../arquillan/ArquillianLiveTest.java | 0 .../batch/understanding/BatchTestHelper.java | 0 .../CustomCheckPointIntegrationTest.java | 0 .../JobSequenceIntegrationTest.java | 0 .../SimpleBatchLetIntegrationTest.java | 0 .../SimpleChunkIntegrationTest.java | 0 .../SimpleErrorChunkIntegrationTest.java | 0 .../convListVal/ConvListValLiveTest.java | 0 .../jaxws/EmployeeServiceLiveTest.java | 0 .../singleton/CarServiceIntegrationTest.java | 0 .../soap/ws/client/CountryClientLiveTest.java | 0 .../timer/AutomaticTimerBeanLiveTest.java | 0 ...grammaticAtFixedRateTimerBeanLiveTest.java | 0 .../timer/ProgrammaticTimerBeanLiveTest.java | 0 ...mmaticWithFixedDelayTimerBeanLiveTest.java | 0 .../timer/ScheduleTimerBeanLiveTest.java | 0 .../baeldung/timer/WithinWindowMatcher.java | 0 .../test/resources/META-INF/persistence.xml | 0 .../jee-7}/src/test/resources/arquillian.xml | 0 .../src/test/resources/jberet.properties | 0 {jooby => web-modules/jooby}/README.md | 0 .../jooby}/conf/application.conf | 0 {jooby => web-modules/jooby}/conf/logback.xml | 0 {jooby => web-modules/jooby}/pom.xml | 2 +- {jooby => web-modules/jooby}/public/form.html | 0 .../jooby}/public/welcome.html | 0 .../jooby}/src/etc/stork.yml | 0 .../src/main/java/com/baeldung/jooby/App.java | 0 .../com/baeldung/jooby/bean/Employee.java | 0 .../com/baeldung/jooby/mvc/GetController.java | 0 .../baeldung/jooby/mvc/PostController.java | 0 .../jooby}/src/main/resources/logback.xml | 0 .../java/com/baeldung/jooby/AppLiveTest.java | 0 .../java/com/baeldung/jooby/AppUnitTest.java | 0 {linkrest => web-modules/linkrest}/README.md | 0 .../linkrest}/WebContent/META-INF/MANIFEST.MF | 0 .../linkrest}/WebContent/WEB-INF/web.xml | 0 {linkrest => web-modules/linkrest}/pom.xml | 2 +- .../com/baeldung/LinkRestApplication.java | 0 .../java/com/baeldung/cayenne/Department.java | 0 .../java/com/baeldung/cayenne/Employee.java | 0 .../baeldung/cayenne/auto/_Department.java | 0 .../com/baeldung/cayenne/auto/_Employee.java | 0 .../linkrest/apis/DepartmentResource.java | 0 .../linkrest/apis/EmployeeSubResource.java | 0 .../resources/cayenne-linkrest-project.xml | 0 .../src/main/resources/linkrest.map.xml | 0 .../linkrest}/src/main/resources/logback.xml | 0 {ninja => web-modules/ninja}/README.md | 0 {ninja => web-modules/ninja}/pom.xml | 0 .../src/main/java/META-INF/persistence.xml | 0 .../src/main/java/assets/css/custom.css | 0 .../ninja}/src/main/java/conf/Filters.java | 0 .../ninja}/src/main/java/conf/Module.java | 0 .../ninja}/src/main/java/conf/Routes.java | 0 .../src/main/java/conf/application.conf | 0 .../src/main/java/conf/messages.properties | 0 .../src/main/java/conf/messages_fr.properties | 0 .../controllers/ApplicationController.java | 0 .../ninja}/src/main/java/ehcache.xml | 0 .../ninja}/src/main/java/logback.xml | 0 .../ninja}/src/main/java/models/User.java | 0 .../src/main/java/services/UserService.java | 0 .../main/java/services/UserServiceImpl.java | 0 .../ApplicationController/createUser.ftl.html | 0 .../views/ApplicationController/home.ftl.html | 0 .../ApplicationController/index.ftl.html | 0 .../java/views/layout/defaultLayout.ftl.html | 0 .../main/java/views/layout/footer.ftl.html | 0 .../main/java/views/layout/header.ftl.html | 0 .../java/views/system/403forbidden.ftl.html | 0 .../java/views/system/404notFound.ftl.html | 0 .../ninja}/src/main/webapp/WEB-INF/web.xml | 0 .../ApiControllerDocTesterTest.java | 0 .../ApiControllerMockUnitTest.java | 0 .../play-framework}/README.md | 0 .../controllers/$model__Camel$Controller.java | 0 .../app/controllers/$model__Camel$Data.java | 0 .../app/views/$model__camel$/form.scala.html | 0 .../async-http/.g8/form/default.properties | 0 .../.g8/form/generated-test/README.md | 0 .../$model__Camel$ControllerTest.java | 0 .../play-framework}/async-http/.gitignore | 0 .../play-framework}/async-http/README.md | 0 .../app/controllers/HomeController.java | 0 .../async-http/app/views/index.scala.html | 0 .../async-http/app/views/main.scala.html | 0 .../play-framework}/async-http/build.sbt | 0 .../async-http/conf/application.conf | 0 .../async-http/conf/logback.xml | 0 .../play-framework}/async-http/conf/routes | 0 .../async-http/project/build.properties | 0 .../async-http/project/plugins.sbt | 0 .../async-http/public/images/favicon.png | Bin .../async-http/public/javascripts/main.js | 0 .../async-http/public/stylesheets/main.css | 0 .../test/controllers/HomeControllerTest.java | 0 .../play-framework}/introduction/.gitignore | 0 .../app/controllers/HomeController.java | 0 .../introduction/app/views/index.scala.html | 0 .../introduction/app/views/main.scala.html | 0 .../play-framework}/introduction/build.sbt | 0 .../introduction/conf/application.conf | 0 .../introduction/conf/logback.xml | 0 .../play-framework}/introduction/conf/routes | 0 .../introduction/project/build.properties | 0 .../introduction/project/plugins.sbt | 0 .../introduction/public/images/favicon.png | Bin .../introduction/public/javascripts/main.js | 0 .../introduction/public/stylesheets/main.css | 0 .../controllers/HomeControllerUnitTest.java | 0 .../app/controllers/HomeController.java | 0 .../app/views/index.scala.html | 0 .../routing-in-play/app/views/main.scala.html | 0 .../play-framework}/routing-in-play/build.sbt | 0 .../routing-in-play/conf/application.conf | 0 .../routing-in-play/conf/logback.xml | 0 .../routing-in-play/conf/routes | 0 .../routing-in-play/project/build.properties | 0 .../routing-in-play/project/plugins.sbt | 0 .../routing-in-play/public/images/favicon.png | Bin .../public/javascripts/main.js | 0 .../public/stylesheets/main.css | 0 .../controllers/HomeControllerUnitTest.java | 0 .../play-framework}/student-api/.gitignore | 0 .../app/controllers/StudentController.java | 0 .../student-api/app/model/Student.java | 0 .../student-api/app/store/StudentStore.java | 0 .../student-api/app/utils/Util.java | 0 .../play-framework}/student-api/build.sbt | 0 .../student-api/conf/application.conf | 0 .../student-api/conf/logback.xml | 0 .../play-framework}/student-api/conf/routes | 0 .../student-api/project/build.properties | 0 .../student-api/project/plugins.sbt | 0 .../StudentControllerUnitTest.java | 0 .../play-framework}/websockets/README.md | 0 .../websockets/app/actors/Messenger.java | 0 .../app/controllers/HomeController.java | 0 .../websockets/app/dto/MessageDTO.java | 0 .../websockets/app/dto/RequestDTO.java | 0 .../app/utils/MessageConverter.java | 0 .../websockets/app/views/index.scala.html | 0 .../websockets/app/views/main.scala.html | 0 .../play-framework}/websockets/build.sbt | 0 .../websockets/conf/application.conf | 0 .../websockets/conf/logback.xml | 0 .../play-framework}/websockets/conf/routes | 0 .../websockets/project/build.properties | 0 .../websockets/project/plugins.sbt | 0 .../websockets/public/images/favicon.png | Bin .../websockets/public/javascripts/main.js | 0 .../websockets/public/stylesheets/main.css | 0 .../test/controllers/HomeControllerTest.java | 0 web-modules/pom.xml | 50 ++++++ {raml => web-modules/raml}/README.md | 0 .../raml}/annotations/README.md | 0 .../raml}/annotations/api.raml | 0 .../raml}/annotations/examples/Bar.json | 0 .../raml}/annotations/examples/Bars.json | 0 .../raml}/annotations/examples/Error.json | 0 .../raml}/annotations/examples/Foo.json | 0 .../raml}/annotations/examples/Foos.json | 0 .../extensions/en_US/additionalResources.raml | 0 .../annotations/libraries/dataTypes.raml | 0 .../annotations/libraries/resourceTypes.raml | 0 .../libraries/securitySchemes.raml | 0 .../raml}/annotations/libraries/traits.raml | 0 .../overlays/es_ES/additionalResources.raml | 0 .../overlays/es_ES/documentationItems.raml | 0 .../raml}/introduction/0.8/api.raml | 0 .../raml}/introduction/0.8/error-example.json | 0 .../raml}/introduction/0.8/error.json | 0 .../raml}/introduction/0.8/foo-example.json | 0 .../raml}/introduction/0.8/foo.json | 0 .../raml}/introduction/0.8/foos-example.json | 0 .../raml}/introduction/0.8/foos.json | 0 .../raml}/introduction/1.0/api.raml | 0 .../introduction/1.0/examples/Error.json | 0 .../raml}/introduction/1.0/examples/Foo.json | 0 .../raml}/introduction/1.0/examples/Foos.json | 0 .../raml}/introduction/1.0/types/Error.raml | 0 .../raml}/introduction/1.0/types/Foo.raml | 0 .../raml}/modularization/README.md | 0 .../api-before-modularization.raml | 0 .../modularization/api-with-libraries.raml | 0 .../api-with-typed-fragments.raml | 0 .../raml}/modularization/api.raml | 0 .../raml}/modularization/examples/Bar.json | 0 .../raml}/modularization/examples/Bars.json | 0 .../raml}/modularization/examples/Error.json | 0 .../raml}/modularization/examples/Foo.json | 0 .../raml}/modularization/examples/Foos.json | 0 .../extensions/en_US/additionalResources.raml | 0 .../modularization/libraries/dataTypes.raml | 0 .../libraries/resourceTypes.raml | 0 .../libraries/securitySchemes.raml | 0 .../modularization/libraries/traits.raml | 0 .../overlays/es_ES/additionalResources.raml | 0 .../overlays/es_ES/documentationItems.raml | 0 .../resourceTypes/collection.raml | 0 .../modularization/resourceTypes/item.raml | 0 .../modularization/traits/hasNotFound.raml | 0 .../modularization/traits/hasRequestItem.raml | 0 .../traits/hasResponseCollection.raml | 0 .../traits/hasResponseItem.raml | 0 .../raml}/modularization/types/Bar.raml | 0 .../raml}/modularization/types/Error.raml | 0 .../raml}/modularization/types/Foo.raml | 0 .../raml}/resource-types-and-traits/README.md | 0 .../api-before-resource-types-and-traits.raml | 0 .../raml}/resource-types-and-traits/api.raml | 0 .../examples/Bar.json | 0 .../examples/Bars.json | 0 .../examples/Error.json | 0 .../examples/Foo.json | 0 .../examples/Foos.json | 0 .../resource-types-and-traits/types/Bar.raml | 0 .../types/Error.raml | 0 .../resource-types-and-traits/types/Foo.raml | 0 {ratpack => web-modules/ratpack}/README.md | 0 {ratpack => web-modules/ratpack}/build.gradle | 74 ++++---- {ratpack => web-modules/ratpack}/pom.xml | 2 +- .../main/groovy/com/baeldung/Ratpack.groovy | 0 .../com/baeldung/RatpackGroovyApp.groovy | 0 .../groovy/com/baeldung/model/User.groovy | 0 .../main/java/com/baeldung/Application.java | 162 +++++++++--------- .../filter/RequestValidatorFilter.java | 0 .../java/com/baeldung/guice/Application.java | 0 .../guice/config/DependencyModule.java | 0 .../guice/service/DataPumpService.java | 0 .../guice/service/ServiceFactory.java | 0 .../service/impl/DataPumpServiceImpl.java | 0 .../com/baeldung/handler/EmployeeHandler.java | 40 ++--- .../java/com/baeldung/handler/FooHandler.java | 24 +-- .../com/baeldung/handler/RedirectHandler.java | 44 ++--- .../hystrix/HystrixAsyncHttpCommand.java | 0 .../hystrix/HystrixReactiveHttpCommand.java | 0 .../hystrix/HystrixSyncHttpCommand.java | 0 .../baeldung/hystrix/RatpackHystrixApp.java | 0 .../java/com/baeldung/model/Employee.java | 0 .../main/java/com/baeldung/model/Movie.java | 0 .../main/java/com/baeldung/model/Quote.java | 0 .../repository/EmployeeRepository.java | 20 +-- .../repository/EmployeeRepositoryImpl.java | 50 +++--- .../rxjava/RatpackErrorHandlingApp.java | 0 .../baeldung/rxjava/RatpackObserveApp.java | 0 .../rxjava/RatpackParallelismApp.java | 0 .../baeldung/rxjava/RatpackPromiseApp.java | 0 .../service/MovieObservableService.java | 0 .../rxjava/service/MoviePromiseService.java | 0 .../rxjava/service/QuotesService.java | 0 .../impl/MovieObservableServiceImpl.java | 0 .../service/impl/MoviePromiseServiceImpl.java | 0 .../java/com/baeldung/spring/ArticleList.java | 0 .../main/java/com/baeldung/spring/Config.java | 0 .../java/com/baeldung/spring/Content.java | 0 .../com/baeldung/spring/EmbedRatpackApp.java | 0 .../spring/EmbedRatpackStreamsApp.java | 0 .../baeldung/spring/EmbedSpringBootApp.java | 0 .../ratpack}/src/main/resources/DDL.sql | 0 .../ratpack}/src/main/resources/User.sql | 0 .../ratpack}/src/main/resources/logback.xml | 0 .../src/main/resources/public/index.html | 0 .../com/baeldung/RatpackGroovySpec.groovy | 0 .../java/com/baeldung/AppHttpUnitTest.java | 116 ++++++------- .../baeldung/ApplicationIntegrationTest.java | 0 .../RatpackHystrixAppFallbackLiveTest.java | 0 .../hystrix/RatpackHystrixAppLiveTest.java | 0 .../baeldung/ratpack/CompliantPublisher.java | 0 .../baeldung/ratpack/LoggingSubscriber.java | 0 .../ratpack/NonCompliantPublisher.java | 0 .../ratpack/RatpackStreamsUnitTest.java | 0 .../EmbedRatpackAppIntegrationTest.java | 0 {resteasy => web-modules/resteasy}/README.md | 0 {resteasy => web-modules/resteasy}/pom.xml | 2 +- .../baeldung/client/ServicesInterface.java | 0 .../java/com/baeldung/filter/CORSFilter.java | 0 .../main/java/com/baeldung/model/Movie.java | 0 .../com/baeldung/server/MovieCrudService.java | 0 .../com/baeldung/server/RestEasyServices.java | 0 .../resteasy}/src/main/resources/logback.xml | 0 .../main/webapp/WEB-INF/classes/logback.xml | 0 .../WEB-INF/jboss-deployment-structure.xml | 0 .../src/main/webapp/WEB-INF/jboss-web.xml | 0 .../resteasy}/src/main/webapp/WEB-INF/web.xml | 0 .../resteasy}/src/main/webapp/script.js | 0 .../server/RestEasyClientLiveTest.java | 0 .../com/baeldung/server/movies/batman.json | 0 .../baeldung/server/movies/transformer.json | 0 {restx => web-modules/restx}/README.md | 0 .../restx}/data/credentials.json | 0 {restx => web-modules/restx}/data/users.json | 0 {restx => web-modules/restx}/md.restx.json | 0 {restx => web-modules/restx}/pom.xml | 2 +- .../src/main/java/restx/demo/AppModule.java | 0 .../src/main/java/restx/demo/AppServer.java | 0 .../src/main/java/restx/demo/Roles.java | 0 .../main/java/restx/demo/domain/Message.java | 0 .../java/restx/demo/rest/HelloResource.java | 0 .../restx}/src/main/resources/logback.xml | 0 .../resources/restx/demo/settings.properties | 0 .../restx}/src/main/webapp/WEB-INF/web.xml | 0 .../HelloResourceSpecIntegrationTest.java | 0 .../hello/should_admin_say_hello.spec.yaml | 0 .../hello/should_anyone_say_hello.spec.yaml | 0 ..._value_triggers_validation_error.spec.yaml | 0 .../hello/should_user1_say_hello.spec.yaml | 0 .../should_user2_not_say_hello.spec.yaml | 0 .../spark-java}/README.md | 0 .../spark-java}/pom.xml | 2 +- .../baeldung/sparkjava/HelloWorldService.java | 0 .../baeldung/sparkjava/SparkRestExample.java | 0 .../baeldung/sparkjava/StandardResponse.java | 0 .../baeldung/sparkjava/StatusResponse.java | 0 .../java/com/baeldung/sparkjava/User.java | 0 .../com/baeldung/sparkjava/UserException.java | 0 .../com/baeldung/sparkjava/UserService.java | 0 .../sparkjava/UserServiceMapImpl.java | 0 .../src/main/resources/logback.xml | 0 {struts-2 => web-modules/struts-2}/README.md | 0 .../struts-2}/WebContent/WEB-INF/web.xml | 0 .../struts-2}/WebContent/input.jsp | 40 ++--- .../struts-2}/WebContent/result.jsp | 22 +-- {struts-2 => web-modules/struts-2}/pom.xml | 149 ++++++++-------- .../java/com/baeldung/struts/CarAction.java | 74 ++++---- .../baeldung/struts/CarMessageService.java | 36 ++-- .../struts-2}/src/main/resources/logback.xml | 0 .../baeldung/struts/test/CarActionTest.java | 58 +++---- {vraptor => web-modules/vraptor}/.gitignore | 0 {vraptor => web-modules/vraptor}/README.md | 0 {vraptor => web-modules/vraptor}/pom.xml | 3 +- .../java/com/baeldung/config/UserInfo.java | 0 .../baeldung/controllers/AuthController.java | 0 .../baeldung/controllers/IndexController.java | 0 .../baeldung/controllers/PostController.java | 0 .../main/java/com/baeldung/daos/PostDao.java | 0 .../main/java/com/baeldung/daos/UserDao.java | 0 .../main/java/com/baeldung/models/Post.java | 0 .../main/java/com/baeldung/models/User.java | 0 .../src/main/resources/META-INF/beans.xml | 0 .../vraptor}/src/main/resources/database.sql | 0 .../src/main/resources/hibernate.cfg.xml | 0 .../vraptor}/src/main/resources/log4j.xml | 0 .../main/resources/templates/auth/login.ftl | 0 .../resources/templates/auth/register.ftl | 0 .../src/main/resources/templates/index.ftl | 0 .../main/resources/templates/posts/add.ftl | 0 .../src/main/resources/templates/view.ftl | 0 .../src/main/webapp/META-INF/MANIFEST.MF | 0 .../main/webapp/WEB-INF/jsp/index/index.jsp | 0 .../vraptor}/src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/css/clean-blog.css | 0 .../src/main/webapp/css/clean-blog.min.css | 0 .../vraptor}/src/main/webapp/img/about-bg.jpg | Bin .../src/main/webapp/img/contact-bg.jpg | Bin .../vraptor}/src/main/webapp/img/home-bg.jpg | Bin .../vraptor}/src/main/webapp/img/post-bg.jpg | Bin .../src/main/webapp/img/post-sample-image.jpg | Bin .../vraptor}/src/main/webapp/js/clean-blog.js | 0 .../src/main/webapp/js/clean-blog.min.js | 0 .../vraptor}/src/main/webapp/js/contact_me.js | 0 .../main/webapp/js/jqBootstrapValidation.js | 0 .../webapp/vendor/bootstrap/css/bootstrap.css | 0 .../vendor/bootstrap/css/bootstrap.min.css | 0 .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin .../webapp/vendor/bootstrap/js/bootstrap.js | 0 .../vendor/bootstrap/js/bootstrap.min.js | 0 .../vendor/font-awesome/css/font-awesome.css | 0 .../font-awesome/css/font-awesome.min.css | 0 .../vendor/font-awesome/fonts/FontAwesome.otf | Bin .../fonts/fontawesome-webfont.eot | Bin .../fonts/fontawesome-webfont.svg | 0 .../fonts/fontawesome-webfont.ttf | Bin .../fonts/fontawesome-webfont.woff | Bin .../fonts/fontawesome-webfont.woff2 | Bin .../vendor/font-awesome/less/animated.less | 0 .../font-awesome/less/bordered-pulled.less | 0 .../webapp/vendor/font-awesome/less/core.less | 0 .../vendor/font-awesome/less/fixed-width.less | 0 .../font-awesome/less/font-awesome.less | 0 .../vendor/font-awesome/less/icons.less | 0 .../vendor/font-awesome/less/larger.less | 0 .../webapp/vendor/font-awesome/less/list.less | 0 .../vendor/font-awesome/less/mixins.less | 0 .../webapp/vendor/font-awesome/less/path.less | 0 .../font-awesome/less/rotated-flipped.less | 0 .../font-awesome/less/screen-reader.less | 0 .../vendor/font-awesome/less/stacked.less | 0 .../vendor/font-awesome/less/variables.less | 0 .../vendor/font-awesome/scss/_animated.scss | 0 .../font-awesome/scss/_bordered-pulled.scss | 0 .../vendor/font-awesome/scss/_core.scss | 0 .../font-awesome/scss/_fixed-width.scss | 0 .../vendor/font-awesome/scss/_icons.scss | 0 .../vendor/font-awesome/scss/_larger.scss | 0 .../vendor/font-awesome/scss/_list.scss | 0 .../vendor/font-awesome/scss/_mixins.scss | 0 .../vendor/font-awesome/scss/_path.scss | 0 .../font-awesome/scss/_rotated-flipped.scss | 0 .../font-awesome/scss/_screen-reader.scss | 0 .../vendor/font-awesome/scss/_stacked.scss | 0 .../vendor/font-awesome/scss/_variables.scss | 0 .../font-awesome/scss/font-awesome.scss | 0 .../src/main/webapp/vendor/jquery/jquery.js | 0 .../main/webapp/vendor/jquery/jquery.min.js | 0 {wicket => web-modules/wicket}/README.md | 0 {wicket => web-modules/wicket}/pom.xml | 2 +- .../baeldung/wicket/examples/HelloWorld.html | 0 .../baeldung/wicket/examples/HelloWorld.java | 0 .../examples/HelloWorldApplication.java | 0 .../examples/cafeaddress/CafeAddress.html | 0 .../examples/cafeaddress/CafeAddress.java | 0 .../examples/helloworld/HelloWorld.html | 0 .../examples/helloworld/HelloWorld.java | 0 .../wicket}/src/main/resources/logback.xml | 0 .../examples/HomePageIntegrationTest.java | 0 .../wicket}/src/main/webapp/WEB-INF/web.xml | 0 755 files changed, 768 insertions(+), 755 deletions(-) create mode 100644 web-modules/README.md rename {apache-tapestry => web-modules/apache-tapestry}/README.md (100%) rename {apache-tapestry => web-modules/apache-tapestry}/pom.xml (99%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/components/Layout.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/pages/Error404.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/pages/Home.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/pages/Index.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/pages/Login.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/services/AppModule.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/services/DevelopmentModule.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/java/com/baeldung/tapestry/services/QaModule.java (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/components/Layout.tml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/logback.xml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/pages/Error404.tml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/pages/Home.properties (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/pages/Home.tml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/pages/Index.properties (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/pages/Index.tml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/com/baeldung/tapestry/pages/Login.tml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/resources/log4j.properties (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/WEB-INF/app.properties (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/WEB-INF/web.xml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/favicon.ico (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/images/tapestry.png (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/css/bootstrap-theme.css (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/css/bootstrap.css (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.eot (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.svg (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.ttf (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff2 (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/affix.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/alert.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/button.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/carousel.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/collapse.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/dropdown.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/modal.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/popover.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/scrollspy.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/tab.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/tooltip.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/main/webapp/mybootstrap/js/transition.js (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/site/apt/index.apt (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/site/site.xml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/test/conf/testng.xml (100%) rename {apache-tapestry => web-modules/apache-tapestry}/src/test/conf/webdefault.xml (100%) rename {blade => web-modules/blade}/README.md (100%) rename {blade => web-modules/blade}/pom.xml (98%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/App.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/AttributesExampleController.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/LogExampleController.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/ParameterInjectionExampleController.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/RouteExampleController.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/configuration/BaeldungException.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/configuration/GlobalExceptionHandler.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/configuration/LoadConfig.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/configuration/ScheduleExample.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungHook.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungMiddleware.java (100%) rename {blade => web-modules/blade}/src/main/java/com/baeldung/blade/sample/vo/User.java (100%) rename {blade => web-modules/blade}/src/main/resources/application.properties (100%) rename {blade => web-modules/blade}/src/main/resources/custom-static/icon.png (100%) rename {blade => web-modules/blade}/src/main/resources/favicon.ico (100%) rename {blade => web-modules/blade}/src/main/resources/static/app.css (100%) rename {blade => web-modules/blade}/src/main/resources/static/app.js (100%) rename {blade => web-modules/blade}/src/main/resources/static/file-upload.html (100%) rename {blade => web-modules/blade}/src/main/resources/static/user-post.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/allmatch.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/delete.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/get.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/index.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/my-404.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/my-500.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/post.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/put.html (100%) rename {blade => web-modules/blade}/src/main/resources/templates/template-output-test.html (100%) rename {blade => web-modules/blade}/src/test/java/com/baeldung/blade/sample/AppLiveTest.java (100%) rename {blade => web-modules/blade}/src/test/java/com/baeldung/blade/sample/AttributesExampleControllerLiveTest.java (100%) rename {blade => web-modules/blade}/src/test/java/com/baeldung/blade/sample/ParameterInjectionExampleControllerLiveTest.java (100%) rename {blade => web-modules/blade}/src/test/java/com/baeldung/blade/sample/RouteExampleControllerLiveTest.java (100%) rename {bootique => web-modules/bootique}/README.md (100%) rename {bootique => web-modules/bootique}/config.yml (100%) rename {bootique => web-modules/bootique}/pom.xml (97%) rename {bootique => web-modules/bootique}/src/main/java/com/baeldung/bootique/App.java (100%) rename {bootique => web-modules/bootique}/src/main/java/com/baeldung/bootique/module/ModuleBinder.java (100%) rename {bootique => web-modules/bootique}/src/main/java/com/baeldung/bootique/module/ModuleProvider.java (100%) rename {bootique => web-modules/bootique}/src/main/java/com/baeldung/bootique/router/IndexController.java (100%) rename {bootique => web-modules/bootique}/src/main/java/com/baeldung/bootique/router/SaveController.java (100%) rename {bootique => web-modules/bootique}/src/main/java/com/baeldung/bootique/service/HelloService.java (100%) rename {bootique => web-modules/bootique}/src/main/java/com/baeldung/bootique/service/impl/HelloServiceImpl.java (100%) rename {bootique => web-modules/bootique}/src/main/resources/META-INF/services/io.bootique.BQModuleProvider (100%) rename {bootique => web-modules/bootique}/src/main/resources/logback.xml (100%) rename {bootique => web-modules/bootique}/src/test/java/com/baeldung/bootique/AppUnitTest.java (100%) rename {dropwizard => web-modules/dropwizard}/README.md (100%) rename {dropwizard => web-modules/dropwizard}/pom.xml (98%) rename {dropwizard => web-modules/dropwizard}/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java (100%) rename {dropwizard => web-modules/dropwizard}/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java (100%) rename {dropwizard => web-modules/dropwizard}/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java (100%) rename {dropwizard => web-modules/dropwizard}/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java (100%) rename {dropwizard => web-modules/dropwizard}/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java (100%) rename {dropwizard => web-modules/dropwizard}/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java (100%) rename {dropwizard => web-modules/dropwizard}/src/main/resources/introduction-config.yml (100%) rename {dropwizard => web-modules/dropwizard}/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/README.md (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/pom.xml (98%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/java/com/baeldung/Google_web_toolkit.gwt.xml (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/java/com/baeldung/client/Google_web_toolkit.java (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/java/com/baeldung/server/MessageServiceImpl.java (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/java/com/baeldung/shared/MessageService.java (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/java/com/baeldung/shared/MessageServiceAsync.java (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/resources/logback.xml (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/webapp/Google_web_toolkit.css (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/webapp/Google_web_toolkit.html (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/webapp/WEB-INF/web.xml (100%) rename {google-web-toolkit => web-modules/google-web-toolkit}/src/main/webapp/favicon.ico (100%) rename {jakarta-ee => web-modules/jakarta-ee}/README.md (100%) rename {jakarta-ee => web-modules/jakarta-ee}/pom.xml (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/main/java/com/baeldung/eclipse/krazo/User.java (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/main/java/com/baeldung/eclipse/krazo/UserApplication.java (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/main/java/com/baeldung/eclipse/krazo/UserController.java (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/main/webapp/WEB-INF/beans.xml (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/main/webapp/WEB-INF/views/success.jsp (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/main/webapp/WEB-INF/views/user.jsp (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/main/webapp/styles.css (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/test/java/com/baeldung/eclipse/krazo/AppTest.java (100%) rename {jakarta-ee => web-modules/jakarta-ee}/src/test/java/com/baeldung/eclipse/krazo/UserControllerUnitTest.java (100%) rename {java-lite => web-modules/java-lite}/README.md (100%) rename {java-lite => web-modules/java-lite}/pom.xml (98%) rename {java-lite => web-modules/java-lite}/src/main/java/app/config/AppBootstrap.java (100%) rename {java-lite => web-modules/java-lite}/src/main/java/app/config/AppControllerConfig.java (100%) rename {java-lite => web-modules/java-lite}/src/main/java/app/config/DbConfig.java (100%) rename {java-lite => web-modules/java-lite}/src/main/java/app/controllers/ArticleController.java (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/java/app/controllers/HomeController.java (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/java/app/controllers/ProductsController.java (100%) rename {java-lite => web-modules/java-lite}/src/main/java/app/models/Article.java (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/java/app/models/Product.java (100%) rename {java-lite => web-modules/java-lite}/src/main/java/app/services/ArticleService.java (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/java/app/services/ArticleServiceImpl.java (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/java/app/services/ArticleServiceModule.java (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/resources/database.properties (100%) rename {java-lite => web-modules/java-lite}/src/main/resources/logback.xml (100%) rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/article/index.ftl (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/article/search.ftl (95%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/common/error.ftl (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/home/index.ftl (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/layouts/default_layout.ftl (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/layouts/footer.ftl (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/layouts/header.ftl (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/products/_comma.ftl (100%) rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/products/_product.ftl (100%) rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/products/index.ftl (100%) rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/views/products/message.ftl (100%) rename {java-lite => web-modules/java-lite}/src/main/webapp/WEB-INF/web.xml (100%) rename {java-lite => web-modules/java-lite}/src/test/java/app/controllers/ArticleControllerSpec.java (100%) mode change 100755 => 100644 rename {java-lite => web-modules/java-lite}/src/test/java/app/models/ProductUnitTest.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/README.md (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/pom.xml (98%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/java/com/baeldung/servlets/UserServlet.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/java/com/baeldung/user/check/User.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/java/com/baeldung/user/check/UserCheckFilter.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/java/com/baeldung/user/check/UserCheckLoginServlet.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/java/com/baeldung/user/check/UserCheckLogoutServlet.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/java/com/baeldung/user/check/UserCheckServlet.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/resources/logback.xml (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/webapp/WEB-INF/user.check/home.jsp (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/main/webapp/WEB-INF/user.check/login.jsp (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/test/java/com/baeldung/servlets/TestUtil.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/test/java/com/baeldung/servlets/UserServletUnitTest.java (100%) rename {javax-servlets-2 => web-modules/javax-servlets-2}/src/test/java/com/baeldung/user/check/UserCheckServletLiveTest.java (100%) rename {javax-servlets => web-modules/javax-servlets}/.gitignore (100%) rename {javax-servlets => web-modules/javax-servlets}/README.md (100%) rename {javax-servlets => web-modules/javax-servlets}/pom.xml (97%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/Constants.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/controller/StudentServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/model/Employee.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/model/Student.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/service/StudentService.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/CookieReader.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/DownloadServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/EmployeeServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/ErrorHandlerServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/FormServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/LoginServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/MainServlet.java (96%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/MultipartServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/MyHttpServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/RandomErrorServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/UpdateServlet.java (96%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/UploadServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/UploadWelcomeServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/UserLoginServlet.java (96%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/UserServlet.java (97%) rename {javax-servlets => web-modules/javax-servlets}/src/main/java/com/baeldung/servlets/WelcomeServlet.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/resources/logback.xml (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/index.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/login.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/main.jsp (96%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/result.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/student-record.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/update.jsp (96%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/userlogin.jsp (96%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/jsp/welcome.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/sample.txt (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/WEB-INF/web.xml (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/error-404.html (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/result.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/upload.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/main/webapp/user.jsp (100%) rename {javax-servlets => web-modules/javax-servlets}/src/test/java/com/baeldung/servlets/EmployeeServletIntegrationTest.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/test/java/com/baeldung/test/FormServletLiveTest.java (100%) rename {javax-servlets => web-modules/javax-servlets}/src/test/java/com/baeldung/test/UserServletUnitTest.java (97%) rename {jee-7 => web-modules/jee-7}/.gitignore (100%) rename {jee-7 => web-modules/jee-7}/README.md (100%) rename {jee-7 => web-modules/jee-7}/pom.xml (99%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/arquillian/CapsConvertor.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/arquillian/CapsService.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/arquillian/Car.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/arquillian/CarEJB.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/arquillian/Component.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/arquillian/ConvertToLowerCase.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/convListVal/ConvListVal.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/convListVal/MyListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/javaeeannotations/AccountServlet.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/javaeeannotations/BankAppServletContextListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/javaeeannotations/LogInFilter.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/javaeeannotations/UploadCustomerDocumentsServlet.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/AddEmployee.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/AddEmployeeResponse.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/CountEmployees.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/CountEmployeesResponse.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/DeleteEmployee.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/DeleteEmployeeResponse.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/Employee.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists_Exception.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound_Exception.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/EmployeeService.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/EmployeeServiceClient.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/EmployeeService_Service.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/GetAllEmployees.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/GetAllEmployeesResponse.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/GetEmployee.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/GetEmployeeResponse.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/ObjectFactory.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/UpdateEmployee.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/UpdateEmployeeResponse.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/client/package-info.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeService.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeServiceImpl.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeAlreadyExists.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeNotFound.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/bottomup/model/Employee.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/config/EmployeeServicePublisher.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepository.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepositoryImpl.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDownImpl.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown_Service.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/server/topdown/ObjectFactory.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/jaxws/wsdl/employeeservicetopdown.wsdl (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/json/Person.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/json/PersonBuilder.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/json/PersonWriter.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/singleton/Car.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/singleton/CarServiceBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/singleton/CarServiceEjbSingleton.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/singleton/CarServiceSingleton.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/client/generated/Country.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/server/Country.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/server/CountryService.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/soap/ws/server/Currency.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/AutomaticTimerBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/FixedDelayTimerBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/ProgrammaticTimerBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/ProgrammaticWithInitialFixedDelayTimerBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/ScheduleTimerBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/TimerEvent.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/TimerEventListener.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/java/com/baeldung/timer/WorkerBean.java (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/simpleChunk.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/beans.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/META-INF/persistence.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/country.xsd (100%) rename {jee-7 => web-modules/jee-7}/src/main/resources/logback.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/webapp/ConvListVal.xhtml (100%) rename {jee-7 => web-modules/jee-7}/src/main/webapp/WEB-INF/beans.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/webapp/WEB-INF/faces-config.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/webapp/WEB-INF/web.xml (100%) rename {jee-7 => web-modules/jee-7}/src/main/webapp/account.jsp (100%) rename {jee-7 => web-modules/jee-7}/src/main/webapp/upload.jsp (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldug/json/JsonUnitTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/arquillan/ArquillianLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/batch/understanding/CustomCheckPointIntegrationTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/batch/understanding/JobSequenceIntegrationTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetIntegrationTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/batch/understanding/SimpleChunkIntegrationTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkIntegrationTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/convListVal/ConvListValLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/jaxws/EmployeeServiceLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/singleton/CarServiceIntegrationTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/timer/AutomaticTimerBeanLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/timer/ScheduleTimerBeanLiveTest.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/java/com/baeldung/timer/WithinWindowMatcher.java (100%) rename {jee-7 => web-modules/jee-7}/src/test/resources/META-INF/persistence.xml (100%) rename {jee-7 => web-modules/jee-7}/src/test/resources/arquillian.xml (100%) rename {jee-7 => web-modules/jee-7}/src/test/resources/jberet.properties (100%) rename {jooby => web-modules/jooby}/README.md (100%) rename {jooby => web-modules/jooby}/conf/application.conf (100%) rename {jooby => web-modules/jooby}/conf/logback.xml (100%) rename {jooby => web-modules/jooby}/pom.xml (97%) rename {jooby => web-modules/jooby}/public/form.html (100%) rename {jooby => web-modules/jooby}/public/welcome.html (100%) rename {jooby => web-modules/jooby}/src/etc/stork.yml (100%) rename {jooby => web-modules/jooby}/src/main/java/com/baeldung/jooby/App.java (100%) rename {jooby => web-modules/jooby}/src/main/java/com/baeldung/jooby/bean/Employee.java (100%) rename {jooby => web-modules/jooby}/src/main/java/com/baeldung/jooby/mvc/GetController.java (100%) rename {jooby => web-modules/jooby}/src/main/java/com/baeldung/jooby/mvc/PostController.java (100%) rename {jooby => web-modules/jooby}/src/main/resources/logback.xml (100%) rename {jooby => web-modules/jooby}/src/test/java/com/baeldung/jooby/AppLiveTest.java (100%) rename {jooby => web-modules/jooby}/src/test/java/com/baeldung/jooby/AppUnitTest.java (100%) rename {linkrest => web-modules/linkrest}/README.md (100%) rename {linkrest => web-modules/linkrest}/WebContent/META-INF/MANIFEST.MF (100%) rename {linkrest => web-modules/linkrest}/WebContent/WEB-INF/web.xml (100%) rename {linkrest => web-modules/linkrest}/pom.xml (98%) rename {linkrest => web-modules/linkrest}/src/main/java/com/baeldung/LinkRestApplication.java (100%) rename {linkrest => web-modules/linkrest}/src/main/java/com/baeldung/cayenne/Department.java (100%) rename {linkrest => web-modules/linkrest}/src/main/java/com/baeldung/cayenne/Employee.java (100%) rename {linkrest => web-modules/linkrest}/src/main/java/com/baeldung/cayenne/auto/_Department.java (100%) rename {linkrest => web-modules/linkrest}/src/main/java/com/baeldung/cayenne/auto/_Employee.java (100%) rename {linkrest => web-modules/linkrest}/src/main/java/com/baeldung/linkrest/apis/DepartmentResource.java (100%) rename {linkrest => web-modules/linkrest}/src/main/java/com/baeldung/linkrest/apis/EmployeeSubResource.java (100%) rename {linkrest => web-modules/linkrest}/src/main/resources/cayenne-linkrest-project.xml (100%) rename {linkrest => web-modules/linkrest}/src/main/resources/linkrest.map.xml (100%) rename {linkrest => web-modules/linkrest}/src/main/resources/logback.xml (100%) rename {ninja => web-modules/ninja}/README.md (100%) rename {ninja => web-modules/ninja}/pom.xml (100%) rename {ninja => web-modules/ninja}/src/main/java/META-INF/persistence.xml (100%) rename {ninja => web-modules/ninja}/src/main/java/assets/css/custom.css (100%) rename {ninja => web-modules/ninja}/src/main/java/conf/Filters.java (100%) rename {ninja => web-modules/ninja}/src/main/java/conf/Module.java (100%) rename {ninja => web-modules/ninja}/src/main/java/conf/Routes.java (100%) rename {ninja => web-modules/ninja}/src/main/java/conf/application.conf (100%) rename {ninja => web-modules/ninja}/src/main/java/conf/messages.properties (100%) rename {ninja => web-modules/ninja}/src/main/java/conf/messages_fr.properties (100%) rename {ninja => web-modules/ninja}/src/main/java/controllers/ApplicationController.java (100%) rename {ninja => web-modules/ninja}/src/main/java/ehcache.xml (100%) rename {ninja => web-modules/ninja}/src/main/java/logback.xml (100%) rename {ninja => web-modules/ninja}/src/main/java/models/User.java (100%) rename {ninja => web-modules/ninja}/src/main/java/services/UserService.java (100%) rename {ninja => web-modules/ninja}/src/main/java/services/UserServiceImpl.java (100%) rename {ninja => web-modules/ninja}/src/main/java/views/ApplicationController/createUser.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/java/views/ApplicationController/home.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/java/views/ApplicationController/index.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/java/views/layout/defaultLayout.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/java/views/layout/footer.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/java/views/layout/header.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/java/views/system/403forbidden.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/java/views/system/404notFound.ftl.html (100%) rename {ninja => web-modules/ninja}/src/main/webapp/WEB-INF/web.xml (100%) rename {ninja => web-modules/ninja}/src/test/java/controllers/ApiControllerDocTesterTest.java (100%) rename {ninja => web-modules/ninja}/src/test/java/controllers/ApiControllerMockUnitTest.java (100%) rename {play-framework => web-modules/play-framework}/README.md (100%) rename {play-framework => web-modules/play-framework}/async-http/.g8/form/app/controllers/$model__Camel$Controller.java (100%) rename {play-framework => web-modules/play-framework}/async-http/.g8/form/app/controllers/$model__Camel$Data.java (100%) rename {play-framework => web-modules/play-framework}/async-http/.g8/form/app/views/$model__camel$/form.scala.html (100%) rename {play-framework => web-modules/play-framework}/async-http/.g8/form/default.properties (100%) rename {play-framework => web-modules/play-framework}/async-http/.g8/form/generated-test/README.md (100%) rename {play-framework => web-modules/play-framework}/async-http/.g8/form/generated-test/controllers/$model__Camel$ControllerTest.java (100%) rename {play-framework => web-modules/play-framework}/async-http/.gitignore (100%) rename {play-framework => web-modules/play-framework}/async-http/README.md (100%) rename {play-framework => web-modules/play-framework}/async-http/app/controllers/HomeController.java (100%) rename {play-framework => web-modules/play-framework}/async-http/app/views/index.scala.html (100%) rename {play-framework => web-modules/play-framework}/async-http/app/views/main.scala.html (100%) rename {play-framework => web-modules/play-framework}/async-http/build.sbt (100%) rename {play-framework => web-modules/play-framework}/async-http/conf/application.conf (100%) rename {play-framework => web-modules/play-framework}/async-http/conf/logback.xml (100%) rename {play-framework => web-modules/play-framework}/async-http/conf/routes (100%) rename {play-framework => web-modules/play-framework}/async-http/project/build.properties (100%) rename {play-framework => web-modules/play-framework}/async-http/project/plugins.sbt (100%) rename {play-framework => web-modules/play-framework}/async-http/public/images/favicon.png (100%) rename {play-framework => web-modules/play-framework}/async-http/public/javascripts/main.js (100%) rename {play-framework => web-modules/play-framework}/async-http/public/stylesheets/main.css (100%) rename {play-framework => web-modules/play-framework}/async-http/test/controllers/HomeControllerTest.java (100%) rename {play-framework => web-modules/play-framework}/introduction/.gitignore (100%) rename {play-framework => web-modules/play-framework}/introduction/app/controllers/HomeController.java (100%) rename {play-framework => web-modules/play-framework}/introduction/app/views/index.scala.html (100%) rename {play-framework => web-modules/play-framework}/introduction/app/views/main.scala.html (100%) rename {play-framework => web-modules/play-framework}/introduction/build.sbt (100%) rename {play-framework => web-modules/play-framework}/introduction/conf/application.conf (100%) rename {play-framework => web-modules/play-framework}/introduction/conf/logback.xml (100%) rename {play-framework => web-modules/play-framework}/introduction/conf/routes (100%) rename {play-framework => web-modules/play-framework}/introduction/project/build.properties (100%) rename {play-framework => web-modules/play-framework}/introduction/project/plugins.sbt (100%) rename {play-framework => web-modules/play-framework}/introduction/public/images/favicon.png (100%) rename {play-framework => web-modules/play-framework}/introduction/public/javascripts/main.js (100%) rename {play-framework => web-modules/play-framework}/introduction/public/stylesheets/main.css (100%) rename {play-framework => web-modules/play-framework}/introduction/test/controllers/HomeControllerUnitTest.java (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/app/controllers/HomeController.java (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/app/views/index.scala.html (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/app/views/main.scala.html (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/build.sbt (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/conf/application.conf (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/conf/logback.xml (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/conf/routes (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/project/build.properties (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/project/plugins.sbt (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/public/images/favicon.png (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/public/javascripts/main.js (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/public/stylesheets/main.css (100%) rename {play-framework => web-modules/play-framework}/routing-in-play/test/controllers/HomeControllerUnitTest.java (100%) rename {play-framework => web-modules/play-framework}/student-api/.gitignore (100%) rename {play-framework => web-modules/play-framework}/student-api/app/controllers/StudentController.java (100%) rename {play-framework => web-modules/play-framework}/student-api/app/model/Student.java (100%) rename {play-framework => web-modules/play-framework}/student-api/app/store/StudentStore.java (100%) rename {play-framework => web-modules/play-framework}/student-api/app/utils/Util.java (100%) rename {play-framework => web-modules/play-framework}/student-api/build.sbt (100%) rename {play-framework => web-modules/play-framework}/student-api/conf/application.conf (100%) rename {play-framework => web-modules/play-framework}/student-api/conf/logback.xml (100%) rename {play-framework => web-modules/play-framework}/student-api/conf/routes (100%) rename {play-framework => web-modules/play-framework}/student-api/project/build.properties (100%) rename {play-framework => web-modules/play-framework}/student-api/project/plugins.sbt (100%) rename {play-framework => web-modules/play-framework}/student-api/test/controllers/StudentControllerUnitTest.java (100%) rename {play-framework => web-modules/play-framework}/websockets/README.md (100%) rename {play-framework => web-modules/play-framework}/websockets/app/actors/Messenger.java (100%) rename {play-framework => web-modules/play-framework}/websockets/app/controllers/HomeController.java (100%) rename {play-framework => web-modules/play-framework}/websockets/app/dto/MessageDTO.java (100%) rename {play-framework => web-modules/play-framework}/websockets/app/dto/RequestDTO.java (100%) rename {play-framework => web-modules/play-framework}/websockets/app/utils/MessageConverter.java (100%) rename {play-framework => web-modules/play-framework}/websockets/app/views/index.scala.html (100%) rename {play-framework => web-modules/play-framework}/websockets/app/views/main.scala.html (100%) rename {play-framework => web-modules/play-framework}/websockets/build.sbt (100%) rename {play-framework => web-modules/play-framework}/websockets/conf/application.conf (100%) rename {play-framework => web-modules/play-framework}/websockets/conf/logback.xml (100%) rename {play-framework => web-modules/play-framework}/websockets/conf/routes (100%) rename {play-framework => web-modules/play-framework}/websockets/project/build.properties (100%) rename {play-framework => web-modules/play-framework}/websockets/project/plugins.sbt (100%) rename {play-framework => web-modules/play-framework}/websockets/public/images/favicon.png (100%) rename {play-framework => web-modules/play-framework}/websockets/public/javascripts/main.js (100%) rename {play-framework => web-modules/play-framework}/websockets/public/stylesheets/main.css (100%) rename {play-framework => web-modules/play-framework}/websockets/test/controllers/HomeControllerTest.java (100%) create mode 100644 web-modules/pom.xml rename {raml => web-modules/raml}/README.md (100%) rename {raml => web-modules/raml}/annotations/README.md (100%) rename {raml => web-modules/raml}/annotations/api.raml (100%) rename {raml => web-modules/raml}/annotations/examples/Bar.json (100%) rename {raml => web-modules/raml}/annotations/examples/Bars.json (100%) rename {raml => web-modules/raml}/annotations/examples/Error.json (100%) rename {raml => web-modules/raml}/annotations/examples/Foo.json (100%) rename {raml => web-modules/raml}/annotations/examples/Foos.json (100%) rename {raml => web-modules/raml}/annotations/extensions/en_US/additionalResources.raml (100%) rename {raml => web-modules/raml}/annotations/libraries/dataTypes.raml (100%) rename {raml => web-modules/raml}/annotations/libraries/resourceTypes.raml (100%) rename {raml => web-modules/raml}/annotations/libraries/securitySchemes.raml (100%) rename {raml => web-modules/raml}/annotations/libraries/traits.raml (100%) rename {raml => web-modules/raml}/annotations/overlays/es_ES/additionalResources.raml (100%) rename {raml => web-modules/raml}/annotations/overlays/es_ES/documentationItems.raml (100%) rename {raml => web-modules/raml}/introduction/0.8/api.raml (100%) rename {raml => web-modules/raml}/introduction/0.8/error-example.json (100%) rename {raml => web-modules/raml}/introduction/0.8/error.json (100%) rename {raml => web-modules/raml}/introduction/0.8/foo-example.json (100%) rename {raml => web-modules/raml}/introduction/0.8/foo.json (100%) rename {raml => web-modules/raml}/introduction/0.8/foos-example.json (100%) rename {raml => web-modules/raml}/introduction/0.8/foos.json (100%) rename {raml => web-modules/raml}/introduction/1.0/api.raml (100%) rename {raml => web-modules/raml}/introduction/1.0/examples/Error.json (100%) rename {raml => web-modules/raml}/introduction/1.0/examples/Foo.json (100%) rename {raml => web-modules/raml}/introduction/1.0/examples/Foos.json (100%) rename {raml => web-modules/raml}/introduction/1.0/types/Error.raml (100%) rename {raml => web-modules/raml}/introduction/1.0/types/Foo.raml (100%) rename {raml => web-modules/raml}/modularization/README.md (100%) rename {raml => web-modules/raml}/modularization/api-before-modularization.raml (100%) rename {raml => web-modules/raml}/modularization/api-with-libraries.raml (100%) rename {raml => web-modules/raml}/modularization/api-with-typed-fragments.raml (100%) rename {raml => web-modules/raml}/modularization/api.raml (100%) rename {raml => web-modules/raml}/modularization/examples/Bar.json (100%) rename {raml => web-modules/raml}/modularization/examples/Bars.json (100%) rename {raml => web-modules/raml}/modularization/examples/Error.json (100%) rename {raml => web-modules/raml}/modularization/examples/Foo.json (100%) rename {raml => web-modules/raml}/modularization/examples/Foos.json (100%) rename {raml => web-modules/raml}/modularization/extensions/en_US/additionalResources.raml (100%) rename {raml => web-modules/raml}/modularization/libraries/dataTypes.raml (100%) rename {raml => web-modules/raml}/modularization/libraries/resourceTypes.raml (100%) rename {raml => web-modules/raml}/modularization/libraries/securitySchemes.raml (100%) rename {raml => web-modules/raml}/modularization/libraries/traits.raml (100%) rename {raml => web-modules/raml}/modularization/overlays/es_ES/additionalResources.raml (100%) rename {raml => web-modules/raml}/modularization/overlays/es_ES/documentationItems.raml (100%) rename {raml => web-modules/raml}/modularization/resourceTypes/collection.raml (100%) rename {raml => web-modules/raml}/modularization/resourceTypes/item.raml (100%) rename {raml => web-modules/raml}/modularization/traits/hasNotFound.raml (100%) rename {raml => web-modules/raml}/modularization/traits/hasRequestItem.raml (100%) rename {raml => web-modules/raml}/modularization/traits/hasResponseCollection.raml (100%) rename {raml => web-modules/raml}/modularization/traits/hasResponseItem.raml (100%) rename {raml => web-modules/raml}/modularization/types/Bar.raml (100%) rename {raml => web-modules/raml}/modularization/types/Error.raml (100%) rename {raml => web-modules/raml}/modularization/types/Foo.raml (100%) rename {raml => web-modules/raml}/resource-types-and-traits/README.md (100%) rename {raml => web-modules/raml}/resource-types-and-traits/api-before-resource-types-and-traits.raml (100%) rename {raml => web-modules/raml}/resource-types-and-traits/api.raml (100%) rename {raml => web-modules/raml}/resource-types-and-traits/examples/Bar.json (100%) rename {raml => web-modules/raml}/resource-types-and-traits/examples/Bars.json (100%) rename {raml => web-modules/raml}/resource-types-and-traits/examples/Error.json (100%) rename {raml => web-modules/raml}/resource-types-and-traits/examples/Foo.json (100%) rename {raml => web-modules/raml}/resource-types-and-traits/examples/Foos.json (100%) rename {raml => web-modules/raml}/resource-types-and-traits/types/Bar.raml (100%) rename {raml => web-modules/raml}/resource-types-and-traits/types/Error.raml (100%) rename {raml => web-modules/raml}/resource-types-and-traits/types/Foo.raml (100%) rename {ratpack => web-modules/ratpack}/README.md (100%) rename {ratpack => web-modules/ratpack}/build.gradle (95%) rename {ratpack => web-modules/ratpack}/pom.xml (98%) rename {ratpack => web-modules/ratpack}/src/main/groovy/com/baeldung/Ratpack.groovy (100%) rename {ratpack => web-modules/ratpack}/src/main/groovy/com/baeldung/RatpackGroovyApp.groovy (100%) rename {ratpack => web-modules/ratpack}/src/main/groovy/com/baeldung/model/User.groovy (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/Application.java (97%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/filter/RequestValidatorFilter.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/guice/Application.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/guice/config/DependencyModule.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/guice/service/DataPumpService.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/guice/service/ServiceFactory.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/guice/service/impl/DataPumpServiceImpl.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/handler/EmployeeHandler.java (97%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/handler/FooHandler.java (95%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/handler/RedirectHandler.java (97%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/hystrix/HystrixAsyncHttpCommand.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/hystrix/HystrixReactiveHttpCommand.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/hystrix/HystrixSyncHttpCommand.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/hystrix/RatpackHystrixApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/model/Employee.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/model/Movie.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/model/Quote.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/repository/EmployeeRepository.java (95%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/repository/EmployeeRepositoryImpl.java (96%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/RatpackErrorHandlingApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/RatpackObserveApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/RatpackParallelismApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/RatpackPromiseApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/service/MovieObservableService.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/service/MoviePromiseService.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/service/QuotesService.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/service/impl/MovieObservableServiceImpl.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/rxjava/service/impl/MoviePromiseServiceImpl.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/spring/ArticleList.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/spring/Config.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/spring/Content.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/spring/EmbedRatpackApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/spring/EmbedRatpackStreamsApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/java/com/baeldung/spring/EmbedSpringBootApp.java (100%) rename {ratpack => web-modules/ratpack}/src/main/resources/DDL.sql (100%) rename {ratpack => web-modules/ratpack}/src/main/resources/User.sql (100%) rename {ratpack => web-modules/ratpack}/src/main/resources/logback.xml (100%) rename {ratpack => web-modules/ratpack}/src/main/resources/public/index.html (100%) rename {ratpack => web-modules/ratpack}/src/test/groovy/com/baeldung/RatpackGroovySpec.groovy (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/AppHttpUnitTest.java (97%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/ApplicationIntegrationTest.java (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/hystrix/RatpackHystrixAppFallbackLiveTest.java (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/hystrix/RatpackHystrixAppLiveTest.java (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/ratpack/CompliantPublisher.java (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/ratpack/LoggingSubscriber.java (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/ratpack/NonCompliantPublisher.java (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/ratpack/RatpackStreamsUnitTest.java (100%) rename {ratpack => web-modules/ratpack}/src/test/java/com/baeldung/spring/EmbedRatpackAppIntegrationTest.java (100%) rename {resteasy => web-modules/resteasy}/README.md (100%) rename {resteasy => web-modules/resteasy}/pom.xml (99%) rename {resteasy => web-modules/resteasy}/src/main/java/com/baeldung/client/ServicesInterface.java (100%) rename {resteasy => web-modules/resteasy}/src/main/java/com/baeldung/filter/CORSFilter.java (100%) rename {resteasy => web-modules/resteasy}/src/main/java/com/baeldung/model/Movie.java (100%) rename {resteasy => web-modules/resteasy}/src/main/java/com/baeldung/server/MovieCrudService.java (100%) rename {resteasy => web-modules/resteasy}/src/main/java/com/baeldung/server/RestEasyServices.java (100%) rename {resteasy => web-modules/resteasy}/src/main/resources/logback.xml (100%) rename {resteasy => web-modules/resteasy}/src/main/webapp/WEB-INF/classes/logback.xml (100%) rename {resteasy => web-modules/resteasy}/src/main/webapp/WEB-INF/jboss-deployment-structure.xml (100%) rename {resteasy => web-modules/resteasy}/src/main/webapp/WEB-INF/jboss-web.xml (100%) rename {resteasy => web-modules/resteasy}/src/main/webapp/WEB-INF/web.xml (100%) rename {resteasy => web-modules/resteasy}/src/main/webapp/script.js (100%) rename {resteasy => web-modules/resteasy}/src/test/java/com/baeldung/server/RestEasyClientLiveTest.java (100%) rename {resteasy => web-modules/resteasy}/src/test/resources/com/baeldung/server/movies/batman.json (100%) rename {resteasy => web-modules/resteasy}/src/test/resources/com/baeldung/server/movies/transformer.json (100%) rename {restx => web-modules/restx}/README.md (100%) rename {restx => web-modules/restx}/data/credentials.json (100%) rename {restx => web-modules/restx}/data/users.json (100%) rename {restx => web-modules/restx}/md.restx.json (100%) rename {restx => web-modules/restx}/pom.xml (99%) rename {restx => web-modules/restx}/src/main/java/restx/demo/AppModule.java (100%) rename {restx => web-modules/restx}/src/main/java/restx/demo/AppServer.java (100%) rename {restx => web-modules/restx}/src/main/java/restx/demo/Roles.java (100%) rename {restx => web-modules/restx}/src/main/java/restx/demo/domain/Message.java (100%) rename {restx => web-modules/restx}/src/main/java/restx/demo/rest/HelloResource.java (100%) rename {restx => web-modules/restx}/src/main/resources/logback.xml (100%) rename {restx => web-modules/restx}/src/main/resources/restx/demo/settings.properties (100%) rename {restx => web-modules/restx}/src/main/webapp/WEB-INF/web.xml (100%) rename {restx => web-modules/restx}/src/test/java/restx/demo/rest/HelloResourceSpecIntegrationTest.java (100%) rename {restx => web-modules/restx}/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml (100%) rename {restx => web-modules/restx}/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml (100%) rename {restx => web-modules/restx}/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml (100%) rename {restx => web-modules/restx}/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml (100%) rename {restx => web-modules/restx}/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml (100%) rename {spark-java => web-modules/spark-java}/README.md (100%) rename {spark-java => web-modules/spark-java}/pom.xml (96%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/HelloWorldService.java (100%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/SparkRestExample.java (100%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/StandardResponse.java (100%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/StatusResponse.java (100%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/User.java (100%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/UserException.java (100%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/UserService.java (100%) rename {spark-java => web-modules/spark-java}/src/main/java/com/baeldung/sparkjava/UserServiceMapImpl.java (100%) rename {spark-java => web-modules/spark-java}/src/main/resources/logback.xml (100%) rename {struts-2 => web-modules/struts-2}/README.md (100%) rename {struts-2 => web-modules/struts-2}/WebContent/WEB-INF/web.xml (100%) rename {struts-2 => web-modules/struts-2}/WebContent/input.jsp (97%) rename {struts-2 => web-modules/struts-2}/WebContent/result.jsp (95%) rename {struts-2 => web-modules/struts-2}/pom.xml (93%) rename {struts-2 => web-modules/struts-2}/src/main/java/com/baeldung/struts/CarAction.java (96%) rename {struts-2 => web-modules/struts-2}/src/main/java/com/baeldung/struts/CarMessageService.java (96%) rename {struts-2 => web-modules/struts-2}/src/main/resources/logback.xml (100%) rename {struts-2 => web-modules/struts-2}/src/test/java/com/baeldung/struts/test/CarActionTest.java (97%) rename {vraptor => web-modules/vraptor}/.gitignore (100%) rename {vraptor => web-modules/vraptor}/README.md (100%) rename {vraptor => web-modules/vraptor}/pom.xml (98%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/config/UserInfo.java (100%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/controllers/AuthController.java (100%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/controllers/IndexController.java (100%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/controllers/PostController.java (100%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/daos/PostDao.java (100%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/daos/UserDao.java (100%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/models/Post.java (100%) rename {vraptor => web-modules/vraptor}/src/main/java/com/baeldung/models/User.java (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/META-INF/beans.xml (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/database.sql (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/hibernate.cfg.xml (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/log4j.xml (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/templates/auth/login.ftl (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/templates/auth/register.ftl (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/templates/index.ftl (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/templates/posts/add.ftl (100%) rename {vraptor => web-modules/vraptor}/src/main/resources/templates/view.ftl (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/META-INF/MANIFEST.MF (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/WEB-INF/jsp/index/index.jsp (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/WEB-INF/web.xml (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/css/clean-blog.css (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/css/clean-blog.min.css (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/img/about-bg.jpg (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/img/contact-bg.jpg (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/img/home-bg.jpg (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/img/post-bg.jpg (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/img/post-sample-image.jpg (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/js/clean-blog.js (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/js/clean-blog.min.js (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/js/contact_me.js (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/js/jqBootstrapValidation.js (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/css/bootstrap.css (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/css/bootstrap.min.css (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/js/bootstrap.js (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/bootstrap/js/bootstrap.min.js (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/css/font-awesome.css (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/css/font-awesome.min.css (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/fonts/FontAwesome.otf (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.eot (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.svg (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.ttf (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff2 (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/animated.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/bordered-pulled.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/core.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/fixed-width.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/font-awesome.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/icons.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/larger.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/list.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/mixins.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/path.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/rotated-flipped.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/screen-reader.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/stacked.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/less/variables.less (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_animated.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_bordered-pulled.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_core.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_fixed-width.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_icons.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_larger.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_list.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_mixins.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_path.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_rotated-flipped.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_screen-reader.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_stacked.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/_variables.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/font-awesome/scss/font-awesome.scss (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/jquery/jquery.js (100%) rename {vraptor => web-modules/vraptor}/src/main/webapp/vendor/jquery/jquery.min.js (100%) rename {wicket => web-modules/wicket}/README.md (100%) rename {wicket => web-modules/wicket}/pom.xml (98%) rename {wicket => web-modules/wicket}/src/main/java/com/baeldung/wicket/examples/HelloWorld.html (100%) rename {wicket => web-modules/wicket}/src/main/java/com/baeldung/wicket/examples/HelloWorld.java (100%) rename {wicket => web-modules/wicket}/src/main/java/com/baeldung/wicket/examples/HelloWorldApplication.java (100%) rename {wicket => web-modules/wicket}/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.html (100%) rename {wicket => web-modules/wicket}/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java (100%) rename {wicket => web-modules/wicket}/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.html (100%) rename {wicket => web-modules/wicket}/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java (100%) rename {wicket => web-modules/wicket}/src/main/resources/logback.xml (100%) rename {wicket => web-modules/wicket}/src/main/test/java/com/baeldung/wicket/examples/HomePageIntegrationTest.java (100%) rename {wicket => web-modules/wicket}/src/main/webapp/WEB-INF/web.xml (100%) diff --git a/pom.xml b/pom.xml index cdee542d12..f142d7bd96 100644 --- a/pom.xml +++ b/pom.xml @@ -345,7 +345,6 @@ apache-poi-2 apache-rocketmq apache-spark - apache-tapestry apache-thrift apache-tika apache-velocity @@ -362,8 +361,6 @@ azure bazel - blade - bootique cdi checker-plugin @@ -384,7 +381,6 @@ disruptor dozer drools - dropwizard dubbo @@ -394,7 +390,6 @@ geotools google-cloud - google-web-toolkit graphql-modules @@ -413,18 +408,13 @@ java-blockchain javafx java-jdi - java-lite java-rmi java-spi java-vavr-stream java-websocket - javax-servlets - javax-servlets-2 javax-sound javaxval jaxb - jee-7 - jakarta-ee jersey jgit jgroups @@ -433,7 +423,6 @@ jmeter jmh java-native - jooby jsf json-modules jsoup @@ -459,7 +448,6 @@ libraries-server libraries-server-2 libraries-testing - linkrest logging-modules lombok-modules lucene @@ -477,7 +465,6 @@ netflix-modules netty - ninja orika osgi @@ -493,10 +480,7 @@ rabbitmq - ratpack reactor-core - resteasy - restx rsocket rule-engines rxjava-modules @@ -504,6 +488,7 @@ reactive-systems security-modules slack + web-modules @@ -550,7 +535,6 @@ saas - spark-java spf4j spring-4 @@ -634,7 +618,6 @@ static-analysis stripe - struts-2 tensorflow-java testing-modules @@ -647,10 +630,8 @@ vertx vertx-and-rxjava video-tutorials - vraptor webrtc - wicket wildfly xml xstream @@ -763,7 +744,6 @@ apache-poi-2 apache-rocketmq apache-spark - apache-tapestry apache-thrift apache-tika apache-velocity @@ -780,8 +760,6 @@ azure bazel - blade - bootique cdi checker-plugin @@ -802,7 +780,6 @@ disruptor dozer drools - dropwizard dubbo @@ -812,7 +789,6 @@ geotools google-cloud - google-web-toolkit graphql-modules @@ -831,18 +807,13 @@ java-blockchain javafx java-jdi - java-lite java-rmi java-spi java-vavr-stream java-websocket - javax-servlets - javax-servlets-2 javax-sound javaxval jaxb - jee-7 - jakarta-ee jersey jgit jgroups @@ -851,7 +822,6 @@ jmeter jmh java-native - jooby jsf json-modules jsoup @@ -879,7 +849,6 @@ libraries-server libraries-server-2 libraries-testing - linkrest logging-modules lombok-modules lucene @@ -897,7 +866,6 @@ netflix-modules netty - ninja orika osgi @@ -913,10 +881,7 @@ rabbitmq - ratpack reactor-core - resteasy - restx rsocket rule-engines rxjava-modules @@ -924,6 +889,7 @@ reactive-systems security-modules slack + web-modules @@ -962,7 +928,6 @@ saas - spark-java spf4j spring-4 @@ -1047,7 +1012,6 @@ static-analysis stripe - struts-2 tensorflow-java testing-modules @@ -1060,10 +1024,8 @@ vertx vertx-and-rxjava video-tutorials - vraptor webrtc - wicket wildfly xml xml-2 diff --git a/web-modules/README.md b/web-modules/README.md new file mode 100644 index 0000000000..1329ce18db --- /dev/null +++ b/web-modules/README.md @@ -0,0 +1,3 @@ +## Web + +This module contains web modules. diff --git a/apache-tapestry/README.md b/web-modules/apache-tapestry/README.md similarity index 100% rename from apache-tapestry/README.md rename to web-modules/apache-tapestry/README.md diff --git a/apache-tapestry/pom.xml b/web-modules/apache-tapestry/pom.xml similarity index 99% rename from apache-tapestry/pom.xml rename to web-modules/apache-tapestry/pom.xml index 201b807d9f..d70af20a59 100644 --- a/apache-tapestry/pom.xml +++ b/web-modules/apache-tapestry/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/components/Layout.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/components/Layout.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/components/Layout.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/components/Layout.java diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Error404.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Error404.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Error404.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Error404.java diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Home.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Home.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Home.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Home.java diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Index.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Index.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Index.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Index.java diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Login.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Login.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Login.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/pages/Login.java diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/services/AppModule.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/services/AppModule.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/services/AppModule.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/services/AppModule.java diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/services/DevelopmentModule.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/services/DevelopmentModule.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/services/DevelopmentModule.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/services/DevelopmentModule.java diff --git a/apache-tapestry/src/main/java/com/baeldung/tapestry/services/QaModule.java b/web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/services/QaModule.java similarity index 100% rename from apache-tapestry/src/main/java/com/baeldung/tapestry/services/QaModule.java rename to web-modules/apache-tapestry/src/main/java/com/baeldung/tapestry/services/QaModule.java diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/components/Layout.tml b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/components/Layout.tml similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/components/Layout.tml rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/components/Layout.tml diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/logback.xml b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/logback.xml similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/logback.xml rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/logback.xml diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Error404.tml b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Error404.tml similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Error404.tml rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Error404.tml diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.properties b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.properties similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.properties rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.properties diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.tml b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.tml similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.tml rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Home.tml diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.properties b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.properties similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.properties rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.properties diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.tml b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.tml similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.tml rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Index.tml diff --git a/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Login.tml b/web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Login.tml similarity index 100% rename from apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Login.tml rename to web-modules/apache-tapestry/src/main/resources/com/baeldung/tapestry/pages/Login.tml diff --git a/apache-tapestry/src/main/resources/log4j.properties b/web-modules/apache-tapestry/src/main/resources/log4j.properties similarity index 100% rename from apache-tapestry/src/main/resources/log4j.properties rename to web-modules/apache-tapestry/src/main/resources/log4j.properties diff --git a/apache-tapestry/src/main/webapp/WEB-INF/app.properties b/web-modules/apache-tapestry/src/main/webapp/WEB-INF/app.properties similarity index 100% rename from apache-tapestry/src/main/webapp/WEB-INF/app.properties rename to web-modules/apache-tapestry/src/main/webapp/WEB-INF/app.properties diff --git a/apache-tapestry/src/main/webapp/WEB-INF/web.xml b/web-modules/apache-tapestry/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from apache-tapestry/src/main/webapp/WEB-INF/web.xml rename to web-modules/apache-tapestry/src/main/webapp/WEB-INF/web.xml diff --git a/apache-tapestry/src/main/webapp/favicon.ico b/web-modules/apache-tapestry/src/main/webapp/favicon.ico similarity index 100% rename from apache-tapestry/src/main/webapp/favicon.ico rename to web-modules/apache-tapestry/src/main/webapp/favicon.ico diff --git a/apache-tapestry/src/main/webapp/images/tapestry.png b/web-modules/apache-tapestry/src/main/webapp/images/tapestry.png similarity index 100% rename from apache-tapestry/src/main/webapp/images/tapestry.png rename to web-modules/apache-tapestry/src/main/webapp/images/tapestry.png diff --git a/apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap-theme.css b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap-theme.css similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap-theme.css rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap-theme.css diff --git a/apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap.css b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap.css similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap.css rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/css/bootstrap.css diff --git a/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.eot b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.eot rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.eot diff --git a/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.svg b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.svg rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.svg diff --git a/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.ttf b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.ttf rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.ttf diff --git a/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff diff --git a/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff2 b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff2 rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/fonts/glyphicons-halflings-regular.woff2 diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/affix.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/affix.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/affix.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/affix.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/alert.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/alert.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/alert.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/alert.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/button.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/button.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/button.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/button.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/carousel.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/carousel.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/carousel.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/carousel.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/collapse.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/collapse.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/collapse.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/collapse.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/dropdown.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/dropdown.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/dropdown.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/dropdown.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/modal.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/modal.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/modal.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/modal.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/popover.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/popover.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/popover.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/popover.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/scrollspy.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/scrollspy.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/scrollspy.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/scrollspy.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/tab.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/tab.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/tab.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/tab.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/tooltip.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/tooltip.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/tooltip.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/tooltip.js diff --git a/apache-tapestry/src/main/webapp/mybootstrap/js/transition.js b/web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/transition.js similarity index 100% rename from apache-tapestry/src/main/webapp/mybootstrap/js/transition.js rename to web-modules/apache-tapestry/src/main/webapp/mybootstrap/js/transition.js diff --git a/apache-tapestry/src/site/apt/index.apt b/web-modules/apache-tapestry/src/site/apt/index.apt similarity index 100% rename from apache-tapestry/src/site/apt/index.apt rename to web-modules/apache-tapestry/src/site/apt/index.apt diff --git a/apache-tapestry/src/site/site.xml b/web-modules/apache-tapestry/src/site/site.xml similarity index 100% rename from apache-tapestry/src/site/site.xml rename to web-modules/apache-tapestry/src/site/site.xml diff --git a/apache-tapestry/src/test/conf/testng.xml b/web-modules/apache-tapestry/src/test/conf/testng.xml similarity index 100% rename from apache-tapestry/src/test/conf/testng.xml rename to web-modules/apache-tapestry/src/test/conf/testng.xml diff --git a/apache-tapestry/src/test/conf/webdefault.xml b/web-modules/apache-tapestry/src/test/conf/webdefault.xml similarity index 100% rename from apache-tapestry/src/test/conf/webdefault.xml rename to web-modules/apache-tapestry/src/test/conf/webdefault.xml diff --git a/blade/README.md b/web-modules/blade/README.md similarity index 100% rename from blade/README.md rename to web-modules/blade/README.md diff --git a/blade/pom.xml b/web-modules/blade/pom.xml similarity index 98% rename from blade/pom.xml rename to web-modules/blade/pom.xml index 441629b859..0733556c20 100644 --- a/blade/pom.xml +++ b/web-modules/blade/pom.xml @@ -8,7 +8,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/blade/src/main/java/com/baeldung/blade/sample/App.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/App.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/App.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/App.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/AttributesExampleController.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/AttributesExampleController.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/AttributesExampleController.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/AttributesExampleController.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/LogExampleController.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/LogExampleController.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/LogExampleController.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/LogExampleController.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/ParameterInjectionExampleController.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/ParameterInjectionExampleController.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/ParameterInjectionExampleController.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/ParameterInjectionExampleController.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/RouteExampleController.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/RouteExampleController.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/RouteExampleController.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/RouteExampleController.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/configuration/BaeldungException.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/BaeldungException.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/configuration/BaeldungException.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/BaeldungException.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/configuration/GlobalExceptionHandler.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/GlobalExceptionHandler.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/configuration/GlobalExceptionHandler.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/GlobalExceptionHandler.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/configuration/LoadConfig.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/LoadConfig.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/configuration/LoadConfig.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/LoadConfig.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/configuration/ScheduleExample.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/ScheduleExample.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/configuration/ScheduleExample.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/configuration/ScheduleExample.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungHook.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungHook.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungHook.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungHook.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungMiddleware.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungMiddleware.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungMiddleware.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/interceptors/BaeldungMiddleware.java diff --git a/blade/src/main/java/com/baeldung/blade/sample/vo/User.java b/web-modules/blade/src/main/java/com/baeldung/blade/sample/vo/User.java similarity index 100% rename from blade/src/main/java/com/baeldung/blade/sample/vo/User.java rename to web-modules/blade/src/main/java/com/baeldung/blade/sample/vo/User.java diff --git a/blade/src/main/resources/application.properties b/web-modules/blade/src/main/resources/application.properties similarity index 100% rename from blade/src/main/resources/application.properties rename to web-modules/blade/src/main/resources/application.properties diff --git a/blade/src/main/resources/custom-static/icon.png b/web-modules/blade/src/main/resources/custom-static/icon.png similarity index 100% rename from blade/src/main/resources/custom-static/icon.png rename to web-modules/blade/src/main/resources/custom-static/icon.png diff --git a/blade/src/main/resources/favicon.ico b/web-modules/blade/src/main/resources/favicon.ico similarity index 100% rename from blade/src/main/resources/favicon.ico rename to web-modules/blade/src/main/resources/favicon.ico diff --git a/blade/src/main/resources/static/app.css b/web-modules/blade/src/main/resources/static/app.css similarity index 100% rename from blade/src/main/resources/static/app.css rename to web-modules/blade/src/main/resources/static/app.css diff --git a/blade/src/main/resources/static/app.js b/web-modules/blade/src/main/resources/static/app.js similarity index 100% rename from blade/src/main/resources/static/app.js rename to web-modules/blade/src/main/resources/static/app.js diff --git a/blade/src/main/resources/static/file-upload.html b/web-modules/blade/src/main/resources/static/file-upload.html similarity index 100% rename from blade/src/main/resources/static/file-upload.html rename to web-modules/blade/src/main/resources/static/file-upload.html diff --git a/blade/src/main/resources/static/user-post.html b/web-modules/blade/src/main/resources/static/user-post.html similarity index 100% rename from blade/src/main/resources/static/user-post.html rename to web-modules/blade/src/main/resources/static/user-post.html diff --git a/blade/src/main/resources/templates/allmatch.html b/web-modules/blade/src/main/resources/templates/allmatch.html similarity index 100% rename from blade/src/main/resources/templates/allmatch.html rename to web-modules/blade/src/main/resources/templates/allmatch.html diff --git a/blade/src/main/resources/templates/delete.html b/web-modules/blade/src/main/resources/templates/delete.html similarity index 100% rename from blade/src/main/resources/templates/delete.html rename to web-modules/blade/src/main/resources/templates/delete.html diff --git a/blade/src/main/resources/templates/get.html b/web-modules/blade/src/main/resources/templates/get.html similarity index 100% rename from blade/src/main/resources/templates/get.html rename to web-modules/blade/src/main/resources/templates/get.html diff --git a/blade/src/main/resources/templates/index.html b/web-modules/blade/src/main/resources/templates/index.html similarity index 100% rename from blade/src/main/resources/templates/index.html rename to web-modules/blade/src/main/resources/templates/index.html diff --git a/blade/src/main/resources/templates/my-404.html b/web-modules/blade/src/main/resources/templates/my-404.html similarity index 100% rename from blade/src/main/resources/templates/my-404.html rename to web-modules/blade/src/main/resources/templates/my-404.html diff --git a/blade/src/main/resources/templates/my-500.html b/web-modules/blade/src/main/resources/templates/my-500.html similarity index 100% rename from blade/src/main/resources/templates/my-500.html rename to web-modules/blade/src/main/resources/templates/my-500.html diff --git a/blade/src/main/resources/templates/post.html b/web-modules/blade/src/main/resources/templates/post.html similarity index 100% rename from blade/src/main/resources/templates/post.html rename to web-modules/blade/src/main/resources/templates/post.html diff --git a/blade/src/main/resources/templates/put.html b/web-modules/blade/src/main/resources/templates/put.html similarity index 100% rename from blade/src/main/resources/templates/put.html rename to web-modules/blade/src/main/resources/templates/put.html diff --git a/blade/src/main/resources/templates/template-output-test.html b/web-modules/blade/src/main/resources/templates/template-output-test.html similarity index 100% rename from blade/src/main/resources/templates/template-output-test.html rename to web-modules/blade/src/main/resources/templates/template-output-test.html diff --git a/blade/src/test/java/com/baeldung/blade/sample/AppLiveTest.java b/web-modules/blade/src/test/java/com/baeldung/blade/sample/AppLiveTest.java similarity index 100% rename from blade/src/test/java/com/baeldung/blade/sample/AppLiveTest.java rename to web-modules/blade/src/test/java/com/baeldung/blade/sample/AppLiveTest.java diff --git a/blade/src/test/java/com/baeldung/blade/sample/AttributesExampleControllerLiveTest.java b/web-modules/blade/src/test/java/com/baeldung/blade/sample/AttributesExampleControllerLiveTest.java similarity index 100% rename from blade/src/test/java/com/baeldung/blade/sample/AttributesExampleControllerLiveTest.java rename to web-modules/blade/src/test/java/com/baeldung/blade/sample/AttributesExampleControllerLiveTest.java diff --git a/blade/src/test/java/com/baeldung/blade/sample/ParameterInjectionExampleControllerLiveTest.java b/web-modules/blade/src/test/java/com/baeldung/blade/sample/ParameterInjectionExampleControllerLiveTest.java similarity index 100% rename from blade/src/test/java/com/baeldung/blade/sample/ParameterInjectionExampleControllerLiveTest.java rename to web-modules/blade/src/test/java/com/baeldung/blade/sample/ParameterInjectionExampleControllerLiveTest.java diff --git a/blade/src/test/java/com/baeldung/blade/sample/RouteExampleControllerLiveTest.java b/web-modules/blade/src/test/java/com/baeldung/blade/sample/RouteExampleControllerLiveTest.java similarity index 100% rename from blade/src/test/java/com/baeldung/blade/sample/RouteExampleControllerLiveTest.java rename to web-modules/blade/src/test/java/com/baeldung/blade/sample/RouteExampleControllerLiveTest.java diff --git a/bootique/README.md b/web-modules/bootique/README.md similarity index 100% rename from bootique/README.md rename to web-modules/bootique/README.md diff --git a/bootique/config.yml b/web-modules/bootique/config.yml similarity index 100% rename from bootique/config.yml rename to web-modules/bootique/config.yml diff --git a/bootique/pom.xml b/web-modules/bootique/pom.xml similarity index 97% rename from bootique/pom.xml rename to web-modules/bootique/pom.xml index 34fc75a5c0..d06f835889 100644 --- a/bootique/pom.xml +++ b/web-modules/bootique/pom.xml @@ -12,7 +12,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/bootique/src/main/java/com/baeldung/bootique/App.java b/web-modules/bootique/src/main/java/com/baeldung/bootique/App.java similarity index 100% rename from bootique/src/main/java/com/baeldung/bootique/App.java rename to web-modules/bootique/src/main/java/com/baeldung/bootique/App.java diff --git a/bootique/src/main/java/com/baeldung/bootique/module/ModuleBinder.java b/web-modules/bootique/src/main/java/com/baeldung/bootique/module/ModuleBinder.java similarity index 100% rename from bootique/src/main/java/com/baeldung/bootique/module/ModuleBinder.java rename to web-modules/bootique/src/main/java/com/baeldung/bootique/module/ModuleBinder.java diff --git a/bootique/src/main/java/com/baeldung/bootique/module/ModuleProvider.java b/web-modules/bootique/src/main/java/com/baeldung/bootique/module/ModuleProvider.java similarity index 100% rename from bootique/src/main/java/com/baeldung/bootique/module/ModuleProvider.java rename to web-modules/bootique/src/main/java/com/baeldung/bootique/module/ModuleProvider.java diff --git a/bootique/src/main/java/com/baeldung/bootique/router/IndexController.java b/web-modules/bootique/src/main/java/com/baeldung/bootique/router/IndexController.java similarity index 100% rename from bootique/src/main/java/com/baeldung/bootique/router/IndexController.java rename to web-modules/bootique/src/main/java/com/baeldung/bootique/router/IndexController.java diff --git a/bootique/src/main/java/com/baeldung/bootique/router/SaveController.java b/web-modules/bootique/src/main/java/com/baeldung/bootique/router/SaveController.java similarity index 100% rename from bootique/src/main/java/com/baeldung/bootique/router/SaveController.java rename to web-modules/bootique/src/main/java/com/baeldung/bootique/router/SaveController.java diff --git a/bootique/src/main/java/com/baeldung/bootique/service/HelloService.java b/web-modules/bootique/src/main/java/com/baeldung/bootique/service/HelloService.java similarity index 100% rename from bootique/src/main/java/com/baeldung/bootique/service/HelloService.java rename to web-modules/bootique/src/main/java/com/baeldung/bootique/service/HelloService.java diff --git a/bootique/src/main/java/com/baeldung/bootique/service/impl/HelloServiceImpl.java b/web-modules/bootique/src/main/java/com/baeldung/bootique/service/impl/HelloServiceImpl.java similarity index 100% rename from bootique/src/main/java/com/baeldung/bootique/service/impl/HelloServiceImpl.java rename to web-modules/bootique/src/main/java/com/baeldung/bootique/service/impl/HelloServiceImpl.java diff --git a/bootique/src/main/resources/META-INF/services/io.bootique.BQModuleProvider b/web-modules/bootique/src/main/resources/META-INF/services/io.bootique.BQModuleProvider similarity index 100% rename from bootique/src/main/resources/META-INF/services/io.bootique.BQModuleProvider rename to web-modules/bootique/src/main/resources/META-INF/services/io.bootique.BQModuleProvider diff --git a/bootique/src/main/resources/logback.xml b/web-modules/bootique/src/main/resources/logback.xml similarity index 100% rename from bootique/src/main/resources/logback.xml rename to web-modules/bootique/src/main/resources/logback.xml diff --git a/bootique/src/test/java/com/baeldung/bootique/AppUnitTest.java b/web-modules/bootique/src/test/java/com/baeldung/bootique/AppUnitTest.java similarity index 100% rename from bootique/src/test/java/com/baeldung/bootique/AppUnitTest.java rename to web-modules/bootique/src/test/java/com/baeldung/bootique/AppUnitTest.java diff --git a/dropwizard/README.md b/web-modules/dropwizard/README.md similarity index 100% rename from dropwizard/README.md rename to web-modules/dropwizard/README.md diff --git a/dropwizard/pom.xml b/web-modules/dropwizard/pom.xml similarity index 98% rename from dropwizard/pom.xml rename to web-modules/dropwizard/pom.xml index 36f2ec43f0..999aa5c805 100644 --- a/dropwizard/pom.xml +++ b/web-modules/dropwizard/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java b/web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java similarity index 100% rename from dropwizard/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java rename to web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/IntroductionApplication.java diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java b/web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java similarity index 100% rename from dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java rename to web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/ApplicationHealthCheck.java diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java b/web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java similarity index 100% rename from dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java rename to web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/configuration/BasicConfiguration.java diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java b/web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java similarity index 100% rename from dropwizard/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java rename to web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/domain/Brand.java diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java b/web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java similarity index 100% rename from dropwizard/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java rename to web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/repository/BrandRepository.java diff --git a/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java b/web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java similarity index 100% rename from dropwizard/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java rename to web-modules/dropwizard/src/main/java/com/baeldung/dropwizard/introduction/resource/BrandResource.java diff --git a/dropwizard/src/main/resources/introduction-config.yml b/web-modules/dropwizard/src/main/resources/introduction-config.yml similarity index 100% rename from dropwizard/src/main/resources/introduction-config.yml rename to web-modules/dropwizard/src/main/resources/introduction-config.yml diff --git a/dropwizard/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java b/web-modules/dropwizard/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java similarity index 100% rename from dropwizard/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java rename to web-modules/dropwizard/src/test/java/com/baeldung/dropwizard/introduction/repository/BrandRepositoryUnitTest.java diff --git a/google-web-toolkit/README.md b/web-modules/google-web-toolkit/README.md similarity index 100% rename from google-web-toolkit/README.md rename to web-modules/google-web-toolkit/README.md diff --git a/google-web-toolkit/pom.xml b/web-modules/google-web-toolkit/pom.xml similarity index 98% rename from google-web-toolkit/pom.xml rename to web-modules/google-web-toolkit/pom.xml index bcccc136a4..2d5a1fa324 100644 --- a/google-web-toolkit/pom.xml +++ b/web-modules/google-web-toolkit/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/google-web-toolkit/src/main/java/com/baeldung/Google_web_toolkit.gwt.xml b/web-modules/google-web-toolkit/src/main/java/com/baeldung/Google_web_toolkit.gwt.xml similarity index 100% rename from google-web-toolkit/src/main/java/com/baeldung/Google_web_toolkit.gwt.xml rename to web-modules/google-web-toolkit/src/main/java/com/baeldung/Google_web_toolkit.gwt.xml diff --git a/google-web-toolkit/src/main/java/com/baeldung/client/Google_web_toolkit.java b/web-modules/google-web-toolkit/src/main/java/com/baeldung/client/Google_web_toolkit.java similarity index 100% rename from google-web-toolkit/src/main/java/com/baeldung/client/Google_web_toolkit.java rename to web-modules/google-web-toolkit/src/main/java/com/baeldung/client/Google_web_toolkit.java diff --git a/google-web-toolkit/src/main/java/com/baeldung/server/MessageServiceImpl.java b/web-modules/google-web-toolkit/src/main/java/com/baeldung/server/MessageServiceImpl.java similarity index 100% rename from google-web-toolkit/src/main/java/com/baeldung/server/MessageServiceImpl.java rename to web-modules/google-web-toolkit/src/main/java/com/baeldung/server/MessageServiceImpl.java diff --git a/google-web-toolkit/src/main/java/com/baeldung/shared/MessageService.java b/web-modules/google-web-toolkit/src/main/java/com/baeldung/shared/MessageService.java similarity index 100% rename from google-web-toolkit/src/main/java/com/baeldung/shared/MessageService.java rename to web-modules/google-web-toolkit/src/main/java/com/baeldung/shared/MessageService.java diff --git a/google-web-toolkit/src/main/java/com/baeldung/shared/MessageServiceAsync.java b/web-modules/google-web-toolkit/src/main/java/com/baeldung/shared/MessageServiceAsync.java similarity index 100% rename from google-web-toolkit/src/main/java/com/baeldung/shared/MessageServiceAsync.java rename to web-modules/google-web-toolkit/src/main/java/com/baeldung/shared/MessageServiceAsync.java diff --git a/google-web-toolkit/src/main/resources/logback.xml b/web-modules/google-web-toolkit/src/main/resources/logback.xml similarity index 100% rename from google-web-toolkit/src/main/resources/logback.xml rename to web-modules/google-web-toolkit/src/main/resources/logback.xml diff --git a/google-web-toolkit/src/main/webapp/Google_web_toolkit.css b/web-modules/google-web-toolkit/src/main/webapp/Google_web_toolkit.css similarity index 100% rename from google-web-toolkit/src/main/webapp/Google_web_toolkit.css rename to web-modules/google-web-toolkit/src/main/webapp/Google_web_toolkit.css diff --git a/google-web-toolkit/src/main/webapp/Google_web_toolkit.html b/web-modules/google-web-toolkit/src/main/webapp/Google_web_toolkit.html similarity index 100% rename from google-web-toolkit/src/main/webapp/Google_web_toolkit.html rename to web-modules/google-web-toolkit/src/main/webapp/Google_web_toolkit.html diff --git a/google-web-toolkit/src/main/webapp/WEB-INF/web.xml b/web-modules/google-web-toolkit/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from google-web-toolkit/src/main/webapp/WEB-INF/web.xml rename to web-modules/google-web-toolkit/src/main/webapp/WEB-INF/web.xml diff --git a/google-web-toolkit/src/main/webapp/favicon.ico b/web-modules/google-web-toolkit/src/main/webapp/favicon.ico similarity index 100% rename from google-web-toolkit/src/main/webapp/favicon.ico rename to web-modules/google-web-toolkit/src/main/webapp/favicon.ico diff --git a/jakarta-ee/README.md b/web-modules/jakarta-ee/README.md similarity index 100% rename from jakarta-ee/README.md rename to web-modules/jakarta-ee/README.md diff --git a/jakarta-ee/pom.xml b/web-modules/jakarta-ee/pom.xml similarity index 100% rename from jakarta-ee/pom.xml rename to web-modules/jakarta-ee/pom.xml diff --git a/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/User.java b/web-modules/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/User.java similarity index 100% rename from jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/User.java rename to web-modules/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/User.java diff --git a/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserApplication.java b/web-modules/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserApplication.java similarity index 100% rename from jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserApplication.java rename to web-modules/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserApplication.java diff --git a/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserController.java b/web-modules/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserController.java similarity index 100% rename from jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserController.java rename to web-modules/jakarta-ee/src/main/java/com/baeldung/eclipse/krazo/UserController.java diff --git a/jakarta-ee/src/main/webapp/WEB-INF/beans.xml b/web-modules/jakarta-ee/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from jakarta-ee/src/main/webapp/WEB-INF/beans.xml rename to web-modules/jakarta-ee/src/main/webapp/WEB-INF/beans.xml diff --git a/jakarta-ee/src/main/webapp/WEB-INF/views/success.jsp b/web-modules/jakarta-ee/src/main/webapp/WEB-INF/views/success.jsp similarity index 100% rename from jakarta-ee/src/main/webapp/WEB-INF/views/success.jsp rename to web-modules/jakarta-ee/src/main/webapp/WEB-INF/views/success.jsp diff --git a/jakarta-ee/src/main/webapp/WEB-INF/views/user.jsp b/web-modules/jakarta-ee/src/main/webapp/WEB-INF/views/user.jsp similarity index 100% rename from jakarta-ee/src/main/webapp/WEB-INF/views/user.jsp rename to web-modules/jakarta-ee/src/main/webapp/WEB-INF/views/user.jsp diff --git a/jakarta-ee/src/main/webapp/styles.css b/web-modules/jakarta-ee/src/main/webapp/styles.css similarity index 100% rename from jakarta-ee/src/main/webapp/styles.css rename to web-modules/jakarta-ee/src/main/webapp/styles.css diff --git a/jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/AppTest.java b/web-modules/jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/AppTest.java similarity index 100% rename from jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/AppTest.java rename to web-modules/jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/AppTest.java diff --git a/jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/UserControllerUnitTest.java b/web-modules/jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/UserControllerUnitTest.java similarity index 100% rename from jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/UserControllerUnitTest.java rename to web-modules/jakarta-ee/src/test/java/com/baeldung/eclipse/krazo/UserControllerUnitTest.java diff --git a/java-lite/README.md b/web-modules/java-lite/README.md similarity index 100% rename from java-lite/README.md rename to web-modules/java-lite/README.md diff --git a/java-lite/pom.xml b/web-modules/java-lite/pom.xml similarity index 98% rename from java-lite/pom.xml rename to web-modules/java-lite/pom.xml index 092063a110..0e44e72b09 100644 --- a/java-lite/pom.xml +++ b/web-modules/java-lite/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/java-lite/src/main/java/app/config/AppBootstrap.java b/web-modules/java-lite/src/main/java/app/config/AppBootstrap.java similarity index 100% rename from java-lite/src/main/java/app/config/AppBootstrap.java rename to web-modules/java-lite/src/main/java/app/config/AppBootstrap.java diff --git a/java-lite/src/main/java/app/config/AppControllerConfig.java b/web-modules/java-lite/src/main/java/app/config/AppControllerConfig.java similarity index 100% rename from java-lite/src/main/java/app/config/AppControllerConfig.java rename to web-modules/java-lite/src/main/java/app/config/AppControllerConfig.java diff --git a/java-lite/src/main/java/app/config/DbConfig.java b/web-modules/java-lite/src/main/java/app/config/DbConfig.java similarity index 100% rename from java-lite/src/main/java/app/config/DbConfig.java rename to web-modules/java-lite/src/main/java/app/config/DbConfig.java diff --git a/java-lite/src/main/java/app/controllers/ArticleController.java b/web-modules/java-lite/src/main/java/app/controllers/ArticleController.java old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/java/app/controllers/ArticleController.java rename to web-modules/java-lite/src/main/java/app/controllers/ArticleController.java diff --git a/java-lite/src/main/java/app/controllers/HomeController.java b/web-modules/java-lite/src/main/java/app/controllers/HomeController.java old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/java/app/controllers/HomeController.java rename to web-modules/java-lite/src/main/java/app/controllers/HomeController.java diff --git a/java-lite/src/main/java/app/controllers/ProductsController.java b/web-modules/java-lite/src/main/java/app/controllers/ProductsController.java similarity index 100% rename from java-lite/src/main/java/app/controllers/ProductsController.java rename to web-modules/java-lite/src/main/java/app/controllers/ProductsController.java diff --git a/java-lite/src/main/java/app/models/Article.java b/web-modules/java-lite/src/main/java/app/models/Article.java old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/java/app/models/Article.java rename to web-modules/java-lite/src/main/java/app/models/Article.java diff --git a/java-lite/src/main/java/app/models/Product.java b/web-modules/java-lite/src/main/java/app/models/Product.java similarity index 100% rename from java-lite/src/main/java/app/models/Product.java rename to web-modules/java-lite/src/main/java/app/models/Product.java diff --git a/java-lite/src/main/java/app/services/ArticleService.java b/web-modules/java-lite/src/main/java/app/services/ArticleService.java old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/java/app/services/ArticleService.java rename to web-modules/java-lite/src/main/java/app/services/ArticleService.java diff --git a/java-lite/src/main/java/app/services/ArticleServiceImpl.java b/web-modules/java-lite/src/main/java/app/services/ArticleServiceImpl.java old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/java/app/services/ArticleServiceImpl.java rename to web-modules/java-lite/src/main/java/app/services/ArticleServiceImpl.java diff --git a/java-lite/src/main/java/app/services/ArticleServiceModule.java b/web-modules/java-lite/src/main/java/app/services/ArticleServiceModule.java old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/java/app/services/ArticleServiceModule.java rename to web-modules/java-lite/src/main/java/app/services/ArticleServiceModule.java diff --git a/java-lite/src/main/resources/database.properties b/web-modules/java-lite/src/main/resources/database.properties similarity index 100% rename from java-lite/src/main/resources/database.properties rename to web-modules/java-lite/src/main/resources/database.properties diff --git a/java-lite/src/main/resources/logback.xml b/web-modules/java-lite/src/main/resources/logback.xml similarity index 100% rename from java-lite/src/main/resources/logback.xml rename to web-modules/java-lite/src/main/resources/logback.xml diff --git a/java-lite/src/main/webapp/WEB-INF/views/article/index.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/article/index.ftl old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/article/index.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/article/index.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/article/search.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/article/search.ftl old mode 100755 new mode 100644 similarity index 95% rename from java-lite/src/main/webapp/WEB-INF/views/article/search.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/article/search.ftl index 45a73808ed..540bbaf857 --- a/java-lite/src/main/webapp/WEB-INF/views/article/search.ftl +++ b/web-modules/java-lite/src/main/webapp/WEB-INF/views/article/search.ftl @@ -1,17 +1,17 @@ -<@content for="title">Search - - - - - - - - - - - - - - - +<@content for="title">Search + +
TitleAuthorWords #Date Published
${article.title}${article.author}${article.words}${article.date}
+ + + + + + + + + + + + +
TitleAuthorWords #Date Published
${article.title}${article.author}${article.words}${article.date}
\ No newline at end of file diff --git a/java-lite/src/main/webapp/WEB-INF/views/common/error.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/common/error.ftl old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/common/error.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/common/error.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/home/index.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/home/index.ftl old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/home/index.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/home/index.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/layouts/default_layout.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/layouts/default_layout.ftl old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/layouts/default_layout.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/layouts/default_layout.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/layouts/footer.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/layouts/footer.ftl old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/layouts/footer.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/layouts/footer.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/layouts/header.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/layouts/header.ftl old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/layouts/header.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/layouts/header.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/products/_comma.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/products/_comma.ftl similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/products/_comma.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/products/_comma.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/products/_product.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/products/_product.ftl similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/products/_product.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/products/_product.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/products/index.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/products/index.ftl similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/products/index.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/products/index.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/views/products/message.ftl b/web-modules/java-lite/src/main/webapp/WEB-INF/views/products/message.ftl similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/views/products/message.ftl rename to web-modules/java-lite/src/main/webapp/WEB-INF/views/products/message.ftl diff --git a/java-lite/src/main/webapp/WEB-INF/web.xml b/web-modules/java-lite/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from java-lite/src/main/webapp/WEB-INF/web.xml rename to web-modules/java-lite/src/main/webapp/WEB-INF/web.xml diff --git a/java-lite/src/test/java/app/controllers/ArticleControllerSpec.java b/web-modules/java-lite/src/test/java/app/controllers/ArticleControllerSpec.java old mode 100755 new mode 100644 similarity index 100% rename from java-lite/src/test/java/app/controllers/ArticleControllerSpec.java rename to web-modules/java-lite/src/test/java/app/controllers/ArticleControllerSpec.java diff --git a/java-lite/src/test/java/app/models/ProductUnitTest.java b/web-modules/java-lite/src/test/java/app/models/ProductUnitTest.java similarity index 100% rename from java-lite/src/test/java/app/models/ProductUnitTest.java rename to web-modules/java-lite/src/test/java/app/models/ProductUnitTest.java diff --git a/javax-servlets-2/README.md b/web-modules/javax-servlets-2/README.md similarity index 100% rename from javax-servlets-2/README.md rename to web-modules/javax-servlets-2/README.md diff --git a/javax-servlets-2/pom.xml b/web-modules/javax-servlets-2/pom.xml similarity index 98% rename from javax-servlets-2/pom.xml rename to web-modules/javax-servlets-2/pom.xml index 5fa1e76e0b..1c008ceb9a 100644 --- a/javax-servlets-2/pom.xml +++ b/web-modules/javax-servlets-2/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/javax-servlets-2/src/main/java/com/baeldung/servlets/UserServlet.java b/web-modules/javax-servlets-2/src/main/java/com/baeldung/servlets/UserServlet.java similarity index 100% rename from javax-servlets-2/src/main/java/com/baeldung/servlets/UserServlet.java rename to web-modules/javax-servlets-2/src/main/java/com/baeldung/servlets/UserServlet.java diff --git a/javax-servlets-2/src/main/java/com/baeldung/user/check/User.java b/web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/User.java similarity index 100% rename from javax-servlets-2/src/main/java/com/baeldung/user/check/User.java rename to web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/User.java diff --git a/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckFilter.java b/web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckFilter.java similarity index 100% rename from javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckFilter.java rename to web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckFilter.java diff --git a/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLoginServlet.java b/web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLoginServlet.java similarity index 100% rename from javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLoginServlet.java rename to web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLoginServlet.java diff --git a/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLogoutServlet.java b/web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLogoutServlet.java similarity index 100% rename from javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLogoutServlet.java rename to web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckLogoutServlet.java diff --git a/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckServlet.java b/web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckServlet.java similarity index 100% rename from javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckServlet.java rename to web-modules/javax-servlets-2/src/main/java/com/baeldung/user/check/UserCheckServlet.java diff --git a/javax-servlets-2/src/main/resources/logback.xml b/web-modules/javax-servlets-2/src/main/resources/logback.xml similarity index 100% rename from javax-servlets-2/src/main/resources/logback.xml rename to web-modules/javax-servlets-2/src/main/resources/logback.xml diff --git a/javax-servlets-2/src/main/webapp/WEB-INF/user.check/home.jsp b/web-modules/javax-servlets-2/src/main/webapp/WEB-INF/user.check/home.jsp similarity index 100% rename from javax-servlets-2/src/main/webapp/WEB-INF/user.check/home.jsp rename to web-modules/javax-servlets-2/src/main/webapp/WEB-INF/user.check/home.jsp diff --git a/javax-servlets-2/src/main/webapp/WEB-INF/user.check/login.jsp b/web-modules/javax-servlets-2/src/main/webapp/WEB-INF/user.check/login.jsp similarity index 100% rename from javax-servlets-2/src/main/webapp/WEB-INF/user.check/login.jsp rename to web-modules/javax-servlets-2/src/main/webapp/WEB-INF/user.check/login.jsp diff --git a/javax-servlets-2/src/test/java/com/baeldung/servlets/TestUtil.java b/web-modules/javax-servlets-2/src/test/java/com/baeldung/servlets/TestUtil.java similarity index 100% rename from javax-servlets-2/src/test/java/com/baeldung/servlets/TestUtil.java rename to web-modules/javax-servlets-2/src/test/java/com/baeldung/servlets/TestUtil.java diff --git a/javax-servlets-2/src/test/java/com/baeldung/servlets/UserServletUnitTest.java b/web-modules/javax-servlets-2/src/test/java/com/baeldung/servlets/UserServletUnitTest.java similarity index 100% rename from javax-servlets-2/src/test/java/com/baeldung/servlets/UserServletUnitTest.java rename to web-modules/javax-servlets-2/src/test/java/com/baeldung/servlets/UserServletUnitTest.java diff --git a/javax-servlets-2/src/test/java/com/baeldung/user/check/UserCheckServletLiveTest.java b/web-modules/javax-servlets-2/src/test/java/com/baeldung/user/check/UserCheckServletLiveTest.java similarity index 100% rename from javax-servlets-2/src/test/java/com/baeldung/user/check/UserCheckServletLiveTest.java rename to web-modules/javax-servlets-2/src/test/java/com/baeldung/user/check/UserCheckServletLiveTest.java diff --git a/javax-servlets/.gitignore b/web-modules/javax-servlets/.gitignore similarity index 100% rename from javax-servlets/.gitignore rename to web-modules/javax-servlets/.gitignore diff --git a/javax-servlets/README.md b/web-modules/javax-servlets/README.md similarity index 100% rename from javax-servlets/README.md rename to web-modules/javax-servlets/README.md diff --git a/javax-servlets/pom.xml b/web-modules/javax-servlets/pom.xml similarity index 97% rename from javax-servlets/pom.xml rename to web-modules/javax-servlets/pom.xml index 1dc58aa917..298c8562e4 100644 --- a/javax-servlets/pom.xml +++ b/web-modules/javax-servlets/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/javax-servlets/src/main/java/com/baeldung/Constants.java b/web-modules/javax-servlets/src/main/java/com/baeldung/Constants.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/Constants.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/Constants.java diff --git a/javax-servlets/src/main/java/com/baeldung/controller/StudentServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/controller/StudentServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/controller/StudentServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/controller/StudentServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/model/Employee.java b/web-modules/javax-servlets/src/main/java/com/baeldung/model/Employee.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/model/Employee.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/model/Employee.java diff --git a/javax-servlets/src/main/java/com/baeldung/model/Student.java b/web-modules/javax-servlets/src/main/java/com/baeldung/model/Student.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/model/Student.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/model/Student.java diff --git a/javax-servlets/src/main/java/com/baeldung/service/StudentService.java b/web-modules/javax-servlets/src/main/java/com/baeldung/service/StudentService.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/service/StudentService.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/service/StudentService.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/CookieReader.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/CookieReader.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/CookieReader.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/CookieReader.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/DownloadServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/DownloadServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/DownloadServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/DownloadServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/EmployeeServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/EmployeeServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/EmployeeServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/EmployeeServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/ErrorHandlerServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/ErrorHandlerServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/ErrorHandlerServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/ErrorHandlerServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/FormServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/FormServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/FormServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/FormServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/LoginServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/LoginServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/LoginServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/LoginServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/MainServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/MainServlet.java similarity index 96% rename from javax-servlets/src/main/java/com/baeldung/servlets/MainServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/MainServlet.java index 12c75444bb..198920cb23 100644 --- a/javax-servlets/src/main/java/com/baeldung/servlets/MainServlet.java +++ b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/MainServlet.java @@ -1,21 +1,21 @@ -package com.baeldung.servlets; - -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet("/main") -public class MainServlet extends HttpServlet { - - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - request.getRequestDispatcher("/WEB-INF/jsp/main.jsp").forward(request, response); - } - - - - -} +package com.baeldung.servlets; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@WebServlet("/main") +public class MainServlet extends HttpServlet { + + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + request.getRequestDispatcher("/WEB-INF/jsp/main.jsp").forward(request, response); + } + + + + +} diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/MultipartServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/MultipartServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/MultipartServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/MultipartServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/MyHttpServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/MyHttpServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/MyHttpServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/MyHttpServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/RandomErrorServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/RandomErrorServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/RandomErrorServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/RandomErrorServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/UpdateServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UpdateServlet.java similarity index 96% rename from javax-servlets/src/main/java/com/baeldung/servlets/UpdateServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UpdateServlet.java index 721e3afe6b..8582a1ccef 100644 --- a/javax-servlets/src/main/java/com/baeldung/servlets/UpdateServlet.java +++ b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UpdateServlet.java @@ -1,31 +1,31 @@ -package com.baeldung.servlets; - -import java.io.IOException; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -@WebServlet("/update") -public class UpdateServlet extends HttpServlet { - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - HttpSession session = request.getSession(false); - - if (session != null) { - - session.setAttribute("userName", request.getParameter("userName")); - session.setAttribute("age", request.getParameter("age")); - - request.setAttribute("sessionData", session); - } - - request.getRequestDispatcher("/WEB-INF/jsp/update.jsp").forward(request, response); - } - -} +package com.baeldung.servlets; + +import java.io.IOException; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +@WebServlet("/update") +public class UpdateServlet extends HttpServlet { + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + HttpSession session = request.getSession(false); + + if (session != null) { + + session.setAttribute("userName", request.getParameter("userName")); + session.setAttribute("age", request.getParameter("age")); + + request.setAttribute("sessionData", session); + } + + request.getRequestDispatcher("/WEB-INF/jsp/update.jsp").forward(request, response); + } + +} diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/UploadServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UploadServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/UploadServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UploadServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/UploadWelcomeServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UploadWelcomeServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/UploadWelcomeServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UploadWelcomeServlet.java diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/UserLoginServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UserLoginServlet.java similarity index 96% rename from javax-servlets/src/main/java/com/baeldung/servlets/UserLoginServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UserLoginServlet.java index fd732ef89d..25ec6a8f59 100644 --- a/javax-servlets/src/main/java/com/baeldung/servlets/UserLoginServlet.java +++ b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UserLoginServlet.java @@ -1,28 +1,28 @@ -package com.baeldung.servlets; - - -import java.io.IOException; - -import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -@WebServlet("/u_login") -public class UserLoginServlet extends HttpServlet { - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - HttpSession session = request.getSession(); - - session.setAttribute("userId", request.getParameter("userId")); - - request.setAttribute("id", session.getAttribute("userId")); - - request.getRequestDispatcher("/WEB-INF/jsp/userlogin.jsp").forward(request, response); - - } - -} +package com.baeldung.servlets; + + +import java.io.IOException; + +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +@WebServlet("/u_login") +public class UserLoginServlet extends HttpServlet { + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + HttpSession session = request.getSession(); + + session.setAttribute("userId", request.getParameter("userId")); + + request.setAttribute("id", session.getAttribute("userId")); + + request.getRequestDispatcher("/WEB-INF/jsp/userlogin.jsp").forward(request, response); + + } + +} diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/UserServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UserServlet.java similarity index 97% rename from javax-servlets/src/main/java/com/baeldung/servlets/UserServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UserServlet.java index 24f2500aa4..75977b0660 100644 --- a/javax-servlets/src/main/java/com/baeldung/servlets/UserServlet.java +++ b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/UserServlet.java @@ -1,49 +1,49 @@ -package com.baeldung.servlets; - -import java.io.IOException; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebInitParam; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -@WebServlet(name = "UserServlet", urlPatterns = "/userServlet", initParams={ - @WebInitParam(name="name", value="Not provided"), - @WebInitParam(name="email", value="Not provided")}) -public class UserServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - processRequest(request, response); - forwardRequest(request, response, "/WEB-INF/jsp/result.jsp"); - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - } - - protected void processRequest(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - request.setAttribute("name", getRequestParameter(request, "name")); - request.setAttribute("email", getRequestParameter(request, "email")); - request.setAttribute("province", getContextParameter("province")); - request.setAttribute("country", getContextParameter("country")); - } - - protected String getRequestParameter(HttpServletRequest request, String name) { - String param = request.getParameter(name); - return !param.isEmpty() ? param : getInitParameter(name); - } - - protected String getContextParameter(String name) { - return getServletContext().getInitParameter(name); - } - - protected void forwardRequest(HttpServletRequest request, HttpServletResponse response, String path) - throws ServletException, IOException { - request.getRequestDispatcher(path).forward(request, response); - } +package com.baeldung.servlets; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebInitParam; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@WebServlet(name = "UserServlet", urlPatterns = "/userServlet", initParams={ + @WebInitParam(name="name", value="Not provided"), + @WebInitParam(name="email", value="Not provided")}) +public class UserServlet extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + forwardRequest(request, response, "/WEB-INF/jsp/result.jsp"); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + } + + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + request.setAttribute("name", getRequestParameter(request, "name")); + request.setAttribute("email", getRequestParameter(request, "email")); + request.setAttribute("province", getContextParameter("province")); + request.setAttribute("country", getContextParameter("country")); + } + + protected String getRequestParameter(HttpServletRequest request, String name) { + String param = request.getParameter(name); + return !param.isEmpty() ? param : getInitParameter(name); + } + + protected String getContextParameter(String name) { + return getServletContext().getInitParameter(name); + } + + protected void forwardRequest(HttpServletRequest request, HttpServletResponse response, String path) + throws ServletException, IOException { + request.getRequestDispatcher(path).forward(request, response); + } } \ No newline at end of file diff --git a/javax-servlets/src/main/java/com/baeldung/servlets/WelcomeServlet.java b/web-modules/javax-servlets/src/main/java/com/baeldung/servlets/WelcomeServlet.java similarity index 100% rename from javax-servlets/src/main/java/com/baeldung/servlets/WelcomeServlet.java rename to web-modules/javax-servlets/src/main/java/com/baeldung/servlets/WelcomeServlet.java diff --git a/javax-servlets/src/main/resources/logback.xml b/web-modules/javax-servlets/src/main/resources/logback.xml similarity index 100% rename from javax-servlets/src/main/resources/logback.xml rename to web-modules/javax-servlets/src/main/resources/logback.xml diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/index.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/index.jsp similarity index 100% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/index.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/index.jsp diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/login.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/login.jsp similarity index 100% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/login.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/login.jsp diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/main.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/main.jsp similarity index 96% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/main.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/main.jsp index cbbb578770..313310a2a9 100644 --- a/javax-servlets/src/main/webapp/WEB-INF/jsp/main.jsp +++ b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/main.jsp @@ -1,15 +1,15 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - - - -
-

Enter your User Id and Password

- User ID:
- Password:
-
- +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +
+

Enter your User Id and Password

+ User ID:
+ Password:
+
+ \ No newline at end of file diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/result.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/result.jsp similarity index 100% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/result.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/result.jsp diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/student-record.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/student-record.jsp similarity index 100% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/student-record.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/student-record.jsp diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/update.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/update.jsp similarity index 96% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/update.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/update.jsp index 36ac2d277b..fae5ea2ac2 100644 --- a/javax-servlets/src/main/webapp/WEB-INF/jsp/update.jsp +++ b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/update.jsp @@ -1,17 +1,17 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - - - - - Hi, User : ${sessionData.getAttribute("userId")} - -
Your User Data has been updated as below : -
User Name: ${sessionData.getAttribute("userName")} -
Age : ${sessionData.getAttribute("age")} - - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + + + Hi, User : ${sessionData.getAttribute("userId")} + +
Your User Data has been updated as below : +
User Name: ${sessionData.getAttribute("userName")} +
Age : ${sessionData.getAttribute("age")} + + \ No newline at end of file diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/userlogin.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/userlogin.jsp similarity index 96% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/userlogin.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/userlogin.jsp index f181222f39..b2a550b811 100644 --- a/javax-servlets/src/main/webapp/WEB-INF/jsp/userlogin.jsp +++ b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/userlogin.jsp @@ -1,18 +1,18 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - - - -

Update your User Details:

- -
- User ID:
User Name: - Age:
-
- +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + + +

Update your User Details:

+ +
+ User ID:
User Name: + Age:
+
+ \ No newline at end of file diff --git a/javax-servlets/src/main/webapp/WEB-INF/jsp/welcome.jsp b/web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/welcome.jsp similarity index 100% rename from javax-servlets/src/main/webapp/WEB-INF/jsp/welcome.jsp rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/jsp/welcome.jsp diff --git a/javax-servlets/src/main/webapp/WEB-INF/sample.txt b/web-modules/javax-servlets/src/main/webapp/WEB-INF/sample.txt similarity index 100% rename from javax-servlets/src/main/webapp/WEB-INF/sample.txt rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/sample.txt diff --git a/javax-servlets/src/main/webapp/WEB-INF/web.xml b/web-modules/javax-servlets/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from javax-servlets/src/main/webapp/WEB-INF/web.xml rename to web-modules/javax-servlets/src/main/webapp/WEB-INF/web.xml diff --git a/javax-servlets/src/main/webapp/error-404.html b/web-modules/javax-servlets/src/main/webapp/error-404.html similarity index 100% rename from javax-servlets/src/main/webapp/error-404.html rename to web-modules/javax-servlets/src/main/webapp/error-404.html diff --git a/javax-servlets/src/main/webapp/result.jsp b/web-modules/javax-servlets/src/main/webapp/result.jsp similarity index 100% rename from javax-servlets/src/main/webapp/result.jsp rename to web-modules/javax-servlets/src/main/webapp/result.jsp diff --git a/javax-servlets/src/main/webapp/upload.jsp b/web-modules/javax-servlets/src/main/webapp/upload.jsp similarity index 100% rename from javax-servlets/src/main/webapp/upload.jsp rename to web-modules/javax-servlets/src/main/webapp/upload.jsp diff --git a/javax-servlets/src/main/webapp/user.jsp b/web-modules/javax-servlets/src/main/webapp/user.jsp similarity index 100% rename from javax-servlets/src/main/webapp/user.jsp rename to web-modules/javax-servlets/src/main/webapp/user.jsp diff --git a/javax-servlets/src/test/java/com/baeldung/servlets/EmployeeServletIntegrationTest.java b/web-modules/javax-servlets/src/test/java/com/baeldung/servlets/EmployeeServletIntegrationTest.java similarity index 100% rename from javax-servlets/src/test/java/com/baeldung/servlets/EmployeeServletIntegrationTest.java rename to web-modules/javax-servlets/src/test/java/com/baeldung/servlets/EmployeeServletIntegrationTest.java diff --git a/javax-servlets/src/test/java/com/baeldung/test/FormServletLiveTest.java b/web-modules/javax-servlets/src/test/java/com/baeldung/test/FormServletLiveTest.java similarity index 100% rename from javax-servlets/src/test/java/com/baeldung/test/FormServletLiveTest.java rename to web-modules/javax-servlets/src/test/java/com/baeldung/test/FormServletLiveTest.java diff --git a/javax-servlets/src/test/java/com/baeldung/test/UserServletUnitTest.java b/web-modules/javax-servlets/src/test/java/com/baeldung/test/UserServletUnitTest.java similarity index 97% rename from javax-servlets/src/test/java/com/baeldung/test/UserServletUnitTest.java rename to web-modules/javax-servlets/src/test/java/com/baeldung/test/UserServletUnitTest.java index 6222e35f4b..ef3d877dd7 100644 --- a/javax-servlets/src/test/java/com/baeldung/test/UserServletUnitTest.java +++ b/web-modules/javax-servlets/src/test/java/com/baeldung/test/UserServletUnitTest.java @@ -1,52 +1,52 @@ -package com.baeldung.test; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import static org.assertj.core.api.Assertions.assertThat; -import org.junit.BeforeClass; -import org.junit.Test; -import static org.mockito.Mockito.atLeast; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class UserServletUnitTest { - - private static HttpServletRequest request; - private static HttpServletResponse response; - - - @BeforeClass - public static void setUpHttpServletRequestMockInstance() { - request = mock(HttpServletRequest.class); - } - - @BeforeClass - public static void setUpHttpServletResponsetMockInstance() { - response = mock(HttpServletResponse.class); - } - - @Test - public void givenHttpServletRequestMockInstance_whenCalledgetParameter_thenCalledAtLeastOnce() { - request.getParameter("name"); - verify(request, atLeast(1)).getParameter("name"); - } - - @Test - public void givenHttpServletRequestMockInstance_whenCalledgetParameter_thenOneAssertion() { - when(request.getParameter("name")).thenReturn("username"); - assertThat(request.getParameter("name")).isEqualTo("username"); - } - - @Test - public void givenHttpServletResponseMockInstance_whenCalledgetContentType_thenCalledAtLeastOnce() { - response.getContentType(); - verify(response, atLeast(1)).getContentType(); - } - - @Test - public void givenHttpServletResponseMockInstance_whenCalledgetContentType_thenOneAssertion() { - when(response.getContentType()).thenReturn("text/html"); - assertThat(response.getContentType()).isEqualTo("text/html"); - } +package com.baeldung.test; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +public class UserServletUnitTest { + + private static HttpServletRequest request; + private static HttpServletResponse response; + + + @BeforeClass + public static void setUpHttpServletRequestMockInstance() { + request = mock(HttpServletRequest.class); + } + + @BeforeClass + public static void setUpHttpServletResponsetMockInstance() { + response = mock(HttpServletResponse.class); + } + + @Test + public void givenHttpServletRequestMockInstance_whenCalledgetParameter_thenCalledAtLeastOnce() { + request.getParameter("name"); + verify(request, atLeast(1)).getParameter("name"); + } + + @Test + public void givenHttpServletRequestMockInstance_whenCalledgetParameter_thenOneAssertion() { + when(request.getParameter("name")).thenReturn("username"); + assertThat(request.getParameter("name")).isEqualTo("username"); + } + + @Test + public void givenHttpServletResponseMockInstance_whenCalledgetContentType_thenCalledAtLeastOnce() { + response.getContentType(); + verify(response, atLeast(1)).getContentType(); + } + + @Test + public void givenHttpServletResponseMockInstance_whenCalledgetContentType_thenOneAssertion() { + when(response.getContentType()).thenReturn("text/html"); + assertThat(response.getContentType()).isEqualTo("text/html"); + } } \ No newline at end of file diff --git a/jee-7/.gitignore b/web-modules/jee-7/.gitignore similarity index 100% rename from jee-7/.gitignore rename to web-modules/jee-7/.gitignore diff --git a/jee-7/README.md b/web-modules/jee-7/README.md similarity index 100% rename from jee-7/README.md rename to web-modules/jee-7/README.md diff --git a/jee-7/pom.xml b/web-modules/jee-7/pom.xml similarity index 99% rename from jee-7/pom.xml rename to web-modules/jee-7/pom.xml index eb23a3e150..08c8b2cc68 100644 --- a/jee-7/pom.xml +++ b/web-modules/jee-7/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/jee-7/src/main/java/com/baeldung/arquillian/CapsConvertor.java b/web-modules/jee-7/src/main/java/com/baeldung/arquillian/CapsConvertor.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/arquillian/CapsConvertor.java rename to web-modules/jee-7/src/main/java/com/baeldung/arquillian/CapsConvertor.java diff --git a/jee-7/src/main/java/com/baeldung/arquillian/CapsService.java b/web-modules/jee-7/src/main/java/com/baeldung/arquillian/CapsService.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/arquillian/CapsService.java rename to web-modules/jee-7/src/main/java/com/baeldung/arquillian/CapsService.java diff --git a/jee-7/src/main/java/com/baeldung/arquillian/Car.java b/web-modules/jee-7/src/main/java/com/baeldung/arquillian/Car.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/arquillian/Car.java rename to web-modules/jee-7/src/main/java/com/baeldung/arquillian/Car.java diff --git a/jee-7/src/main/java/com/baeldung/arquillian/CarEJB.java b/web-modules/jee-7/src/main/java/com/baeldung/arquillian/CarEJB.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/arquillian/CarEJB.java rename to web-modules/jee-7/src/main/java/com/baeldung/arquillian/CarEJB.java diff --git a/jee-7/src/main/java/com/baeldung/arquillian/Component.java b/web-modules/jee-7/src/main/java/com/baeldung/arquillian/Component.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/arquillian/Component.java rename to web-modules/jee-7/src/main/java/com/baeldung/arquillian/Component.java diff --git a/jee-7/src/main/java/com/baeldung/arquillian/ConvertToLowerCase.java b/web-modules/jee-7/src/main/java/com/baeldung/arquillian/ConvertToLowerCase.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/arquillian/ConvertToLowerCase.java rename to web-modules/jee-7/src/main/java/com/baeldung/arquillian/ConvertToLowerCase.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/ChunkExceptionSkipReadListener.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/CustomCheckPoint.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/DeciderJobSequence.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/InjectSimpleBatchLet.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleBatchLet.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemProcessor.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReader.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkItemReaderError.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/SimpleChunkWriter.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyInputRecord.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemProcessor.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemReader.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyItemWriter.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyOutputRecord.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryProcessorListener.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryReadListener.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MyRetryWriteListener.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipProcessorListener.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipReadListener.java diff --git a/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java b/web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/batch/understanding/exception/MySkipWriteListener.java diff --git a/jee-7/src/main/java/com/baeldung/convListVal/ConvListVal.java b/web-modules/jee-7/src/main/java/com/baeldung/convListVal/ConvListVal.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/convListVal/ConvListVal.java rename to web-modules/jee-7/src/main/java/com/baeldung/convListVal/ConvListVal.java diff --git a/jee-7/src/main/java/com/baeldung/convListVal/MyListener.java b/web-modules/jee-7/src/main/java/com/baeldung/convListVal/MyListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/convListVal/MyListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/convListVal/MyListener.java diff --git a/jee-7/src/main/java/com/baeldung/javaeeannotations/AccountServlet.java b/web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/AccountServlet.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/javaeeannotations/AccountServlet.java rename to web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/AccountServlet.java diff --git a/jee-7/src/main/java/com/baeldung/javaeeannotations/BankAppServletContextListener.java b/web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/BankAppServletContextListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/javaeeannotations/BankAppServletContextListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/BankAppServletContextListener.java diff --git a/jee-7/src/main/java/com/baeldung/javaeeannotations/LogInFilter.java b/web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/LogInFilter.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/javaeeannotations/LogInFilter.java rename to web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/LogInFilter.java diff --git a/jee-7/src/main/java/com/baeldung/javaeeannotations/UploadCustomerDocumentsServlet.java b/web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/UploadCustomerDocumentsServlet.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/javaeeannotations/UploadCustomerDocumentsServlet.java rename to web-modules/jee-7/src/main/java/com/baeldung/javaeeannotations/UploadCustomerDocumentsServlet.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployee.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployee.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployee.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployee.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployeeResponse.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployeeResponse.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployeeResponse.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/AddEmployeeResponse.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployees.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployees.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployees.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployees.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployeesResponse.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployeesResponse.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployeesResponse.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/CountEmployeesResponse.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployee.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployee.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployee.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployee.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployeeResponse.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployeeResponse.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployeeResponse.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/DeleteEmployeeResponse.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/Employee.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/Employee.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/Employee.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/Employee.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists_Exception.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists_Exception.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists_Exception.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeAlreadyExists_Exception.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound_Exception.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound_Exception.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound_Exception.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeNotFound_Exception.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeServiceClient.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeServiceClient.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeServiceClient.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeServiceClient.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService_Service.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService_Service.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService_Service.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/EmployeeService_Service.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployees.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployees.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployees.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployees.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployeesResponse.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployeesResponse.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployeesResponse.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetAllEmployeesResponse.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployee.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployee.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployee.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployee.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployeeResponse.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployeeResponse.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployeeResponse.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/GetEmployeeResponse.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/ObjectFactory.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/ObjectFactory.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/ObjectFactory.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/ObjectFactory.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployee.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployee.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployee.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployee.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployeeResponse.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployeeResponse.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployeeResponse.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/UpdateEmployeeResponse.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/client/package-info.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/package-info.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/client/package-info.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/client/package-info.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeService.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeService.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeService.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeService.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeServiceImpl.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeServiceImpl.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeServiceImpl.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/EmployeeServiceImpl.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeAlreadyExists.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeAlreadyExists.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeAlreadyExists.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeAlreadyExists.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeNotFound.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeNotFound.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeNotFound.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/exception/EmployeeNotFound.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/model/Employee.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/model/Employee.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/model/Employee.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/bottomup/model/Employee.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/config/EmployeeServicePublisher.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/config/EmployeeServicePublisher.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/config/EmployeeServicePublisher.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/config/EmployeeServicePublisher.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepository.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepository.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepository.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepository.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepositoryImpl.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepositoryImpl.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepositoryImpl.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/repository/EmployeeRepositoryImpl.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDownImpl.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDownImpl.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDownImpl.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDownImpl.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown_Service.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown_Service.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown_Service.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/EmployeeServiceTopDown_Service.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/ObjectFactory.java b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/ObjectFactory.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/server/topdown/ObjectFactory.java rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/server/topdown/ObjectFactory.java diff --git a/jee-7/src/main/java/com/baeldung/jaxws/wsdl/employeeservicetopdown.wsdl b/web-modules/jee-7/src/main/java/com/baeldung/jaxws/wsdl/employeeservicetopdown.wsdl similarity index 100% rename from jee-7/src/main/java/com/baeldung/jaxws/wsdl/employeeservicetopdown.wsdl rename to web-modules/jee-7/src/main/java/com/baeldung/jaxws/wsdl/employeeservicetopdown.wsdl diff --git a/jee-7/src/main/java/com/baeldung/json/Person.java b/web-modules/jee-7/src/main/java/com/baeldung/json/Person.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/json/Person.java rename to web-modules/jee-7/src/main/java/com/baeldung/json/Person.java diff --git a/jee-7/src/main/java/com/baeldung/json/PersonBuilder.java b/web-modules/jee-7/src/main/java/com/baeldung/json/PersonBuilder.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/json/PersonBuilder.java rename to web-modules/jee-7/src/main/java/com/baeldung/json/PersonBuilder.java diff --git a/jee-7/src/main/java/com/baeldung/json/PersonWriter.java b/web-modules/jee-7/src/main/java/com/baeldung/json/PersonWriter.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/json/PersonWriter.java rename to web-modules/jee-7/src/main/java/com/baeldung/json/PersonWriter.java diff --git a/jee-7/src/main/java/com/baeldung/singleton/Car.java b/web-modules/jee-7/src/main/java/com/baeldung/singleton/Car.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/singleton/Car.java rename to web-modules/jee-7/src/main/java/com/baeldung/singleton/Car.java diff --git a/jee-7/src/main/java/com/baeldung/singleton/CarServiceBean.java b/web-modules/jee-7/src/main/java/com/baeldung/singleton/CarServiceBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/singleton/CarServiceBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/singleton/CarServiceBean.java diff --git a/jee-7/src/main/java/com/baeldung/singleton/CarServiceEjbSingleton.java b/web-modules/jee-7/src/main/java/com/baeldung/singleton/CarServiceEjbSingleton.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/singleton/CarServiceEjbSingleton.java rename to web-modules/jee-7/src/main/java/com/baeldung/singleton/CarServiceEjbSingleton.java diff --git a/jee-7/src/main/java/com/baeldung/singleton/CarServiceSingleton.java b/web-modules/jee-7/src/main/java/com/baeldung/singleton/CarServiceSingleton.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/singleton/CarServiceSingleton.java rename to web-modules/jee-7/src/main/java/com/baeldung/singleton/CarServiceSingleton.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Country.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Country.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Country.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Country.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/Country.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/Country.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/server/Country.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/Country.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryService.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryService.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/server/CountryService.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryService.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/Currency.java b/web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/Currency.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/soap/ws/server/Currency.java rename to web-modules/jee-7/src/main/java/com/baeldung/soap/ws/server/Currency.java diff --git a/jee-7/src/main/java/com/baeldung/timer/AutomaticTimerBean.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/AutomaticTimerBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/AutomaticTimerBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/AutomaticTimerBean.java diff --git a/jee-7/src/main/java/com/baeldung/timer/FixedDelayTimerBean.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/FixedDelayTimerBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/FixedDelayTimerBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/FixedDelayTimerBean.java diff --git a/jee-7/src/main/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBean.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBean.java diff --git a/jee-7/src/main/java/com/baeldung/timer/ProgrammaticTimerBean.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/ProgrammaticTimerBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/ProgrammaticTimerBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/ProgrammaticTimerBean.java diff --git a/jee-7/src/main/java/com/baeldung/timer/ProgrammaticWithInitialFixedDelayTimerBean.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/ProgrammaticWithInitialFixedDelayTimerBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/ProgrammaticWithInitialFixedDelayTimerBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/ProgrammaticWithInitialFixedDelayTimerBean.java diff --git a/jee-7/src/main/java/com/baeldung/timer/ScheduleTimerBean.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/ScheduleTimerBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/ScheduleTimerBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/ScheduleTimerBean.java diff --git a/jee-7/src/main/java/com/baeldung/timer/TimerEvent.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/TimerEvent.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/TimerEvent.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/TimerEvent.java diff --git a/jee-7/src/main/java/com/baeldung/timer/TimerEventListener.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/TimerEventListener.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/TimerEventListener.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/TimerEventListener.java diff --git a/jee-7/src/main/java/com/baeldung/timer/WorkerBean.java b/web-modules/jee-7/src/main/java/com/baeldung/timer/WorkerBean.java similarity index 100% rename from jee-7/src/main/java/com/baeldung/timer/WorkerBean.java rename to web-modules/jee-7/src/main/java/com/baeldung/timer/WorkerBean.java diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/customCheckPoint.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/decideJobSequence.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/flowJobSequence.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/injectionSimpleBatchLet.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/partitionSimpleBatchLet.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleBatchLet.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleChunk.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorChunk.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleErrorSkipChunk.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/simpleJobSequence.xml diff --git a/jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml b/web-modules/jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml rename to web-modules/jee-7/src/main/resources/META-INF/batch-jobs/splitJobSequence.xml diff --git a/jee-7/src/main/resources/META-INF/beans.xml b/web-modules/jee-7/src/main/resources/META-INF/beans.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/beans.xml rename to web-modules/jee-7/src/main/resources/META-INF/beans.xml diff --git a/jee-7/src/main/resources/META-INF/persistence.xml b/web-modules/jee-7/src/main/resources/META-INF/persistence.xml similarity index 100% rename from jee-7/src/main/resources/META-INF/persistence.xml rename to web-modules/jee-7/src/main/resources/META-INF/persistence.xml diff --git a/jee-7/src/main/resources/country.xsd b/web-modules/jee-7/src/main/resources/country.xsd similarity index 100% rename from jee-7/src/main/resources/country.xsd rename to web-modules/jee-7/src/main/resources/country.xsd diff --git a/jee-7/src/main/resources/logback.xml b/web-modules/jee-7/src/main/resources/logback.xml similarity index 100% rename from jee-7/src/main/resources/logback.xml rename to web-modules/jee-7/src/main/resources/logback.xml diff --git a/jee-7/src/main/webapp/ConvListVal.xhtml b/web-modules/jee-7/src/main/webapp/ConvListVal.xhtml similarity index 100% rename from jee-7/src/main/webapp/ConvListVal.xhtml rename to web-modules/jee-7/src/main/webapp/ConvListVal.xhtml diff --git a/jee-7/src/main/webapp/WEB-INF/beans.xml b/web-modules/jee-7/src/main/webapp/WEB-INF/beans.xml similarity index 100% rename from jee-7/src/main/webapp/WEB-INF/beans.xml rename to web-modules/jee-7/src/main/webapp/WEB-INF/beans.xml diff --git a/jee-7/src/main/webapp/WEB-INF/faces-config.xml b/web-modules/jee-7/src/main/webapp/WEB-INF/faces-config.xml similarity index 100% rename from jee-7/src/main/webapp/WEB-INF/faces-config.xml rename to web-modules/jee-7/src/main/webapp/WEB-INF/faces-config.xml diff --git a/jee-7/src/main/webapp/WEB-INF/web.xml b/web-modules/jee-7/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from jee-7/src/main/webapp/WEB-INF/web.xml rename to web-modules/jee-7/src/main/webapp/WEB-INF/web.xml diff --git a/jee-7/src/main/webapp/account.jsp b/web-modules/jee-7/src/main/webapp/account.jsp similarity index 100% rename from jee-7/src/main/webapp/account.jsp rename to web-modules/jee-7/src/main/webapp/account.jsp diff --git a/jee-7/src/main/webapp/upload.jsp b/web-modules/jee-7/src/main/webapp/upload.jsp similarity index 100% rename from jee-7/src/main/webapp/upload.jsp rename to web-modules/jee-7/src/main/webapp/upload.jsp diff --git a/jee-7/src/test/java/com/baeldug/json/JsonUnitTest.java b/web-modules/jee-7/src/test/java/com/baeldug/json/JsonUnitTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldug/json/JsonUnitTest.java rename to web-modules/jee-7/src/test/java/com/baeldug/json/JsonUnitTest.java diff --git a/jee-7/src/test/java/com/baeldung/arquillan/ArquillianLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/arquillan/ArquillianLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/arquillan/ArquillianLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/arquillan/ArquillianLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java b/web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java rename to web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/BatchTestHelper.java diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointIntegrationTest.java b/web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointIntegrationTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointIntegrationTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointIntegrationTest.java diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceIntegrationTest.java b/web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceIntegrationTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceIntegrationTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceIntegrationTest.java diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetIntegrationTest.java b/web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetIntegrationTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetIntegrationTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetIntegrationTest.java diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkIntegrationTest.java b/web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkIntegrationTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkIntegrationTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkIntegrationTest.java diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkIntegrationTest.java b/web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkIntegrationTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkIntegrationTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkIntegrationTest.java diff --git a/jee-7/src/test/java/com/baeldung/convListVal/ConvListValLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/convListVal/ConvListValLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/convListVal/ConvListValLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/convListVal/ConvListValLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/jaxws/EmployeeServiceLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/jaxws/EmployeeServiceLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/jaxws/EmployeeServiceLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/jaxws/EmployeeServiceLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/singleton/CarServiceIntegrationTest.java b/web-modules/jee-7/src/test/java/com/baeldung/singleton/CarServiceIntegrationTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/singleton/CarServiceIntegrationTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/singleton/CarServiceIntegrationTest.java diff --git a/jee-7/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/timer/AutomaticTimerBeanLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/timer/AutomaticTimerBeanLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/timer/AutomaticTimerBeanLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/timer/AutomaticTimerBeanLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/timer/ProgrammaticAtFixedRateTimerBeanLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/timer/ProgrammaticTimerBeanLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/timer/ProgrammaticWithFixedDelayTimerBeanLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/timer/ScheduleTimerBeanLiveTest.java b/web-modules/jee-7/src/test/java/com/baeldung/timer/ScheduleTimerBeanLiveTest.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/timer/ScheduleTimerBeanLiveTest.java rename to web-modules/jee-7/src/test/java/com/baeldung/timer/ScheduleTimerBeanLiveTest.java diff --git a/jee-7/src/test/java/com/baeldung/timer/WithinWindowMatcher.java b/web-modules/jee-7/src/test/java/com/baeldung/timer/WithinWindowMatcher.java similarity index 100% rename from jee-7/src/test/java/com/baeldung/timer/WithinWindowMatcher.java rename to web-modules/jee-7/src/test/java/com/baeldung/timer/WithinWindowMatcher.java diff --git a/jee-7/src/test/resources/META-INF/persistence.xml b/web-modules/jee-7/src/test/resources/META-INF/persistence.xml similarity index 100% rename from jee-7/src/test/resources/META-INF/persistence.xml rename to web-modules/jee-7/src/test/resources/META-INF/persistence.xml diff --git a/jee-7/src/test/resources/arquillian.xml b/web-modules/jee-7/src/test/resources/arquillian.xml similarity index 100% rename from jee-7/src/test/resources/arquillian.xml rename to web-modules/jee-7/src/test/resources/arquillian.xml diff --git a/jee-7/src/test/resources/jberet.properties b/web-modules/jee-7/src/test/resources/jberet.properties similarity index 100% rename from jee-7/src/test/resources/jberet.properties rename to web-modules/jee-7/src/test/resources/jberet.properties diff --git a/jooby/README.md b/web-modules/jooby/README.md similarity index 100% rename from jooby/README.md rename to web-modules/jooby/README.md diff --git a/jooby/conf/application.conf b/web-modules/jooby/conf/application.conf similarity index 100% rename from jooby/conf/application.conf rename to web-modules/jooby/conf/application.conf diff --git a/jooby/conf/logback.xml b/web-modules/jooby/conf/logback.xml similarity index 100% rename from jooby/conf/logback.xml rename to web-modules/jooby/conf/logback.xml diff --git a/jooby/pom.xml b/web-modules/jooby/pom.xml similarity index 97% rename from jooby/pom.xml rename to web-modules/jooby/pom.xml index f972a22e9c..6c2ce3a5c5 100644 --- a/jooby/pom.xml +++ b/web-modules/jooby/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/jooby/public/form.html b/web-modules/jooby/public/form.html similarity index 100% rename from jooby/public/form.html rename to web-modules/jooby/public/form.html diff --git a/jooby/public/welcome.html b/web-modules/jooby/public/welcome.html similarity index 100% rename from jooby/public/welcome.html rename to web-modules/jooby/public/welcome.html diff --git a/jooby/src/etc/stork.yml b/web-modules/jooby/src/etc/stork.yml similarity index 100% rename from jooby/src/etc/stork.yml rename to web-modules/jooby/src/etc/stork.yml diff --git a/jooby/src/main/java/com/baeldung/jooby/App.java b/web-modules/jooby/src/main/java/com/baeldung/jooby/App.java similarity index 100% rename from jooby/src/main/java/com/baeldung/jooby/App.java rename to web-modules/jooby/src/main/java/com/baeldung/jooby/App.java diff --git a/jooby/src/main/java/com/baeldung/jooby/bean/Employee.java b/web-modules/jooby/src/main/java/com/baeldung/jooby/bean/Employee.java similarity index 100% rename from jooby/src/main/java/com/baeldung/jooby/bean/Employee.java rename to web-modules/jooby/src/main/java/com/baeldung/jooby/bean/Employee.java diff --git a/jooby/src/main/java/com/baeldung/jooby/mvc/GetController.java b/web-modules/jooby/src/main/java/com/baeldung/jooby/mvc/GetController.java similarity index 100% rename from jooby/src/main/java/com/baeldung/jooby/mvc/GetController.java rename to web-modules/jooby/src/main/java/com/baeldung/jooby/mvc/GetController.java diff --git a/jooby/src/main/java/com/baeldung/jooby/mvc/PostController.java b/web-modules/jooby/src/main/java/com/baeldung/jooby/mvc/PostController.java similarity index 100% rename from jooby/src/main/java/com/baeldung/jooby/mvc/PostController.java rename to web-modules/jooby/src/main/java/com/baeldung/jooby/mvc/PostController.java diff --git a/jooby/src/main/resources/logback.xml b/web-modules/jooby/src/main/resources/logback.xml similarity index 100% rename from jooby/src/main/resources/logback.xml rename to web-modules/jooby/src/main/resources/logback.xml diff --git a/jooby/src/test/java/com/baeldung/jooby/AppLiveTest.java b/web-modules/jooby/src/test/java/com/baeldung/jooby/AppLiveTest.java similarity index 100% rename from jooby/src/test/java/com/baeldung/jooby/AppLiveTest.java rename to web-modules/jooby/src/test/java/com/baeldung/jooby/AppLiveTest.java diff --git a/jooby/src/test/java/com/baeldung/jooby/AppUnitTest.java b/web-modules/jooby/src/test/java/com/baeldung/jooby/AppUnitTest.java similarity index 100% rename from jooby/src/test/java/com/baeldung/jooby/AppUnitTest.java rename to web-modules/jooby/src/test/java/com/baeldung/jooby/AppUnitTest.java diff --git a/linkrest/README.md b/web-modules/linkrest/README.md similarity index 100% rename from linkrest/README.md rename to web-modules/linkrest/README.md diff --git a/linkrest/WebContent/META-INF/MANIFEST.MF b/web-modules/linkrest/WebContent/META-INF/MANIFEST.MF similarity index 100% rename from linkrest/WebContent/META-INF/MANIFEST.MF rename to web-modules/linkrest/WebContent/META-INF/MANIFEST.MF diff --git a/linkrest/WebContent/WEB-INF/web.xml b/web-modules/linkrest/WebContent/WEB-INF/web.xml similarity index 100% rename from linkrest/WebContent/WEB-INF/web.xml rename to web-modules/linkrest/WebContent/WEB-INF/web.xml diff --git a/linkrest/pom.xml b/web-modules/linkrest/pom.xml similarity index 98% rename from linkrest/pom.xml rename to web-modules/linkrest/pom.xml index e40efb3930..f43add6910 100644 --- a/linkrest/pom.xml +++ b/web-modules/linkrest/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/linkrest/src/main/java/com/baeldung/LinkRestApplication.java b/web-modules/linkrest/src/main/java/com/baeldung/LinkRestApplication.java similarity index 100% rename from linkrest/src/main/java/com/baeldung/LinkRestApplication.java rename to web-modules/linkrest/src/main/java/com/baeldung/LinkRestApplication.java diff --git a/linkrest/src/main/java/com/baeldung/cayenne/Department.java b/web-modules/linkrest/src/main/java/com/baeldung/cayenne/Department.java similarity index 100% rename from linkrest/src/main/java/com/baeldung/cayenne/Department.java rename to web-modules/linkrest/src/main/java/com/baeldung/cayenne/Department.java diff --git a/linkrest/src/main/java/com/baeldung/cayenne/Employee.java b/web-modules/linkrest/src/main/java/com/baeldung/cayenne/Employee.java similarity index 100% rename from linkrest/src/main/java/com/baeldung/cayenne/Employee.java rename to web-modules/linkrest/src/main/java/com/baeldung/cayenne/Employee.java diff --git a/linkrest/src/main/java/com/baeldung/cayenne/auto/_Department.java b/web-modules/linkrest/src/main/java/com/baeldung/cayenne/auto/_Department.java similarity index 100% rename from linkrest/src/main/java/com/baeldung/cayenne/auto/_Department.java rename to web-modules/linkrest/src/main/java/com/baeldung/cayenne/auto/_Department.java diff --git a/linkrest/src/main/java/com/baeldung/cayenne/auto/_Employee.java b/web-modules/linkrest/src/main/java/com/baeldung/cayenne/auto/_Employee.java similarity index 100% rename from linkrest/src/main/java/com/baeldung/cayenne/auto/_Employee.java rename to web-modules/linkrest/src/main/java/com/baeldung/cayenne/auto/_Employee.java diff --git a/linkrest/src/main/java/com/baeldung/linkrest/apis/DepartmentResource.java b/web-modules/linkrest/src/main/java/com/baeldung/linkrest/apis/DepartmentResource.java similarity index 100% rename from linkrest/src/main/java/com/baeldung/linkrest/apis/DepartmentResource.java rename to web-modules/linkrest/src/main/java/com/baeldung/linkrest/apis/DepartmentResource.java diff --git a/linkrest/src/main/java/com/baeldung/linkrest/apis/EmployeeSubResource.java b/web-modules/linkrest/src/main/java/com/baeldung/linkrest/apis/EmployeeSubResource.java similarity index 100% rename from linkrest/src/main/java/com/baeldung/linkrest/apis/EmployeeSubResource.java rename to web-modules/linkrest/src/main/java/com/baeldung/linkrest/apis/EmployeeSubResource.java diff --git a/linkrest/src/main/resources/cayenne-linkrest-project.xml b/web-modules/linkrest/src/main/resources/cayenne-linkrest-project.xml similarity index 100% rename from linkrest/src/main/resources/cayenne-linkrest-project.xml rename to web-modules/linkrest/src/main/resources/cayenne-linkrest-project.xml diff --git a/linkrest/src/main/resources/linkrest.map.xml b/web-modules/linkrest/src/main/resources/linkrest.map.xml similarity index 100% rename from linkrest/src/main/resources/linkrest.map.xml rename to web-modules/linkrest/src/main/resources/linkrest.map.xml diff --git a/linkrest/src/main/resources/logback.xml b/web-modules/linkrest/src/main/resources/logback.xml similarity index 100% rename from linkrest/src/main/resources/logback.xml rename to web-modules/linkrest/src/main/resources/logback.xml diff --git a/ninja/README.md b/web-modules/ninja/README.md similarity index 100% rename from ninja/README.md rename to web-modules/ninja/README.md diff --git a/ninja/pom.xml b/web-modules/ninja/pom.xml similarity index 100% rename from ninja/pom.xml rename to web-modules/ninja/pom.xml diff --git a/ninja/src/main/java/META-INF/persistence.xml b/web-modules/ninja/src/main/java/META-INF/persistence.xml similarity index 100% rename from ninja/src/main/java/META-INF/persistence.xml rename to web-modules/ninja/src/main/java/META-INF/persistence.xml diff --git a/ninja/src/main/java/assets/css/custom.css b/web-modules/ninja/src/main/java/assets/css/custom.css similarity index 100% rename from ninja/src/main/java/assets/css/custom.css rename to web-modules/ninja/src/main/java/assets/css/custom.css diff --git a/ninja/src/main/java/conf/Filters.java b/web-modules/ninja/src/main/java/conf/Filters.java similarity index 100% rename from ninja/src/main/java/conf/Filters.java rename to web-modules/ninja/src/main/java/conf/Filters.java diff --git a/ninja/src/main/java/conf/Module.java b/web-modules/ninja/src/main/java/conf/Module.java similarity index 100% rename from ninja/src/main/java/conf/Module.java rename to web-modules/ninja/src/main/java/conf/Module.java diff --git a/ninja/src/main/java/conf/Routes.java b/web-modules/ninja/src/main/java/conf/Routes.java similarity index 100% rename from ninja/src/main/java/conf/Routes.java rename to web-modules/ninja/src/main/java/conf/Routes.java diff --git a/ninja/src/main/java/conf/application.conf b/web-modules/ninja/src/main/java/conf/application.conf similarity index 100% rename from ninja/src/main/java/conf/application.conf rename to web-modules/ninja/src/main/java/conf/application.conf diff --git a/ninja/src/main/java/conf/messages.properties b/web-modules/ninja/src/main/java/conf/messages.properties similarity index 100% rename from ninja/src/main/java/conf/messages.properties rename to web-modules/ninja/src/main/java/conf/messages.properties diff --git a/ninja/src/main/java/conf/messages_fr.properties b/web-modules/ninja/src/main/java/conf/messages_fr.properties similarity index 100% rename from ninja/src/main/java/conf/messages_fr.properties rename to web-modules/ninja/src/main/java/conf/messages_fr.properties diff --git a/ninja/src/main/java/controllers/ApplicationController.java b/web-modules/ninja/src/main/java/controllers/ApplicationController.java similarity index 100% rename from ninja/src/main/java/controllers/ApplicationController.java rename to web-modules/ninja/src/main/java/controllers/ApplicationController.java diff --git a/ninja/src/main/java/ehcache.xml b/web-modules/ninja/src/main/java/ehcache.xml similarity index 100% rename from ninja/src/main/java/ehcache.xml rename to web-modules/ninja/src/main/java/ehcache.xml diff --git a/ninja/src/main/java/logback.xml b/web-modules/ninja/src/main/java/logback.xml similarity index 100% rename from ninja/src/main/java/logback.xml rename to web-modules/ninja/src/main/java/logback.xml diff --git a/ninja/src/main/java/models/User.java b/web-modules/ninja/src/main/java/models/User.java similarity index 100% rename from ninja/src/main/java/models/User.java rename to web-modules/ninja/src/main/java/models/User.java diff --git a/ninja/src/main/java/services/UserService.java b/web-modules/ninja/src/main/java/services/UserService.java similarity index 100% rename from ninja/src/main/java/services/UserService.java rename to web-modules/ninja/src/main/java/services/UserService.java diff --git a/ninja/src/main/java/services/UserServiceImpl.java b/web-modules/ninja/src/main/java/services/UserServiceImpl.java similarity index 100% rename from ninja/src/main/java/services/UserServiceImpl.java rename to web-modules/ninja/src/main/java/services/UserServiceImpl.java diff --git a/ninja/src/main/java/views/ApplicationController/createUser.ftl.html b/web-modules/ninja/src/main/java/views/ApplicationController/createUser.ftl.html similarity index 100% rename from ninja/src/main/java/views/ApplicationController/createUser.ftl.html rename to web-modules/ninja/src/main/java/views/ApplicationController/createUser.ftl.html diff --git a/ninja/src/main/java/views/ApplicationController/home.ftl.html b/web-modules/ninja/src/main/java/views/ApplicationController/home.ftl.html similarity index 100% rename from ninja/src/main/java/views/ApplicationController/home.ftl.html rename to web-modules/ninja/src/main/java/views/ApplicationController/home.ftl.html diff --git a/ninja/src/main/java/views/ApplicationController/index.ftl.html b/web-modules/ninja/src/main/java/views/ApplicationController/index.ftl.html similarity index 100% rename from ninja/src/main/java/views/ApplicationController/index.ftl.html rename to web-modules/ninja/src/main/java/views/ApplicationController/index.ftl.html diff --git a/ninja/src/main/java/views/layout/defaultLayout.ftl.html b/web-modules/ninja/src/main/java/views/layout/defaultLayout.ftl.html similarity index 100% rename from ninja/src/main/java/views/layout/defaultLayout.ftl.html rename to web-modules/ninja/src/main/java/views/layout/defaultLayout.ftl.html diff --git a/ninja/src/main/java/views/layout/footer.ftl.html b/web-modules/ninja/src/main/java/views/layout/footer.ftl.html similarity index 100% rename from ninja/src/main/java/views/layout/footer.ftl.html rename to web-modules/ninja/src/main/java/views/layout/footer.ftl.html diff --git a/ninja/src/main/java/views/layout/header.ftl.html b/web-modules/ninja/src/main/java/views/layout/header.ftl.html similarity index 100% rename from ninja/src/main/java/views/layout/header.ftl.html rename to web-modules/ninja/src/main/java/views/layout/header.ftl.html diff --git a/ninja/src/main/java/views/system/403forbidden.ftl.html b/web-modules/ninja/src/main/java/views/system/403forbidden.ftl.html similarity index 100% rename from ninja/src/main/java/views/system/403forbidden.ftl.html rename to web-modules/ninja/src/main/java/views/system/403forbidden.ftl.html diff --git a/ninja/src/main/java/views/system/404notFound.ftl.html b/web-modules/ninja/src/main/java/views/system/404notFound.ftl.html similarity index 100% rename from ninja/src/main/java/views/system/404notFound.ftl.html rename to web-modules/ninja/src/main/java/views/system/404notFound.ftl.html diff --git a/ninja/src/main/webapp/WEB-INF/web.xml b/web-modules/ninja/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from ninja/src/main/webapp/WEB-INF/web.xml rename to web-modules/ninja/src/main/webapp/WEB-INF/web.xml diff --git a/ninja/src/test/java/controllers/ApiControllerDocTesterTest.java b/web-modules/ninja/src/test/java/controllers/ApiControllerDocTesterTest.java similarity index 100% rename from ninja/src/test/java/controllers/ApiControllerDocTesterTest.java rename to web-modules/ninja/src/test/java/controllers/ApiControllerDocTesterTest.java diff --git a/ninja/src/test/java/controllers/ApiControllerMockUnitTest.java b/web-modules/ninja/src/test/java/controllers/ApiControllerMockUnitTest.java similarity index 100% rename from ninja/src/test/java/controllers/ApiControllerMockUnitTest.java rename to web-modules/ninja/src/test/java/controllers/ApiControllerMockUnitTest.java diff --git a/play-framework/README.md b/web-modules/play-framework/README.md similarity index 100% rename from play-framework/README.md rename to web-modules/play-framework/README.md diff --git a/play-framework/async-http/.g8/form/app/controllers/$model__Camel$Controller.java b/web-modules/play-framework/async-http/.g8/form/app/controllers/$model__Camel$Controller.java similarity index 100% rename from play-framework/async-http/.g8/form/app/controllers/$model__Camel$Controller.java rename to web-modules/play-framework/async-http/.g8/form/app/controllers/$model__Camel$Controller.java diff --git a/play-framework/async-http/.g8/form/app/controllers/$model__Camel$Data.java b/web-modules/play-framework/async-http/.g8/form/app/controllers/$model__Camel$Data.java similarity index 100% rename from play-framework/async-http/.g8/form/app/controllers/$model__Camel$Data.java rename to web-modules/play-framework/async-http/.g8/form/app/controllers/$model__Camel$Data.java diff --git a/play-framework/async-http/.g8/form/app/views/$model__camel$/form.scala.html b/web-modules/play-framework/async-http/.g8/form/app/views/$model__camel$/form.scala.html similarity index 100% rename from play-framework/async-http/.g8/form/app/views/$model__camel$/form.scala.html rename to web-modules/play-framework/async-http/.g8/form/app/views/$model__camel$/form.scala.html diff --git a/play-framework/async-http/.g8/form/default.properties b/web-modules/play-framework/async-http/.g8/form/default.properties similarity index 100% rename from play-framework/async-http/.g8/form/default.properties rename to web-modules/play-framework/async-http/.g8/form/default.properties diff --git a/play-framework/async-http/.g8/form/generated-test/README.md b/web-modules/play-framework/async-http/.g8/form/generated-test/README.md similarity index 100% rename from play-framework/async-http/.g8/form/generated-test/README.md rename to web-modules/play-framework/async-http/.g8/form/generated-test/README.md diff --git a/play-framework/async-http/.g8/form/generated-test/controllers/$model__Camel$ControllerTest.java b/web-modules/play-framework/async-http/.g8/form/generated-test/controllers/$model__Camel$ControllerTest.java similarity index 100% rename from play-framework/async-http/.g8/form/generated-test/controllers/$model__Camel$ControllerTest.java rename to web-modules/play-framework/async-http/.g8/form/generated-test/controllers/$model__Camel$ControllerTest.java diff --git a/play-framework/async-http/.gitignore b/web-modules/play-framework/async-http/.gitignore similarity index 100% rename from play-framework/async-http/.gitignore rename to web-modules/play-framework/async-http/.gitignore diff --git a/play-framework/async-http/README.md b/web-modules/play-framework/async-http/README.md similarity index 100% rename from play-framework/async-http/README.md rename to web-modules/play-framework/async-http/README.md diff --git a/play-framework/async-http/app/controllers/HomeController.java b/web-modules/play-framework/async-http/app/controllers/HomeController.java similarity index 100% rename from play-framework/async-http/app/controllers/HomeController.java rename to web-modules/play-framework/async-http/app/controllers/HomeController.java diff --git a/play-framework/async-http/app/views/index.scala.html b/web-modules/play-framework/async-http/app/views/index.scala.html similarity index 100% rename from play-framework/async-http/app/views/index.scala.html rename to web-modules/play-framework/async-http/app/views/index.scala.html diff --git a/play-framework/async-http/app/views/main.scala.html b/web-modules/play-framework/async-http/app/views/main.scala.html similarity index 100% rename from play-framework/async-http/app/views/main.scala.html rename to web-modules/play-framework/async-http/app/views/main.scala.html diff --git a/play-framework/async-http/build.sbt b/web-modules/play-framework/async-http/build.sbt similarity index 100% rename from play-framework/async-http/build.sbt rename to web-modules/play-framework/async-http/build.sbt diff --git a/play-framework/async-http/conf/application.conf b/web-modules/play-framework/async-http/conf/application.conf similarity index 100% rename from play-framework/async-http/conf/application.conf rename to web-modules/play-framework/async-http/conf/application.conf diff --git a/play-framework/async-http/conf/logback.xml b/web-modules/play-framework/async-http/conf/logback.xml similarity index 100% rename from play-framework/async-http/conf/logback.xml rename to web-modules/play-framework/async-http/conf/logback.xml diff --git a/play-framework/async-http/conf/routes b/web-modules/play-framework/async-http/conf/routes similarity index 100% rename from play-framework/async-http/conf/routes rename to web-modules/play-framework/async-http/conf/routes diff --git a/play-framework/async-http/project/build.properties b/web-modules/play-framework/async-http/project/build.properties similarity index 100% rename from play-framework/async-http/project/build.properties rename to web-modules/play-framework/async-http/project/build.properties diff --git a/play-framework/async-http/project/plugins.sbt b/web-modules/play-framework/async-http/project/plugins.sbt similarity index 100% rename from play-framework/async-http/project/plugins.sbt rename to web-modules/play-framework/async-http/project/plugins.sbt diff --git a/play-framework/async-http/public/images/favicon.png b/web-modules/play-framework/async-http/public/images/favicon.png similarity index 100% rename from play-framework/async-http/public/images/favicon.png rename to web-modules/play-framework/async-http/public/images/favicon.png diff --git a/play-framework/async-http/public/javascripts/main.js b/web-modules/play-framework/async-http/public/javascripts/main.js similarity index 100% rename from play-framework/async-http/public/javascripts/main.js rename to web-modules/play-framework/async-http/public/javascripts/main.js diff --git a/play-framework/async-http/public/stylesheets/main.css b/web-modules/play-framework/async-http/public/stylesheets/main.css similarity index 100% rename from play-framework/async-http/public/stylesheets/main.css rename to web-modules/play-framework/async-http/public/stylesheets/main.css diff --git a/play-framework/async-http/test/controllers/HomeControllerTest.java b/web-modules/play-framework/async-http/test/controllers/HomeControllerTest.java similarity index 100% rename from play-framework/async-http/test/controllers/HomeControllerTest.java rename to web-modules/play-framework/async-http/test/controllers/HomeControllerTest.java diff --git a/play-framework/introduction/.gitignore b/web-modules/play-framework/introduction/.gitignore similarity index 100% rename from play-framework/introduction/.gitignore rename to web-modules/play-framework/introduction/.gitignore diff --git a/play-framework/introduction/app/controllers/HomeController.java b/web-modules/play-framework/introduction/app/controllers/HomeController.java similarity index 100% rename from play-framework/introduction/app/controllers/HomeController.java rename to web-modules/play-framework/introduction/app/controllers/HomeController.java diff --git a/play-framework/introduction/app/views/index.scala.html b/web-modules/play-framework/introduction/app/views/index.scala.html similarity index 100% rename from play-framework/introduction/app/views/index.scala.html rename to web-modules/play-framework/introduction/app/views/index.scala.html diff --git a/play-framework/introduction/app/views/main.scala.html b/web-modules/play-framework/introduction/app/views/main.scala.html similarity index 100% rename from play-framework/introduction/app/views/main.scala.html rename to web-modules/play-framework/introduction/app/views/main.scala.html diff --git a/play-framework/introduction/build.sbt b/web-modules/play-framework/introduction/build.sbt similarity index 100% rename from play-framework/introduction/build.sbt rename to web-modules/play-framework/introduction/build.sbt diff --git a/play-framework/introduction/conf/application.conf b/web-modules/play-framework/introduction/conf/application.conf similarity index 100% rename from play-framework/introduction/conf/application.conf rename to web-modules/play-framework/introduction/conf/application.conf diff --git a/play-framework/introduction/conf/logback.xml b/web-modules/play-framework/introduction/conf/logback.xml similarity index 100% rename from play-framework/introduction/conf/logback.xml rename to web-modules/play-framework/introduction/conf/logback.xml diff --git a/play-framework/introduction/conf/routes b/web-modules/play-framework/introduction/conf/routes similarity index 100% rename from play-framework/introduction/conf/routes rename to web-modules/play-framework/introduction/conf/routes diff --git a/play-framework/introduction/project/build.properties b/web-modules/play-framework/introduction/project/build.properties similarity index 100% rename from play-framework/introduction/project/build.properties rename to web-modules/play-framework/introduction/project/build.properties diff --git a/play-framework/introduction/project/plugins.sbt b/web-modules/play-framework/introduction/project/plugins.sbt similarity index 100% rename from play-framework/introduction/project/plugins.sbt rename to web-modules/play-framework/introduction/project/plugins.sbt diff --git a/play-framework/introduction/public/images/favicon.png b/web-modules/play-framework/introduction/public/images/favicon.png similarity index 100% rename from play-framework/introduction/public/images/favicon.png rename to web-modules/play-framework/introduction/public/images/favicon.png diff --git a/play-framework/introduction/public/javascripts/main.js b/web-modules/play-framework/introduction/public/javascripts/main.js similarity index 100% rename from play-framework/introduction/public/javascripts/main.js rename to web-modules/play-framework/introduction/public/javascripts/main.js diff --git a/play-framework/introduction/public/stylesheets/main.css b/web-modules/play-framework/introduction/public/stylesheets/main.css similarity index 100% rename from play-framework/introduction/public/stylesheets/main.css rename to web-modules/play-framework/introduction/public/stylesheets/main.css diff --git a/play-framework/introduction/test/controllers/HomeControllerUnitTest.java b/web-modules/play-framework/introduction/test/controllers/HomeControllerUnitTest.java similarity index 100% rename from play-framework/introduction/test/controllers/HomeControllerUnitTest.java rename to web-modules/play-framework/introduction/test/controllers/HomeControllerUnitTest.java diff --git a/play-framework/routing-in-play/app/controllers/HomeController.java b/web-modules/play-framework/routing-in-play/app/controllers/HomeController.java similarity index 100% rename from play-framework/routing-in-play/app/controllers/HomeController.java rename to web-modules/play-framework/routing-in-play/app/controllers/HomeController.java diff --git a/play-framework/routing-in-play/app/views/index.scala.html b/web-modules/play-framework/routing-in-play/app/views/index.scala.html similarity index 100% rename from play-framework/routing-in-play/app/views/index.scala.html rename to web-modules/play-framework/routing-in-play/app/views/index.scala.html diff --git a/play-framework/routing-in-play/app/views/main.scala.html b/web-modules/play-framework/routing-in-play/app/views/main.scala.html similarity index 100% rename from play-framework/routing-in-play/app/views/main.scala.html rename to web-modules/play-framework/routing-in-play/app/views/main.scala.html diff --git a/play-framework/routing-in-play/build.sbt b/web-modules/play-framework/routing-in-play/build.sbt similarity index 100% rename from play-framework/routing-in-play/build.sbt rename to web-modules/play-framework/routing-in-play/build.sbt diff --git a/play-framework/routing-in-play/conf/application.conf b/web-modules/play-framework/routing-in-play/conf/application.conf similarity index 100% rename from play-framework/routing-in-play/conf/application.conf rename to web-modules/play-framework/routing-in-play/conf/application.conf diff --git a/play-framework/routing-in-play/conf/logback.xml b/web-modules/play-framework/routing-in-play/conf/logback.xml similarity index 100% rename from play-framework/routing-in-play/conf/logback.xml rename to web-modules/play-framework/routing-in-play/conf/logback.xml diff --git a/play-framework/routing-in-play/conf/routes b/web-modules/play-framework/routing-in-play/conf/routes similarity index 100% rename from play-framework/routing-in-play/conf/routes rename to web-modules/play-framework/routing-in-play/conf/routes diff --git a/play-framework/routing-in-play/project/build.properties b/web-modules/play-framework/routing-in-play/project/build.properties similarity index 100% rename from play-framework/routing-in-play/project/build.properties rename to web-modules/play-framework/routing-in-play/project/build.properties diff --git a/play-framework/routing-in-play/project/plugins.sbt b/web-modules/play-framework/routing-in-play/project/plugins.sbt similarity index 100% rename from play-framework/routing-in-play/project/plugins.sbt rename to web-modules/play-framework/routing-in-play/project/plugins.sbt diff --git a/play-framework/routing-in-play/public/images/favicon.png b/web-modules/play-framework/routing-in-play/public/images/favicon.png similarity index 100% rename from play-framework/routing-in-play/public/images/favicon.png rename to web-modules/play-framework/routing-in-play/public/images/favicon.png diff --git a/play-framework/routing-in-play/public/javascripts/main.js b/web-modules/play-framework/routing-in-play/public/javascripts/main.js similarity index 100% rename from play-framework/routing-in-play/public/javascripts/main.js rename to web-modules/play-framework/routing-in-play/public/javascripts/main.js diff --git a/play-framework/routing-in-play/public/stylesheets/main.css b/web-modules/play-framework/routing-in-play/public/stylesheets/main.css similarity index 100% rename from play-framework/routing-in-play/public/stylesheets/main.css rename to web-modules/play-framework/routing-in-play/public/stylesheets/main.css diff --git a/play-framework/routing-in-play/test/controllers/HomeControllerUnitTest.java b/web-modules/play-framework/routing-in-play/test/controllers/HomeControllerUnitTest.java similarity index 100% rename from play-framework/routing-in-play/test/controllers/HomeControllerUnitTest.java rename to web-modules/play-framework/routing-in-play/test/controllers/HomeControllerUnitTest.java diff --git a/play-framework/student-api/.gitignore b/web-modules/play-framework/student-api/.gitignore similarity index 100% rename from play-framework/student-api/.gitignore rename to web-modules/play-framework/student-api/.gitignore diff --git a/play-framework/student-api/app/controllers/StudentController.java b/web-modules/play-framework/student-api/app/controllers/StudentController.java similarity index 100% rename from play-framework/student-api/app/controllers/StudentController.java rename to web-modules/play-framework/student-api/app/controllers/StudentController.java diff --git a/play-framework/student-api/app/model/Student.java b/web-modules/play-framework/student-api/app/model/Student.java similarity index 100% rename from play-framework/student-api/app/model/Student.java rename to web-modules/play-framework/student-api/app/model/Student.java diff --git a/play-framework/student-api/app/store/StudentStore.java b/web-modules/play-framework/student-api/app/store/StudentStore.java similarity index 100% rename from play-framework/student-api/app/store/StudentStore.java rename to web-modules/play-framework/student-api/app/store/StudentStore.java diff --git a/play-framework/student-api/app/utils/Util.java b/web-modules/play-framework/student-api/app/utils/Util.java similarity index 100% rename from play-framework/student-api/app/utils/Util.java rename to web-modules/play-framework/student-api/app/utils/Util.java diff --git a/play-framework/student-api/build.sbt b/web-modules/play-framework/student-api/build.sbt similarity index 100% rename from play-framework/student-api/build.sbt rename to web-modules/play-framework/student-api/build.sbt diff --git a/play-framework/student-api/conf/application.conf b/web-modules/play-framework/student-api/conf/application.conf similarity index 100% rename from play-framework/student-api/conf/application.conf rename to web-modules/play-framework/student-api/conf/application.conf diff --git a/play-framework/student-api/conf/logback.xml b/web-modules/play-framework/student-api/conf/logback.xml similarity index 100% rename from play-framework/student-api/conf/logback.xml rename to web-modules/play-framework/student-api/conf/logback.xml diff --git a/play-framework/student-api/conf/routes b/web-modules/play-framework/student-api/conf/routes similarity index 100% rename from play-framework/student-api/conf/routes rename to web-modules/play-framework/student-api/conf/routes diff --git a/play-framework/student-api/project/build.properties b/web-modules/play-framework/student-api/project/build.properties similarity index 100% rename from play-framework/student-api/project/build.properties rename to web-modules/play-framework/student-api/project/build.properties diff --git a/play-framework/student-api/project/plugins.sbt b/web-modules/play-framework/student-api/project/plugins.sbt similarity index 100% rename from play-framework/student-api/project/plugins.sbt rename to web-modules/play-framework/student-api/project/plugins.sbt diff --git a/play-framework/student-api/test/controllers/StudentControllerUnitTest.java b/web-modules/play-framework/student-api/test/controllers/StudentControllerUnitTest.java similarity index 100% rename from play-framework/student-api/test/controllers/StudentControllerUnitTest.java rename to web-modules/play-framework/student-api/test/controllers/StudentControllerUnitTest.java diff --git a/play-framework/websockets/README.md b/web-modules/play-framework/websockets/README.md similarity index 100% rename from play-framework/websockets/README.md rename to web-modules/play-framework/websockets/README.md diff --git a/play-framework/websockets/app/actors/Messenger.java b/web-modules/play-framework/websockets/app/actors/Messenger.java similarity index 100% rename from play-framework/websockets/app/actors/Messenger.java rename to web-modules/play-framework/websockets/app/actors/Messenger.java diff --git a/play-framework/websockets/app/controllers/HomeController.java b/web-modules/play-framework/websockets/app/controllers/HomeController.java similarity index 100% rename from play-framework/websockets/app/controllers/HomeController.java rename to web-modules/play-framework/websockets/app/controllers/HomeController.java diff --git a/play-framework/websockets/app/dto/MessageDTO.java b/web-modules/play-framework/websockets/app/dto/MessageDTO.java similarity index 100% rename from play-framework/websockets/app/dto/MessageDTO.java rename to web-modules/play-framework/websockets/app/dto/MessageDTO.java diff --git a/play-framework/websockets/app/dto/RequestDTO.java b/web-modules/play-framework/websockets/app/dto/RequestDTO.java similarity index 100% rename from play-framework/websockets/app/dto/RequestDTO.java rename to web-modules/play-framework/websockets/app/dto/RequestDTO.java diff --git a/play-framework/websockets/app/utils/MessageConverter.java b/web-modules/play-framework/websockets/app/utils/MessageConverter.java similarity index 100% rename from play-framework/websockets/app/utils/MessageConverter.java rename to web-modules/play-framework/websockets/app/utils/MessageConverter.java diff --git a/play-framework/websockets/app/views/index.scala.html b/web-modules/play-framework/websockets/app/views/index.scala.html similarity index 100% rename from play-framework/websockets/app/views/index.scala.html rename to web-modules/play-framework/websockets/app/views/index.scala.html diff --git a/play-framework/websockets/app/views/main.scala.html b/web-modules/play-framework/websockets/app/views/main.scala.html similarity index 100% rename from play-framework/websockets/app/views/main.scala.html rename to web-modules/play-framework/websockets/app/views/main.scala.html diff --git a/play-framework/websockets/build.sbt b/web-modules/play-framework/websockets/build.sbt similarity index 100% rename from play-framework/websockets/build.sbt rename to web-modules/play-framework/websockets/build.sbt diff --git a/play-framework/websockets/conf/application.conf b/web-modules/play-framework/websockets/conf/application.conf similarity index 100% rename from play-framework/websockets/conf/application.conf rename to web-modules/play-framework/websockets/conf/application.conf diff --git a/play-framework/websockets/conf/logback.xml b/web-modules/play-framework/websockets/conf/logback.xml similarity index 100% rename from play-framework/websockets/conf/logback.xml rename to web-modules/play-framework/websockets/conf/logback.xml diff --git a/play-framework/websockets/conf/routes b/web-modules/play-framework/websockets/conf/routes similarity index 100% rename from play-framework/websockets/conf/routes rename to web-modules/play-framework/websockets/conf/routes diff --git a/play-framework/websockets/project/build.properties b/web-modules/play-framework/websockets/project/build.properties similarity index 100% rename from play-framework/websockets/project/build.properties rename to web-modules/play-framework/websockets/project/build.properties diff --git a/play-framework/websockets/project/plugins.sbt b/web-modules/play-framework/websockets/project/plugins.sbt similarity index 100% rename from play-framework/websockets/project/plugins.sbt rename to web-modules/play-framework/websockets/project/plugins.sbt diff --git a/play-framework/websockets/public/images/favicon.png b/web-modules/play-framework/websockets/public/images/favicon.png similarity index 100% rename from play-framework/websockets/public/images/favicon.png rename to web-modules/play-framework/websockets/public/images/favicon.png diff --git a/play-framework/websockets/public/javascripts/main.js b/web-modules/play-framework/websockets/public/javascripts/main.js similarity index 100% rename from play-framework/websockets/public/javascripts/main.js rename to web-modules/play-framework/websockets/public/javascripts/main.js diff --git a/play-framework/websockets/public/stylesheets/main.css b/web-modules/play-framework/websockets/public/stylesheets/main.css similarity index 100% rename from play-framework/websockets/public/stylesheets/main.css rename to web-modules/play-framework/websockets/public/stylesheets/main.css diff --git a/play-framework/websockets/test/controllers/HomeControllerTest.java b/web-modules/play-framework/websockets/test/controllers/HomeControllerTest.java similarity index 100% rename from play-framework/websockets/test/controllers/HomeControllerTest.java rename to web-modules/play-framework/websockets/test/controllers/HomeControllerTest.java diff --git a/web-modules/pom.xml b/web-modules/pom.xml new file mode 100644 index 0000000000..a6e13cbb2a --- /dev/null +++ b/web-modules/pom.xml @@ -0,0 +1,50 @@ + + + 4.0.0 + web-modules + web-modules + pom + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + + + apache-tapestry + blade + bootique + dropwizard + google-web-toolkit + jakarta-ee + java-lite + javax-servlets + javax-servlets-2 + jee-7 + jooby + linkrest + ninja + ratpack + resteasy + restx + spark-java + struts-2 + vraptor + wicket + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + \ No newline at end of file diff --git a/raml/README.md b/web-modules/raml/README.md similarity index 100% rename from raml/README.md rename to web-modules/raml/README.md diff --git a/raml/annotations/README.md b/web-modules/raml/annotations/README.md similarity index 100% rename from raml/annotations/README.md rename to web-modules/raml/annotations/README.md diff --git a/raml/annotations/api.raml b/web-modules/raml/annotations/api.raml similarity index 100% rename from raml/annotations/api.raml rename to web-modules/raml/annotations/api.raml diff --git a/raml/annotations/examples/Bar.json b/web-modules/raml/annotations/examples/Bar.json similarity index 100% rename from raml/annotations/examples/Bar.json rename to web-modules/raml/annotations/examples/Bar.json diff --git a/raml/annotations/examples/Bars.json b/web-modules/raml/annotations/examples/Bars.json similarity index 100% rename from raml/annotations/examples/Bars.json rename to web-modules/raml/annotations/examples/Bars.json diff --git a/raml/annotations/examples/Error.json b/web-modules/raml/annotations/examples/Error.json similarity index 100% rename from raml/annotations/examples/Error.json rename to web-modules/raml/annotations/examples/Error.json diff --git a/raml/annotations/examples/Foo.json b/web-modules/raml/annotations/examples/Foo.json similarity index 100% rename from raml/annotations/examples/Foo.json rename to web-modules/raml/annotations/examples/Foo.json diff --git a/raml/annotations/examples/Foos.json b/web-modules/raml/annotations/examples/Foos.json similarity index 100% rename from raml/annotations/examples/Foos.json rename to web-modules/raml/annotations/examples/Foos.json diff --git a/raml/annotations/extensions/en_US/additionalResources.raml b/web-modules/raml/annotations/extensions/en_US/additionalResources.raml similarity index 100% rename from raml/annotations/extensions/en_US/additionalResources.raml rename to web-modules/raml/annotations/extensions/en_US/additionalResources.raml diff --git a/raml/annotations/libraries/dataTypes.raml b/web-modules/raml/annotations/libraries/dataTypes.raml similarity index 100% rename from raml/annotations/libraries/dataTypes.raml rename to web-modules/raml/annotations/libraries/dataTypes.raml diff --git a/raml/annotations/libraries/resourceTypes.raml b/web-modules/raml/annotations/libraries/resourceTypes.raml similarity index 100% rename from raml/annotations/libraries/resourceTypes.raml rename to web-modules/raml/annotations/libraries/resourceTypes.raml diff --git a/raml/annotations/libraries/securitySchemes.raml b/web-modules/raml/annotations/libraries/securitySchemes.raml similarity index 100% rename from raml/annotations/libraries/securitySchemes.raml rename to web-modules/raml/annotations/libraries/securitySchemes.raml diff --git a/raml/annotations/libraries/traits.raml b/web-modules/raml/annotations/libraries/traits.raml similarity index 100% rename from raml/annotations/libraries/traits.raml rename to web-modules/raml/annotations/libraries/traits.raml diff --git a/raml/annotations/overlays/es_ES/additionalResources.raml b/web-modules/raml/annotations/overlays/es_ES/additionalResources.raml similarity index 100% rename from raml/annotations/overlays/es_ES/additionalResources.raml rename to web-modules/raml/annotations/overlays/es_ES/additionalResources.raml diff --git a/raml/annotations/overlays/es_ES/documentationItems.raml b/web-modules/raml/annotations/overlays/es_ES/documentationItems.raml similarity index 100% rename from raml/annotations/overlays/es_ES/documentationItems.raml rename to web-modules/raml/annotations/overlays/es_ES/documentationItems.raml diff --git a/raml/introduction/0.8/api.raml b/web-modules/raml/introduction/0.8/api.raml similarity index 100% rename from raml/introduction/0.8/api.raml rename to web-modules/raml/introduction/0.8/api.raml diff --git a/raml/introduction/0.8/error-example.json b/web-modules/raml/introduction/0.8/error-example.json similarity index 100% rename from raml/introduction/0.8/error-example.json rename to web-modules/raml/introduction/0.8/error-example.json diff --git a/raml/introduction/0.8/error.json b/web-modules/raml/introduction/0.8/error.json similarity index 100% rename from raml/introduction/0.8/error.json rename to web-modules/raml/introduction/0.8/error.json diff --git a/raml/introduction/0.8/foo-example.json b/web-modules/raml/introduction/0.8/foo-example.json similarity index 100% rename from raml/introduction/0.8/foo-example.json rename to web-modules/raml/introduction/0.8/foo-example.json diff --git a/raml/introduction/0.8/foo.json b/web-modules/raml/introduction/0.8/foo.json similarity index 100% rename from raml/introduction/0.8/foo.json rename to web-modules/raml/introduction/0.8/foo.json diff --git a/raml/introduction/0.8/foos-example.json b/web-modules/raml/introduction/0.8/foos-example.json similarity index 100% rename from raml/introduction/0.8/foos-example.json rename to web-modules/raml/introduction/0.8/foos-example.json diff --git a/raml/introduction/0.8/foos.json b/web-modules/raml/introduction/0.8/foos.json similarity index 100% rename from raml/introduction/0.8/foos.json rename to web-modules/raml/introduction/0.8/foos.json diff --git a/raml/introduction/1.0/api.raml b/web-modules/raml/introduction/1.0/api.raml similarity index 100% rename from raml/introduction/1.0/api.raml rename to web-modules/raml/introduction/1.0/api.raml diff --git a/raml/introduction/1.0/examples/Error.json b/web-modules/raml/introduction/1.0/examples/Error.json similarity index 100% rename from raml/introduction/1.0/examples/Error.json rename to web-modules/raml/introduction/1.0/examples/Error.json diff --git a/raml/introduction/1.0/examples/Foo.json b/web-modules/raml/introduction/1.0/examples/Foo.json similarity index 100% rename from raml/introduction/1.0/examples/Foo.json rename to web-modules/raml/introduction/1.0/examples/Foo.json diff --git a/raml/introduction/1.0/examples/Foos.json b/web-modules/raml/introduction/1.0/examples/Foos.json similarity index 100% rename from raml/introduction/1.0/examples/Foos.json rename to web-modules/raml/introduction/1.0/examples/Foos.json diff --git a/raml/introduction/1.0/types/Error.raml b/web-modules/raml/introduction/1.0/types/Error.raml similarity index 100% rename from raml/introduction/1.0/types/Error.raml rename to web-modules/raml/introduction/1.0/types/Error.raml diff --git a/raml/introduction/1.0/types/Foo.raml b/web-modules/raml/introduction/1.0/types/Foo.raml similarity index 100% rename from raml/introduction/1.0/types/Foo.raml rename to web-modules/raml/introduction/1.0/types/Foo.raml diff --git a/raml/modularization/README.md b/web-modules/raml/modularization/README.md similarity index 100% rename from raml/modularization/README.md rename to web-modules/raml/modularization/README.md diff --git a/raml/modularization/api-before-modularization.raml b/web-modules/raml/modularization/api-before-modularization.raml similarity index 100% rename from raml/modularization/api-before-modularization.raml rename to web-modules/raml/modularization/api-before-modularization.raml diff --git a/raml/modularization/api-with-libraries.raml b/web-modules/raml/modularization/api-with-libraries.raml similarity index 100% rename from raml/modularization/api-with-libraries.raml rename to web-modules/raml/modularization/api-with-libraries.raml diff --git a/raml/modularization/api-with-typed-fragments.raml b/web-modules/raml/modularization/api-with-typed-fragments.raml similarity index 100% rename from raml/modularization/api-with-typed-fragments.raml rename to web-modules/raml/modularization/api-with-typed-fragments.raml diff --git a/raml/modularization/api.raml b/web-modules/raml/modularization/api.raml similarity index 100% rename from raml/modularization/api.raml rename to web-modules/raml/modularization/api.raml diff --git a/raml/modularization/examples/Bar.json b/web-modules/raml/modularization/examples/Bar.json similarity index 100% rename from raml/modularization/examples/Bar.json rename to web-modules/raml/modularization/examples/Bar.json diff --git a/raml/modularization/examples/Bars.json b/web-modules/raml/modularization/examples/Bars.json similarity index 100% rename from raml/modularization/examples/Bars.json rename to web-modules/raml/modularization/examples/Bars.json diff --git a/raml/modularization/examples/Error.json b/web-modules/raml/modularization/examples/Error.json similarity index 100% rename from raml/modularization/examples/Error.json rename to web-modules/raml/modularization/examples/Error.json diff --git a/raml/modularization/examples/Foo.json b/web-modules/raml/modularization/examples/Foo.json similarity index 100% rename from raml/modularization/examples/Foo.json rename to web-modules/raml/modularization/examples/Foo.json diff --git a/raml/modularization/examples/Foos.json b/web-modules/raml/modularization/examples/Foos.json similarity index 100% rename from raml/modularization/examples/Foos.json rename to web-modules/raml/modularization/examples/Foos.json diff --git a/raml/modularization/extensions/en_US/additionalResources.raml b/web-modules/raml/modularization/extensions/en_US/additionalResources.raml similarity index 100% rename from raml/modularization/extensions/en_US/additionalResources.raml rename to web-modules/raml/modularization/extensions/en_US/additionalResources.raml diff --git a/raml/modularization/libraries/dataTypes.raml b/web-modules/raml/modularization/libraries/dataTypes.raml similarity index 100% rename from raml/modularization/libraries/dataTypes.raml rename to web-modules/raml/modularization/libraries/dataTypes.raml diff --git a/raml/modularization/libraries/resourceTypes.raml b/web-modules/raml/modularization/libraries/resourceTypes.raml similarity index 100% rename from raml/modularization/libraries/resourceTypes.raml rename to web-modules/raml/modularization/libraries/resourceTypes.raml diff --git a/raml/modularization/libraries/securitySchemes.raml b/web-modules/raml/modularization/libraries/securitySchemes.raml similarity index 100% rename from raml/modularization/libraries/securitySchemes.raml rename to web-modules/raml/modularization/libraries/securitySchemes.raml diff --git a/raml/modularization/libraries/traits.raml b/web-modules/raml/modularization/libraries/traits.raml similarity index 100% rename from raml/modularization/libraries/traits.raml rename to web-modules/raml/modularization/libraries/traits.raml diff --git a/raml/modularization/overlays/es_ES/additionalResources.raml b/web-modules/raml/modularization/overlays/es_ES/additionalResources.raml similarity index 100% rename from raml/modularization/overlays/es_ES/additionalResources.raml rename to web-modules/raml/modularization/overlays/es_ES/additionalResources.raml diff --git a/raml/modularization/overlays/es_ES/documentationItems.raml b/web-modules/raml/modularization/overlays/es_ES/documentationItems.raml similarity index 100% rename from raml/modularization/overlays/es_ES/documentationItems.raml rename to web-modules/raml/modularization/overlays/es_ES/documentationItems.raml diff --git a/raml/modularization/resourceTypes/collection.raml b/web-modules/raml/modularization/resourceTypes/collection.raml similarity index 100% rename from raml/modularization/resourceTypes/collection.raml rename to web-modules/raml/modularization/resourceTypes/collection.raml diff --git a/raml/modularization/resourceTypes/item.raml b/web-modules/raml/modularization/resourceTypes/item.raml similarity index 100% rename from raml/modularization/resourceTypes/item.raml rename to web-modules/raml/modularization/resourceTypes/item.raml diff --git a/raml/modularization/traits/hasNotFound.raml b/web-modules/raml/modularization/traits/hasNotFound.raml similarity index 100% rename from raml/modularization/traits/hasNotFound.raml rename to web-modules/raml/modularization/traits/hasNotFound.raml diff --git a/raml/modularization/traits/hasRequestItem.raml b/web-modules/raml/modularization/traits/hasRequestItem.raml similarity index 100% rename from raml/modularization/traits/hasRequestItem.raml rename to web-modules/raml/modularization/traits/hasRequestItem.raml diff --git a/raml/modularization/traits/hasResponseCollection.raml b/web-modules/raml/modularization/traits/hasResponseCollection.raml similarity index 100% rename from raml/modularization/traits/hasResponseCollection.raml rename to web-modules/raml/modularization/traits/hasResponseCollection.raml diff --git a/raml/modularization/traits/hasResponseItem.raml b/web-modules/raml/modularization/traits/hasResponseItem.raml similarity index 100% rename from raml/modularization/traits/hasResponseItem.raml rename to web-modules/raml/modularization/traits/hasResponseItem.raml diff --git a/raml/modularization/types/Bar.raml b/web-modules/raml/modularization/types/Bar.raml similarity index 100% rename from raml/modularization/types/Bar.raml rename to web-modules/raml/modularization/types/Bar.raml diff --git a/raml/modularization/types/Error.raml b/web-modules/raml/modularization/types/Error.raml similarity index 100% rename from raml/modularization/types/Error.raml rename to web-modules/raml/modularization/types/Error.raml diff --git a/raml/modularization/types/Foo.raml b/web-modules/raml/modularization/types/Foo.raml similarity index 100% rename from raml/modularization/types/Foo.raml rename to web-modules/raml/modularization/types/Foo.raml diff --git a/raml/resource-types-and-traits/README.md b/web-modules/raml/resource-types-and-traits/README.md similarity index 100% rename from raml/resource-types-and-traits/README.md rename to web-modules/raml/resource-types-and-traits/README.md diff --git a/raml/resource-types-and-traits/api-before-resource-types-and-traits.raml b/web-modules/raml/resource-types-and-traits/api-before-resource-types-and-traits.raml similarity index 100% rename from raml/resource-types-and-traits/api-before-resource-types-and-traits.raml rename to web-modules/raml/resource-types-and-traits/api-before-resource-types-and-traits.raml diff --git a/raml/resource-types-and-traits/api.raml b/web-modules/raml/resource-types-and-traits/api.raml similarity index 100% rename from raml/resource-types-and-traits/api.raml rename to web-modules/raml/resource-types-and-traits/api.raml diff --git a/raml/resource-types-and-traits/examples/Bar.json b/web-modules/raml/resource-types-and-traits/examples/Bar.json similarity index 100% rename from raml/resource-types-and-traits/examples/Bar.json rename to web-modules/raml/resource-types-and-traits/examples/Bar.json diff --git a/raml/resource-types-and-traits/examples/Bars.json b/web-modules/raml/resource-types-and-traits/examples/Bars.json similarity index 100% rename from raml/resource-types-and-traits/examples/Bars.json rename to web-modules/raml/resource-types-and-traits/examples/Bars.json diff --git a/raml/resource-types-and-traits/examples/Error.json b/web-modules/raml/resource-types-and-traits/examples/Error.json similarity index 100% rename from raml/resource-types-and-traits/examples/Error.json rename to web-modules/raml/resource-types-and-traits/examples/Error.json diff --git a/raml/resource-types-and-traits/examples/Foo.json b/web-modules/raml/resource-types-and-traits/examples/Foo.json similarity index 100% rename from raml/resource-types-and-traits/examples/Foo.json rename to web-modules/raml/resource-types-and-traits/examples/Foo.json diff --git a/raml/resource-types-and-traits/examples/Foos.json b/web-modules/raml/resource-types-and-traits/examples/Foos.json similarity index 100% rename from raml/resource-types-and-traits/examples/Foos.json rename to web-modules/raml/resource-types-and-traits/examples/Foos.json diff --git a/raml/resource-types-and-traits/types/Bar.raml b/web-modules/raml/resource-types-and-traits/types/Bar.raml similarity index 100% rename from raml/resource-types-and-traits/types/Bar.raml rename to web-modules/raml/resource-types-and-traits/types/Bar.raml diff --git a/raml/resource-types-and-traits/types/Error.raml b/web-modules/raml/resource-types-and-traits/types/Error.raml similarity index 100% rename from raml/resource-types-and-traits/types/Error.raml rename to web-modules/raml/resource-types-and-traits/types/Error.raml diff --git a/raml/resource-types-and-traits/types/Foo.raml b/web-modules/raml/resource-types-and-traits/types/Foo.raml similarity index 100% rename from raml/resource-types-and-traits/types/Foo.raml rename to web-modules/raml/resource-types-and-traits/types/Foo.raml diff --git a/ratpack/README.md b/web-modules/ratpack/README.md similarity index 100% rename from ratpack/README.md rename to web-modules/ratpack/README.md diff --git a/ratpack/build.gradle b/web-modules/ratpack/build.gradle similarity index 95% rename from ratpack/build.gradle rename to web-modules/ratpack/build.gradle index c997b4e697..f50c5b3800 100644 --- a/ratpack/build.gradle +++ b/web-modules/ratpack/build.gradle @@ -1,37 +1,37 @@ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath "io.ratpack:ratpack-gradle:1.5.4" - classpath "com.h2database:h2:1.4.193" - } -} - -if (!JavaVersion.current().java8Compatible) { - throw new IllegalStateException("Must be built with Java 8 or higher") -} - -apply plugin: "io.ratpack.ratpack-java" -apply plugin: 'java' -apply plugin: 'groovy' -apply plugin: 'io.ratpack.ratpack-groovy' - -repositories { - jcenter() -} - -dependencies { - compile ratpack.dependency('hikari') - compile 'com.h2database:h2:1.4.193' - testCompile 'junit:junit:4.11' - runtime "org.slf4j:slf4j-simple:1.7.21" -} - -test { - testLogging { - events 'started', 'passed' - } -} - -mainClassName = "com.baeldung.Application" +buildscript { + repositories { + jcenter() + } + dependencies { + classpath "io.ratpack:ratpack-gradle:1.5.4" + classpath "com.h2database:h2:1.4.193" + } +} + +if (!JavaVersion.current().java8Compatible) { + throw new IllegalStateException("Must be built with Java 8 or higher") +} + +apply plugin: "io.ratpack.ratpack-java" +apply plugin: 'java' +apply plugin: 'groovy' +apply plugin: 'io.ratpack.ratpack-groovy' + +repositories { + jcenter() +} + +dependencies { + compile ratpack.dependency('hikari') + compile 'com.h2database:h2:1.4.193' + testCompile 'junit:junit:4.11' + runtime "org.slf4j:slf4j-simple:1.7.21" +} + +test { + testLogging { + events 'started', 'passed' + } +} + +mainClassName = "com.baeldung.Application" diff --git a/ratpack/pom.xml b/web-modules/ratpack/pom.xml similarity index 98% rename from ratpack/pom.xml rename to web-modules/ratpack/pom.xml index c57934d8b7..2a63b4118c 100644 --- a/ratpack/pom.xml +++ b/web-modules/ratpack/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/ratpack/src/main/groovy/com/baeldung/Ratpack.groovy b/web-modules/ratpack/src/main/groovy/com/baeldung/Ratpack.groovy similarity index 100% rename from ratpack/src/main/groovy/com/baeldung/Ratpack.groovy rename to web-modules/ratpack/src/main/groovy/com/baeldung/Ratpack.groovy diff --git a/ratpack/src/main/groovy/com/baeldung/RatpackGroovyApp.groovy b/web-modules/ratpack/src/main/groovy/com/baeldung/RatpackGroovyApp.groovy similarity index 100% rename from ratpack/src/main/groovy/com/baeldung/RatpackGroovyApp.groovy rename to web-modules/ratpack/src/main/groovy/com/baeldung/RatpackGroovyApp.groovy diff --git a/ratpack/src/main/groovy/com/baeldung/model/User.groovy b/web-modules/ratpack/src/main/groovy/com/baeldung/model/User.groovy similarity index 100% rename from ratpack/src/main/groovy/com/baeldung/model/User.groovy rename to web-modules/ratpack/src/main/groovy/com/baeldung/model/User.groovy diff --git a/ratpack/src/main/java/com/baeldung/Application.java b/web-modules/ratpack/src/main/java/com/baeldung/Application.java similarity index 97% rename from ratpack/src/main/java/com/baeldung/Application.java rename to web-modules/ratpack/src/main/java/com/baeldung/Application.java index 4a391d04a1..235a6f0068 100644 --- a/ratpack/src/main/java/com/baeldung/Application.java +++ b/web-modules/ratpack/src/main/java/com/baeldung/Application.java @@ -1,81 +1,81 @@ -package com.baeldung; - -import com.baeldung.filter.RequestValidatorFilter; -import com.baeldung.handler.EmployeeHandler; -import com.baeldung.handler.RedirectHandler; -import com.baeldung.model.Employee; -import com.baeldung.repository.EmployeeRepository; -import com.baeldung.repository.EmployeeRepositoryImpl; -import com.zaxxer.hikari.HikariConfig; -import io.netty.buffer.PooledByteBufAllocator; -import ratpack.func.Action; -import ratpack.func.Function; -import ratpack.guice.BindingsSpec; -import ratpack.guice.Guice; -import ratpack.handling.Chain; -import ratpack.hikari.HikariModule; -import ratpack.http.client.HttpClient; -import ratpack.jackson.Jackson; -import ratpack.registry.Registry; -import ratpack.server.RatpackServer; -import ratpack.server.RatpackServerSpec; -import ratpack.server.ServerConfig; - -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; - -public class Application { - - public static void main(String[] args) throws Exception { - - final Action hikariConfigAction = hikariConfig -> { - hikariConfig.setDataSourceClassName("org.h2.jdbcx.JdbcDataSource"); - hikariConfig.addDataSourceProperty("URL", "jdbc:h2:mem:baeldung;INIT=RUNSCRIPT FROM 'classpath:/DDL.sql'"); - }; - - final Action bindingsSpecAction = bindings -> bindings.module(HikariModule.class, hikariConfigAction); - final HttpClient httpClient = HttpClient.of(httpClientSpec -> { - httpClientSpec.poolSize(10) - .connectTimeout(Duration.of(60, ChronoUnit.SECONDS)) - .maxContentLength(ServerConfig.DEFAULT_MAX_CONTENT_LENGTH) - .responseMaxChunkSize(16384) - .readTimeout(Duration.of(60, ChronoUnit.SECONDS)) - .byteBufAllocator(PooledByteBufAllocator.DEFAULT); - }); - final Function registryFunction = Guice.registry(bindingsSpecAction); - - final Action chainAction = chain -> chain.all(new RequestValidatorFilter()) - .get(ctx -> ctx.render("Welcome to baeldung ratpack!!!")) - .get("data/employees", ctx -> ctx.render(Jackson.json(createEmpList()))) - .get(":name", ctx -> ctx.render("Hello " + ctx.getPathTokens() - .get("name") + "!!!")) - .post(":amount", ctx -> ctx.render(" Amount $" + ctx.getPathTokens() - .get("amount") + " added successfully !!!")); - - final Action routerChainAction = routerChain -> { - routerChain.path("redirect", new RedirectHandler()) - .prefix("employee", empChain -> { - empChain.get(":id", new EmployeeHandler()); - }); - }; - final Action ratpackServerSpecAction = serverSpec -> serverSpec.registry(registryFunction) - .registryOf(registrySpec -> { - registrySpec.add(EmployeeRepository.class, new EmployeeRepositoryImpl()); - registrySpec.add(HttpClient.class, httpClient); - }) - .handlers(chain -> chain.insert(routerChainAction) - .insert(chainAction)); - - RatpackServer.start(ratpackServerSpecAction); - } - - private static List createEmpList() { - List employees = new ArrayList<>(); - employees.add(new Employee(1L, "Mr", "John Doe")); - employees.add(new Employee(2L, "Mr", "White Snow")); - return employees; - } - -} +package com.baeldung; + +import com.baeldung.filter.RequestValidatorFilter; +import com.baeldung.handler.EmployeeHandler; +import com.baeldung.handler.RedirectHandler; +import com.baeldung.model.Employee; +import com.baeldung.repository.EmployeeRepository; +import com.baeldung.repository.EmployeeRepositoryImpl; +import com.zaxxer.hikari.HikariConfig; +import io.netty.buffer.PooledByteBufAllocator; +import ratpack.func.Action; +import ratpack.func.Function; +import ratpack.guice.BindingsSpec; +import ratpack.guice.Guice; +import ratpack.handling.Chain; +import ratpack.hikari.HikariModule; +import ratpack.http.client.HttpClient; +import ratpack.jackson.Jackson; +import ratpack.registry.Registry; +import ratpack.server.RatpackServer; +import ratpack.server.RatpackServerSpec; +import ratpack.server.ServerConfig; + +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; + +public class Application { + + public static void main(String[] args) throws Exception { + + final Action hikariConfigAction = hikariConfig -> { + hikariConfig.setDataSourceClassName("org.h2.jdbcx.JdbcDataSource"); + hikariConfig.addDataSourceProperty("URL", "jdbc:h2:mem:baeldung;INIT=RUNSCRIPT FROM 'classpath:/DDL.sql'"); + }; + + final Action bindingsSpecAction = bindings -> bindings.module(HikariModule.class, hikariConfigAction); + final HttpClient httpClient = HttpClient.of(httpClientSpec -> { + httpClientSpec.poolSize(10) + .connectTimeout(Duration.of(60, ChronoUnit.SECONDS)) + .maxContentLength(ServerConfig.DEFAULT_MAX_CONTENT_LENGTH) + .responseMaxChunkSize(16384) + .readTimeout(Duration.of(60, ChronoUnit.SECONDS)) + .byteBufAllocator(PooledByteBufAllocator.DEFAULT); + }); + final Function registryFunction = Guice.registry(bindingsSpecAction); + + final Action chainAction = chain -> chain.all(new RequestValidatorFilter()) + .get(ctx -> ctx.render("Welcome to baeldung ratpack!!!")) + .get("data/employees", ctx -> ctx.render(Jackson.json(createEmpList()))) + .get(":name", ctx -> ctx.render("Hello " + ctx.getPathTokens() + .get("name") + "!!!")) + .post(":amount", ctx -> ctx.render(" Amount $" + ctx.getPathTokens() + .get("amount") + " added successfully !!!")); + + final Action routerChainAction = routerChain -> { + routerChain.path("redirect", new RedirectHandler()) + .prefix("employee", empChain -> { + empChain.get(":id", new EmployeeHandler()); + }); + }; + final Action ratpackServerSpecAction = serverSpec -> serverSpec.registry(registryFunction) + .registryOf(registrySpec -> { + registrySpec.add(EmployeeRepository.class, new EmployeeRepositoryImpl()); + registrySpec.add(HttpClient.class, httpClient); + }) + .handlers(chain -> chain.insert(routerChainAction) + .insert(chainAction)); + + RatpackServer.start(ratpackServerSpecAction); + } + + private static List createEmpList() { + List employees = new ArrayList<>(); + employees.add(new Employee(1L, "Mr", "John Doe")); + employees.add(new Employee(2L, "Mr", "White Snow")); + return employees; + } + +} diff --git a/ratpack/src/main/java/com/baeldung/filter/RequestValidatorFilter.java b/web-modules/ratpack/src/main/java/com/baeldung/filter/RequestValidatorFilter.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/filter/RequestValidatorFilter.java rename to web-modules/ratpack/src/main/java/com/baeldung/filter/RequestValidatorFilter.java diff --git a/ratpack/src/main/java/com/baeldung/guice/Application.java b/web-modules/ratpack/src/main/java/com/baeldung/guice/Application.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/guice/Application.java rename to web-modules/ratpack/src/main/java/com/baeldung/guice/Application.java diff --git a/ratpack/src/main/java/com/baeldung/guice/config/DependencyModule.java b/web-modules/ratpack/src/main/java/com/baeldung/guice/config/DependencyModule.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/guice/config/DependencyModule.java rename to web-modules/ratpack/src/main/java/com/baeldung/guice/config/DependencyModule.java diff --git a/ratpack/src/main/java/com/baeldung/guice/service/DataPumpService.java b/web-modules/ratpack/src/main/java/com/baeldung/guice/service/DataPumpService.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/guice/service/DataPumpService.java rename to web-modules/ratpack/src/main/java/com/baeldung/guice/service/DataPumpService.java diff --git a/ratpack/src/main/java/com/baeldung/guice/service/ServiceFactory.java b/web-modules/ratpack/src/main/java/com/baeldung/guice/service/ServiceFactory.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/guice/service/ServiceFactory.java rename to web-modules/ratpack/src/main/java/com/baeldung/guice/service/ServiceFactory.java diff --git a/ratpack/src/main/java/com/baeldung/guice/service/impl/DataPumpServiceImpl.java b/web-modules/ratpack/src/main/java/com/baeldung/guice/service/impl/DataPumpServiceImpl.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/guice/service/impl/DataPumpServiceImpl.java rename to web-modules/ratpack/src/main/java/com/baeldung/guice/service/impl/DataPumpServiceImpl.java diff --git a/ratpack/src/main/java/com/baeldung/handler/EmployeeHandler.java b/web-modules/ratpack/src/main/java/com/baeldung/handler/EmployeeHandler.java similarity index 97% rename from ratpack/src/main/java/com/baeldung/handler/EmployeeHandler.java rename to web-modules/ratpack/src/main/java/com/baeldung/handler/EmployeeHandler.java index 9a6b79259c..9144e68434 100644 --- a/ratpack/src/main/java/com/baeldung/handler/EmployeeHandler.java +++ b/web-modules/ratpack/src/main/java/com/baeldung/handler/EmployeeHandler.java @@ -1,20 +1,20 @@ -package com.baeldung.handler; - -import com.baeldung.repository.EmployeeRepository; -import com.baeldung.model.Employee; -import ratpack.exec.Promise; -import ratpack.handling.Context; -import ratpack.handling.Handler; - -public class EmployeeHandler implements Handler { - @Override - public void handle(Context ctx) throws Exception { - EmployeeRepository repository = ctx.get(EmployeeRepository.class); - Long id = Long.valueOf(ctx.getPathTokens() - .get("id")); - Promise employeePromise = repository.findEmployeeById(id); - employeePromise.map(employee -> employee.getName()) - .then(name -> ctx.getResponse() - .send(name)); - } -} +package com.baeldung.handler; + +import com.baeldung.repository.EmployeeRepository; +import com.baeldung.model.Employee; +import ratpack.exec.Promise; +import ratpack.handling.Context; +import ratpack.handling.Handler; + +public class EmployeeHandler implements Handler { + @Override + public void handle(Context ctx) throws Exception { + EmployeeRepository repository = ctx.get(EmployeeRepository.class); + Long id = Long.valueOf(ctx.getPathTokens() + .get("id")); + Promise employeePromise = repository.findEmployeeById(id); + employeePromise.map(employee -> employee.getName()) + .then(name -> ctx.getResponse() + .send(name)); + } +} diff --git a/ratpack/src/main/java/com/baeldung/handler/FooHandler.java b/web-modules/ratpack/src/main/java/com/baeldung/handler/FooHandler.java similarity index 95% rename from ratpack/src/main/java/com/baeldung/handler/FooHandler.java rename to web-modules/ratpack/src/main/java/com/baeldung/handler/FooHandler.java index d2c4dbdce5..c80d3a0654 100644 --- a/ratpack/src/main/java/com/baeldung/handler/FooHandler.java +++ b/web-modules/ratpack/src/main/java/com/baeldung/handler/FooHandler.java @@ -1,12 +1,12 @@ -package com.baeldung.handler; - -import ratpack.handling.Context; -import ratpack.handling.Handler; - -public class FooHandler implements Handler { - @Override - public void handle(Context ctx) throws Exception { - ctx.getResponse() - .send("Hello Foo!"); - } -} +package com.baeldung.handler; + +import ratpack.handling.Context; +import ratpack.handling.Handler; + +public class FooHandler implements Handler { + @Override + public void handle(Context ctx) throws Exception { + ctx.getResponse() + .send("Hello Foo!"); + } +} diff --git a/ratpack/src/main/java/com/baeldung/handler/RedirectHandler.java b/web-modules/ratpack/src/main/java/com/baeldung/handler/RedirectHandler.java similarity index 97% rename from ratpack/src/main/java/com/baeldung/handler/RedirectHandler.java rename to web-modules/ratpack/src/main/java/com/baeldung/handler/RedirectHandler.java index c95543a961..2ed4431ef2 100644 --- a/ratpack/src/main/java/com/baeldung/handler/RedirectHandler.java +++ b/web-modules/ratpack/src/main/java/com/baeldung/handler/RedirectHandler.java @@ -1,23 +1,23 @@ -package com.baeldung.handler; - -import ratpack.exec.Promise; -import ratpack.handling.Context; -import ratpack.handling.Handler; -import ratpack.http.client.HttpClient; -import ratpack.http.client.ReceivedResponse; - -import java.net.URI; - -public class RedirectHandler implements Handler { - @Override - public void handle(Context ctx) throws Exception { - HttpClient client = ctx.get(HttpClient.class); - URI uri = URI.create("http://localhost:5050/employee/1"); - Promise responsePromise = client.get(uri); - responsePromise.map(response -> response.getBody() - .getText() - .toUpperCase()) - .then(responseText -> ctx.getResponse() - .send(responseText)); - } +package com.baeldung.handler; + +import ratpack.exec.Promise; +import ratpack.handling.Context; +import ratpack.handling.Handler; +import ratpack.http.client.HttpClient; +import ratpack.http.client.ReceivedResponse; + +import java.net.URI; + +public class RedirectHandler implements Handler { + @Override + public void handle(Context ctx) throws Exception { + HttpClient client = ctx.get(HttpClient.class); + URI uri = URI.create("http://localhost:5050/employee/1"); + Promise responsePromise = client.get(uri); + responsePromise.map(response -> response.getBody() + .getText() + .toUpperCase()) + .then(responseText -> ctx.getResponse() + .send(responseText)); + } } \ No newline at end of file diff --git a/ratpack/src/main/java/com/baeldung/hystrix/HystrixAsyncHttpCommand.java b/web-modules/ratpack/src/main/java/com/baeldung/hystrix/HystrixAsyncHttpCommand.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/hystrix/HystrixAsyncHttpCommand.java rename to web-modules/ratpack/src/main/java/com/baeldung/hystrix/HystrixAsyncHttpCommand.java diff --git a/ratpack/src/main/java/com/baeldung/hystrix/HystrixReactiveHttpCommand.java b/web-modules/ratpack/src/main/java/com/baeldung/hystrix/HystrixReactiveHttpCommand.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/hystrix/HystrixReactiveHttpCommand.java rename to web-modules/ratpack/src/main/java/com/baeldung/hystrix/HystrixReactiveHttpCommand.java diff --git a/ratpack/src/main/java/com/baeldung/hystrix/HystrixSyncHttpCommand.java b/web-modules/ratpack/src/main/java/com/baeldung/hystrix/HystrixSyncHttpCommand.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/hystrix/HystrixSyncHttpCommand.java rename to web-modules/ratpack/src/main/java/com/baeldung/hystrix/HystrixSyncHttpCommand.java diff --git a/ratpack/src/main/java/com/baeldung/hystrix/RatpackHystrixApp.java b/web-modules/ratpack/src/main/java/com/baeldung/hystrix/RatpackHystrixApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/hystrix/RatpackHystrixApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/hystrix/RatpackHystrixApp.java diff --git a/ratpack/src/main/java/com/baeldung/model/Employee.java b/web-modules/ratpack/src/main/java/com/baeldung/model/Employee.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/model/Employee.java rename to web-modules/ratpack/src/main/java/com/baeldung/model/Employee.java diff --git a/ratpack/src/main/java/com/baeldung/model/Movie.java b/web-modules/ratpack/src/main/java/com/baeldung/model/Movie.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/model/Movie.java rename to web-modules/ratpack/src/main/java/com/baeldung/model/Movie.java diff --git a/ratpack/src/main/java/com/baeldung/model/Quote.java b/web-modules/ratpack/src/main/java/com/baeldung/model/Quote.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/model/Quote.java rename to web-modules/ratpack/src/main/java/com/baeldung/model/Quote.java diff --git a/ratpack/src/main/java/com/baeldung/repository/EmployeeRepository.java b/web-modules/ratpack/src/main/java/com/baeldung/repository/EmployeeRepository.java similarity index 95% rename from ratpack/src/main/java/com/baeldung/repository/EmployeeRepository.java rename to web-modules/ratpack/src/main/java/com/baeldung/repository/EmployeeRepository.java index de04c23da5..2b23f91877 100644 --- a/ratpack/src/main/java/com/baeldung/repository/EmployeeRepository.java +++ b/web-modules/ratpack/src/main/java/com/baeldung/repository/EmployeeRepository.java @@ -1,10 +1,10 @@ -package com.baeldung.repository; - -import com.baeldung.model.Employee; -import ratpack.exec.Promise; - -public interface EmployeeRepository { - - Promise findEmployeeById(Long id) throws Exception; - -} +package com.baeldung.repository; + +import com.baeldung.model.Employee; +import ratpack.exec.Promise; + +public interface EmployeeRepository { + + Promise findEmployeeById(Long id) throws Exception; + +} diff --git a/ratpack/src/main/java/com/baeldung/repository/EmployeeRepositoryImpl.java b/web-modules/ratpack/src/main/java/com/baeldung/repository/EmployeeRepositoryImpl.java similarity index 96% rename from ratpack/src/main/java/com/baeldung/repository/EmployeeRepositoryImpl.java rename to web-modules/ratpack/src/main/java/com/baeldung/repository/EmployeeRepositoryImpl.java index 6d15012ccb..122e5206b1 100644 --- a/ratpack/src/main/java/com/baeldung/repository/EmployeeRepositoryImpl.java +++ b/web-modules/ratpack/src/main/java/com/baeldung/repository/EmployeeRepositoryImpl.java @@ -1,25 +1,25 @@ -package com.baeldung.repository; - -import com.baeldung.model.Employee; -import ratpack.exec.Promise; - -import java.util.HashMap; -import java.util.Map; - -public class EmployeeRepositoryImpl implements EmployeeRepository { - - private static final Map EMPLOYEE_MAP = new HashMap<>(); - - public EmployeeRepositoryImpl() { - EMPLOYEE_MAP.put(1L, new Employee(1L, "Ms", "Jane Doe")); - EMPLOYEE_MAP.put(2L, new Employee(2L, "Mr", "NY")); - } - - @Override - public Promise findEmployeeById(Long id) throws Exception { - return Promise.async(downstream -> { - Thread.sleep(500); - downstream.success(EMPLOYEE_MAP.get(id)); - }); - } -} +package com.baeldung.repository; + +import com.baeldung.model.Employee; +import ratpack.exec.Promise; + +import java.util.HashMap; +import java.util.Map; + +public class EmployeeRepositoryImpl implements EmployeeRepository { + + private static final Map EMPLOYEE_MAP = new HashMap<>(); + + public EmployeeRepositoryImpl() { + EMPLOYEE_MAP.put(1L, new Employee(1L, "Ms", "Jane Doe")); + EMPLOYEE_MAP.put(2L, new Employee(2L, "Mr", "NY")); + } + + @Override + public Promise findEmployeeById(Long id) throws Exception { + return Promise.async(downstream -> { + Thread.sleep(500); + downstream.success(EMPLOYEE_MAP.get(id)); + }); + } +} diff --git a/ratpack/src/main/java/com/baeldung/rxjava/RatpackErrorHandlingApp.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackErrorHandlingApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/RatpackErrorHandlingApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackErrorHandlingApp.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/RatpackObserveApp.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackObserveApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/RatpackObserveApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackObserveApp.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/RatpackParallelismApp.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackParallelismApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/RatpackParallelismApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackParallelismApp.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/RatpackPromiseApp.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackPromiseApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/RatpackPromiseApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/RatpackPromiseApp.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/service/MovieObservableService.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/MovieObservableService.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/service/MovieObservableService.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/MovieObservableService.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/service/MoviePromiseService.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/MoviePromiseService.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/service/MoviePromiseService.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/MoviePromiseService.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/service/QuotesService.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/QuotesService.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/service/QuotesService.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/QuotesService.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/service/impl/MovieObservableServiceImpl.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/impl/MovieObservableServiceImpl.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/service/impl/MovieObservableServiceImpl.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/impl/MovieObservableServiceImpl.java diff --git a/ratpack/src/main/java/com/baeldung/rxjava/service/impl/MoviePromiseServiceImpl.java b/web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/impl/MoviePromiseServiceImpl.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/rxjava/service/impl/MoviePromiseServiceImpl.java rename to web-modules/ratpack/src/main/java/com/baeldung/rxjava/service/impl/MoviePromiseServiceImpl.java diff --git a/ratpack/src/main/java/com/baeldung/spring/ArticleList.java b/web-modules/ratpack/src/main/java/com/baeldung/spring/ArticleList.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/spring/ArticleList.java rename to web-modules/ratpack/src/main/java/com/baeldung/spring/ArticleList.java diff --git a/ratpack/src/main/java/com/baeldung/spring/Config.java b/web-modules/ratpack/src/main/java/com/baeldung/spring/Config.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/spring/Config.java rename to web-modules/ratpack/src/main/java/com/baeldung/spring/Config.java diff --git a/ratpack/src/main/java/com/baeldung/spring/Content.java b/web-modules/ratpack/src/main/java/com/baeldung/spring/Content.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/spring/Content.java rename to web-modules/ratpack/src/main/java/com/baeldung/spring/Content.java diff --git a/ratpack/src/main/java/com/baeldung/spring/EmbedRatpackApp.java b/web-modules/ratpack/src/main/java/com/baeldung/spring/EmbedRatpackApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/spring/EmbedRatpackApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/spring/EmbedRatpackApp.java diff --git a/ratpack/src/main/java/com/baeldung/spring/EmbedRatpackStreamsApp.java b/web-modules/ratpack/src/main/java/com/baeldung/spring/EmbedRatpackStreamsApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/spring/EmbedRatpackStreamsApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/spring/EmbedRatpackStreamsApp.java diff --git a/ratpack/src/main/java/com/baeldung/spring/EmbedSpringBootApp.java b/web-modules/ratpack/src/main/java/com/baeldung/spring/EmbedSpringBootApp.java similarity index 100% rename from ratpack/src/main/java/com/baeldung/spring/EmbedSpringBootApp.java rename to web-modules/ratpack/src/main/java/com/baeldung/spring/EmbedSpringBootApp.java diff --git a/ratpack/src/main/resources/DDL.sql b/web-modules/ratpack/src/main/resources/DDL.sql similarity index 100% rename from ratpack/src/main/resources/DDL.sql rename to web-modules/ratpack/src/main/resources/DDL.sql diff --git a/ratpack/src/main/resources/User.sql b/web-modules/ratpack/src/main/resources/User.sql similarity index 100% rename from ratpack/src/main/resources/User.sql rename to web-modules/ratpack/src/main/resources/User.sql diff --git a/ratpack/src/main/resources/logback.xml b/web-modules/ratpack/src/main/resources/logback.xml similarity index 100% rename from ratpack/src/main/resources/logback.xml rename to web-modules/ratpack/src/main/resources/logback.xml diff --git a/ratpack/src/main/resources/public/index.html b/web-modules/ratpack/src/main/resources/public/index.html similarity index 100% rename from ratpack/src/main/resources/public/index.html rename to web-modules/ratpack/src/main/resources/public/index.html diff --git a/ratpack/src/test/groovy/com/baeldung/RatpackGroovySpec.groovy b/web-modules/ratpack/src/test/groovy/com/baeldung/RatpackGroovySpec.groovy similarity index 100% rename from ratpack/src/test/groovy/com/baeldung/RatpackGroovySpec.groovy rename to web-modules/ratpack/src/test/groovy/com/baeldung/RatpackGroovySpec.groovy diff --git a/ratpack/src/test/java/com/baeldung/AppHttpUnitTest.java b/web-modules/ratpack/src/test/java/com/baeldung/AppHttpUnitTest.java similarity index 97% rename from ratpack/src/test/java/com/baeldung/AppHttpUnitTest.java rename to web-modules/ratpack/src/test/java/com/baeldung/AppHttpUnitTest.java index a97516dd74..74517d9a9b 100644 --- a/ratpack/src/test/java/com/baeldung/AppHttpUnitTest.java +++ b/web-modules/ratpack/src/test/java/com/baeldung/AppHttpUnitTest.java @@ -1,58 +1,58 @@ -package com.baeldung; - -import com.baeldung.model.Employee; -import org.junit.Test; -import ratpack.exec.Promise; -import ratpack.func.Action; -import ratpack.handling.Chain; -import ratpack.handling.Handler; -import ratpack.registry.Registry; -import ratpack.test.embed.EmbeddedApp; -import ratpack.test.exec.ExecHarness; - -import static org.junit.Assert.assertEquals; - -public class AppHttpUnitTest { - - @Test - public void givenAnyUri_GetEmployeeFromSameRegistry() throws Exception { - Handler allHandler = ctx -> { - Long id = Long.valueOf(ctx.getPathTokens() - .get("id")); - Employee employee = new Employee(id, "Mr", "NY"); - ctx.next(Registry.single(Employee.class, employee)); - }; - Handler empNameHandler = ctx -> { - Employee employee = ctx.get(Employee.class); - ctx.getResponse() - .send("Name of employee with ID " + employee.getId() + " is " + employee.getName()); - }; - Handler empTitleHandler = ctx -> { - Employee employee = ctx.get(Employee.class); - ctx.getResponse() - .send("Title of employee with ID " + employee.getId() + " is " + employee.getTitle()); - }; - - Action chainAction = chain -> chain.prefix("employee/:id", empChain -> { - empChain.all(allHandler) - .get("name", empNameHandler) - .get("title", empTitleHandler); - }); - EmbeddedApp.fromHandlers(chainAction) - .test(testHttpClient -> { - assertEquals("Name of employee with ID 1 is NY", testHttpClient.get("employee/1/name") - .getBody() - .getText()); - assertEquals("Title of employee with ID 1 is Mr", testHttpClient.get("employee/1/title") - .getBody() - .getText()); - }); - } - - @Test - public void givenSyncDataSource_GetDataFromPromise() throws Exception { - String value = ExecHarness.yieldSingle(execution -> Promise.sync(() -> "Foo")) - .getValueOrThrow(); - assertEquals("Foo", value); - } -} +package com.baeldung; + +import com.baeldung.model.Employee; +import org.junit.Test; +import ratpack.exec.Promise; +import ratpack.func.Action; +import ratpack.handling.Chain; +import ratpack.handling.Handler; +import ratpack.registry.Registry; +import ratpack.test.embed.EmbeddedApp; +import ratpack.test.exec.ExecHarness; + +import static org.junit.Assert.assertEquals; + +public class AppHttpUnitTest { + + @Test + public void givenAnyUri_GetEmployeeFromSameRegistry() throws Exception { + Handler allHandler = ctx -> { + Long id = Long.valueOf(ctx.getPathTokens() + .get("id")); + Employee employee = new Employee(id, "Mr", "NY"); + ctx.next(Registry.single(Employee.class, employee)); + }; + Handler empNameHandler = ctx -> { + Employee employee = ctx.get(Employee.class); + ctx.getResponse() + .send("Name of employee with ID " + employee.getId() + " is " + employee.getName()); + }; + Handler empTitleHandler = ctx -> { + Employee employee = ctx.get(Employee.class); + ctx.getResponse() + .send("Title of employee with ID " + employee.getId() + " is " + employee.getTitle()); + }; + + Action chainAction = chain -> chain.prefix("employee/:id", empChain -> { + empChain.all(allHandler) + .get("name", empNameHandler) + .get("title", empTitleHandler); + }); + EmbeddedApp.fromHandlers(chainAction) + .test(testHttpClient -> { + assertEquals("Name of employee with ID 1 is NY", testHttpClient.get("employee/1/name") + .getBody() + .getText()); + assertEquals("Title of employee with ID 1 is Mr", testHttpClient.get("employee/1/title") + .getBody() + .getText()); + }); + } + + @Test + public void givenSyncDataSource_GetDataFromPromise() throws Exception { + String value = ExecHarness.yieldSingle(execution -> Promise.sync(() -> "Foo")) + .getValueOrThrow(); + assertEquals("Foo", value); + } +} diff --git a/ratpack/src/test/java/com/baeldung/ApplicationIntegrationTest.java b/web-modules/ratpack/src/test/java/com/baeldung/ApplicationIntegrationTest.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/ApplicationIntegrationTest.java rename to web-modules/ratpack/src/test/java/com/baeldung/ApplicationIntegrationTest.java diff --git a/ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppFallbackLiveTest.java b/web-modules/ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppFallbackLiveTest.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppFallbackLiveTest.java rename to web-modules/ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppFallbackLiveTest.java diff --git a/ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppLiveTest.java b/web-modules/ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppLiveTest.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppLiveTest.java rename to web-modules/ratpack/src/test/java/com/baeldung/hystrix/RatpackHystrixAppLiveTest.java diff --git a/ratpack/src/test/java/com/baeldung/ratpack/CompliantPublisher.java b/web-modules/ratpack/src/test/java/com/baeldung/ratpack/CompliantPublisher.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/ratpack/CompliantPublisher.java rename to web-modules/ratpack/src/test/java/com/baeldung/ratpack/CompliantPublisher.java diff --git a/ratpack/src/test/java/com/baeldung/ratpack/LoggingSubscriber.java b/web-modules/ratpack/src/test/java/com/baeldung/ratpack/LoggingSubscriber.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/ratpack/LoggingSubscriber.java rename to web-modules/ratpack/src/test/java/com/baeldung/ratpack/LoggingSubscriber.java diff --git a/ratpack/src/test/java/com/baeldung/ratpack/NonCompliantPublisher.java b/web-modules/ratpack/src/test/java/com/baeldung/ratpack/NonCompliantPublisher.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/ratpack/NonCompliantPublisher.java rename to web-modules/ratpack/src/test/java/com/baeldung/ratpack/NonCompliantPublisher.java diff --git a/ratpack/src/test/java/com/baeldung/ratpack/RatpackStreamsUnitTest.java b/web-modules/ratpack/src/test/java/com/baeldung/ratpack/RatpackStreamsUnitTest.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/ratpack/RatpackStreamsUnitTest.java rename to web-modules/ratpack/src/test/java/com/baeldung/ratpack/RatpackStreamsUnitTest.java diff --git a/ratpack/src/test/java/com/baeldung/spring/EmbedRatpackAppIntegrationTest.java b/web-modules/ratpack/src/test/java/com/baeldung/spring/EmbedRatpackAppIntegrationTest.java similarity index 100% rename from ratpack/src/test/java/com/baeldung/spring/EmbedRatpackAppIntegrationTest.java rename to web-modules/ratpack/src/test/java/com/baeldung/spring/EmbedRatpackAppIntegrationTest.java diff --git a/resteasy/README.md b/web-modules/resteasy/README.md similarity index 100% rename from resteasy/README.md rename to web-modules/resteasy/README.md diff --git a/resteasy/pom.xml b/web-modules/resteasy/pom.xml similarity index 99% rename from resteasy/pom.xml rename to web-modules/resteasy/pom.xml index b12576e583..355dcdb9b5 100644 --- a/resteasy/pom.xml +++ b/web-modules/resteasy/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/resteasy/src/main/java/com/baeldung/client/ServicesInterface.java b/web-modules/resteasy/src/main/java/com/baeldung/client/ServicesInterface.java similarity index 100% rename from resteasy/src/main/java/com/baeldung/client/ServicesInterface.java rename to web-modules/resteasy/src/main/java/com/baeldung/client/ServicesInterface.java diff --git a/resteasy/src/main/java/com/baeldung/filter/CORSFilter.java b/web-modules/resteasy/src/main/java/com/baeldung/filter/CORSFilter.java similarity index 100% rename from resteasy/src/main/java/com/baeldung/filter/CORSFilter.java rename to web-modules/resteasy/src/main/java/com/baeldung/filter/CORSFilter.java diff --git a/resteasy/src/main/java/com/baeldung/model/Movie.java b/web-modules/resteasy/src/main/java/com/baeldung/model/Movie.java similarity index 100% rename from resteasy/src/main/java/com/baeldung/model/Movie.java rename to web-modules/resteasy/src/main/java/com/baeldung/model/Movie.java diff --git a/resteasy/src/main/java/com/baeldung/server/MovieCrudService.java b/web-modules/resteasy/src/main/java/com/baeldung/server/MovieCrudService.java similarity index 100% rename from resteasy/src/main/java/com/baeldung/server/MovieCrudService.java rename to web-modules/resteasy/src/main/java/com/baeldung/server/MovieCrudService.java diff --git a/resteasy/src/main/java/com/baeldung/server/RestEasyServices.java b/web-modules/resteasy/src/main/java/com/baeldung/server/RestEasyServices.java similarity index 100% rename from resteasy/src/main/java/com/baeldung/server/RestEasyServices.java rename to web-modules/resteasy/src/main/java/com/baeldung/server/RestEasyServices.java diff --git a/resteasy/src/main/resources/logback.xml b/web-modules/resteasy/src/main/resources/logback.xml similarity index 100% rename from resteasy/src/main/resources/logback.xml rename to web-modules/resteasy/src/main/resources/logback.xml diff --git a/resteasy/src/main/webapp/WEB-INF/classes/logback.xml b/web-modules/resteasy/src/main/webapp/WEB-INF/classes/logback.xml similarity index 100% rename from resteasy/src/main/webapp/WEB-INF/classes/logback.xml rename to web-modules/resteasy/src/main/webapp/WEB-INF/classes/logback.xml diff --git a/resteasy/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/web-modules/resteasy/src/main/webapp/WEB-INF/jboss-deployment-structure.xml similarity index 100% rename from resteasy/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to web-modules/resteasy/src/main/webapp/WEB-INF/jboss-deployment-structure.xml diff --git a/resteasy/src/main/webapp/WEB-INF/jboss-web.xml b/web-modules/resteasy/src/main/webapp/WEB-INF/jboss-web.xml similarity index 100% rename from resteasy/src/main/webapp/WEB-INF/jboss-web.xml rename to web-modules/resteasy/src/main/webapp/WEB-INF/jboss-web.xml diff --git a/resteasy/src/main/webapp/WEB-INF/web.xml b/web-modules/resteasy/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from resteasy/src/main/webapp/WEB-INF/web.xml rename to web-modules/resteasy/src/main/webapp/WEB-INF/web.xml diff --git a/resteasy/src/main/webapp/script.js b/web-modules/resteasy/src/main/webapp/script.js similarity index 100% rename from resteasy/src/main/webapp/script.js rename to web-modules/resteasy/src/main/webapp/script.js diff --git a/resteasy/src/test/java/com/baeldung/server/RestEasyClientLiveTest.java b/web-modules/resteasy/src/test/java/com/baeldung/server/RestEasyClientLiveTest.java similarity index 100% rename from resteasy/src/test/java/com/baeldung/server/RestEasyClientLiveTest.java rename to web-modules/resteasy/src/test/java/com/baeldung/server/RestEasyClientLiveTest.java diff --git a/resteasy/src/test/resources/com/baeldung/server/movies/batman.json b/web-modules/resteasy/src/test/resources/com/baeldung/server/movies/batman.json similarity index 100% rename from resteasy/src/test/resources/com/baeldung/server/movies/batman.json rename to web-modules/resteasy/src/test/resources/com/baeldung/server/movies/batman.json diff --git a/resteasy/src/test/resources/com/baeldung/server/movies/transformer.json b/web-modules/resteasy/src/test/resources/com/baeldung/server/movies/transformer.json similarity index 100% rename from resteasy/src/test/resources/com/baeldung/server/movies/transformer.json rename to web-modules/resteasy/src/test/resources/com/baeldung/server/movies/transformer.json diff --git a/restx/README.md b/web-modules/restx/README.md similarity index 100% rename from restx/README.md rename to web-modules/restx/README.md diff --git a/restx/data/credentials.json b/web-modules/restx/data/credentials.json similarity index 100% rename from restx/data/credentials.json rename to web-modules/restx/data/credentials.json diff --git a/restx/data/users.json b/web-modules/restx/data/users.json similarity index 100% rename from restx/data/users.json rename to web-modules/restx/data/users.json diff --git a/restx/md.restx.json b/web-modules/restx/md.restx.json similarity index 100% rename from restx/md.restx.json rename to web-modules/restx/md.restx.json diff --git a/restx/pom.xml b/web-modules/restx/pom.xml similarity index 99% rename from restx/pom.xml rename to web-modules/restx/pom.xml index 953b56e2f3..e48ee897e5 100644 --- a/restx/pom.xml +++ b/web-modules/restx/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/restx/src/main/java/restx/demo/AppModule.java b/web-modules/restx/src/main/java/restx/demo/AppModule.java similarity index 100% rename from restx/src/main/java/restx/demo/AppModule.java rename to web-modules/restx/src/main/java/restx/demo/AppModule.java diff --git a/restx/src/main/java/restx/demo/AppServer.java b/web-modules/restx/src/main/java/restx/demo/AppServer.java similarity index 100% rename from restx/src/main/java/restx/demo/AppServer.java rename to web-modules/restx/src/main/java/restx/demo/AppServer.java diff --git a/restx/src/main/java/restx/demo/Roles.java b/web-modules/restx/src/main/java/restx/demo/Roles.java similarity index 100% rename from restx/src/main/java/restx/demo/Roles.java rename to web-modules/restx/src/main/java/restx/demo/Roles.java diff --git a/restx/src/main/java/restx/demo/domain/Message.java b/web-modules/restx/src/main/java/restx/demo/domain/Message.java similarity index 100% rename from restx/src/main/java/restx/demo/domain/Message.java rename to web-modules/restx/src/main/java/restx/demo/domain/Message.java diff --git a/restx/src/main/java/restx/demo/rest/HelloResource.java b/web-modules/restx/src/main/java/restx/demo/rest/HelloResource.java similarity index 100% rename from restx/src/main/java/restx/demo/rest/HelloResource.java rename to web-modules/restx/src/main/java/restx/demo/rest/HelloResource.java diff --git a/restx/src/main/resources/logback.xml b/web-modules/restx/src/main/resources/logback.xml similarity index 100% rename from restx/src/main/resources/logback.xml rename to web-modules/restx/src/main/resources/logback.xml diff --git a/restx/src/main/resources/restx/demo/settings.properties b/web-modules/restx/src/main/resources/restx/demo/settings.properties similarity index 100% rename from restx/src/main/resources/restx/demo/settings.properties rename to web-modules/restx/src/main/resources/restx/demo/settings.properties diff --git a/restx/src/main/webapp/WEB-INF/web.xml b/web-modules/restx/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from restx/src/main/webapp/WEB-INF/web.xml rename to web-modules/restx/src/main/webapp/WEB-INF/web.xml diff --git a/restx/src/test/java/restx/demo/rest/HelloResourceSpecIntegrationTest.java b/web-modules/restx/src/test/java/restx/demo/rest/HelloResourceSpecIntegrationTest.java similarity index 100% rename from restx/src/test/java/restx/demo/rest/HelloResourceSpecIntegrationTest.java rename to web-modules/restx/src/test/java/restx/demo/rest/HelloResourceSpecIntegrationTest.java diff --git a/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml b/web-modules/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml similarity index 100% rename from restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml rename to web-modules/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml diff --git a/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml b/web-modules/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml similarity index 100% rename from restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml rename to web-modules/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml diff --git a/restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml b/web-modules/restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml similarity index 100% rename from restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml rename to web-modules/restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml diff --git a/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml b/web-modules/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml similarity index 100% rename from restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml rename to web-modules/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml diff --git a/restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml b/web-modules/restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml similarity index 100% rename from restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml rename to web-modules/restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml diff --git a/spark-java/README.md b/web-modules/spark-java/README.md similarity index 100% rename from spark-java/README.md rename to web-modules/spark-java/README.md diff --git a/spark-java/pom.xml b/web-modules/spark-java/pom.xml similarity index 96% rename from spark-java/pom.xml rename to web-modules/spark-java/pom.xml index 0ecdd02f6a..da09467212 100644 --- a/spark-java/pom.xml +++ b/web-modules/spark-java/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/HelloWorldService.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/HelloWorldService.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/HelloWorldService.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/HelloWorldService.java diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/SparkRestExample.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/SparkRestExample.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/SparkRestExample.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/SparkRestExample.java diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/StandardResponse.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/StandardResponse.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/StandardResponse.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/StandardResponse.java diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/StatusResponse.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/StatusResponse.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/StatusResponse.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/StatusResponse.java diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/User.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/User.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/User.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/User.java diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/UserException.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/UserException.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/UserException.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/UserException.java diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/UserService.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/UserService.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/UserService.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/UserService.java diff --git a/spark-java/src/main/java/com/baeldung/sparkjava/UserServiceMapImpl.java b/web-modules/spark-java/src/main/java/com/baeldung/sparkjava/UserServiceMapImpl.java similarity index 100% rename from spark-java/src/main/java/com/baeldung/sparkjava/UserServiceMapImpl.java rename to web-modules/spark-java/src/main/java/com/baeldung/sparkjava/UserServiceMapImpl.java diff --git a/spark-java/src/main/resources/logback.xml b/web-modules/spark-java/src/main/resources/logback.xml similarity index 100% rename from spark-java/src/main/resources/logback.xml rename to web-modules/spark-java/src/main/resources/logback.xml diff --git a/struts-2/README.md b/web-modules/struts-2/README.md similarity index 100% rename from struts-2/README.md rename to web-modules/struts-2/README.md diff --git a/struts-2/WebContent/WEB-INF/web.xml b/web-modules/struts-2/WebContent/WEB-INF/web.xml similarity index 100% rename from struts-2/WebContent/WEB-INF/web.xml rename to web-modules/struts-2/WebContent/WEB-INF/web.xml diff --git a/struts-2/WebContent/input.jsp b/web-modules/struts-2/WebContent/input.jsp similarity index 97% rename from struts-2/WebContent/input.jsp rename to web-modules/struts-2/WebContent/input.jsp index 6d80aa3ffd..2d63c22fe3 100644 --- a/struts-2/WebContent/input.jsp +++ b/web-modules/struts-2/WebContent/input.jsp @@ -1,21 +1,21 @@ -<%@ page language="java" contentType="text/html; charset=ISO-8859-1" - pageEncoding="ISO-8859-1"%> - - - - -Baledung Struts - - -
-

Welcome to Baeldung Struts 2 app

-

Which car do you like !!

-

Please choose ferrari or bmw

- - -
- +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Baledung Struts + + +
+

Welcome to Baeldung Struts 2 app

+

Which car do you like !!

+

Please choose ferrari or bmw

+ + +
+ \ No newline at end of file diff --git a/struts-2/WebContent/result.jsp b/web-modules/struts-2/WebContent/result.jsp similarity index 95% rename from struts-2/WebContent/result.jsp rename to web-modules/struts-2/WebContent/result.jsp index 0fe9ea2d1d..d095a493ec 100644 --- a/struts-2/WebContent/result.jsp +++ b/web-modules/struts-2/WebContent/result.jsp @@ -1,11 +1,11 @@ -<%@ page contentType="text/html; charset=UTF-8" %> -<%@ taglib prefix="s" uri="/struts-tags" %> - - -Hello World - - -

Hello Baeldung User

-

You are a

- - +<%@ page contentType="text/html; charset=UTF-8" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + + +Hello World + + +

Hello Baeldung User

+

You are a

+ + diff --git a/struts-2/pom.xml b/web-modules/struts-2/pom.xml similarity index 93% rename from struts-2/pom.xml rename to web-modules/struts-2/pom.xml index 87663cf545..8b19bd530f 100644 --- a/struts-2/pom.xml +++ b/web-modules/struts-2/pom.xml @@ -1,76 +1,75 @@ - - - 4.0.0 - struts-2 - 0.0.1-SNAPSHOT - struts-2 - pom - - - com.baeldung - parent-spring-4 - 0.0.1-SNAPSHOT - ../parent-spring-4 - - - - - org.apache.struts - struts2-core - ${struts2.version} - - - org.apache.struts - struts2-junit-plugin - ${struts2.version} - - - org.apache.struts - struts2-convention-plugin - ${struts2-convention-plugin.version} - - - javax.servlet - javax.servlet-api - ${javax.servlet-api.version} - - - org.springframework - spring-core - ${spring.version} - - - commons-logging - commons-logging - - - - - - - src/main/java - - - src/main/resources - - - - - maven-war-plugin - ${maven-war-plugin.version} - - WebContent - - - - - - - 2.5.5 - 2.5.8 - 4.3.6.RELEASE - - + + + 4.0.0 + struts-2 + struts-2 + pom + + + com.baeldung + parent-spring-4 + 0.0.1-SNAPSHOT + ../../parent-spring-4 + + + + + org.apache.struts + struts2-core + ${struts2.version} + + + org.apache.struts + struts2-junit-plugin + ${struts2.version} + + + org.apache.struts + struts2-convention-plugin + ${struts2-convention-plugin.version} + + + javax.servlet + javax.servlet-api + ${javax.servlet-api.version} + + + org.springframework + spring-core + ${spring.version} + + + commons-logging + commons-logging + + + + + + + src/main/java + + + src/main/resources + + + + + maven-war-plugin + ${maven-war-plugin.version} + + WebContent + + + + + + + 2.5.5 + 2.5.8 + 4.3.6.RELEASE + + \ No newline at end of file diff --git a/struts-2/src/main/java/com/baeldung/struts/CarAction.java b/web-modules/struts-2/src/main/java/com/baeldung/struts/CarAction.java similarity index 96% rename from struts-2/src/main/java/com/baeldung/struts/CarAction.java rename to web-modules/struts-2/src/main/java/com/baeldung/struts/CarAction.java index 478f3b4cc2..b4eacb0fea 100644 --- a/struts-2/src/main/java/com/baeldung/struts/CarAction.java +++ b/web-modules/struts-2/src/main/java/com/baeldung/struts/CarAction.java @@ -1,37 +1,37 @@ -package com.baeldung.struts; - -import org.apache.struts2.convention.annotation.Action; -import org.apache.struts2.convention.annotation.Namespace; -import org.apache.struts2.convention.annotation.Result; - -@Namespace("/tutorial") -@Action("/car") -@Result(name = "success", location = "/result.jsp") -public class CarAction { - private String carName; - private String carMessage; - private CarMessageService carMessageService = new CarMessageService(); - - public String execute() { - System.out.println("inside execute(): carName is" + carName); - this.setCarMessage(this.carMessageService.getMessage(carName)); - return "success"; - } - - public String getCarName() { - return carName; - } - - public void setCarName(String carName) { - this.carName = carName; - } - - public String getCarMessage() { - return carMessage; - } - - public void setCarMessage(String carMessage) { - this.carMessage = carMessage; - } - -} +package com.baeldung.struts; + +import org.apache.struts2.convention.annotation.Action; +import org.apache.struts2.convention.annotation.Namespace; +import org.apache.struts2.convention.annotation.Result; + +@Namespace("/tutorial") +@Action("/car") +@Result(name = "success", location = "/result.jsp") +public class CarAction { + private String carName; + private String carMessage; + private CarMessageService carMessageService = new CarMessageService(); + + public String execute() { + System.out.println("inside execute(): carName is" + carName); + this.setCarMessage(this.carMessageService.getMessage(carName)); + return "success"; + } + + public String getCarName() { + return carName; + } + + public void setCarName(String carName) { + this.carName = carName; + } + + public String getCarMessage() { + return carMessage; + } + + public void setCarMessage(String carMessage) { + this.carMessage = carMessage; + } + +} diff --git a/struts-2/src/main/java/com/baeldung/struts/CarMessageService.java b/web-modules/struts-2/src/main/java/com/baeldung/struts/CarMessageService.java similarity index 96% rename from struts-2/src/main/java/com/baeldung/struts/CarMessageService.java rename to web-modules/struts-2/src/main/java/com/baeldung/struts/CarMessageService.java index 34d3ca3d76..fb674de02e 100644 --- a/struts-2/src/main/java/com/baeldung/struts/CarMessageService.java +++ b/web-modules/struts-2/src/main/java/com/baeldung/struts/CarMessageService.java @@ -1,18 +1,18 @@ -package com.baeldung.struts; - -public class CarMessageService { - - public String getMessage(String carName) { - System.out.println("inside getMessage()" + carName); - if (carName.equalsIgnoreCase("ferrari")){ - return "Ferrari Fan!"; - } - else if (carName.equalsIgnoreCase("bmw")){ - return "BMW Fan!"; - } - else{ - return "please choose ferrari Or bmw"; - } - } - -} +package com.baeldung.struts; + +public class CarMessageService { + + public String getMessage(String carName) { + System.out.println("inside getMessage()" + carName); + if (carName.equalsIgnoreCase("ferrari")){ + return "Ferrari Fan!"; + } + else if (carName.equalsIgnoreCase("bmw")){ + return "BMW Fan!"; + } + else{ + return "please choose ferrari Or bmw"; + } + } + +} diff --git a/struts-2/src/main/resources/logback.xml b/web-modules/struts-2/src/main/resources/logback.xml similarity index 100% rename from struts-2/src/main/resources/logback.xml rename to web-modules/struts-2/src/main/resources/logback.xml diff --git a/struts-2/src/test/java/com/baeldung/struts/test/CarActionTest.java b/web-modules/struts-2/src/test/java/com/baeldung/struts/test/CarActionTest.java similarity index 97% rename from struts-2/src/test/java/com/baeldung/struts/test/CarActionTest.java rename to web-modules/struts-2/src/test/java/com/baeldung/struts/test/CarActionTest.java index 64b640edfb..41dc0a6ceb 100644 --- a/struts-2/src/test/java/com/baeldung/struts/test/CarActionTest.java +++ b/web-modules/struts-2/src/test/java/com/baeldung/struts/test/CarActionTest.java @@ -1,29 +1,29 @@ -//package com.baeldung.struts.test; -// -//import org.apache.struts2.StrutsTestCase; -//import org.junit.Test; -// -//import com.baeldung.struts.CarAction; -//import com.opensymphony.xwork2.ActionProxy; -// -//public class CarActionTest extends StrutsTestCase { -// -// public void testgivenCarOptions_WhenferrariSelected_ThenShowMessage() throws Exception { -// request.setParameter("carName", "ferrari"); -// ActionProxy proxy = getActionProxy("/tutorial/car.action"); -// CarAction carAction = (CarAction) proxy.getAction(); -// String result = proxy.execute(); -// assertEquals(result, "success"); -// assertEquals(carAction.getCarMessage(), "Ferrari Fan!"); -// } -// -// public void testgivenCarOptions_WhenbmwSelected_ThenShowMessage() throws Exception { -// request.setParameter("carName", "bmw"); -// ActionProxy proxy = getActionProxy("/tutorial/car.action"); -// CarAction carAction = (CarAction) proxy.getAction(); -// String result = proxy.execute(); -// assertEquals(result, "success"); -// assertEquals(carAction.getCarMessage(), "BMW Fan!"); -// } -// -//} +//package com.baeldung.struts.test; +// +//import org.apache.struts2.StrutsTestCase; +//import org.junit.Test; +// +//import com.baeldung.struts.CarAction; +//import com.opensymphony.xwork2.ActionProxy; +// +//public class CarActionTest extends StrutsTestCase { +// +// public void testgivenCarOptions_WhenferrariSelected_ThenShowMessage() throws Exception { +// request.setParameter("carName", "ferrari"); +// ActionProxy proxy = getActionProxy("/tutorial/car.action"); +// CarAction carAction = (CarAction) proxy.getAction(); +// String result = proxy.execute(); +// assertEquals(result, "success"); +// assertEquals(carAction.getCarMessage(), "Ferrari Fan!"); +// } +// +// public void testgivenCarOptions_WhenbmwSelected_ThenShowMessage() throws Exception { +// request.setParameter("carName", "bmw"); +// ActionProxy proxy = getActionProxy("/tutorial/car.action"); +// CarAction carAction = (CarAction) proxy.getAction(); +// String result = proxy.execute(); +// assertEquals(result, "success"); +// assertEquals(carAction.getCarMessage(), "BMW Fan!"); +// } +// +//} diff --git a/vraptor/.gitignore b/web-modules/vraptor/.gitignore similarity index 100% rename from vraptor/.gitignore rename to web-modules/vraptor/.gitignore diff --git a/vraptor/README.md b/web-modules/vraptor/README.md similarity index 100% rename from vraptor/README.md rename to web-modules/vraptor/README.md diff --git a/vraptor/pom.xml b/web-modules/vraptor/pom.xml similarity index 98% rename from vraptor/pom.xml rename to web-modules/vraptor/pom.xml index fad17e7aae..ecc6fe3313 100644 --- a/vraptor/pom.xml +++ b/web-modules/vraptor/pom.xml @@ -4,14 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 vraptor - 1.0.0 vraptor war A demo project to start using VRaptor 4 com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/vraptor/src/main/java/com/baeldung/config/UserInfo.java b/web-modules/vraptor/src/main/java/com/baeldung/config/UserInfo.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/config/UserInfo.java rename to web-modules/vraptor/src/main/java/com/baeldung/config/UserInfo.java diff --git a/vraptor/src/main/java/com/baeldung/controllers/AuthController.java b/web-modules/vraptor/src/main/java/com/baeldung/controllers/AuthController.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/controllers/AuthController.java rename to web-modules/vraptor/src/main/java/com/baeldung/controllers/AuthController.java diff --git a/vraptor/src/main/java/com/baeldung/controllers/IndexController.java b/web-modules/vraptor/src/main/java/com/baeldung/controllers/IndexController.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/controllers/IndexController.java rename to web-modules/vraptor/src/main/java/com/baeldung/controllers/IndexController.java diff --git a/vraptor/src/main/java/com/baeldung/controllers/PostController.java b/web-modules/vraptor/src/main/java/com/baeldung/controllers/PostController.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/controllers/PostController.java rename to web-modules/vraptor/src/main/java/com/baeldung/controllers/PostController.java diff --git a/vraptor/src/main/java/com/baeldung/daos/PostDao.java b/web-modules/vraptor/src/main/java/com/baeldung/daos/PostDao.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/daos/PostDao.java rename to web-modules/vraptor/src/main/java/com/baeldung/daos/PostDao.java diff --git a/vraptor/src/main/java/com/baeldung/daos/UserDao.java b/web-modules/vraptor/src/main/java/com/baeldung/daos/UserDao.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/daos/UserDao.java rename to web-modules/vraptor/src/main/java/com/baeldung/daos/UserDao.java diff --git a/vraptor/src/main/java/com/baeldung/models/Post.java b/web-modules/vraptor/src/main/java/com/baeldung/models/Post.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/models/Post.java rename to web-modules/vraptor/src/main/java/com/baeldung/models/Post.java diff --git a/vraptor/src/main/java/com/baeldung/models/User.java b/web-modules/vraptor/src/main/java/com/baeldung/models/User.java similarity index 100% rename from vraptor/src/main/java/com/baeldung/models/User.java rename to web-modules/vraptor/src/main/java/com/baeldung/models/User.java diff --git a/vraptor/src/main/resources/META-INF/beans.xml b/web-modules/vraptor/src/main/resources/META-INF/beans.xml similarity index 100% rename from vraptor/src/main/resources/META-INF/beans.xml rename to web-modules/vraptor/src/main/resources/META-INF/beans.xml diff --git a/vraptor/src/main/resources/database.sql b/web-modules/vraptor/src/main/resources/database.sql similarity index 100% rename from vraptor/src/main/resources/database.sql rename to web-modules/vraptor/src/main/resources/database.sql diff --git a/vraptor/src/main/resources/hibernate.cfg.xml b/web-modules/vraptor/src/main/resources/hibernate.cfg.xml similarity index 100% rename from vraptor/src/main/resources/hibernate.cfg.xml rename to web-modules/vraptor/src/main/resources/hibernate.cfg.xml diff --git a/vraptor/src/main/resources/log4j.xml b/web-modules/vraptor/src/main/resources/log4j.xml similarity index 100% rename from vraptor/src/main/resources/log4j.xml rename to web-modules/vraptor/src/main/resources/log4j.xml diff --git a/vraptor/src/main/resources/templates/auth/login.ftl b/web-modules/vraptor/src/main/resources/templates/auth/login.ftl similarity index 100% rename from vraptor/src/main/resources/templates/auth/login.ftl rename to web-modules/vraptor/src/main/resources/templates/auth/login.ftl diff --git a/vraptor/src/main/resources/templates/auth/register.ftl b/web-modules/vraptor/src/main/resources/templates/auth/register.ftl similarity index 100% rename from vraptor/src/main/resources/templates/auth/register.ftl rename to web-modules/vraptor/src/main/resources/templates/auth/register.ftl diff --git a/vraptor/src/main/resources/templates/index.ftl b/web-modules/vraptor/src/main/resources/templates/index.ftl similarity index 100% rename from vraptor/src/main/resources/templates/index.ftl rename to web-modules/vraptor/src/main/resources/templates/index.ftl diff --git a/vraptor/src/main/resources/templates/posts/add.ftl b/web-modules/vraptor/src/main/resources/templates/posts/add.ftl similarity index 100% rename from vraptor/src/main/resources/templates/posts/add.ftl rename to web-modules/vraptor/src/main/resources/templates/posts/add.ftl diff --git a/vraptor/src/main/resources/templates/view.ftl b/web-modules/vraptor/src/main/resources/templates/view.ftl similarity index 100% rename from vraptor/src/main/resources/templates/view.ftl rename to web-modules/vraptor/src/main/resources/templates/view.ftl diff --git a/vraptor/src/main/webapp/META-INF/MANIFEST.MF b/web-modules/vraptor/src/main/webapp/META-INF/MANIFEST.MF similarity index 100% rename from vraptor/src/main/webapp/META-INF/MANIFEST.MF rename to web-modules/vraptor/src/main/webapp/META-INF/MANIFEST.MF diff --git a/vraptor/src/main/webapp/WEB-INF/jsp/index/index.jsp b/web-modules/vraptor/src/main/webapp/WEB-INF/jsp/index/index.jsp similarity index 100% rename from vraptor/src/main/webapp/WEB-INF/jsp/index/index.jsp rename to web-modules/vraptor/src/main/webapp/WEB-INF/jsp/index/index.jsp diff --git a/vraptor/src/main/webapp/WEB-INF/web.xml b/web-modules/vraptor/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from vraptor/src/main/webapp/WEB-INF/web.xml rename to web-modules/vraptor/src/main/webapp/WEB-INF/web.xml diff --git a/vraptor/src/main/webapp/css/clean-blog.css b/web-modules/vraptor/src/main/webapp/css/clean-blog.css similarity index 100% rename from vraptor/src/main/webapp/css/clean-blog.css rename to web-modules/vraptor/src/main/webapp/css/clean-blog.css diff --git a/vraptor/src/main/webapp/css/clean-blog.min.css b/web-modules/vraptor/src/main/webapp/css/clean-blog.min.css similarity index 100% rename from vraptor/src/main/webapp/css/clean-blog.min.css rename to web-modules/vraptor/src/main/webapp/css/clean-blog.min.css diff --git a/vraptor/src/main/webapp/img/about-bg.jpg b/web-modules/vraptor/src/main/webapp/img/about-bg.jpg similarity index 100% rename from vraptor/src/main/webapp/img/about-bg.jpg rename to web-modules/vraptor/src/main/webapp/img/about-bg.jpg diff --git a/vraptor/src/main/webapp/img/contact-bg.jpg b/web-modules/vraptor/src/main/webapp/img/contact-bg.jpg similarity index 100% rename from vraptor/src/main/webapp/img/contact-bg.jpg rename to web-modules/vraptor/src/main/webapp/img/contact-bg.jpg diff --git a/vraptor/src/main/webapp/img/home-bg.jpg b/web-modules/vraptor/src/main/webapp/img/home-bg.jpg similarity index 100% rename from vraptor/src/main/webapp/img/home-bg.jpg rename to web-modules/vraptor/src/main/webapp/img/home-bg.jpg diff --git a/vraptor/src/main/webapp/img/post-bg.jpg b/web-modules/vraptor/src/main/webapp/img/post-bg.jpg similarity index 100% rename from vraptor/src/main/webapp/img/post-bg.jpg rename to web-modules/vraptor/src/main/webapp/img/post-bg.jpg diff --git a/vraptor/src/main/webapp/img/post-sample-image.jpg b/web-modules/vraptor/src/main/webapp/img/post-sample-image.jpg similarity index 100% rename from vraptor/src/main/webapp/img/post-sample-image.jpg rename to web-modules/vraptor/src/main/webapp/img/post-sample-image.jpg diff --git a/vraptor/src/main/webapp/js/clean-blog.js b/web-modules/vraptor/src/main/webapp/js/clean-blog.js similarity index 100% rename from vraptor/src/main/webapp/js/clean-blog.js rename to web-modules/vraptor/src/main/webapp/js/clean-blog.js diff --git a/vraptor/src/main/webapp/js/clean-blog.min.js b/web-modules/vraptor/src/main/webapp/js/clean-blog.min.js similarity index 100% rename from vraptor/src/main/webapp/js/clean-blog.min.js rename to web-modules/vraptor/src/main/webapp/js/clean-blog.min.js diff --git a/vraptor/src/main/webapp/js/contact_me.js b/web-modules/vraptor/src/main/webapp/js/contact_me.js similarity index 100% rename from vraptor/src/main/webapp/js/contact_me.js rename to web-modules/vraptor/src/main/webapp/js/contact_me.js diff --git a/vraptor/src/main/webapp/js/jqBootstrapValidation.js b/web-modules/vraptor/src/main/webapp/js/jqBootstrapValidation.js similarity index 100% rename from vraptor/src/main/webapp/js/jqBootstrapValidation.js rename to web-modules/vraptor/src/main/webapp/js/jqBootstrapValidation.js diff --git a/vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.css b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.css similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.css rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.css diff --git a/vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.min.css b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.min.css similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.min.css rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/css/bootstrap.min.css diff --git a/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot diff --git a/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg diff --git a/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf diff --git a/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff diff --git a/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 diff --git a/vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.js b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.js similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.js rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.js diff --git a/vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.min.js b/web-modules/vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.min.js similarity index 100% rename from vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.min.js rename to web-modules/vraptor/src/main/webapp/vendor/bootstrap/js/bootstrap.min.js diff --git a/vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.css b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.css similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.css rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.css diff --git a/vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.min.css b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.min.css similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.min.css rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/css/font-awesome.min.css diff --git a/vraptor/src/main/webapp/vendor/font-awesome/fonts/FontAwesome.otf b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/FontAwesome.otf similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/fonts/FontAwesome.otf rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/FontAwesome.otf diff --git a/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.eot b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.eot similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.eot rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.eot diff --git a/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.svg b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.svg similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.svg rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.svg diff --git a/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.ttf b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.ttf similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.ttf rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.ttf diff --git a/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff diff --git a/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff2 b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff2 similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff2 rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/fonts/fontawesome-webfont.woff2 diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/animated.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/animated.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/animated.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/animated.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/bordered-pulled.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/bordered-pulled.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/bordered-pulled.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/bordered-pulled.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/core.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/core.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/core.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/core.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/fixed-width.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/fixed-width.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/fixed-width.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/fixed-width.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/font-awesome.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/font-awesome.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/font-awesome.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/font-awesome.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/icons.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/icons.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/icons.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/icons.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/larger.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/larger.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/larger.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/larger.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/list.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/list.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/list.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/list.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/mixins.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/mixins.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/mixins.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/mixins.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/path.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/path.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/path.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/path.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/rotated-flipped.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/rotated-flipped.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/rotated-flipped.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/rotated-flipped.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/screen-reader.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/screen-reader.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/screen-reader.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/screen-reader.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/stacked.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/stacked.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/stacked.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/stacked.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/less/variables.less b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/variables.less similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/less/variables.less rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/less/variables.less diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_animated.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_animated.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_animated.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_animated.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_bordered-pulled.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_bordered-pulled.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_bordered-pulled.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_bordered-pulled.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_core.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_core.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_core.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_core.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_fixed-width.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_fixed-width.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_fixed-width.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_fixed-width.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_icons.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_icons.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_icons.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_icons.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_larger.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_larger.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_larger.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_larger.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_list.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_list.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_list.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_list.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_mixins.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_mixins.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_mixins.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_mixins.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_path.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_path.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_path.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_path.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_rotated-flipped.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_rotated-flipped.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_rotated-flipped.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_rotated-flipped.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_screen-reader.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_screen-reader.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_screen-reader.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_screen-reader.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_stacked.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_stacked.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_stacked.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_stacked.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/_variables.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_variables.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/_variables.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/_variables.scss diff --git a/vraptor/src/main/webapp/vendor/font-awesome/scss/font-awesome.scss b/web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/font-awesome.scss similarity index 100% rename from vraptor/src/main/webapp/vendor/font-awesome/scss/font-awesome.scss rename to web-modules/vraptor/src/main/webapp/vendor/font-awesome/scss/font-awesome.scss diff --git a/vraptor/src/main/webapp/vendor/jquery/jquery.js b/web-modules/vraptor/src/main/webapp/vendor/jquery/jquery.js similarity index 100% rename from vraptor/src/main/webapp/vendor/jquery/jquery.js rename to web-modules/vraptor/src/main/webapp/vendor/jquery/jquery.js diff --git a/vraptor/src/main/webapp/vendor/jquery/jquery.min.js b/web-modules/vraptor/src/main/webapp/vendor/jquery/jquery.min.js similarity index 100% rename from vraptor/src/main/webapp/vendor/jquery/jquery.min.js rename to web-modules/vraptor/src/main/webapp/vendor/jquery/jquery.min.js diff --git a/wicket/README.md b/web-modules/wicket/README.md similarity index 100% rename from wicket/README.md rename to web-modules/wicket/README.md diff --git a/wicket/pom.xml b/web-modules/wicket/pom.xml similarity index 98% rename from wicket/pom.xml rename to web-modules/wicket/pom.xml index 55baf64032..c9dac11379 100644 --- a/wicket/pom.xml +++ b/web-modules/wicket/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + web-modules 1.0.0-SNAPSHOT diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.html b/web-modules/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.html similarity index 100% rename from wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.html rename to web-modules/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.html diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.java b/web-modules/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.java similarity index 100% rename from wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.java rename to web-modules/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorld.java diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorldApplication.java b/web-modules/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorldApplication.java similarity index 100% rename from wicket/src/main/java/com/baeldung/wicket/examples/HelloWorldApplication.java rename to web-modules/wicket/src/main/java/com/baeldung/wicket/examples/HelloWorldApplication.java diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.html b/web-modules/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.html similarity index 100% rename from wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.html rename to web-modules/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.html diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java b/web-modules/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java similarity index 100% rename from wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java rename to web-modules/wicket/src/main/java/com/baeldung/wicket/examples/cafeaddress/CafeAddress.java diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.html b/web-modules/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.html similarity index 100% rename from wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.html rename to web-modules/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.html diff --git a/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java b/web-modules/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java similarity index 100% rename from wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java rename to web-modules/wicket/src/main/java/com/baeldung/wicket/examples/helloworld/HelloWorld.java diff --git a/wicket/src/main/resources/logback.xml b/web-modules/wicket/src/main/resources/logback.xml similarity index 100% rename from wicket/src/main/resources/logback.xml rename to web-modules/wicket/src/main/resources/logback.xml diff --git a/wicket/src/main/test/java/com/baeldung/wicket/examples/HomePageIntegrationTest.java b/web-modules/wicket/src/main/test/java/com/baeldung/wicket/examples/HomePageIntegrationTest.java similarity index 100% rename from wicket/src/main/test/java/com/baeldung/wicket/examples/HomePageIntegrationTest.java rename to web-modules/wicket/src/main/test/java/com/baeldung/wicket/examples/HomePageIntegrationTest.java diff --git a/wicket/src/main/webapp/WEB-INF/web.xml b/web-modules/wicket/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from wicket/src/main/webapp/WEB-INF/web.xml rename to web-modules/wicket/src/main/webapp/WEB-INF/web.xml From 94ecd00052ebf81af46e8f39675fbe2c79d66fce Mon Sep 17 00:00:00 2001 From: Shaun Phillips <61982125+ShaPhi7@users.noreply.github.com> Date: Sun, 21 Aug 2022 15:32:00 +0100 Subject: [PATCH 42/73] CS-868 Add Luhn Algorithm (#12594) * CS-868 Add Luhn Algorithm --- .../algorithms-miscellaneous-7/README.md | 3 + .../algorithms-miscellaneous-7/pom.xml | 16 ++++ .../baeldung/algorithms/luhn/LuhnChecker.java | 73 +++++++++++++++++++ .../src/main/resources/logback.xml | 13 ++++ .../algorithms/luhn/LuhnCheckerUnitTest.java | 63 ++++++++++++++++ algorithms-modules/pom.xml | 1 + 6 files changed, 169 insertions(+) create mode 100644 algorithms-modules/algorithms-miscellaneous-7/README.md create mode 100644 algorithms-modules/algorithms-miscellaneous-7/pom.xml create mode 100644 algorithms-modules/algorithms-miscellaneous-7/src/main/java/com/baeldung/algorithms/luhn/LuhnChecker.java create mode 100644 algorithms-modules/algorithms-miscellaneous-7/src/main/resources/logback.xml create mode 100644 algorithms-modules/algorithms-miscellaneous-7/src/test/java/com/baeldung/algorithms/luhn/LuhnCheckerUnitTest.java diff --git a/algorithms-modules/algorithms-miscellaneous-7/README.md b/algorithms-modules/algorithms-miscellaneous-7/README.md new file mode 100644 index 0000000000..d220afd678 --- /dev/null +++ b/algorithms-modules/algorithms-miscellaneous-7/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- More articles: [[<-- prev]](/algorithms-miscellaneous-6) diff --git a/algorithms-modules/algorithms-miscellaneous-7/pom.xml b/algorithms-modules/algorithms-miscellaneous-7/pom.xml new file mode 100644 index 0000000000..3703ea5a16 --- /dev/null +++ b/algorithms-modules/algorithms-miscellaneous-7/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + algorithms-miscellaneous-7 + 0.0.1-SNAPSHOT + algorithms-miscellaneous-7 + + + com.baeldung + algorithms-modules + 1.0.0-SNAPSHOT + + + \ No newline at end of file diff --git a/algorithms-modules/algorithms-miscellaneous-7/src/main/java/com/baeldung/algorithms/luhn/LuhnChecker.java b/algorithms-modules/algorithms-miscellaneous-7/src/main/java/com/baeldung/algorithms/luhn/LuhnChecker.java new file mode 100644 index 0000000000..8f8bed4261 --- /dev/null +++ b/algorithms-modules/algorithms-miscellaneous-7/src/main/java/com/baeldung/algorithms/luhn/LuhnChecker.java @@ -0,0 +1,73 @@ +package com.baeldung.algorithms.luhn; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class LuhnChecker { + + private static final Logger LOGGER = LoggerFactory.getLogger(LuhnChecker.class); + + /* + * Starting from the rightmost digit, we add all the digits together, performing + * a special step for every second digit. + * + * If the result is not divisible by 10, then the card number must not be valid. + * + * We can form a number that passes the Luhn Check by subtracting the result of + * the Luhn algorithm from 10. + * + * This is how the final digit of a credit card is calculated. + */ + public static boolean checkLuhn(String cardNumber) { + int sum = 0; + + try { + for (int i = cardNumber.length() - 1; i >= 0; i--) { + int digit = Integer.parseInt(cardNumber.substring(i, i + 1)); + + if ((cardNumber.length() - i) % 2 == 0) { + digit = doubleAndSumDigits(digit); + } + + sum += digit; + } + + LOGGER.info("Luhn Algorithm sum of digits is " + sum); + + } catch (NumberFormatException e) { + LOGGER.error("NumberFormatException - Card number probably contained some non-numeric characters, returning false"); + return false; + } catch (NullPointerException e) { + LOGGER.error("Null pointer - Card number was probably null, returning false"); + return false; + } + + boolean result = sum % 10 == 0; + + LOGGER.info("Luhn check result (sum divisible by 10): " + result); + + return result; + } + + /* + * We apply this method to every second number from the right of the card + * number. First, we double the digit, then we sum the digits. + * + * Note: subtracting 9 is equivalent to doubling and summing digits (when + * starting with a single digit) 0-4 -> produce single digit when doubled + * 5*2 = 10 -> 1+0 = 1 = 10-9 + * 6*2 = 12 -> 1+3 = 3 = 12-9 + * 7*2 = 14 -> 1+5 = 5 = 14-9 + * 8*2 = 16 -> 1+7 = 7 = 16-9 + * 9*2 = 18 -> 1+9 = 9 = 18-9 + */ + public static int doubleAndSumDigits(int digit) { + int ret = digit * 2; + + if (ret > 9) { + ret -= 9; + } + + return ret; + } +} diff --git a/algorithms-modules/algorithms-miscellaneous-7/src/main/resources/logback.xml b/algorithms-modules/algorithms-miscellaneous-7/src/main/resources/logback.xml new file mode 100644 index 0000000000..7d900d8ea8 --- /dev/null +++ b/algorithms-modules/algorithms-miscellaneous-7/src/main/resources/logback.xml @@ -0,0 +1,13 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + \ No newline at end of file diff --git a/algorithms-modules/algorithms-miscellaneous-7/src/test/java/com/baeldung/algorithms/luhn/LuhnCheckerUnitTest.java b/algorithms-modules/algorithms-miscellaneous-7/src/test/java/com/baeldung/algorithms/luhn/LuhnCheckerUnitTest.java new file mode 100644 index 0000000000..dd1b184b81 --- /dev/null +++ b/algorithms-modules/algorithms-miscellaneous-7/src/test/java/com/baeldung/algorithms/luhn/LuhnCheckerUnitTest.java @@ -0,0 +1,63 @@ +package com.baeldung.algorithms.luhn; + +import org.junit.Assert; +import org.junit.Test; + +public class LuhnCheckerUnitTest { + + @Test + public void whenCardNumberDoesMeetLuhnCriteria_thenCheckLuhnReturnsTrue() { + String cardNumber = "8649"; + boolean result = LuhnChecker.checkLuhn(cardNumber); + Assert.assertTrue(result); + } + + @Test + public void whenCardNumberDoesNotMeetLuhnCriteria_thenCheckLuhnReturnsFalse() { + String cardNumber = "8642"; + boolean result = LuhnChecker.checkLuhn(cardNumber); + Assert.assertFalse(result); + } + + @Test + public void whenCardNumberHasNoSecondDigits_thenCheckLuhnCalculatesCorrectly() { + String cardNumber = "0505050505050505"; + boolean result = LuhnChecker.checkLuhn(cardNumber); + Assert.assertTrue(result); + } + + @Test + public void whenCardNumberHasSecondDigits_thenCheckLuhnCalculatesCorrectly() { + String cardNumber = "75757575757575"; + boolean result = LuhnChecker.checkLuhn(cardNumber); + Assert.assertTrue(result); + } + + @Test + public void whenDoubleAndSumDigitsIsCalled_thenOutputIsCorrect() { + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(0), 0); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(1), 2); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(2), 4); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(3), 6); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(4), 8); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(5), 1); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(6), 3); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(7), 5); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(8), 7); + Assert.assertEquals(LuhnChecker.doubleAndSumDigits(9), 9); + } + + @Test + public void whenCardNumberNonNumeric_thenCheckLuhnReturnsFalse() { + String cardNumber = "test"; + boolean result = LuhnChecker.checkLuhn(cardNumber); + Assert.assertFalse(result); + } + + @Test + public void whenCardNumberIsNull_thenCheckLuhnReturnsFalse() { + String cardNumber = null; + boolean result = LuhnChecker.checkLuhn(cardNumber); + Assert.assertFalse(result); + } +} diff --git a/algorithms-modules/pom.xml b/algorithms-modules/pom.xml index 4ba819cfe3..4a5f36c944 100644 --- a/algorithms-modules/pom.xml +++ b/algorithms-modules/pom.xml @@ -21,6 +21,7 @@ algorithms-miscellaneous-4 algorithms-miscellaneous-5 algorithms-miscellaneous-6 + algorithms-miscellaneous-7 algorithms-searching algorithms-sorting algorithms-sorting-2 From a20006b451ce1dd0da499cf3e3612131360d74c9 Mon Sep 17 00:00:00 2001 From: Kai Yuan Date: Sun, 21 Aug 2022 18:43:45 +0200 Subject: [PATCH 43/73] toggle boolean (#12618) --- .../baeldung/toggleboolean/ToggleBoolean.java | 10 ++++ .../toggleboolean/ToggleBooleanUnitTest.java | 60 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 core-java-modules/core-java-lang-5/src/main/java/com/baeldung/toggleboolean/ToggleBoolean.java create mode 100644 core-java-modules/core-java-lang-5/src/test/java/com/baeldung/toggleboolean/ToggleBooleanUnitTest.java diff --git a/core-java-modules/core-java-lang-5/src/main/java/com/baeldung/toggleboolean/ToggleBoolean.java b/core-java-modules/core-java-lang-5/src/main/java/com/baeldung/toggleboolean/ToggleBoolean.java new file mode 100644 index 0000000000..e68ff31d05 --- /dev/null +++ b/core-java-modules/core-java-lang-5/src/main/java/com/baeldung/toggleboolean/ToggleBoolean.java @@ -0,0 +1,10 @@ +package com.baeldung.toggleboolean; + +public class ToggleBoolean { + public static Boolean toggle(Boolean b) { + if (b == null) { + return b; + } + return !b; + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-lang-5/src/test/java/com/baeldung/toggleboolean/ToggleBooleanUnitTest.java b/core-java-modules/core-java-lang-5/src/test/java/com/baeldung/toggleboolean/ToggleBooleanUnitTest.java new file mode 100644 index 0000000000..2490281477 --- /dev/null +++ b/core-java-modules/core-java-lang-5/src/test/java/com/baeldung/toggleboolean/ToggleBooleanUnitTest.java @@ -0,0 +1,60 @@ +package com.baeldung.toggleboolean; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +class ToggleBooleanUnitTest { + @Test + void givenPrimitiveBoolean_whenUsingNotOperator_shouldToggleTheBoolean() { + boolean b = true; + b = !b; + assertFalse(b); + + b = !b; + assertTrue(b); + } + + @Test + void givenNullBoxedBoolean_whenUsingNotOperator_shouldThrowNPE() { + assertThatThrownBy(() -> { + Boolean b = null; + b = !b; + }).isInstanceOf(NullPointerException.class); + } + + @Test + void givenPrimitiveBoolean_whenUsingXorOperator_shouldToggleTheBoolean() { + boolean b = true; + b ^= true; + assertFalse(b); + + b ^= true; + assertTrue(b); + } + + @Test + void givenBooleanObj_whenToggle_shouldGetExpectedResult() { + //boxed Boolean + Boolean b = true; + b = ToggleBoolean.toggle(b); + assertFalse(b); + + b = ToggleBoolean.toggle(b); + assertTrue(b); + + b = null; + b = ToggleBoolean.toggle(b); + assertNull(b); + + //primitive boolean + boolean bb = true; + bb = ToggleBoolean.toggle(bb); + assertFalse(bb); + bb = ToggleBoolean.toggle(bb); + assertTrue(bb); + } +} From 26483e62322c5ab4680114d1cf60ea7bb8d0f677 Mon Sep 17 00:00:00 2001 From: "thibault.faure" Date: Mon, 22 Aug 2022 00:00:29 +0200 Subject: [PATCH 44/73] BAEL-4345 add code for the swagger specify two responses with the same code article --- .../spring-boot-swagger-2/README.md | 2 + .../spring-boot-swagger-2/pom.xml | 75 +++++++++++++++++++ .../baeldung/tworesponses/Application.java | 13 ++++ .../com/baeldung/tworesponses/Config.java | 27 +++++++ .../src/main/resources/application.properties | 2 + .../src/main/resources/static/api_2.yaml | 45 +++++++++++ .../src/main/resources/static/api_3.yaml | 44 +++++++++++ 7 files changed, 208 insertions(+) create mode 100644 spring-boot-modules/spring-boot-swagger-2/README.md create mode 100644 spring-boot-modules/spring-boot-swagger-2/pom.xml create mode 100644 spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Application.java create mode 100644 spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Config.java create mode 100644 spring-boot-modules/spring-boot-swagger-2/src/main/resources/application.properties create mode 100644 spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_2.yaml create mode 100644 spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_3.yaml diff --git a/spring-boot-modules/spring-boot-swagger-2/README.md b/spring-boot-modules/spring-boot-swagger-2/README.md new file mode 100644 index 0000000000..97c76dc431 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-2/README.md @@ -0,0 +1,2 @@ +## Relevant Articles: + diff --git a/spring-boot-modules/spring-boot-swagger-2/pom.xml b/spring-boot-modules/spring-boot-swagger-2/pom.xml new file mode 100644 index 0000000000..44555b9e43 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-2/pom.xml @@ -0,0 +1,75 @@ + + + 4.0.0 + spring-boot-swagger-2 + 0.1.0-SNAPSHOT + spring-boot-swagger-2 + jar + Module For Spring Boot Swagger + + + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + + + + 3.0.0 + 3.0.34 + 1.6.10 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + io.springfox + springfox-oas + ${springfox.version} + + + io.springfox + springfox-swagger-ui + ${springfox.version} + + + javax.validation + validation-api + + + + + + + io.swagger.codegen.v3 + swagger-codegen-maven-plugin + ${swagger-codegen-maven-plugin.version} + + + + generate + + + ${project.basedir}/src/main/resources/static/api_3.yaml + spring + + true + true + + + + + + + + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Application.java b/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Application.java new file mode 100644 index 0000000000..0932e42747 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Application.java @@ -0,0 +1,13 @@ +package com.baeldung.tworesponses; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String args[]) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Config.java b/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Config.java new file mode 100644 index 0000000000..9238a16698 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-2/src/main/java/com/baeldung/tworesponses/Config.java @@ -0,0 +1,27 @@ +package com.baeldung.tworesponses; + +import org.springdoc.core.SpringDocConfigProperties; +import org.springdoc.core.SpringDocConfiguration; +import org.springdoc.core.providers.ObjectMapperProvider; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class Config { + + @Bean + SpringDocConfiguration springDocConfiguration() { + return new SpringDocConfiguration(); + } + + @Bean + SpringDocConfigProperties springDocConfigProperties() { + return new SpringDocConfigProperties(); + } + + @Bean + ObjectMapperProvider objectMapperProvider(SpringDocConfigProperties springDocConfigProperties) { + return new ObjectMapperProvider(springDocConfigProperties); + } + +} diff --git a/spring-boot-modules/spring-boot-swagger-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-swagger-2/src/main/resources/application.properties new file mode 100644 index 0000000000..03302ebb1c --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-2/src/main/resources/application.properties @@ -0,0 +1,2 @@ +springdoc.api-docs.enabled=false +springdoc.swagger-ui.url=/api_3.yaml diff --git a/spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_2.yaml b/spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_2.yaml new file mode 100644 index 0000000000..c9f7f25d44 --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_2.yaml @@ -0,0 +1,45 @@ +swagger: 2.0.0 +info: + title: Demo api + description: Demo api for the article 'specify two responses with same code based on optional parameter' + version: 0.1.0 +paths: + /vehicle: + get: + responses: + '200': + description: Get a vehicle. Can contain either a Car or a Bike + schema: + $ref: '#/definitions/CarOrBike' + examples: + application/json: + owner: baeldung + plate: AEX305 + speed: +definitions: + Car: + type: object + properties: + owner: + type: string + plate: + type: string + Bike: + type: object + properties: + owner: + type: string + speed: + type: integer + CarOrBike: + description: a car will have an owner and a plate, whereas a bike has an owner and a speed + type: object + required: + - owner + properties: + owner: + type: string + plate: + type: string + speed: + type: integer diff --git a/spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_3.yaml b/spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_3.yaml new file mode 100644 index 0000000000..12de1be39a --- /dev/null +++ b/spring-boot-modules/spring-boot-swagger-2/src/main/resources/static/api_3.yaml @@ -0,0 +1,44 @@ +openapi: 3.0.0 +info: + title: Demo api + description: Demo api for the article 'specify two responses with same code based on optional parameter' + version: 0.1.0 +paths: + /vehicle: + get: + responses: + '200': + description: Get a vehicle + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Car' + - $ref: '#/components/schemas/Bike' + examples: + car: + summary: an example of car + value: + owner: baeldung + plate: AEX305 + bike: + summary: an example of bike + value: + owner: john doe + speed: 25 +components: + schemas: + Car: + type: object + properties: + owner: + type: string + plate: + type: string + Bike: + type: object + properties: + owner: + type: string + speed: + type: integer From b9789c23f0cacbc5fe1ec9ed90adb39893e1154e Mon Sep 17 00:00:00 2001 From: Haroon Khan Date: Mon, 22 Aug 2022 18:17:32 +0100 Subject: [PATCH 45/73] [JAVA-13976] Upgrade Spring Boot to 2.7.2 (#12603) * [JAVA-13976] Upgrade Spring Boot to 2.7.2 * [JAVA-13976] Fix failing test due to incorrect Jackson version --- .../graphql-error-handling/pom.xml | 6 +-- .../exception/GraphQLErrorAdapter.java | 4 +- mustache/pom.xml | 2 +- .../SpringMustacheApplication.java | 12 ++--- parent-boot-2/pom.xml | 4 +- persistence-modules/flyway/pom.xml | 5 +- .../spring-boot-persistence-mongodb-2/pom.xml | 5 -- .../src/main/resources/application.properties | 4 +- .../spring-data-mongodb-reactive/pom.xml | 2 - .../src/main/resources/application.yml | 2 + .../src/test/resources/application.yml | 3 +- pom.xml | 4 +- .../spring-boot-data-2/pom.xml | 2 +- .../scanner/AnnotationScannerApp.java | 16 ++++++ .../{ => jobrunr}/JobRunrSpringBootApp.java | 2 +- .../config/StorageProviderConfig.java | 2 +- .../main/java/com/baeldung/sprq/SpqrApp.java | 13 +++++ .../SampleAnnotationScannerUnitTest.java | 2 +- .../com/baeldung/jobrunr/JobRunrLiveTest.java | 3 -- .../GraphqlControllerIntegrationTest.java | 2 +- .../baeldung/spring/PersistenceConfig.java | 2 +- .../web/error/ErrorHandlingLiveTest.java | 3 +- spring-cloud-modules/pom.xml | 4 +- spring-cloud-modules/spring-cloud-bus/pom.xml | 4 +- .../spring-cloud-config/pom.xml | 4 +- .../kubernetes-guide/client-service/pom.xml | 7 ++- .../cloud/kubernetes/client/Application.java | 11 +--- .../src/main/resources/application.yaml | 11 +++- .../spring-cloud-kubernetes/pom.xml | 2 +- .../spring-cloud-openfeign/pom.xml | 4 +- .../spring-cloud-ribbon-client/pom.xml | 4 +- .../spring-cloud-security/pom.xml | 4 +- .../spring-cloud-zuul/pom.xml | 4 +- spring-jenkins-pipeline/pom.xml | 4 +- .../src/main/resources/application.properties | 2 + .../src/main/resources/acl-schema.sql | 50 +++++++++---------- .../src/main/resources/application.properties | 4 +- .../src/main/resources/data.sql | 2 +- .../spring-security-web-boot-3/pom.xml | 1 - .../baeldung/spring/PersistenceConfig.java | 2 +- .../src/main/resources/data.sql | 8 +-- .../spring-session-mongodb/pom.xml | 7 +-- .../commonutil/ScenarioContextUI.java | 3 +- 43 files changed, 127 insertions(+), 115 deletions(-) create mode 100644 spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java rename spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/{ => jobrunr}/JobRunrSpringBootApp.java (96%) rename spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/{ => jobrunr}/config/StorageProviderConfig.java (93%) create mode 100644 spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java diff --git a/graphql-modules/graphql-error-handling/pom.xml b/graphql-modules/graphql-error-handling/pom.xml index f10bb524fb..d89ff1509d 100644 --- a/graphql-modules/graphql-error-handling/pom.xml +++ b/graphql-modules/graphql-error-handling/pom.xml @@ -36,12 +36,10 @@ org.projectlombok lombok - ${lombok.version} com.h2database h2 - ${h2.version} org.springframework.boot @@ -51,13 +49,12 @@ com.graphql-java graphql-spring-boot-starter-test - test ${graphql-spring-boot-starter.version} + test org.skyscreamer jsonassert - ${jsonassert.version} test @@ -65,7 +62,6 @@ 5.0.2 5.2.4 - 1.5.0 \ No newline at end of file diff --git a/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java b/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java index d982f98db3..94f696a940 100644 --- a/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java +++ b/graphql-modules/graphql-error-handling/src/main/java/com/baeldung/graphql/error/handling/exception/GraphQLErrorAdapter.java @@ -1,6 +1,6 @@ package com.baeldung.graphql.error.handling.exception; -import graphql.ErrorType; +import graphql.ErrorClassification; import graphql.ExceptionWhileDataFetching; import graphql.GraphQLError; import graphql.language.SourceLocation; @@ -27,7 +27,7 @@ public class GraphQLErrorAdapter implements GraphQLError { } @Override - public ErrorType getErrorType() { + public ErrorClassification getErrorType() { return error.getErrorType(); } diff --git a/mustache/pom.xml b/mustache/pom.xml index faa8bfd8a1..b5d39ef15e 100644 --- a/mustache/pom.xml +++ b/mustache/pom.xml @@ -55,7 +55,7 @@ - 0.9.2 + 0.9.10 0.8 3.3.7 diff --git a/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java b/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java index 8cdf89d08a..d6b3528dcb 100644 --- a/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java +++ b/mustache/src/main/java/com/baeldung/springmustache/SpringMustacheApplication.java @@ -1,12 +1,11 @@ package com.baeldung.springmustache; +import com.samskivert.mustache.DefaultCollector; import com.samskivert.mustache.Mustache; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.mustache.MustacheEnvironmentCollector; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; -import org.springframework.core.env.Environment; @SpringBootApplication @ComponentScan(basePackages = {"com.baeldung"}) @@ -17,16 +16,11 @@ public class SpringMustacheApplication { } @Bean - public Mustache.Compiler mustacheCompiler(Mustache.TemplateLoader templateLoader, Environment environment) { - - MustacheEnvironmentCollector collector = new MustacheEnvironmentCollector(); - collector.setEnvironment(environment); - + public Mustache.Compiler mustacheCompiler(Mustache.TemplateLoader templateLoader) { return Mustache.compiler() .defaultValue("Some Default Value") .withLoader(templateLoader) - .withCollector(collector); - + .withCollector(new DefaultCollector()); } } diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index 85f1805a00..1d6c593293 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -88,8 +88,8 @@ 3.3.0 1.0.22.RELEASE - 2.6.4 + 2.7.2 1.9.1
- \ No newline at end of file + diff --git a/persistence-modules/flyway/pom.xml b/persistence-modules/flyway/pom.xml index a339a266e3..67dd0644bd 100644 --- a/persistence-modules/flyway/pom.xml +++ b/persistence-modules/flyway/pom.xml @@ -19,7 +19,6 @@ org.flywaydb flyway-core - ${flyway-core.version} org.springframework.boot @@ -64,8 +63,8 @@ - 8.0.0 - 8.0.0 + 8.5.13 + 2.1.214 \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml b/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml index a745d4efc4..cd7198b931 100644 --- a/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml +++ b/persistence-modules/spring-boot-persistence-mongodb-2/pom.xml @@ -27,13 +27,8 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test - - 3.2.6 - - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties index cb1eab9443..30cc5abbcc 100644 --- a/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties +++ b/persistence-modules/spring-data-jpa-repo-2/src/main/resources/application.properties @@ -1,3 +1,5 @@ spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1 spring.datasource.username=sa -spring.datasource.password=sa \ No newline at end of file +spring.datasource.password=sa + +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-data-mongodb-reactive/pom.xml b/persistence-modules/spring-data-mongodb-reactive/pom.xml index ac2bf14635..85c9a4c4b6 100644 --- a/persistence-modules/spring-data-mongodb-reactive/pom.xml +++ b/persistence-modules/spring-data-mongodb-reactive/pom.xml @@ -57,7 +57,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test @@ -127,7 +126,6 @@ 5.3.15 4.5.2 3.3.1.RELEASE - 3.2.6
\ No newline at end of file diff --git a/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml b/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml index f25c6ea0e3..326bdff8a2 100644 --- a/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml +++ b/persistence-modules/spring-data-rest-querydsl/src/main/resources/application.yml @@ -9,3 +9,5 @@ spring: jpa: hibernate: ddl-auto: create + properties: + globally_quoted_identifiers: true diff --git a/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml b/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml index 33b7231838..57038dc362 100644 --- a/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml +++ b/persistence-modules/spring-data-rest-querydsl/src/test/resources/application.yml @@ -8,4 +8,5 @@ spring: ddl-auto: create-drop properties: hibernate: - dialect: org.hibernate.dialect.H2Dialect \ No newline at end of file + dialect: org.hibernate.dialect.H2Dialect + globally_quoted_identifiers: true \ No newline at end of file diff --git a/pom.xml b/pom.xml index f142d7bd96..5cf2a2907d 100644 --- a/pom.xml +++ b/pom.xml @@ -583,7 +583,7 @@ spring-jenkins-pipeline spring-jersey - spring-jinq + spring-jms spring-kafka @@ -977,7 +977,7 @@ spring-jenkins-pipeline spring-jersey - spring-jinq + spring-jms spring-kafka diff --git a/spring-boot-modules/spring-boot-data-2/pom.xml b/spring-boot-modules/spring-boot-data-2/pom.xml index cd03d1b9b1..9aaab02925 100644 --- a/spring-boot-modules/spring-boot-data-2/pom.xml +++ b/spring-boot-modules/spring-boot-data-2/pom.xml @@ -41,7 +41,7 @@ - 6.5.3 + 6.6.5 \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java new file mode 100644 index 0000000000..b215090447 --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/annotation/scanner/AnnotationScannerApp.java @@ -0,0 +1,16 @@ +package com.baeldung.annotation.scanner; + +import org.jobrunr.autoconfigure.JobRunrAutoConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@EnableAutoConfiguration(exclude = { JobRunrAutoConfiguration.class}) +public class AnnotationScannerApp { + + public static void main(String[] args) { + SpringApplication.run(AnnotationScannerApp.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/JobRunrSpringBootApp.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/JobRunrSpringBootApp.java similarity index 96% rename from spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/JobRunrSpringBootApp.java rename to spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/JobRunrSpringBootApp.java index 3821332132..932ceb249a 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/JobRunrSpringBootApp.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/JobRunrSpringBootApp.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.jobrunr; import com.baeldung.jobrunr.service.SampleJobService; import org.jobrunr.scheduling.JobScheduler; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/config/StorageProviderConfig.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/config/StorageProviderConfig.java similarity index 93% rename from spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/config/StorageProviderConfig.java rename to spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/config/StorageProviderConfig.java index e4b8cf12d7..631ba1834c 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/config/StorageProviderConfig.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/jobrunr/config/StorageProviderConfig.java @@ -1,4 +1,4 @@ -package com.baeldung.config; +package com.baeldung.jobrunr.config; import org.jobrunr.jobs.mappers.JobMapper; import org.jobrunr.storage.InMemoryStorageProvider; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java new file mode 100644 index 0000000000..4a205dcc1f --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java @@ -0,0 +1,13 @@ +package com.baeldung.sprq; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpqrApp { + + public static void main(String[] args) { + SpringApplication.run(SpqrApp.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java index 7c3d01b5e8..c69821d0c0 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/annotation/scanner/SampleAnnotationScannerUnitTest.java @@ -13,7 +13,7 @@ import org.springframework.test.context.junit4.SpringRunner; import static org.junit.Assert.*; @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = AnnotationScannerApp.class) public class SampleAnnotationScannerUnitTest { @Autowired private List scannerList; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java index 2c259b6879..b00d1c472f 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/jobrunr/JobRunrLiveTest.java @@ -1,6 +1,5 @@ package com.baeldung.jobrunr; -import org.awaitility.Awaitility; import org.jobrunr.jobs.states.StateName; import org.jobrunr.storage.StorageProvider; import org.junit.Test; @@ -10,8 +9,6 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.test.context.junit4.SpringRunner; -import com.baeldung.JobRunrSpringBootApp; - import java.net.URI; import java.util.concurrent.TimeUnit; diff --git a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java index b1054f09f8..ec28b98ac7 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/sprq/GraphqlControllerIntegrationTest.java @@ -16,7 +16,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = SpqrApp.class) @AutoConfigureMockMvc public class GraphqlControllerIntegrationTest { diff --git a/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java b/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java index 8887510eca..78c826d6cd 100644 --- a/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java +++ b/spring-boot-rest/src/main/java/com/baeldung/spring/PersistenceConfig.java @@ -77,7 +77,7 @@ public class PersistenceConfig { final Properties hibernateProperties = new Properties(); hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); return hibernateProperties; } diff --git a/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java b/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java index 3e21af524f..9ef8942634 100644 --- a/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java +++ b/spring-boot-rest/src/test/java/com/baeldung/web/error/ErrorHandlingLiveTest.java @@ -59,8 +59,7 @@ public class ErrorHandlingLiveTest { webClient.getOptions() .setThrowExceptionOnFailingStatusCode(false); HtmlPage page = webClient.getPage(EXCEPTION_ENDPOINT); - assertThat(page.getBody() - .asText()).contains("Whitelabel Error Page"); + assertThat(page.getBody().asNormalizedText()).contains("Whitelabel Error Page"); } } } diff --git a/spring-cloud-modules/pom.xml b/spring-cloud-modules/pom.xml index 6d44cb015b..43ccfd5501 100644 --- a/spring-cloud-modules/pom.xml +++ b/spring-cloud-modules/pom.xml @@ -85,7 +85,7 @@ - 2021.0.0 + 2021.0.3 2.2.3.RELEASE 2.2.3.RELEASE 1.4.7.RELEASE @@ -94,4 +94,4 @@ 3.1.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-bus/pom.xml b/spring-cloud-modules/spring-cloud-bus/pom.xml index 4caba15ca9..4be1a60062 100644 --- a/spring-cloud-modules/spring-cloud-bus/pom.xml +++ b/spring-cloud-modules/spring-cloud-bus/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-config/pom.xml b/spring-cloud-modules/spring-cloud-config/pom.xml index 09be8ae1b8..fc9a989844 100644 --- a/spring-cloud-modules/spring-cloud-config/pom.xml +++ b/spring-cloud-modules/spring-cloud-config/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml index 8af035e1db..4da6ac408b 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml +++ b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml @@ -32,6 +32,7 @@ org.springframework.cloud spring-cloud-starter-kubernetes-config + ${spring.cloud.k8s.config.version} org.springframework.boot @@ -54,6 +55,7 @@ org.springframework.cloud spring-cloud-starter-kubernetes-ribbon + ${spring.cloud.k8s.config.version} org.springframework.cloud @@ -83,7 +85,8 @@ - 1.1.8.RELEASE + 2.1.3 + 1.1.10.RELEASE - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java index 24e562c79b..b31e6232ac 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java +++ b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java @@ -3,11 +3,8 @@ package com.baeldung.spring.cloud.kubernetes.client; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; -import org.springframework.cloud.client.loadbalancer.LoadBalanced; -import org.springframework.cloud.netflix.ribbon.RibbonClient; -import org.springframework.context.annotation.Bean; -import org.springframework.web.client.RestTemplate; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.netflix.ribbon.RibbonClient; @SpringBootApplication @EnableDiscoveryClient @@ -15,12 +12,6 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient; @RibbonClient(name = "travel-agency-service", configuration = RibbonConfiguration.class) public class Application { - @LoadBalanced - @Bean - RestTemplate restTemplate() { - return new RestTemplate(); - } - public static void main(String[] args) { SpringApplication.run(Application.class, args); } diff --git a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml index f966fdd7a5..aad4568e87 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml +++ b/spring-cloud-modules/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml @@ -1,6 +1,15 @@ spring: application.name: client-service - cloud.kubernetes.reload.enabled: true + cloud: + kubernetes: + reload: + enabled: true + discovery: + enabled: true + all-namespaces: false + primary-port-name: "default-http" + discovery-server-url: "http://myapp-discoveryserver" + include-not-ready-addresses: true server.port: 8080 management: endpoint: diff --git a/spring-cloud-modules/spring-cloud-kubernetes/pom.xml b/spring-cloud-modules/spring-cloud-kubernetes/pom.xml index be555d01e9..cffdabd92b 100644 --- a/spring-cloud-modules/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud-modules/spring-cloud-kubernetes/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 \ No newline at end of file diff --git a/spring-cloud-modules/spring-cloud-openfeign/pom.xml b/spring-cloud-modules/spring-cloud-openfeign/pom.xml index 5657577cb0..a6a24c376e 100644 --- a/spring-cloud-modules/spring-cloud-openfeign/pom.xml +++ b/spring-cloud-modules/spring-cloud-openfeign/pom.xml @@ -64,7 +64,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml b/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml index b78f6ef5cf..5c8fc733dd 100644 --- a/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud-modules/spring-cloud-ribbon-client/pom.xml @@ -46,7 +46,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-security/pom.xml b/spring-cloud-modules/spring-cloud-security/pom.xml index 43eb6e61e8..15b5a9c4bc 100644 --- a/spring-cloud-modules/spring-cloud-security/pom.xml +++ b/spring-cloud-modules/spring-cloud-security/pom.xml @@ -33,7 +33,7 @@ - 2021.0.0 + 2021.0.3 - \ No newline at end of file + diff --git a/spring-cloud-modules/spring-cloud-zuul/pom.xml b/spring-cloud-modules/spring-cloud-zuul/pom.xml index b04a21da1c..6929de0539 100644 --- a/spring-cloud-modules/spring-cloud-zuul/pom.xml +++ b/spring-cloud-modules/spring-cloud-zuul/pom.xml @@ -80,8 +80,8 @@ - 2021.0.0 + 2021.0.3 2.2.7.RELEASE - \ No newline at end of file + diff --git a/spring-jenkins-pipeline/pom.xml b/spring-jenkins-pipeline/pom.xml index 7cd529020a..62e8283c5a 100644 --- a/spring-jenkins-pipeline/pom.xml +++ b/spring-jenkins-pipeline/pom.xml @@ -37,7 +37,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test @@ -82,7 +81,6 @@ 2.17 - 3.2.6 - \ No newline at end of file + diff --git a/spring-katharsis/src/main/resources/application.properties b/spring-katharsis/src/main/resources/application.properties index 415ec1723b..5325d47223 100644 --- a/spring-katharsis/src/main/resources/application.properties +++ b/spring-katharsis/src/main/resources/application.properties @@ -5,6 +5,8 @@ spring.jpa.show-sql = false spring.jpa.hibernate.ddl-auto = create-drop spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.H2Dialect +spring.jpa.properties.hibernate.globally_quoted_identifiers=true + server.port=8082 server.servlet.context-path=/spring-katharsis diff --git a/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql b/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql index 9f74048230..3937efa544 100644 --- a/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql +++ b/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql @@ -1,50 +1,50 @@ create table IF NOT EXISTS system_message (id integer not null, content varchar(255), primary key (id)); CREATE TABLE IF NOT EXISTS acl_sid ( - id bigint(20) NOT NULL AUTO_INCREMENT, - principal tinyint(1) NOT NULL, + id bigint NOT NULL AUTO_INCREMENT, + principal tinyint NOT NULL, sid varchar(100) NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_1 (sid,principal) + CONSTRAINT unique_uk_1 UNIQUE (sid,principal) ); CREATE TABLE IF NOT EXISTS acl_class ( - id bigint(20) NOT NULL AUTO_INCREMENT, + id bigint NOT NULL AUTO_INCREMENT, class varchar(255) NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_2 (class) + CONSTRAINT unique_uk_2 UNIQUE (class) ); - + CREATE TABLE IF NOT EXISTS acl_entry ( - id bigint(20) NOT NULL AUTO_INCREMENT, - acl_object_identity bigint(20) NOT NULL, - ace_order int(11) NOT NULL, - sid bigint(20) NOT NULL, - mask int(11) NOT NULL, - granting tinyint(1) NOT NULL, - audit_success tinyint(1) NOT NULL, - audit_failure tinyint(1) NOT NULL, + id bigint NOT NULL AUTO_INCREMENT, + acl_object_identity bigint NOT NULL, + ace_order int NOT NULL, + sid bigint NOT NULL, + mask int NOT NULL, + granting tinyint NOT NULL, + audit_success tinyint NOT NULL, + audit_failure tinyint NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_4 (acl_object_identity,ace_order) + CONSTRAINT unique_uk_4 UNIQUE (acl_object_identity,ace_order) ); - + CREATE TABLE IF NOT EXISTS acl_object_identity ( - id bigint(20) NOT NULL AUTO_INCREMENT, - object_id_class bigint(20) NOT NULL, - object_id_identity bigint(20) NOT NULL, - parent_object bigint(20) DEFAULT NULL, - owner_sid bigint(20) DEFAULT NULL, - entries_inheriting tinyint(1) NOT NULL, + id bigint NOT NULL AUTO_INCREMENT, + object_id_class bigint NOT NULL, + object_id_identity bigint NOT NULL, + parent_object bigint DEFAULT NULL, + owner_sid bigint DEFAULT NULL, + entries_inheriting tinyint NOT NULL, PRIMARY KEY (id), - UNIQUE KEY unique_uk_3 (object_id_class,object_id_identity) + CONSTRAINT unique_uk_3 UNIQUE (object_id_class,object_id_identity) ); - + ALTER TABLE acl_entry ADD FOREIGN KEY (acl_object_identity) REFERENCES acl_object_identity(id); ALTER TABLE acl_entry ADD FOREIGN KEY (sid) REFERENCES acl_sid(id); - + -- -- Constraints for table acl_object_identity -- diff --git a/spring-security-modules/spring-security-social-login/src/main/resources/application.properties b/spring-security-modules/spring-security-social-login/src/main/resources/application.properties index 57348051ac..02b0cd94c4 100644 --- a/spring-security-modules/spring-security-social-login/src/main/resources/application.properties +++ b/spring-security-modules/spring-security-social-login/src/main/resources/application.properties @@ -3,4 +3,6 @@ spring.social.facebook.appSecret=abefd6497e9cc01ad03be28509617bf0 spring.thymeleaf.cache=false server.servlet.register-default-servlet=true spring.sql.init.mode=always -spring.jpa.defer-datasource-initialization=true \ No newline at end of file +spring.jpa.defer-datasource-initialization=true + +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/spring-security-modules/spring-security-social-login/src/main/resources/data.sql b/spring-security-modules/spring-security-social-login/src/main/resources/data.sql index 3b26afef32..b13a1f143e 100644 --- a/spring-security-modules/spring-security-social-login/src/main/resources/data.sql +++ b/spring-security-modules/spring-security-social-login/src/main/resources/data.sql @@ -1 +1 @@ -insert into User (id, username, password) values (1,'john', '123'); \ No newline at end of file +insert into "user" ("id", "username", "password") values (1,'john', '123'); \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-boot-3/pom.xml b/spring-security-modules/spring-security-web-boot-3/pom.xml index 0984c25e07..5229068dfa 100644 --- a/spring-security-modules/spring-security-web-boot-3/pom.xml +++ b/spring-security-modules/spring-security-web-boot-3/pom.xml @@ -32,7 +32,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - 3.3.1 commons-io diff --git a/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java b/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java index 4a4b9eee3f..910afedbac 100644 --- a/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java +++ b/spring-web-modules/spring-rest-query-language/src/main/java/com/baeldung/spring/PersistenceConfig.java @@ -78,7 +78,7 @@ public class PersistenceConfig { final Properties hibernateProperties = new Properties(); hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); return hibernateProperties; } diff --git a/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql b/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql index 5fba12dd85..50fc79a5c9 100644 --- a/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql +++ b/spring-web-modules/spring-rest-query-language/src/main/resources/data.sql @@ -1,5 +1,5 @@ -insert into User (id, firstName, lastName, email, age) values (1, 'john', 'doe', 'john@doe.com', 22); -insert into User (id, firstName, lastName, email, age) values (2, 'tom', 'doe', 'tom@doe.com', 26); +insert into "User" ("id", "firstName", "lastName", "email", "age") values (1, 'john', 'doe', 'john@doe.com', 22); +insert into "User" ("id", "firstName", "lastName", "email", "age") values (2, 'tom', 'doe', 'tom@doe.com', 26); -insert into MyUser (id, firstName, lastName, email, age) values (1, 'john', 'doe', 'john@doe.com', 22); -insert into MyUser (id, firstName, lastName, email, age) values (2, 'tom', 'doe', 'tom@doe.com', 26); +insert into "MyUser" ("id", "firstName", "lastName", "email", "age") values (1, 'john', 'doe', 'john@doe.com', 22); +insert into "MyUser" ("id", "firstName", "lastName", "email", "age") values (2, 'tom', 'doe', 'tom@doe.com', 26); diff --git a/spring-web-modules/spring-session/spring-session-mongodb/pom.xml b/spring-web-modules/spring-session/spring-session-mongodb/pom.xml index e34589c75b..6e5c12d487 100644 --- a/spring-web-modules/spring-session/spring-session-mongodb/pom.xml +++ b/spring-web-modules/spring-session/spring-session-mongodb/pom.xml @@ -37,7 +37,6 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test @@ -51,8 +50,4 @@ - - 3.2.6 - - - \ No newline at end of file + diff --git a/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java b/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java index 66aabece11..d775c8a152 100644 --- a/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java +++ b/testing-modules/cucumber/src/test/java/com/baeldung/cucumber/tags/acceptance/commonutil/ScenarioContextUI.java @@ -1,5 +1,6 @@ package com.baeldung.cucumber.tags.acceptance.commonutil; +import org.openqa.selenium.Platform; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.remote.DesiredCapabilities; @@ -34,7 +35,7 @@ public class ScenarioContextUI { } private static WebDriver getRemoteWebDriver(URL url) { - return new RemoteWebDriver(url, DesiredCapabilities.chrome()); + return new RemoteWebDriver(url, new DesiredCapabilities("chrome", "", Platform.ANY)); } private static WebDriver getLocalChromeDriver() { From 788cb3ba375f67ef863fc1e11f7a4b2f1bd870d4 Mon Sep 17 00:00:00 2001 From: anuragkumawat Date: Mon, 22 Aug 2022 22:49:42 +0530 Subject: [PATCH 46/73] JAVA-13855 Add missing jar file (#12632) --- .../micronaut/.mvn/wrapper/maven-wrapper.jar | Bin 0 -> 48336 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 microservices-modules/micronaut/.mvn/wrapper/maven-wrapper.jar diff --git a/microservices-modules/micronaut/.mvn/wrapper/maven-wrapper.jar b/microservices-modules/micronaut/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..08ebbb67f088c53eac9a4e2cb019b93f69a1e49c GIT binary patch literal 48336 zcmbTe1CVCTvMxMr+qUiQY1_8@ZQJIwjcMDqjcHHYwr%^)#=(F7yT3U5z7Z9%BGxKo zRaWJbnNPh6(jcIy-yk6&zkT~g^r!sS59-gOtf-10our%?1IRZ8X^6jl^9}f)Unu;` zim3m+qO72tq?o9(3cajYQtTLXA0wjZlmEN0FJT@S(#d3dIUyu^3vxUaybZpL(O^$Y zRjGpdWr$a(Q!B(poj>0Qi$ZKK2C+JpSyCh(=e1-BQzBb2JoL`}H@!{CVaWTtdm>{? zHl}9dYR+#yktD%D!^)jBlcPAUlF6}9mpH&Cl?)_ zBx8`FqZXn&0R3IbK!j>gzW?c(>reUDa}WCGt(~LUzaH~|5jC`|8Ld* zx5fV3c>me=KN|SotP0To*p@8+w~_ouLqc|T&Q8vM)>;-|VXN#6aCA0tq&Kn#I5{P$ zjkuzSqjm*{py#K7g6|uU82*ZfaIuF3icIbGCnUx(3KUF*r7N>;`q`dz8DGaj5$BoMJTCWCb=m5uxvZGY@%ws2{U!OHYk<>VYrUTE<)ZAQil}N;ZZZliM3)o5~{80@i}|jP*!+D&4L&I{|j#Y5VgCO!ztz zfNdDniy=SG{5)I*jL;u?K@AMad_IXuo>Q6ZwBB8IB$Y`NUw7+iq1FP&^%&)=$chV2 zch?gj#RQ7GV#0}@GiEKqL1NvnBe6giQl!fy#Y46Sqpvr47r{t7r-%qxZmBc#A%_k5 zpl-MS(U-$9E+kfyjvD79+k)k}XH!}w3>JzB-%g$YbFt`b+F8ggH#7^w9KHc-d1s6n zI#ZEb0(dk~!4-`94RyBYoPLY{)H&}~qzvGRG=hHBnwh1J*$Zl+Yp~D`X&z+CCG4GU z>g}N7Lkq+tzJ<{lujC9!$vDK!hi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mon, 22 Aug 2022 22:50:30 +0530 Subject: [PATCH 47/73] JAVA-13856 Remove log file (#12631) --- security-modules/sql-injection-samples/derby.log | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 security-modules/sql-injection-samples/derby.log diff --git a/security-modules/sql-injection-samples/derby.log b/security-modules/sql-injection-samples/derby.log deleted file mode 100644 index 67eaae4238..0000000000 --- a/security-modules/sql-injection-samples/derby.log +++ /dev/null @@ -1,13 +0,0 @@ ----------------------------------------------------------------- -Fri Aug 19 19:44:34 IST 2022: -Booting Derby version The Apache Software Foundation - Apache Derby - 10.14.2.0 - (1828579): instance a816c00e-0182-b674-a779-000005b040a8 -on database directory memory:E:\tutorials\security-modules\sql-injection-samples\cea8e259-4b4e-438e-8ffc-52ce09fc5b49 with class loader sun.misc.Launcher$AppClassLoader@42a57993 -Loaded from file:/C:/Users/DELL/.m2/repository/org/apache/derby/derby/10.14.2.0/derby-10.14.2.0.jar -java.vendor=Oracle Corporation -java.runtime.version=1.8.0_311-b11 -user.dir=E:\tutorials\security-modules\sql-injection-samples -os.name=Windows 10 -os.arch=amd64 -os.version=10.0 -derby.system.home=null -Database Class Loader started - derby.database.classpath='' From d03fb7e217ff0e0ff3fc526ba9809a03f99d8be4 Mon Sep 17 00:00:00 2001 From: psevestre Date: Tue, 23 Aug 2022 12:00:55 -0300 Subject: [PATCH 48/73] [BAEL-2765] Rename test & add module (#12639) * [BAEL-2765] Rename test & add module * [BAEL-2765] Fix java target * [BAEL-2765] Fix java target --- spring-security-modules/pom.xml | 1 + .../pkce/authserver/conf/AuthServerConfiguration.java | 9 ++++----- ...s.java => SpringSecurityPkceApplicationLiveTest.java} | 0 .../pkce/client/config/OAuth2ClientConfiguration.java | 2 +- spring-security-modules/spring-security-pkce/pom.xml | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) rename spring-security-modules/spring-security-pkce/pkce-auth-server/src/test/java/com/baeldung/security/pkce/{SpringSecurityPkceApplicationTests.java => SpringSecurityPkceApplicationLiveTest.java} (100%) diff --git a/spring-security-modules/pom.xml b/spring-security-modules/pom.xml index 83412d2252..296825f23d 100644 --- a/spring-security-modules/pom.xml +++ b/spring-security-modules/pom.xml @@ -47,6 +47,7 @@ spring-security-web-thymeleaf spring-security-web-x509 spring-security-opa + spring-security-pkce diff --git a/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java index 1f6484478d..b599880f3c 100644 --- a/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java +++ b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/main/java/com/baeldung/security/pkce/authserver/conf/AuthServerConfiguration.java @@ -31,12 +31,11 @@ public class AuthServerConfiguration { @Order(1) public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) throws Exception { - var authorizationServerConfigurer = new OAuth2AuthorizationServerConfigurer(); - var endpointsMatcher = authorizationServerConfigurer.getEndpointsMatcher(); + OAuth2AuthorizationServerConfigurer authorizationServerConfigurer = new OAuth2AuthorizationServerConfigurer<>(); // @formatter:off http - .requestMatcher(endpointsMatcher) + .requestMatcher(authorizationServerConfigurer.getEndpointsMatcher()) .authorizeRequests(authorize -> authorize .anyRequest() @@ -46,7 +45,7 @@ public class AuthServerConfiguration { exceptions.authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/login"))) .csrf( csrf -> csrf - .ignoringRequestMatchers(endpointsMatcher)) + .ignoringRequestMatchers(authorizationServerConfigurer.getEndpointsMatcher())) .apply(authorizationServerConfigurer); // Required by /userinfo endpoint @@ -68,7 +67,7 @@ public class AuthServerConfiguration { @Bean public RegisteredClientRepository registeredClientRepository() { - var pkceClient = RegisteredClient + RegisteredClient pkceClient = RegisteredClient .withId(UUID.randomUUID().toString()) .clientId("pkce-client") .clientSecret("{noop}obscura") diff --git a/spring-security-modules/spring-security-pkce/pkce-auth-server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java b/spring-security-modules/spring-security-pkce/pkce-auth-server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationLiveTest.java similarity index 100% rename from spring-security-modules/spring-security-pkce/pkce-auth-server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationTests.java rename to spring-security-modules/spring-security-pkce/pkce-auth-server/src/test/java/com/baeldung/security/pkce/SpringSecurityPkceApplicationLiveTest.java diff --git a/spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java b/spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java index 6863c13fa7..8868bccdb2 100644 --- a/spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java +++ b/spring-security-modules/spring-security-pkce/pkce-client/src/main/java/com/baeldung/security/pkce/client/config/OAuth2ClientConfiguration.java @@ -21,7 +21,7 @@ public class OAuth2ClientConfiguration { @Bean public ServerOAuth2AuthorizationRequestResolver pkceResolver(ReactiveClientRegistrationRepository repo) { - var resolver = new DefaultServerOAuth2AuthorizationRequestResolver(repo); + DefaultServerOAuth2AuthorizationRequestResolver resolver = new DefaultServerOAuth2AuthorizationRequestResolver(repo); resolver.setAuthorizationRequestCustomizer(OAuth2AuthorizationRequestCustomizers.withPkce()); return resolver; } diff --git a/spring-security-modules/spring-security-pkce/pom.xml b/spring-security-modules/spring-security-pkce/pom.xml index a90a0d5c1d..d835c8a9e5 100644 --- a/spring-security-modules/spring-security-pkce/pom.xml +++ b/spring-security-modules/spring-security-pkce/pom.xml @@ -17,7 +17,6 @@ 2.7.2 - 11 From c987c8caf70f1c2382c8368856d232d45b4f5c04 Mon Sep 17 00:00:00 2001 From: Ashley Frieze Date: Fri, 19 Aug 2022 09:08:39 +0100 Subject: [PATCH 49/73] BAEL-5676 Implement ini file parsing and unit tests --- libraries-files/pom.xml | 48 ++++++++ .../java/com/baeldung/ini/CommonsParser.java | 45 ++++++++ .../java/com/baeldung/ini/Ini4JParser.java | 23 ++++ .../com/baeldung/ini/MyConfiguration.java | 109 ++++++++++++++++++ .../baeldung/ini/CommonsParserUnitTest.java | 32 +++++ .../com/baeldung/ini/Ini4JParserUnitTest.java | 32 +++++ .../ini/SerializeIntoPojoUnitTest.java | 31 +++++ libraries-files/src/test/resources/sample.ini | 14 +++ 8 files changed, 334 insertions(+) create mode 100644 libraries-files/pom.xml create mode 100644 libraries-files/src/main/java/com/baeldung/ini/CommonsParser.java create mode 100644 libraries-files/src/main/java/com/baeldung/ini/Ini4JParser.java create mode 100644 libraries-files/src/main/java/com/baeldung/ini/MyConfiguration.java create mode 100644 libraries-files/src/test/java/com/baeldung/ini/CommonsParserUnitTest.java create mode 100644 libraries-files/src/test/java/com/baeldung/ini/Ini4JParserUnitTest.java create mode 100644 libraries-files/src/test/java/com/baeldung/ini/SerializeIntoPojoUnitTest.java create mode 100644 libraries-files/src/test/resources/sample.ini diff --git a/libraries-files/pom.xml b/libraries-files/pom.xml new file mode 100644 index 0000000000..7e21d127bb --- /dev/null +++ b/libraries-files/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + libraries-files + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + + + + org.ini4j + ini4j + ${org.ini4j.version} + + + org.apache.commons + commons-configuration2 + ${commons-configuration2} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + + + 0.5.4 + 2.8.0 + 2.13.1 + + + diff --git a/libraries-files/src/main/java/com/baeldung/ini/CommonsParser.java b/libraries-files/src/main/java/com/baeldung/ini/CommonsParser.java new file mode 100644 index 0000000000..77a544db16 --- /dev/null +++ b/libraries-files/src/main/java/com/baeldung/ini/CommonsParser.java @@ -0,0 +1,45 @@ +package com.baeldung.ini; + +import org.apache.commons.configuration2.INIConfiguration; +import org.apache.commons.configuration2.SubnodeConfiguration; +import org.apache.commons.configuration2.ex.ConfigurationException; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.*; + +public class CommonsParser { + public static Map> parseIniFile(File fileToParse) throws IOException, ConfigurationException { + Map> iniFileContents = new HashMap<>(); + + INIConfiguration iniConfiguration = new INIConfiguration(); + try (FileReader fileReader = new FileReader(fileToParse)) { + iniConfiguration.read(fileReader); + } + + for (String section : iniConfiguration.getSections()) { + Map subSectionMap = new HashMap<>(); + SubnodeConfiguration confSection = iniConfiguration.getSection(section); + Iterator keyIterator = confSection.getKeys(); + while (keyIterator.hasNext()) { + String key = keyIterator.next(); + String value = confSection.getProperty(key) + .toString(); + subSectionMap.put(key, value); + } + iniFileContents.put(section, subSectionMap); + } + return iniFileContents; + } + + public static String readIniFileValue(File fileToParse, String section, String value) throws IOException, ConfigurationException { + INIConfiguration iniConfiguration = new INIConfiguration(); + try (FileReader fileReader = new FileReader(fileToParse)) { + iniConfiguration.read(fileReader); + } + + return iniConfiguration.getSection(section).getProperty(value).toString(); + } +} diff --git a/libraries-files/src/main/java/com/baeldung/ini/Ini4JParser.java b/libraries-files/src/main/java/com/baeldung/ini/Ini4JParser.java new file mode 100644 index 0000000000..dacb559787 --- /dev/null +++ b/libraries-files/src/main/java/com/baeldung/ini/Ini4JParser.java @@ -0,0 +1,23 @@ +package com.baeldung.ini; + +import org.ini4j.Ini; + +import java.io.File; +import java.io.IOException; +import java.util.*; + +import static java.util.stream.Collectors.toMap; + +public class Ini4JParser { + + public static Map> parseIniFile(File fileToParse) throws IOException { + Ini ini = new Ini(fileToParse); + return ini.entrySet().stream() + .collect(toMap(Map.Entry::getKey, Map.Entry::getValue)); + } + + public static String readIniFileValue(File fileToParse, String section, String key) throws IOException { + Ini ini = new Ini(fileToParse); + return ini.get(section, key); + } +} diff --git a/libraries-files/src/main/java/com/baeldung/ini/MyConfiguration.java b/libraries-files/src/main/java/com/baeldung/ini/MyConfiguration.java new file mode 100644 index 0000000000..3d9af04655 --- /dev/null +++ b/libraries-files/src/main/java/com/baeldung/ini/MyConfiguration.java @@ -0,0 +1,109 @@ +package com.baeldung.ini; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; +import com.fasterxml.jackson.databind.annotation.JsonNaming; + +public class MyConfiguration { + + @JsonNaming(PropertyNamingStrategies.KebabCaseStrategy.class) + public static class Fonts { + private String letter; + private int textSize; + + public String getLetter() { + return letter; + } + + public void setLetter(String letter) { + this.letter = letter; + } + + public int getTextSize() { + return textSize; + } + + public void setTextSize(int textSize) { + this.textSize = textSize; + } + } + + public static class Background { + private String color; + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + } + + @JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) + public static class RequestResult { + private int requestCode; + + public int getRequestCode() { + return requestCode; + } + + public void setRequestCode(int requestCode) { + this.requestCode = requestCode; + } + } + + @JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) + public static class ResponseResult { + private int resultCode; + + public int getResultCode() { + return resultCode; + } + + public void setResultCode(int resultCode) { + this.resultCode = resultCode; + } + } + + private Fonts fonts; + private Background background; + + @JsonProperty("RequestResult") + private RequestResult requestResult; + + @JsonProperty("ResponseResult") + private ResponseResult responseResult; + + public Fonts getFonts() { + return fonts; + } + + public void setFonts(Fonts fonts) { + this.fonts = fonts; + } + + public Background getBackground() { + return background; + } + + public void setBackground(Background background) { + this.background = background; + } + + public RequestResult getRequestResult() { + return requestResult; + } + + public void setRequestResult(RequestResult requestResult) { + this.requestResult = requestResult; + } + + public ResponseResult getResponseResult() { + return responseResult; + } + + public void setResponseResult(ResponseResult responseResult) { + this.responseResult = responseResult; + } +} diff --git a/libraries-files/src/test/java/com/baeldung/ini/CommonsParserUnitTest.java b/libraries-files/src/test/java/com/baeldung/ini/CommonsParserUnitTest.java new file mode 100644 index 0000000000..b6645da884 --- /dev/null +++ b/libraries-files/src/test/java/com/baeldung/ini/CommonsParserUnitTest.java @@ -0,0 +1,32 @@ +package com.baeldung.ini; + +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.nio.file.Paths; +import java.util.Map; + +import static com.baeldung.ini.CommonsParser.parseIniFile; +import static com.baeldung.ini.CommonsParser.readIniFileValue; +import static org.assertj.core.api.Assertions.assertThat; + +class CommonsParserUnitTest { + + private static final File TEST_FILE = Paths.get("src", "test", "resources", "sample.ini").toFile(); + + @Test + void givenIniFileThenCanParseWithIni4j() throws Exception { + Map> result = + parseIniFile(TEST_FILE); + + assertThat(result.get("fonts")) + .containsEntry("letter", "bold") + .containsEntry("text-size", "28"); + } + + @Test + void givenIniFileThenCanReadKeyWithIni4j() throws Exception { + assertThat(readIniFileValue(TEST_FILE, "fonts", "letter")) + .isEqualTo("bold"); + } +} \ No newline at end of file diff --git a/libraries-files/src/test/java/com/baeldung/ini/Ini4JParserUnitTest.java b/libraries-files/src/test/java/com/baeldung/ini/Ini4JParserUnitTest.java new file mode 100644 index 0000000000..c974e92a87 --- /dev/null +++ b/libraries-files/src/test/java/com/baeldung/ini/Ini4JParserUnitTest.java @@ -0,0 +1,32 @@ +package com.baeldung.ini; + +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.nio.file.Paths; +import java.util.Map; + +import static com.baeldung.ini.Ini4JParser.readIniFileValue; +import static com.baeldung.ini.Ini4JParser.parseIniFile; +import static org.assertj.core.api.Assertions.assertThat; + +class Ini4JParserUnitTest { + + private static final File TEST_FILE = Paths.get("src", "test", "resources", "sample.ini").toFile(); + + @Test + void givenIniFileThenCanParseWithIni4j() throws Exception { + Map> result = + parseIniFile(TEST_FILE); + + assertThat(result.get("fonts")) + .containsEntry("letter", "bold") + .containsEntry("text-size", "28"); + } + + @Test + void givenIniFileThenCanReadKeyFromIt() throws Exception { + assertThat(readIniFileValue(TEST_FILE, "fonts", "letter")) + .isEqualTo("bold"); + } +} \ No newline at end of file diff --git a/libraries-files/src/test/java/com/baeldung/ini/SerializeIntoPojoUnitTest.java b/libraries-files/src/test/java/com/baeldung/ini/SerializeIntoPojoUnitTest.java new file mode 100644 index 0000000000..a91abcb8b3 --- /dev/null +++ b/libraries-files/src/test/java/com/baeldung/ini/SerializeIntoPojoUnitTest.java @@ -0,0 +1,31 @@ +package com.baeldung.ini; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.nio.file.Paths; +import java.util.Map; + +import static com.baeldung.ini.Ini4JParser.parseIniFile; +import static org.assertj.core.api.Assertions.assertThat; + +class SerializeIntoPojoUnitTest { + + private static final File TEST_FILE = Paths.get("src", "test", "resources", "sample.ini").toFile(); + + @Test + void givenAnIniFileThenCanLoadAsPojo() throws Exception { + ObjectMapper objectMapper = new ObjectMapper(); + + Map> iniKeys = parseIniFile(TEST_FILE); + + MyConfiguration config = objectMapper.convertValue(iniKeys, MyConfiguration.class); + + assertThat(config.getFonts().getLetter()).isEqualTo("bold"); + assertThat(config.getFonts().getTextSize()).isEqualTo(28); + assertThat(config.getBackground().getColor()).isEqualTo("white"); + assertThat(config.getRequestResult().getRequestCode()).isEqualTo(1); + assertThat(config.getResponseResult().getResultCode()).isZero(); + } +} diff --git a/libraries-files/src/test/resources/sample.ini b/libraries-files/src/test/resources/sample.ini new file mode 100644 index 0000000000..687cf1daed --- /dev/null +++ b/libraries-files/src/test/resources/sample.ini @@ -0,0 +1,14 @@ +; for 16-bit app support + +[fonts] +letter=bold +text-size=28 + +[background] +color=white + +[RequestResult] +RequestCode=1 + +[ResponseResult] +ResultCode=0 \ No newline at end of file From 77671ade4b11a5abb8a1651a44a494ce46d351bb Mon Sep 17 00:00:00 2001 From: Harry9656 Date: Tue, 23 Aug 2022 23:22:43 +0200 Subject: [PATCH 50/73] JAVA-5683: Difference Between List.of and Arrays.asList (#12564) Co-authored-by: Harpal Singh --- .../core-java-collections-list-4/pom.xml | 19 ++++++- .../list/creation/ArraysAsListUnitTest.java | 56 +++++++++++++++++++ .../list/creation/ListOfUnitTest.java | 51 +++++++++++++++++ core-java-modules/pom.xml | 1 - pom.xml | 2 + 5 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ArraysAsListUnitTest.java create mode 100644 core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ListOfUnitTest.java diff --git a/core-java-modules/core-java-collections-list-4/pom.xml b/core-java-modules/core-java-collections-list-4/pom.xml index ef815b790d..ab4ba37568 100644 --- a/core-java-modules/core-java-collections-list-4/pom.xml +++ b/core-java-modules/core-java-collections-list-4/pom.xml @@ -64,6 +64,23 @@ 1.2.0 3.0 3.22.0 + 17 + 17 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source.version} + ${maven.compiler.target.version} + + + + - \ No newline at end of file + diff --git a/core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ArraysAsListUnitTest.java b/core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ArraysAsListUnitTest.java new file mode 100644 index 0000000000..732dd6a35a --- /dev/null +++ b/core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ArraysAsListUnitTest.java @@ -0,0 +1,56 @@ +package com.baeldung.list.creation; + +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +class ArraysAsListUnitTest { + + @Test + void givenAnArrayOfIntegersWhenCreatingAListUsingArraysAsListThenItWillHaveTheSameElementsInTheSameOrder() { + Integer[] array = new Integer[]{1, 2, 3, 4}; + List list = Arrays.asList(array); + assertThat(list).containsExactly(1, 2, 3, 4); + } + + @Test + void givenAnListOfIntegersCreatedUsingArraysAsListWhenChangingTheOriginalArrayTheReturnListWillAlsoChange() { + Integer[] array = new Integer[]{1, 2, 3}; + List list = Arrays.asList(array); + array[0] = 1000; + assertThat(list.get(0)).isEqualTo(1000); + } + + @Test + void givenAnListOfIntegersCreatedUsingArraysAsListWhenChangingTheReturnedListTheOriginalArrayWillAlsoChange() { + Integer[] array = new Integer[]{1, 2, 3}; + List list = Arrays.asList(array); + list.set(0, 1000); + assertThat(array[0]).isEqualTo(1000); + } + + @Test + void givenAnArrayOfIntegersCreatedUsingArraysAsListWhenModifyingAnExistingElementThenModifyIt() { + List list = Arrays.asList(1, 2, 3, 4); + list.set(1, 1000); + assertThat(list.get(1)).isEqualTo(1000); + } + + @Test + void givenAnArrayCreatedWithArraysAsListWhenAddingANewElementThenUnsupportedOperationExceptionIsThrown() { + List list = Arrays.asList(1, 2, 3, 4, 5); + assertThrows(UnsupportedOperationException.class, () -> list.add(6)); + } + + @Test + void givenAnArrayCreatedWithArraysAsListWhenRemovingAnExistingElementThenUnsupportedOperationExceptionIsThrown() { + List list = Arrays.asList(1, 2, 3, 4, 5); + assertThrows(UnsupportedOperationException.class, () -> list.remove(1)); + } + + +} diff --git a/core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ListOfUnitTest.java b/core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ListOfUnitTest.java new file mode 100644 index 0000000000..5fe65e965f --- /dev/null +++ b/core-java-modules/core-java-collections-list-4/src/test/java/com/baeldung/list/creation/ListOfUnitTest.java @@ -0,0 +1,51 @@ +package com.baeldung.list.creation; + +import org.junit.jupiter.api.Test; + +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +class ListOfUnitTest { + + @Test + void givenAnArrayOfStringWhenCreatingAListUsingItsValuesThenItWillHaveTheSameElementsInTheSameOrder() { + String[] array = new String[]{"one", "two", "three"}; + List list = List.of(array); + assertThat(list).containsExactly("one", "two", "three"); + } + + @Test + void givenAnListOfStringCreatedUsingListOfWhenChangingTheOriginalArrayTheReturnListWontChange() { + String[] array = new String[]{"one", "two", "three"}; + List list = List.of(array); + array[0] = "thousand"; + assertThat(list.get(0)).isEqualTo("one"); + } + + @Test + void givenAnArrayCreatedWithListOfWhenAddingANewElementThenUnsupportedOperationExceptionIsThrown() { + List list = List.of("one", "two", "three"); + assertThrows(UnsupportedOperationException.class, () -> list.add("four")); + } + + @Test + void givenAnArrayCreatedWithListOfWhenRemovingAnExistingElementThenUnsupportedOperationExceptionIsThrown() { + List list = List.of("one", "two", "three"); + assertThrows(UnsupportedOperationException.class, () -> list.remove("two")); + } + + @Test + void givenAnArrayCreatedWithListOfWhenModifyingAnExistingElementThenUnsupportedOperationExceptionIsThrown() { + List list = List.of("one", "two", "three"); + assertThrows(UnsupportedOperationException.class, () -> list.set(1, "four")); + } + + @Test + void givenAnArrayContainingNullElementWhenUsingItToCreateListThenNullPointerExceptionIsThrown() { + assertThrows(NullPointerException.class, () -> List.of("one", null, "two")); + } + + +} diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml index 981374a4ef..22a7fdec1e 100644 --- a/core-java-modules/pom.xml +++ b/core-java-modules/pom.xml @@ -37,7 +37,6 @@ core-java-collections-list core-java-collections-list-2 core-java-collections-list-3 - core-java-collections-list-4 core-java-collections-maps core-java-collections-maps-2 core-java-collections-maps-3 diff --git a/pom.xml b/pom.xml index 5cf2a2907d..b8a73ad0a0 100644 --- a/pom.xml +++ b/pom.xml @@ -1161,6 +1161,7 @@ core-java-modules/core-java-collections-set + core-java-modules/core-java-collections-list-4 core-java-modules/core-java-collections-maps-4 core-java-modules/core-java-date-operations-1 core-java-modules/core-java-datetime-conversion @@ -1234,6 +1235,7 @@ core-java-modules/core-java-collections-set + core-java-modules/core-java-collections-list-4 core-java-modules/core-java-collections-maps-4 core-java-modules/core-java-date-operations-1 core-java-modules/core-java-datetime-conversion From 7af516d159b9b3929c6920a47f21f6fa5269e64e Mon Sep 17 00:00:00 2001 From: Hamid Reza Sharifi Date: Wed, 24 Aug 2022 02:03:31 +0430 Subject: [PATCH 51/73] Bael 5407: Multitenancy with Spring Data JPA (#12507) * BAEL-5407: add entity, repository, controller, main class * BAEL-5407: add starter-web and postgres dependencies * BAEL-5407: add sample script * BAEL-5407: add tenant definition file * BAEL-5407: add tenant filter * BAEL-5407: add AbstractRoutingDataSource class * BAEL-5407: add TenantContext class * BAEL-5407: add MultitenantConfiguration class * BAEL-5407: replace Object with String * BAEL-5407: improve indentation * BAEL-5407: remove printStackTrace() * BAEL-5407: add security classes * BAEL-5407: add security dependencies * BAEL-5407: get Tenant from JWT token * BAEL-5407: improve indent * BAEL-5407: improve code quality Co-authored-by: h_sharifi --- .../allTenants/tenant_1.properties | 5 ++ .../allTenants/tenant_2.properties | 5 ++ persistence-modules/spring-jpa-2/pom.xml | 21 +++++++ .../multitenant/MultiTenantApplication.java | 14 +++++ .../config/MultitenantConfiguration.java | 53 ++++++++++++++++++ .../config/MultitenantDataSource.java | 12 ++++ .../multitenant/config/TenantContext.java | 14 +++++ .../multitenant/config/TenantFilter.java | 29 ++++++++++ .../controller/EmployeeController.java | 25 +++++++++ .../baeldung/multitenant/domain/Employee.java | 40 +++++++++++++ .../repository/EmployeeRepository.java | 9 +++ .../security/AccountCredentials.java | 23 ++++++++ .../security/AuthenticationFilter.java | 25 +++++++++ .../security/AuthenticationService.java | 56 +++++++++++++++++++ .../multitenant/security/LoginFilter.java | 51 +++++++++++++++++ .../security/SecurityConfiguration.java | 56 +++++++++++++++++++ .../src/main/resources/tenant-schema.sql | 1 + 17 files changed, 439 insertions(+) create mode 100644 persistence-modules/spring-jpa-2/allTenants/tenant_1.properties create mode 100644 persistence-modules/spring-jpa-2/allTenants/tenant_2.properties create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/MultiTenantApplication.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantConfiguration.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantDataSource.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantContext.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantFilter.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/controller/EmployeeController.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/domain/Employee.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/repository/EmployeeRepository.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AccountCredentials.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationFilter.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationService.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/LoginFilter.java create mode 100644 persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/SecurityConfiguration.java create mode 100644 persistence-modules/spring-jpa-2/src/main/resources/tenant-schema.sql diff --git a/persistence-modules/spring-jpa-2/allTenants/tenant_1.properties b/persistence-modules/spring-jpa-2/allTenants/tenant_1.properties new file mode 100644 index 0000000000..141cb8f3d8 --- /dev/null +++ b/persistence-modules/spring-jpa-2/allTenants/tenant_1.properties @@ -0,0 +1,5 @@ +name=tenant_1 +datasource.url=jdbc:postgresql://localhost:5432/tenant1 +datasource.username=postgres +datasource.password=123456 +datasource.driver-class-name=org.postgresql.Driver \ No newline at end of file diff --git a/persistence-modules/spring-jpa-2/allTenants/tenant_2.properties b/persistence-modules/spring-jpa-2/allTenants/tenant_2.properties new file mode 100644 index 0000000000..6069da5822 --- /dev/null +++ b/persistence-modules/spring-jpa-2/allTenants/tenant_2.properties @@ -0,0 +1,5 @@ +name=tenant_2 +datasource.url=jdbc:postgresql://localhost:5432/tenant2 +datasource.username=postgres +datasource.password=123456 +datasource.driver-class-name=org.postgresql.Driver \ No newline at end of file diff --git a/persistence-modules/spring-jpa-2/pom.xml b/persistence-modules/spring-jpa-2/pom.xml index 19f5a8acc2..de42f94856 100644 --- a/persistence-modules/spring-jpa-2/pom.xml +++ b/persistence-modules/spring-jpa-2/pom.xml @@ -21,6 +21,11 @@ spring-boot-starter ${spring-boot.version} + + org.springframework.boot + spring-boot-starter-web + ${spring-boot.version} + org.springframework.boot spring-boot-starter-data-jpa @@ -42,6 +47,16 @@ spring-context ${org.springframework.version} + + org.springframework.boot + spring-boot-starter-security + ${spring-boot.version} + + + io.jsonwebtoken + jjwt + 0.9.1 + org.hibernate @@ -53,6 +68,12 @@ h2 ${h2.version} + + org.postgresql + postgresql + 42.4.0 + runtime + org.apache.tomcat tomcat-dbcp diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/MultiTenantApplication.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/MultiTenantApplication.java new file mode 100644 index 0000000000..236b53f570 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/MultiTenantApplication.java @@ -0,0 +1,14 @@ +package com.baeldung.multitenant; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; + +@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) +public class MultiTenantApplication { + + public static void main(String[] args) { + SpringApplication.run(MultiTenantApplication.class, args); + } + +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantConfiguration.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantConfiguration.java new file mode 100644 index 0000000000..64d66f5cc9 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantConfiguration.java @@ -0,0 +1,53 @@ +package com.baeldung.multitenant.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.jdbc.DataSourceBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + +import javax.sql.DataSource; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +@Configuration +public class MultitenantConfiguration { + + @Bean + @ConfigurationProperties(prefix = "tenants") + public DataSource dataSource() { + File[] files = Paths.get("allTenants").toFile().listFiles(); + Map resolvedDataSources = new HashMap<>(); + + for (File propertyFile : files) { + Properties tenantProperties = new Properties(); + DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create(); + + try { + tenantProperties.load(new FileInputStream(propertyFile)); + String tenantId = tenantProperties.getProperty("name"); + + dataSourceBuilder.driverClassName(tenantProperties.getProperty("datasource.driver-class-name")); + dataSourceBuilder.username(tenantProperties.getProperty("datasource.username")); + dataSourceBuilder.password(tenantProperties.getProperty("datasource.password")); + dataSourceBuilder.url(tenantProperties.getProperty("datasource.url")); + resolvedDataSources.put(tenantId, dataSourceBuilder.build()); + } catch (IOException exp) { + throw new RuntimeException("Problem in tenant datasource:" + exp); + } + } + + AbstractRoutingDataSource dataSource = new MultitenantDataSource(); + dataSource.setDefaultTargetDataSource(resolvedDataSources.get("tenant_1")); + dataSource.setTargetDataSources(resolvedDataSources); + + dataSource.afterPropertiesSet(); + return dataSource; + } + +} \ No newline at end of file diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantDataSource.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantDataSource.java new file mode 100644 index 0000000000..d8bf664488 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/MultitenantDataSource.java @@ -0,0 +1,12 @@ +package com.baeldung.multitenant.config; + +import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource; + +public class MultitenantDataSource extends AbstractRoutingDataSource { + + @Override + protected String determineCurrentLookupKey() { + return TenantContext.getCurrentTenant(); + } + +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantContext.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantContext.java new file mode 100644 index 0000000000..30bfba7892 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantContext.java @@ -0,0 +1,14 @@ +package com.baeldung.multitenant.config; + +public class TenantContext { + + private static final ThreadLocal CURRENT_TENANT = new ThreadLocal<>(); + + public static String getCurrentTenant() { + return CURRENT_TENANT.get(); + } + + public static void setCurrentTenant(String tenant) { + CURRENT_TENANT.set(tenant); + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantFilter.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantFilter.java new file mode 100644 index 0000000000..3fbb5026f7 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/config/TenantFilter.java @@ -0,0 +1,29 @@ +package com.baeldung.multitenant.config; + +import com.baeldung.multitenant.security.AuthenticationService; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +@Component +@Order(1) +class TenantFilter implements Filter { + + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + + String tenant = AuthenticationService.getTenant((HttpServletRequest) request); + TenantContext.setCurrentTenant(tenant); + + try { + chain.doFilter(request, response); + } finally { + TenantContext.setCurrentTenant(""); + } + + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/controller/EmployeeController.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/controller/EmployeeController.java new file mode 100644 index 0000000000..91b35a2836 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/controller/EmployeeController.java @@ -0,0 +1,25 @@ +package com.baeldung.multitenant.controller; + +import com.baeldung.multitenant.domain.Employee; +import com.baeldung.multitenant.repository.EmployeeRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Transactional +public class EmployeeController { + + @Autowired + private EmployeeRepository employeeRepository; + + @PostMapping(path = "/employee") + public ResponseEntity createEmployee() { + Employee newEmployee = new Employee(); + newEmployee.setName("Baeldung"); + employeeRepository.save(newEmployee); + return ResponseEntity.ok(newEmployee); + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/domain/Employee.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/domain/Employee.java new file mode 100644 index 0000000000..883b70ca01 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/domain/Employee.java @@ -0,0 +1,40 @@ +package com.baeldung.multitenant.domain; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; + +@Entity +@Table(name = "employee") +public class Employee { + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name") + private String name; + + public Employee() { + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/repository/EmployeeRepository.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/repository/EmployeeRepository.java new file mode 100644 index 0000000000..4a965fd51a --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/repository/EmployeeRepository.java @@ -0,0 +1,9 @@ +package com.baeldung.multitenant.repository; + +import com.baeldung.multitenant.domain.Employee; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; + +@Repository +public interface EmployeeRepository extends JpaRepository { +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AccountCredentials.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AccountCredentials.java new file mode 100644 index 0000000000..cadfcb601a --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AccountCredentials.java @@ -0,0 +1,23 @@ +package com.baeldung.multitenant.security; + +public class AccountCredentials { + + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationFilter.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationFilter.java new file mode 100644 index 0000000000..fa6bcfb5a0 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationFilter.java @@ -0,0 +1,25 @@ +package com.baeldung.multitenant.security; + +import org.springframework.security.core.Authentication; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.filter.GenericFilterBean; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; + +public class AuthenticationFilter extends GenericFilterBean { + + @Override + public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) + throws IOException, ServletException { + + Authentication authentication = AuthenticationService.getAuthentication((HttpServletRequest) req); + SecurityContextHolder.getContext().setAuthentication(authentication); + + chain.doFilter(req, res); + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationService.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationService.java new file mode 100644 index 0000000000..302058882d --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/AuthenticationService.java @@ -0,0 +1,56 @@ +package com.baeldung.multitenant.security; + +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Collections; +import java.util.Date; + +public class AuthenticationService { + + private static final long EXPIRATIONTIME = 864_000_00; // 1 day in milliseconds + private static final String SIGNINGKEY = "SecretKey"; + private static final String PREFIX = "Bearer"; + + public static void addToken(HttpServletResponse res, String username, String tenant) { + String JwtToken = Jwts.builder().setSubject(username) + .setAudience(tenant) + .setExpiration(new Date(System.currentTimeMillis() + EXPIRATIONTIME)) + .signWith(SignatureAlgorithm.HS512, SIGNINGKEY) + .compact(); + res.addHeader("Authorization", PREFIX + " " + JwtToken); + } + + public static Authentication getAuthentication(HttpServletRequest req) { + String token = req.getHeader("Authorization"); + if (token != null) { + String user = Jwts.parser() + .setSigningKey(SIGNINGKEY) + .parseClaimsJws(token.replace(PREFIX, "")) + .getBody() + .getSubject(); + if (user != null) { + return new UsernamePasswordAuthenticationToken(user, null, Collections.emptyList()); + } + } + + return null; + } + + public static String getTenant(HttpServletRequest req) { + String token = req.getHeader("Authorization"); + if (token == null) { + return null; + } + String tenant = Jwts.parser() + .setSigningKey(SIGNINGKEY) + .parseClaimsJws(token.replace(PREFIX, "")) + .getBody() + .getAudience(); + return tenant; + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/LoginFilter.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/LoginFilter.java new file mode 100644 index 0000000000..9f6cbe6e16 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/LoginFilter.java @@ -0,0 +1,51 @@ +package com.baeldung.multitenant.security; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; + +public class LoginFilter extends AbstractAuthenticationProcessingFilter { + + public LoginFilter(String url, AuthenticationManager authManager) { + super(new AntPathRequestMatcher(url)); + setAuthenticationManager(authManager); + } + + @Override + public Authentication attemptAuthentication(HttpServletRequest req, HttpServletResponse res) + throws AuthenticationException, IOException, ServletException { + + AccountCredentials creds = new ObjectMapper(). + readValue(req.getInputStream(), AccountCredentials.class); + + return getAuthenticationManager().authenticate( + new UsernamePasswordAuthenticationToken(creds.getUsername(), + creds.getPassword(), Collections.emptyList())); + } + + @Override + protected void successfulAuthentication(HttpServletRequest req, HttpServletResponse res, + FilterChain chain, Authentication auth) throws IOException, ServletException { + + Collection authorities = auth.getAuthorities(); + String tenant = ""; + for (GrantedAuthority gauth : authorities) { + tenant = gauth.getAuthority(); + } + + AuthenticationService.addToken(res, auth.getName(), tenant.substring(5)); + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/SecurityConfiguration.java b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/SecurityConfiguration.java new file mode 100644 index 0000000000..98c6a9c58d --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/java/com/baeldung/multitenant/security/SecurityConfiguration.java @@ -0,0 +1,56 @@ +package com.baeldung.multitenant.security; + +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.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; + +@Configuration +@EnableWebSecurity +public class SecurityConfiguration extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(AuthenticationManagerBuilder auth) throws Exception { + auth.inMemoryAuthentication() + .passwordEncoder(passwordEncoder()) + .withUser("user") + .password(passwordEncoder().encode("baeldung")) + .roles("tenant_1"); + + auth.inMemoryAuthentication() + .passwordEncoder(passwordEncoder()) + .withUser("admin") + .password(passwordEncoder().encode("baeldung")) + .roles("tenant_2"); + } + + @Bean + public PasswordEncoder passwordEncoder(){ + return new BCryptPasswordEncoder(); + } + + @Override + protected void configure(HttpSecurity http) throws Exception { + http + .authorizeRequests() + .antMatchers("/login").permitAll() + .anyRequest().authenticated() + .and() + .sessionManagement() + .sessionCreationPolicy(SessionCreationPolicy.STATELESS) + .and() + .addFilterBefore(new LoginFilter("/login", authenticationManager()), + UsernamePasswordAuthenticationFilter.class) + .addFilterBefore(new AuthenticationFilter(), UsernamePasswordAuthenticationFilter.class) + .csrf().disable() + .headers().frameOptions().disable() + .and() + .httpBasic(); + } +} diff --git a/persistence-modules/spring-jpa-2/src/main/resources/tenant-schema.sql b/persistence-modules/spring-jpa-2/src/main/resources/tenant-schema.sql new file mode 100644 index 0000000000..675a571fe4 --- /dev/null +++ b/persistence-modules/spring-jpa-2/src/main/resources/tenant-schema.sql @@ -0,0 +1 @@ +create table employee (id int8 generated by default as identity, name varchar(255), primary key (id)); \ No newline at end of file From 876d78b188781fd5f3b7d959de091ee35d836771 Mon Sep 17 00:00:00 2001 From: kpentaris Date: Wed, 24 Aug 2022 16:47:46 +0300 Subject: [PATCH 52/73] [BAEL-4500] Add locked ownable synchronizers example code (#12608) * Add locked ownable synchronizers example code * refactor application snippet --- .../ownablesynchronizers/Application.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 core-java-modules/core-java-concurrency-advanced-4/src/main/java/com/baeldung/ownablesynchronizers/Application.java diff --git a/core-java-modules/core-java-concurrency-advanced-4/src/main/java/com/baeldung/ownablesynchronizers/Application.java b/core-java-modules/core-java-concurrency-advanced-4/src/main/java/com/baeldung/ownablesynchronizers/Application.java new file mode 100644 index 0000000000..d09c59fedc --- /dev/null +++ b/core-java-modules/core-java-concurrency-advanced-4/src/main/java/com/baeldung/ownablesynchronizers/Application.java @@ -0,0 +1,45 @@ +package com.baeldung.ownablesynchronizers; + +import java.util.concurrent.locks.ReentrantLock; + +public class Application { + + public static Thread createThread(ReentrantLock mainLock, ReentrantLock otherLock, String threadName) { + return new Thread(() -> { + try { + mainLock.lock(); + + // synchronized block here allows us to wait for other thread to lock, + // in order to simulate a deadlock + synchronized (Application.class) { + Application.class.notify(); + if (!otherLock.isLocked()) { + Application.class.wait(); + } + } + + // thread will hang here + otherLock.lock(); + + System.out.println(threadName + ": Finished"); + mainLock.unlock(); + otherLock.unlock(); + } catch (InterruptedException e) { + System.out.println(threadName + ": " + e.getMessage()); + } + }); + } + + public static void main(String[] args) throws Exception { + ReentrantLock firstLock = new ReentrantLock(true); + ReentrantLock secondLock = new ReentrantLock(true); + Thread first = createThread(firstLock, secondLock, "Thread-0"); + Thread second = createThread(secondLock, firstLock, "Thread-1"); + + first.start(); + second.start(); + + first.join(); + second.join(); + } +} From 18d1cb40dc7914f8f439592ccdea009ef944f6e1 Mon Sep 17 00:00:00 2001 From: Kai Yuan Date: Thu, 25 Aug 2022 03:40:26 +0200 Subject: [PATCH 53/73] Armstrong Number in Java (#12637) --- .../armstrong/ArmstrongNumberUtil.java | 44 +++++++++++++++++++ .../ArmstrongNumberUtilUnitTest.java | 40 +++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/armstrong/ArmstrongNumberUtil.java create mode 100644 core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/armstrong/ArmstrongNumberUtilUnitTest.java diff --git a/core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/armstrong/ArmstrongNumberUtil.java b/core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/armstrong/ArmstrongNumberUtil.java new file mode 100644 index 0000000000..79129db009 --- /dev/null +++ b/core-java-modules/core-java-numbers-5/src/main/java/com/baeldung/armstrong/ArmstrongNumberUtil.java @@ -0,0 +1,44 @@ +package com.baeldung.armstrong; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +public class ArmstrongNumberUtil { + + public static boolean isArmstrong(int n) { + if (n < 0) { + return false; + } + List digitsList = digitsInList(n); + int len = digitsList.size(); + int sum = digitsList.stream() + .mapToInt(d -> (int) Math.pow(d, len)) + .sum(); + // alternatively, we can use the reduce() method: + // int sum = digits.stream() + // .reduce(0, (subtotal, digit) -> subtotal + (int) Math.pow(digit, len)); + return n == sum; + } + + private static List digitsInList(int n) { + List list = new ArrayList<>(); + while (n > 0) { + list.add(n % 10); + n = n / 10; + } + return list; + } + + public static List getA005188Sequence(int limit) { + if (limit < 0) { + throw new IllegalArgumentException("The limit cannot be a negative number."); + } + return IntStream.range(0, limit) + .boxed() + .filter(ArmstrongNumberUtil::isArmstrong) + .collect(Collectors.toList()); + + } +} diff --git a/core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/armstrong/ArmstrongNumberUtilUnitTest.java b/core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/armstrong/ArmstrongNumberUtilUnitTest.java new file mode 100644 index 0000000000..78d362c8ef --- /dev/null +++ b/core-java-modules/core-java-numbers-5/src/test/java/com/baeldung/armstrong/ArmstrongNumberUtilUnitTest.java @@ -0,0 +1,40 @@ +package com.baeldung.armstrong; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.List; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +class ArmstrongNumberUtilUnitTest { + // @formatter:off +private static final Map ARMSTRONG_MAP = ImmutableMap.of( + 0, true, + 1, true, + 2, true, + 153, true, + 370, true, + 407, true, + 42, false, + 777, false, + 12345, false); + // @formatter:on + + private static final List A005188_SEQ_1K = ImmutableList.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407); + private static final List A005188_SEQ_10K = ImmutableList.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474); + + @Test + void givenIntegers_whenCheckArmstrong_shouldReturnExpectedResult() { + ARMSTRONG_MAP.forEach((number, result) -> assertEquals(result, ArmstrongNumberUtil.isArmstrong(number))); + } + + @Test + void givenALimit_whenFindArmstrong_shouldReturnExpectedResult() { + assertEquals(A005188_SEQ_1K, ArmstrongNumberUtil.getA005188Sequence(1000)); + assertEquals(A005188_SEQ_10K, ArmstrongNumberUtil.getA005188Sequence(10000)); + } +} From 0a0edd8569742a5abf6a7f5b87b9709de7d11f9f Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:23:45 +0500 Subject: [PATCH 54/73] Updated README.md added link back to the article: https://www.baeldung.com/java-tostring-valueof --- core-java-modules/core-java-string-conversions-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-string-conversions-2/README.md b/core-java-modules/core-java-string-conversions-2/README.md index 71f35c17b1..19f660534f 100644 --- a/core-java-modules/core-java-string-conversions-2/README.md +++ b/core-java-modules/core-java-string-conversions-2/README.md @@ -12,4 +12,5 @@ This module contains articles about string conversions from/to another type. - [Convert a ByteBuffer to String in Java](https://www.baeldung.com/java-bytebuffer-to-string) - [Convert String to Float and Back in Java](https://www.baeldung.com/java-string-to-float) - [Difference Between parseInt() and valueOf() in Java](https://www.baeldung.com/java-integer-parseint-vs-valueof) +- [Integer.toString() vs String.valueOf() in Java](https://www.baeldung.com/java-tostring-valueof) - More articles: [[<-- prev]](/core-java-modules/core-java-string-conversions) From 9721105cf2fbf3eed8c3808fa66b275ba8d87a73 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:32:08 +0500 Subject: [PATCH 55/73] Updated the README.md added link back to the article: https://www.baeldung.com/java-string-permutations --- algorithms-modules/algorithms-miscellaneous-4/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/algorithms-modules/algorithms-miscellaneous-4/README.md b/algorithms-modules/algorithms-miscellaneous-4/README.md index 2649df9fc9..e2ae542bf8 100644 --- a/algorithms-modules/algorithms-miscellaneous-4/README.md +++ b/algorithms-modules/algorithms-miscellaneous-4/README.md @@ -11,4 +11,5 @@ This module contains articles about algorithms. Some classes of algorithms, e.g. - [Find the Longest Substring without Repeating Characters](https://www.baeldung.com/java-longest-substring-without-repeated-characters) - [Permutations of an Array in Java](https://www.baeldung.com/java-array-permutations) - [Find the Smallest Missing Integer in an Array](https://www.baeldung.com/java-smallest-missing-integer-in-array) +- [Permutations of a String in Java](https://www.baeldung.com/java-string-permutations) - More articles: [[<-- prev]](/algorithms-miscellaneous-3) [[next -->]](/algorithms-miscellaneous-5) From 974174bdb9b7aac6b3fbbf9bc639efe5c23dfdcc Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:36:48 +0500 Subject: [PATCH 56/73] Updated README.md added link back to the article: https://www.baeldung.com/apache-kafka-check-server-is-running --- apache-kafka-2/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apache-kafka-2/README.md b/apache-kafka-2/README.md index f43d51c20c..ec9e8e2adc 100644 --- a/apache-kafka-2/README.md +++ b/apache-kafka-2/README.md @@ -4,3 +4,6 @@ This module contains articles about Apache Kafka. ##### Building the project You can build the project from the command line using: *mvn clean install*, or in an IDE. + +### Relevant Articles: +- [Guide to Check if Apache Kafka Server Is Running](https://www.baeldung.com/apache-kafka-check-server-is-running) From afc57731b479e79cf6eef2a4ae504d2bd198ad44 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:42:01 +0500 Subject: [PATCH 57/73] Updated README.md added link back to the article: https://www.baeldung.com/swagger-apioperation-vs-apiresponse --- spring-boot-modules/spring-boot-swagger/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-modules/spring-boot-swagger/README.md b/spring-boot-modules/spring-boot-swagger/README.md index a09df23a80..c3f6578dee 100644 --- a/spring-boot-modules/spring-boot-swagger/README.md +++ b/spring-boot-modules/spring-boot-swagger/README.md @@ -6,3 +6,4 @@ - [Remove Basic Error Controller In SpringFox Swagger-UI](https://www.baeldung.com/spring-swagger-remove-error-controller) - [Setting Example and Description with Swagger](https://www.baeldung.com/swagger-set-example-description) - [Document Enum in Swagger](https://www.baeldung.com/swagger-enum) +- [@ApiOperation vs @ApiResponse in Swagger](https://www.baeldung.com/swagger-apioperation-vs-apiresponse) From 4859fc9324405061d4b077bcfbb738ec7eab5c59 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:50:48 +0500 Subject: [PATCH 58/73] Updated README.md added link back to the article: https://www.baeldung.com/java-read-json-from-url --- jackson-modules/jackson-conversions-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/jackson-modules/jackson-conversions-2/README.md b/jackson-modules/jackson-conversions-2/README.md index fa3568652a..0490f671dd 100644 --- a/jackson-modules/jackson-conversions-2/README.md +++ b/jackson-modules/jackson-conversions-2/README.md @@ -12,4 +12,5 @@ This module contains articles about Jackson conversions. - [Jackson: java.util.LinkedHashMap cannot be cast to X](https://www.baeldung.com/jackson-linkedhashmap-cannot-be-cast) - [Deserialize Snake Case to Camel Case With Jackson](https://www.baeldung.com/jackson-deserialize-snake-to-camel-case) - [Serialize and Deserialize Booleans as Integers With Jackson](https://www.baeldung.com/jackson-booleans-as-integers) +- [Reading JSON From a URL in Java](https://www.baeldung.com/java-read-json-from-url) - More articles: [[<-- prev]](../jackson-conversions) From 8bc901c7d14449fd5aa8cb6446cae64f603ac42d Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:59:44 +0500 Subject: [PATCH 59/73] Updated README.md added link back to the article: https://www.baeldung.com/java-check-number-positive-negative --- core-java-modules/core-java-numbers-5/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-numbers-5/README.md b/core-java-modules/core-java-numbers-5/README.md index d7e37d0ee7..37501ea31a 100644 --- a/core-java-modules/core-java-numbers-5/README.md +++ b/core-java-modules/core-java-numbers-5/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Check if a Number Is Odd or Even](https://www.baeldung.com/java-check-number-parity) - [How to Check Whether an Integer Exists in a Range with Java](https://www.baeldung.com/java-interval-contains-integer) +- [Check if a Number Is Positive or Negative in Java](https://www.baeldung.com/java-check-number-positive-negative) From 46b3bde188e86873d58a0ee892698bfff216181e Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 17:04:21 +0500 Subject: [PATCH 60/73] Updated README.md added link back to the article: https://www.baeldung.com/java-toggle-boolean --- core-java-modules/core-java-lang-5/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-lang-5/README.md b/core-java-modules/core-java-lang-5/README.md index 9505d02fc2..84e9a575c2 100644 --- a/core-java-modules/core-java-lang-5/README.md +++ b/core-java-modules/core-java-lang-5/README.md @@ -6,3 +6,4 @@ This module contains articles about core features in the Java language - [Difference Between == and equals() in Java](https://www.baeldung.com/java-equals-method-operator-difference) - [Advantages and Disadvantages of Using Java Wildcard Imports](https://www.baeldung.com/java-wildcard-imports) +- [Toggle a Boolean Variable in Java](https://www.baeldung.com/java-toggle-boolean) From eb6eba85752a3ae2c9775673396b1ead8c268560 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 18:29:34 +0500 Subject: [PATCH 61/73] Updated README.md added link back to the article: https://www.baeldung.com/spring-jdbc-batch-inserts --- persistence-modules/spring-jdbc/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-jdbc/README.md b/persistence-modules/spring-jdbc/README.md index 437a1312da..22f7fb3d63 100644 --- a/persistence-modules/spring-jdbc/README.md +++ b/persistence-modules/spring-jdbc/README.md @@ -5,3 +5,4 @@ - [Spring JdbcTemplate Unit Testing](https://www.baeldung.com/spring-jdbctemplate-testing) - [Using a List of Values in a JdbcTemplate IN Clause](https://www.baeldung.com/spring-jdbctemplate-in-list) - [Obtaining Auto-generated Keys in Spring JDBC](https://www.baeldung.com/spring-jdbc-autogenerated-keys) +- [Spring JDBC Batch Inserts](https://www.baeldung.com/spring-jdbc-batch-inserts) From 84a5e7f58f51af72f9237534705bd16f017c2904 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 18:32:51 +0500 Subject: [PATCH 62/73] Updated README.md added a link back to the article: https://www.baeldung.com/fauna-spring-building-iot-applications --- persistence-modules/fauna/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/fauna/README.md b/persistence-modules/fauna/README.md index f0899ceaf7..245c2a613b 100644 --- a/persistence-modules/fauna/README.md +++ b/persistence-modules/fauna/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Building a web app Using Fauna and Spring for Your First web Agency Client](https://www.baeldung.com/faunadb-spring-web-app) +- [Building IoT Applications Using Fauna and Spring](https://www.baeldung.com/fauna-spring-building-iot-applications) From 3ce04cafd5b8e4e82ce38a51bfbe9fd0f5f5c6aa Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:47:55 +0100 Subject: [PATCH 63/73] [Java 11502] (#12625) * [JAVA-11502] Added vavr-modules (parent) * [JAVA-11502] Added vavr(submodule) to vavr-modules(parent) * [JAVA-11502] Added vavr-2(submodule) to vavr-modules(parent) * [JAVA-11502] Added java-vavr-stream(submodule) to vavr-modules(parent) * [JAVA-11502] deleted modules that were moved + cleanup Co-authored-by: panagiotiskakos Co-authored-by: Dhawal Kapil --- pom.xml | 10 +- vavr-modules/README.md | 3 + .../java-vavr-stream}/README.md | 0 .../java-vavr-stream}/pom.xml | 2 +- .../samples/java/vavr/VavrSampler.java | 0 .../src/main/resources/logback.xml | 0 vavr-modules/pom.xml | 33 +++ {vavr-2 => vavr-modules/vavr-2}/README.md | 0 {vavr-2 => vavr-modules/vavr-2}/pom.xml | 7 +- .../com/baeldung/vavr/either/EitherDemo.java | 0 .../baeldung/vavr/either/EitherUnitTest.java | 0 .../CollectionsInteroperabilityUnitTest.java | 0 {vavr => vavr-modules/vavr}/README.md | 0 {vavr => vavr-modules/vavr}/pom.xml | 2 +- .../main/java/com/baeldung/Application.java | 0 .../repositories/VavrUserRepository.java | 0 .../samples/java/vavr/VavrSampler.java | 0 .../main/java/com/baeldung/vavr/Person.java | 0 .../com/baeldung/vavr/PersonValidator.java | 0 .../src/main/java/com/baeldung/vavr/User.java | 0 .../vavr/exception/handling/JavaTryCatch.java | 0 .../vavr/exception/handling/VavrTry.java | 0 .../handling/client/ClientException.java | 0 .../exception/handling/client/HttpClient.java | 0 .../exception/handling/client/Response.java | 0 .../application/Application.java | 0 .../baeldung/vavrvalidation/model/User.java | 0 .../validator/UserValidator.java | 0 .../vavr}/src/main/resources/logback.xml | 0 .../vavr/PatternMatchingUnitTest.java | 0 .../PropertyBasedLongRunningUnitTest.java | 0 .../java/com/baeldung/vavr/VavrUnitTest.java | 0 .../collections/CollectionAPIUnitTest.java | 0 .../CollectionFactoryMethodsUnitTest.java | 214 +++++++++--------- .../VavrExceptionHandlingUnitTest.java | 174 +++++++------- .../exception/handling/VavrTryUnitTest.java | 0 .../baeldung/vavr/future/FutureUnitTest.java | 0 .../VavrRepositoryIntegrationTest.java | 0 .../validator/UserValidatorUnitTest.java | 0 .../validator/ValidationUnitTest.java | 0 40 files changed, 239 insertions(+), 206 deletions(-) create mode 100644 vavr-modules/README.md rename {java-vavr-stream => vavr-modules/java-vavr-stream}/README.md (100%) rename {java-vavr-stream => vavr-modules/java-vavr-stream}/pom.xml (94%) rename {java-vavr-stream => vavr-modules/java-vavr-stream}/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java (100%) rename {java-vavr-stream => vavr-modules/java-vavr-stream}/src/main/resources/logback.xml (100%) create mode 100644 vavr-modules/pom.xml rename {vavr-2 => vavr-modules/vavr-2}/README.md (100%) rename {vavr-2 => vavr-modules/vavr-2}/pom.xml (74%) rename {vavr-2 => vavr-modules/vavr-2}/src/main/java/com/baeldung/vavr/either/EitherDemo.java (100%) rename {vavr-2 => vavr-modules/vavr-2}/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java (100%) rename {vavr-2 => vavr-modules/vavr-2}/src/test/java/com/baeldung/vavr/interoperability/CollectionsInteroperabilityUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/README.md (100%) rename {vavr => vavr-modules/vavr}/pom.xml (96%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/Application.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/repositories/VavrUserRepository.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/Person.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/PersonValidator.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/User.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/exception/handling/JavaTryCatch.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/exception/handling/VavrTry.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/exception/handling/client/ClientException.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/exception/handling/client/HttpClient.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavr/exception/handling/client/Response.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavrvalidation/application/Application.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavrvalidation/model/User.java (100%) rename {vavr => vavr-modules/vavr}/src/main/java/com/baeldung/vavrvalidation/validator/UserValidator.java (100%) rename {vavr => vavr-modules/vavr}/src/main/resources/logback.xml (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/PropertyBasedLongRunningUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/VavrUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/collections/CollectionAPIUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/collections/CollectionFactoryMethodsUnitTest.java (96%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/exception/handling/VavrExceptionHandlingUnitTest.java (96%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/exception/handling/VavrTryUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/future/FutureUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavrvalidation/validator/UserValidatorUnitTest.java (100%) rename {vavr => vavr-modules/vavr}/src/test/java/com/baeldung/vavrvalidation/validator/ValidationUnitTest.java (100%) diff --git a/pom.xml b/pom.xml index b8a73ad0a0..4bd983e30b 100644 --- a/pom.xml +++ b/pom.xml @@ -410,7 +410,6 @@ java-jdi java-rmi java-spi - java-vavr-stream java-websocket javax-sound javaxval @@ -488,6 +487,7 @@ reactive-systems security-modules slack + vavr-modules web-modules @@ -692,8 +692,7 @@ spring-ejb-modules/ejb-beans vaadin - vavr - vavr-2 + vavr-modules @@ -809,7 +808,6 @@ java-jdi java-rmi java-spi - java-vavr-stream java-websocket javax-sound javaxval @@ -889,6 +887,7 @@ reactive-systems security-modules slack + vavr-modules web-modules @@ -1079,8 +1078,7 @@ spring-ejb-modules/ejb-beans vaadin - vavr - vavr-2 + vavr-modules diff --git a/vavr-modules/README.md b/vavr-modules/README.md new file mode 100644 index 0000000000..fa2a448f3a --- /dev/null +++ b/vavr-modules/README.md @@ -0,0 +1,3 @@ +## VAVR + +This module contains modules about vavr. \ No newline at end of file diff --git a/java-vavr-stream/README.md b/vavr-modules/java-vavr-stream/README.md similarity index 100% rename from java-vavr-stream/README.md rename to vavr-modules/java-vavr-stream/README.md diff --git a/java-vavr-stream/pom.xml b/vavr-modules/java-vavr-stream/pom.xml similarity index 94% rename from java-vavr-stream/pom.xml rename to vavr-modules/java-vavr-stream/pom.xml index 8358c29003..cda9d1f734 100644 --- a/java-vavr-stream/pom.xml +++ b/vavr-modules/java-vavr-stream/pom.xml @@ -11,7 +11,7 @@ com.baeldung - parent-modules + vavr-modules 1.0.0-SNAPSHOT diff --git a/java-vavr-stream/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java b/vavr-modules/java-vavr-stream/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java similarity index 100% rename from java-vavr-stream/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java rename to vavr-modules/java-vavr-stream/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java diff --git a/java-vavr-stream/src/main/resources/logback.xml b/vavr-modules/java-vavr-stream/src/main/resources/logback.xml similarity index 100% rename from java-vavr-stream/src/main/resources/logback.xml rename to vavr-modules/java-vavr-stream/src/main/resources/logback.xml diff --git a/vavr-modules/pom.xml b/vavr-modules/pom.xml new file mode 100644 index 0000000000..d570df6d34 --- /dev/null +++ b/vavr-modules/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + vavr-modules + vavr-modules + pom + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + + + vavr + vavr-2 + java-vavr-stream + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + \ No newline at end of file diff --git a/vavr-2/README.md b/vavr-modules/vavr-2/README.md similarity index 100% rename from vavr-2/README.md rename to vavr-modules/vavr-2/README.md diff --git a/vavr-2/pom.xml b/vavr-modules/vavr-2/pom.xml similarity index 74% rename from vavr-2/pom.xml rename to vavr-modules/vavr-2/pom.xml index f3640d7c6e..681886ac11 100644 --- a/vavr-2/pom.xml +++ b/vavr-modules/vavr-2/pom.xml @@ -1,18 +1,17 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 vavr-2 vavr-2 jar - parent-modules com.baeldung + vavr-modules 1.0.0-SNAPSHOT - io.vavr diff --git a/vavr-2/src/main/java/com/baeldung/vavr/either/EitherDemo.java b/vavr-modules/vavr-2/src/main/java/com/baeldung/vavr/either/EitherDemo.java similarity index 100% rename from vavr-2/src/main/java/com/baeldung/vavr/either/EitherDemo.java rename to vavr-modules/vavr-2/src/main/java/com/baeldung/vavr/either/EitherDemo.java diff --git a/vavr-2/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java b/vavr-modules/vavr-2/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java similarity index 100% rename from vavr-2/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java rename to vavr-modules/vavr-2/src/test/java/com/baeldung/vavr/either/EitherUnitTest.java diff --git a/vavr-2/src/test/java/com/baeldung/vavr/interoperability/CollectionsInteroperabilityUnitTest.java b/vavr-modules/vavr-2/src/test/java/com/baeldung/vavr/interoperability/CollectionsInteroperabilityUnitTest.java similarity index 100% rename from vavr-2/src/test/java/com/baeldung/vavr/interoperability/CollectionsInteroperabilityUnitTest.java rename to vavr-modules/vavr-2/src/test/java/com/baeldung/vavr/interoperability/CollectionsInteroperabilityUnitTest.java diff --git a/vavr/README.md b/vavr-modules/vavr/README.md similarity index 100% rename from vavr/README.md rename to vavr-modules/vavr/README.md diff --git a/vavr/pom.xml b/vavr-modules/vavr/pom.xml similarity index 96% rename from vavr/pom.xml rename to vavr-modules/vavr/pom.xml index 1604ecc06e..5f6bf4db98 100644 --- a/vavr/pom.xml +++ b/vavr-modules/vavr/pom.xml @@ -11,7 +11,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/vavr/src/main/java/com/baeldung/Application.java b/vavr-modules/vavr/src/main/java/com/baeldung/Application.java similarity index 100% rename from vavr/src/main/java/com/baeldung/Application.java rename to vavr-modules/vavr/src/main/java/com/baeldung/Application.java diff --git a/vavr/src/main/java/com/baeldung/repositories/VavrUserRepository.java b/vavr-modules/vavr/src/main/java/com/baeldung/repositories/VavrUserRepository.java similarity index 100% rename from vavr/src/main/java/com/baeldung/repositories/VavrUserRepository.java rename to vavr-modules/vavr/src/main/java/com/baeldung/repositories/VavrUserRepository.java diff --git a/vavr/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java b/vavr-modules/vavr/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java similarity index 100% rename from vavr/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java rename to vavr-modules/vavr/src/main/java/com/baeldung/samples/java/vavr/VavrSampler.java diff --git a/vavr/src/main/java/com/baeldung/vavr/Person.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/Person.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/Person.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/Person.java diff --git a/vavr/src/main/java/com/baeldung/vavr/PersonValidator.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/PersonValidator.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/PersonValidator.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/PersonValidator.java diff --git a/vavr/src/main/java/com/baeldung/vavr/User.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/User.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/User.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/User.java diff --git a/vavr/src/main/java/com/baeldung/vavr/exception/handling/JavaTryCatch.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/JavaTryCatch.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/exception/handling/JavaTryCatch.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/JavaTryCatch.java diff --git a/vavr/src/main/java/com/baeldung/vavr/exception/handling/VavrTry.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/VavrTry.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/exception/handling/VavrTry.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/VavrTry.java diff --git a/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/ClientException.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/ClientException.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/exception/handling/client/ClientException.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/ClientException.java diff --git a/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/HttpClient.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/HttpClient.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/exception/handling/client/HttpClient.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/HttpClient.java diff --git a/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/Response.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/Response.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavr/exception/handling/client/Response.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavr/exception/handling/client/Response.java diff --git a/vavr/src/main/java/com/baeldung/vavrvalidation/application/Application.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavrvalidation/application/Application.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavrvalidation/application/Application.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavrvalidation/application/Application.java diff --git a/vavr/src/main/java/com/baeldung/vavrvalidation/model/User.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavrvalidation/model/User.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavrvalidation/model/User.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavrvalidation/model/User.java diff --git a/vavr/src/main/java/com/baeldung/vavrvalidation/validator/UserValidator.java b/vavr-modules/vavr/src/main/java/com/baeldung/vavrvalidation/validator/UserValidator.java similarity index 100% rename from vavr/src/main/java/com/baeldung/vavrvalidation/validator/UserValidator.java rename to vavr-modules/vavr/src/main/java/com/baeldung/vavrvalidation/validator/UserValidator.java diff --git a/vavr/src/main/resources/logback.xml b/vavr-modules/vavr/src/main/resources/logback.xml similarity index 100% rename from vavr/src/main/resources/logback.xml rename to vavr-modules/vavr/src/main/resources/logback.xml diff --git a/vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/PatternMatchingUnitTest.java diff --git a/vavr/src/test/java/com/baeldung/vavr/PropertyBasedLongRunningUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/PropertyBasedLongRunningUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavr/PropertyBasedLongRunningUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/PropertyBasedLongRunningUnitTest.java diff --git a/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/VavrUnitTest.java diff --git a/vavr/src/test/java/com/baeldung/vavr/collections/CollectionAPIUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/collections/CollectionAPIUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavr/collections/CollectionAPIUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/collections/CollectionAPIUnitTest.java diff --git a/vavr/src/test/java/com/baeldung/vavr/collections/CollectionFactoryMethodsUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/collections/CollectionFactoryMethodsUnitTest.java similarity index 96% rename from vavr/src/test/java/com/baeldung/vavr/collections/CollectionFactoryMethodsUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/collections/CollectionFactoryMethodsUnitTest.java index 60359d6803..1bae70a3d4 100644 --- a/vavr/src/test/java/com/baeldung/vavr/collections/CollectionFactoryMethodsUnitTest.java +++ b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/collections/CollectionFactoryMethodsUnitTest.java @@ -1,107 +1,107 @@ -package com.baeldung.vavr.collections; - -import static io.vavr.API.Array; -import static io.vavr.API.Failure; -import static io.vavr.API.List; -import static io.vavr.API.None; -import static io.vavr.API.Some; -import static io.vavr.API.Stream; -import static io.vavr.API.Success; -import static io.vavr.API.Tuple; -import static io.vavr.API.Vector; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -import org.junit.Test; - -import io.vavr.Tuple3; -import io.vavr.collection.Array; -import io.vavr.collection.List; -import io.vavr.collection.Stream; -import io.vavr.collection.Vector; -import io.vavr.control.Option; -import io.vavr.control.Try; - -public class CollectionFactoryMethodsUnitTest { - - @Test - public void givenANoneOptionElement_whenCreated_thenCorrect() { - Option none = None(); - assertFalse(none == null); - assertEquals(none, Option.none()); - } - - @Test - public void givenASomeOptionElement_whenCreated_thenCorrect() { - Option some = Some(1); - assertFalse(some == null); - assertTrue(some.contains(1)); - } - - @Test - public void givenATupleElement_whenCreated_thenCorrect() { - Tuple3 tuple = Tuple('a', "chain", 2); - assertTrue(tuple!=null); - assertEquals(tuple._1(), new Character('a')); - assertEquals(tuple._2(), "chain"); - assertEquals(tuple._3().intValue(), 2); - } - - @Test - public void givenASuccessObject_whenEvaluated_thenSuccess() { - Try integer = Success(55); - assertEquals(integer.get().intValue(), 55); - } - @Test - public void givenAFailureObject_whenEvaluated_thenExceptionThrown() { - Try failure = Failure(new Exception("Exception X encapsulated here")); - - try { - Integer i = failure.get();// evaluate a failure raise the exception - System.out.println(i);// not executed - } catch (Exception e) { - assertEquals(e.getMessage(), "Exception X encapsulated here"); - } - } - - @Test - public void givenAList_whenCreated_thenCorrect() { - List list = List(1, 2, 3, 4, 5); - - assertEquals(list.size(), 5); - assertEquals(list.get(0).intValue(), 1); - } - - @Test - public void givenAnEmptyList_whenCreated_thenCorrect() { - List empty = List(); - - assertEquals(empty.size(), 0); - assertEquals(empty, List.empty()); - } - - @Test - public void givenAnArray_whenCreated_thenCorrect() { - Array array = Array(1, 2, 3, 4, 5); - - assertEquals(array.size(), 5); - assertEquals(array.get(0).intValue(), 1); - } - - @Test - public void givenAStream_whenCreated_thenCorrect() { - Stream stream = Stream(1, 2, 3, 4, 5); - - assertEquals(stream.size(), 5); - assertEquals(stream.get(0).intValue(), 1); - } - - @Test - public void givenAVector_whenCreated_thenCorrect() { - Vector vector = Vector(1, 2, 3, 4, 5); - - assertEquals(vector.size(), 5); - assertEquals(vector.get(0).intValue(), 1); - } -} +package com.baeldung.vavr.collections; + +import static io.vavr.API.Array; +import static io.vavr.API.Failure; +import static io.vavr.API.List; +import static io.vavr.API.None; +import static io.vavr.API.Some; +import static io.vavr.API.Stream; +import static io.vavr.API.Success; +import static io.vavr.API.Tuple; +import static io.vavr.API.Vector; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import io.vavr.Tuple3; +import io.vavr.collection.Array; +import io.vavr.collection.List; +import io.vavr.collection.Stream; +import io.vavr.collection.Vector; +import io.vavr.control.Option; +import io.vavr.control.Try; + +public class CollectionFactoryMethodsUnitTest { + + @Test + public void givenANoneOptionElement_whenCreated_thenCorrect() { + Option none = None(); + assertFalse(none == null); + assertEquals(none, Option.none()); + } + + @Test + public void givenASomeOptionElement_whenCreated_thenCorrect() { + Option some = Some(1); + assertFalse(some == null); + assertTrue(some.contains(1)); + } + + @Test + public void givenATupleElement_whenCreated_thenCorrect() { + Tuple3 tuple = Tuple('a', "chain", 2); + assertTrue(tuple!=null); + assertEquals(tuple._1(), new Character('a')); + assertEquals(tuple._2(), "chain"); + assertEquals(tuple._3().intValue(), 2); + } + + @Test + public void givenASuccessObject_whenEvaluated_thenSuccess() { + Try integer = Success(55); + assertEquals(integer.get().intValue(), 55); + } + @Test + public void givenAFailureObject_whenEvaluated_thenExceptionThrown() { + Try failure = Failure(new Exception("Exception X encapsulated here")); + + try { + Integer i = failure.get();// evaluate a failure raise the exception + System.out.println(i);// not executed + } catch (Exception e) { + assertEquals(e.getMessage(), "Exception X encapsulated here"); + } + } + + @Test + public void givenAList_whenCreated_thenCorrect() { + List list = List(1, 2, 3, 4, 5); + + assertEquals(list.size(), 5); + assertEquals(list.get(0).intValue(), 1); + } + + @Test + public void givenAnEmptyList_whenCreated_thenCorrect() { + List empty = List(); + + assertEquals(empty.size(), 0); + assertEquals(empty, List.empty()); + } + + @Test + public void givenAnArray_whenCreated_thenCorrect() { + Array array = Array(1, 2, 3, 4, 5); + + assertEquals(array.size(), 5); + assertEquals(array.get(0).intValue(), 1); + } + + @Test + public void givenAStream_whenCreated_thenCorrect() { + Stream stream = Stream(1, 2, 3, 4, 5); + + assertEquals(stream.size(), 5); + assertEquals(stream.get(0).intValue(), 1); + } + + @Test + public void givenAVector_whenCreated_thenCorrect() { + Vector vector = Vector(1, 2, 3, 4, 5); + + assertEquals(vector.size(), 5); + assertEquals(vector.get(0).intValue(), 1); + } +} diff --git a/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrExceptionHandlingUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrExceptionHandlingUnitTest.java similarity index 96% rename from vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrExceptionHandlingUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrExceptionHandlingUnitTest.java index 140593218f..5be2526c0b 100644 --- a/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrExceptionHandlingUnitTest.java +++ b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrExceptionHandlingUnitTest.java @@ -1,87 +1,87 @@ -package com.baeldung.vavr.exception.handling; - -import io.vavr.API; -import io.vavr.CheckedFunction1; -import io.vavr.Value; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.Arrays; -import java.util.List; - -public class VavrExceptionHandlingUnitTest { - - private static final Logger LOG = LoggerFactory.getLogger(VavrExceptionHandlingUnitTest.class); - - private List integers; - private List validIntegersOnly; - - @Before - public void init() { - integers = Arrays.asList(3, 9, 7, 0, 10, 20); - validIntegersOnly = Arrays.asList(3, 9, 7, 5, 10, 20); - } - - @Test - public void exceptionCausingMethod_UsingCheckedFunction_ThenSuccess() { - CheckedFunction1 fn = i -> readFromFile(i); - - validIntegersOnly.stream().map(fn.unchecked()).forEach(i -> LOG.debug("{}", i)); - } - - @Test(expected = IOException.class) - public void exceptionCausingMethod_UsingCheckedFunction_ThenFailure() { - CheckedFunction1 fn = i -> readFromFile(i); - - integers.stream().map(fn.unchecked()).forEach(i -> LOG.debug("{}", i)); - } - - @Test - public void exceptionCausingMethod_UsingAPI_ThenSuccess() { - validIntegersOnly.stream().map(API.unchecked(i -> readFromFile(i))).forEach(i -> LOG.debug("{}", i)); - } - - @Test(expected = IOException.class) - public void exceptionCausingMethod_UsingAPI_ThenFailure() { - integers.stream().map(API.unchecked(i -> readFromFile(i))).forEach(i -> LOG.debug("{}", i)); - } - - @Test - public void exceptionCausingMethod_UsingLift_ThenSuccess() { - validIntegersOnly.stream().map(CheckedFunction1.lift(i -> readFromFile(i))) - .map(i -> i.getOrElse(-1)) - .forEach(i -> { - Assert.assertNotSame(-1, i); - LOG.debug("{}", i); - }); - } - - @Test - public void exceptionCausingMethod_UsingLift_ThenFailure() { - integers.stream() - .map(CheckedFunction1.lift(i -> readFromFile(i))) - .map(i -> i.getOrElse(-1)) - .forEach(i -> LOG.debug("{}", i)); - - } - - @Test - public void exceptionCausingMethod_UsingTry_ThenSuccess() { - integers.stream() - .map(CheckedFunction1.liftTry(VavrExceptionHandlingUnitTest::readFromFile)) - .flatMap(Value::toJavaStream) - .forEach(i -> LOG.debug("{}", i)); - } - - private static Integer readFromFile(Integer i) throws IOException { - if (i == 0) { - throw new IOException(); // mock IOException - } - return i * i; - } - -} +package com.baeldung.vavr.exception.handling; + +import io.vavr.API; +import io.vavr.CheckedFunction1; +import io.vavr.Value; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +public class VavrExceptionHandlingUnitTest { + + private static final Logger LOG = LoggerFactory.getLogger(VavrExceptionHandlingUnitTest.class); + + private List integers; + private List validIntegersOnly; + + @Before + public void init() { + integers = Arrays.asList(3, 9, 7, 0, 10, 20); + validIntegersOnly = Arrays.asList(3, 9, 7, 5, 10, 20); + } + + @Test + public void exceptionCausingMethod_UsingCheckedFunction_ThenSuccess() { + CheckedFunction1 fn = i -> readFromFile(i); + + validIntegersOnly.stream().map(fn.unchecked()).forEach(i -> LOG.debug("{}", i)); + } + + @Test(expected = IOException.class) + public void exceptionCausingMethod_UsingCheckedFunction_ThenFailure() { + CheckedFunction1 fn = i -> readFromFile(i); + + integers.stream().map(fn.unchecked()).forEach(i -> LOG.debug("{}", i)); + } + + @Test + public void exceptionCausingMethod_UsingAPI_ThenSuccess() { + validIntegersOnly.stream().map(API.unchecked(i -> readFromFile(i))).forEach(i -> LOG.debug("{}", i)); + } + + @Test(expected = IOException.class) + public void exceptionCausingMethod_UsingAPI_ThenFailure() { + integers.stream().map(API.unchecked(i -> readFromFile(i))).forEach(i -> LOG.debug("{}", i)); + } + + @Test + public void exceptionCausingMethod_UsingLift_ThenSuccess() { + validIntegersOnly.stream().map(CheckedFunction1.lift(i -> readFromFile(i))) + .map(i -> i.getOrElse(-1)) + .forEach(i -> { + Assert.assertNotSame(-1, i); + LOG.debug("{}", i); + }); + } + + @Test + public void exceptionCausingMethod_UsingLift_ThenFailure() { + integers.stream() + .map(CheckedFunction1.lift(i -> readFromFile(i))) + .map(i -> i.getOrElse(-1)) + .forEach(i -> LOG.debug("{}", i)); + + } + + @Test + public void exceptionCausingMethod_UsingTry_ThenSuccess() { + integers.stream() + .map(CheckedFunction1.liftTry(VavrExceptionHandlingUnitTest::readFromFile)) + .flatMap(Value::toJavaStream) + .forEach(i -> LOG.debug("{}", i)); + } + + private static Integer readFromFile(Integer i) throws IOException { + if (i == 0) { + throw new IOException(); // mock IOException + } + return i * i; + } + +} diff --git a/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrTryUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrTryUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrTryUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/exception/handling/VavrTryUnitTest.java diff --git a/vavr/src/test/java/com/baeldung/vavr/future/FutureUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/future/FutureUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavr/future/FutureUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/future/FutureUnitTest.java diff --git a/vavr/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavr/repositories/VavrRepositoryIntegrationTest.java diff --git a/vavr/src/test/java/com/baeldung/vavrvalidation/validator/UserValidatorUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavrvalidation/validator/UserValidatorUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavrvalidation/validator/UserValidatorUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavrvalidation/validator/UserValidatorUnitTest.java diff --git a/vavr/src/test/java/com/baeldung/vavrvalidation/validator/ValidationUnitTest.java b/vavr-modules/vavr/src/test/java/com/baeldung/vavrvalidation/validator/ValidationUnitTest.java similarity index 100% rename from vavr/src/test/java/com/baeldung/vavrvalidation/validator/ValidationUnitTest.java rename to vavr-modules/vavr/src/test/java/com/baeldung/vavrvalidation/validator/ValidationUnitTest.java From f391cba986c83d0ffcfcc0d2ea26a69923ead79b Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:48:34 +0100 Subject: [PATCH 64/73] [Java 11503] (#12626) * [JAVA-11503] Created new vertx-modules * [JAVA-11503] Moved vertx(sub-module) to vertx-modules(parent) * [JAVA-11503] Moved spring-vertx(sub-module) to vertx-modules(parent) * [JAVA-11503] Moved vertx-and-java(sub-module) to vertx-modules(parent) * [JAVA-11503] deleted modules that were moved Co-authored-by: panagiotiskakos --- pom.xml | 8 ++--- vertx-modules/README.md | 3 ++ vertx-modules/pom.xml | 33 +++++++++++++++++++ .../spring-vertx}/README.md | 0 .../spring-vertx}/pom.xml | 2 +- .../vertxspring/VertxSpringApplication.java | 0 .../vertxspring/config/PortConfiguration.java | 0 .../baeldung/vertxspring/entity/Article.java | 0 .../repository/ArticleRepository.java | 0 .../vertxspring/service/ArticleService.java | 0 .../vertxspring/util/DbBootstrap.java | 0 .../verticles/ArticleRecipientVerticle.java | 0 .../vertxspring/verticles/ServerVerticle.java | 0 .../src/main/resources/application.properties | 0 .../src/main/resources/conf/conf.json | 0 .../src/main/resources/logback.xml | 0 .../java/com/baeldung/SpringContextTest.java | 0 ...VertxSpringApplicationIntegrationTest.java | 0 .../vertx-and-rxjava}/.gitignore | 0 .../vertx-and-rxjava}/README.md | 0 .../vertx-and-rxjava}/pom.xml | 2 +- .../vertx-and-rxjava}/pom.xml.orig | 0 .../baeldung/weather/CityAndDayLength.java | 0 .../baeldung/weather/MetaWeatherClient.java | 0 .../VertxWithRxJavaIntegrationTest.java | 0 .../src/test/resources/cities.txt | 0 .../src/test/resources/logback-test.xml | 0 {vertx => vertx-modules/vertx}/README.md | 0 {vertx => vertx-modules/vertx}/pom.xml | 2 +- .../main/java/com/baeldung/HelloVerticle.java | 0 .../com/baeldung/SimpleServerVerticle.java | 0 .../main/java/com/baeldung/model/Article.java | 0 .../baeldung/rest/RestServiceVerticle.java | 0 .../vertx}/src/main/resources/conf/conf.json | 0 .../vertx}/src/main/resources/logback.xml | 0 .../baeldung/RestServiceVerticleUnitTest.java | 0 .../SimpleServerVerticleUnitTest.java | 0 37 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 vertx-modules/README.md create mode 100644 vertx-modules/pom.xml rename {spring-vertx => vertx-modules/spring-vertx}/README.md (100%) rename {spring-vertx => vertx-modules/spring-vertx}/pom.xml (97%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/config/PortConfiguration.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/entity/Article.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/service/ArticleService.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/verticles/ArticleRecipientVerticle.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/resources/application.properties (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/resources/conf/conf.json (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/main/resources/logback.xml (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/test/java/com/baeldung/SpringContextTest.java (100%) rename {spring-vertx => vertx-modules/spring-vertx}/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationIntegrationTest.java (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/.gitignore (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/README.md (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/pom.xml (97%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/pom.xml.orig (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/src/test/java/com/baeldung/weather/CityAndDayLength.java (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/src/test/java/com/baeldung/weather/MetaWeatherClient.java (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/src/test/java/com/baeldung/weather/VertxWithRxJavaIntegrationTest.java (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/src/test/resources/cities.txt (100%) rename {vertx-and-rxjava => vertx-modules/vertx-and-rxjava}/src/test/resources/logback-test.xml (100%) rename {vertx => vertx-modules/vertx}/README.md (100%) rename {vertx => vertx-modules/vertx}/pom.xml (98%) rename {vertx => vertx-modules/vertx}/src/main/java/com/baeldung/HelloVerticle.java (100%) rename {vertx => vertx-modules/vertx}/src/main/java/com/baeldung/SimpleServerVerticle.java (100%) rename {vertx => vertx-modules/vertx}/src/main/java/com/baeldung/model/Article.java (100%) rename {vertx => vertx-modules/vertx}/src/main/java/com/baeldung/rest/RestServiceVerticle.java (100%) rename {vertx => vertx-modules/vertx}/src/main/resources/conf/conf.json (100%) rename {vertx => vertx-modules/vertx}/src/main/resources/logback.xml (100%) rename {vertx => vertx-modules/vertx}/src/test/java/com/baeldung/RestServiceVerticleUnitTest.java (100%) rename {vertx => vertx-modules/vertx}/src/test/java/com/baeldung/SimpleServerVerticleUnitTest.java (100%) diff --git a/pom.xml b/pom.xml index 4bd983e30b..8f4ac4d8de 100644 --- a/pom.xml +++ b/pom.xml @@ -610,7 +610,6 @@ spring-threads spring-vault - spring-vertx spring-web-modules spring-webflux-amqp @@ -627,8 +626,7 @@ undertow - vertx - vertx-and-rxjava + vertx-modules video-tutorials webrtc @@ -1003,7 +1001,6 @@ spring-threads spring-vault - spring-vertx spring-web-modules spring-webflux-amqp @@ -1020,8 +1017,7 @@ undertow - vertx - vertx-and-rxjava + vertx-modules video-tutorials webrtc diff --git a/vertx-modules/README.md b/vertx-modules/README.md new file mode 100644 index 0000000000..983577b923 --- /dev/null +++ b/vertx-modules/README.md @@ -0,0 +1,3 @@ +## VERTX + +This module contains modules about VERTX. \ No newline at end of file diff --git a/vertx-modules/pom.xml b/vertx-modules/pom.xml new file mode 100644 index 0000000000..8c9c36e73e --- /dev/null +++ b/vertx-modules/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + vertx-modules + vertx-modules + pom + + + parent-modules + com.baeldung + 1.0.0-SNAPSHOT + + + + vertx + spring-vertx + vertx-and-rxjava + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + \ No newline at end of file diff --git a/spring-vertx/README.md b/vertx-modules/spring-vertx/README.md similarity index 100% rename from spring-vertx/README.md rename to vertx-modules/spring-vertx/README.md diff --git a/spring-vertx/pom.xml b/vertx-modules/spring-vertx/pom.xml similarity index 97% rename from spring-vertx/pom.xml rename to vertx-modules/spring-vertx/pom.xml index e24bb3f1ee..447d31ee55 100644 --- a/spring-vertx/pom.xml +++ b/vertx-modules/spring-vertx/pom.xml @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/VertxSpringApplication.java diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/config/PortConfiguration.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/config/PortConfiguration.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/config/PortConfiguration.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/config/PortConfiguration.java diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/entity/Article.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/entity/Article.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/entity/Article.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/entity/Article.java diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/repository/ArticleRepository.java diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/service/ArticleService.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/service/ArticleService.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/service/ArticleService.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/service/ArticleService.java diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/util/DbBootstrap.java diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ArticleRecipientVerticle.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ArticleRecipientVerticle.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ArticleRecipientVerticle.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ArticleRecipientVerticle.java diff --git a/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java b/vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java similarity index 100% rename from spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java rename to vertx-modules/spring-vertx/src/main/java/com/baeldung/vertxspring/verticles/ServerVerticle.java diff --git a/spring-vertx/src/main/resources/application.properties b/vertx-modules/spring-vertx/src/main/resources/application.properties similarity index 100% rename from spring-vertx/src/main/resources/application.properties rename to vertx-modules/spring-vertx/src/main/resources/application.properties diff --git a/spring-vertx/src/main/resources/conf/conf.json b/vertx-modules/spring-vertx/src/main/resources/conf/conf.json similarity index 100% rename from spring-vertx/src/main/resources/conf/conf.json rename to vertx-modules/spring-vertx/src/main/resources/conf/conf.json diff --git a/spring-vertx/src/main/resources/logback.xml b/vertx-modules/spring-vertx/src/main/resources/logback.xml similarity index 100% rename from spring-vertx/src/main/resources/logback.xml rename to vertx-modules/spring-vertx/src/main/resources/logback.xml diff --git a/spring-vertx/src/test/java/com/baeldung/SpringContextTest.java b/vertx-modules/spring-vertx/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-vertx/src/test/java/com/baeldung/SpringContextTest.java rename to vertx-modules/spring-vertx/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-vertx/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationIntegrationTest.java b/vertx-modules/spring-vertx/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationIntegrationTest.java similarity index 100% rename from spring-vertx/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationIntegrationTest.java rename to vertx-modules/spring-vertx/src/test/java/com/baeldung/vertxspring/VertxSpringApplicationIntegrationTest.java diff --git a/vertx-and-rxjava/.gitignore b/vertx-modules/vertx-and-rxjava/.gitignore similarity index 100% rename from vertx-and-rxjava/.gitignore rename to vertx-modules/vertx-and-rxjava/.gitignore diff --git a/vertx-and-rxjava/README.md b/vertx-modules/vertx-and-rxjava/README.md similarity index 100% rename from vertx-and-rxjava/README.md rename to vertx-modules/vertx-and-rxjava/README.md diff --git a/vertx-and-rxjava/pom.xml b/vertx-modules/vertx-and-rxjava/pom.xml similarity index 97% rename from vertx-and-rxjava/pom.xml rename to vertx-modules/vertx-and-rxjava/pom.xml index 1793cff1e7..95bf95020a 100644 --- a/vertx-and-rxjava/pom.xml +++ b/vertx-modules/vertx-and-rxjava/pom.xml @@ -8,7 +8,7 @@ com.baeldung - parent-modules + vertx-modules 1.0.0-SNAPSHOT diff --git a/vertx-and-rxjava/pom.xml.orig b/vertx-modules/vertx-and-rxjava/pom.xml.orig similarity index 100% rename from vertx-and-rxjava/pom.xml.orig rename to vertx-modules/vertx-and-rxjava/pom.xml.orig diff --git a/vertx-and-rxjava/src/test/java/com/baeldung/weather/CityAndDayLength.java b/vertx-modules/vertx-and-rxjava/src/test/java/com/baeldung/weather/CityAndDayLength.java similarity index 100% rename from vertx-and-rxjava/src/test/java/com/baeldung/weather/CityAndDayLength.java rename to vertx-modules/vertx-and-rxjava/src/test/java/com/baeldung/weather/CityAndDayLength.java diff --git a/vertx-and-rxjava/src/test/java/com/baeldung/weather/MetaWeatherClient.java b/vertx-modules/vertx-and-rxjava/src/test/java/com/baeldung/weather/MetaWeatherClient.java similarity index 100% rename from vertx-and-rxjava/src/test/java/com/baeldung/weather/MetaWeatherClient.java rename to vertx-modules/vertx-and-rxjava/src/test/java/com/baeldung/weather/MetaWeatherClient.java diff --git a/vertx-and-rxjava/src/test/java/com/baeldung/weather/VertxWithRxJavaIntegrationTest.java b/vertx-modules/vertx-and-rxjava/src/test/java/com/baeldung/weather/VertxWithRxJavaIntegrationTest.java similarity index 100% rename from vertx-and-rxjava/src/test/java/com/baeldung/weather/VertxWithRxJavaIntegrationTest.java rename to vertx-modules/vertx-and-rxjava/src/test/java/com/baeldung/weather/VertxWithRxJavaIntegrationTest.java diff --git a/vertx-and-rxjava/src/test/resources/cities.txt b/vertx-modules/vertx-and-rxjava/src/test/resources/cities.txt similarity index 100% rename from vertx-and-rxjava/src/test/resources/cities.txt rename to vertx-modules/vertx-and-rxjava/src/test/resources/cities.txt diff --git a/vertx-and-rxjava/src/test/resources/logback-test.xml b/vertx-modules/vertx-and-rxjava/src/test/resources/logback-test.xml similarity index 100% rename from vertx-and-rxjava/src/test/resources/logback-test.xml rename to vertx-modules/vertx-and-rxjava/src/test/resources/logback-test.xml diff --git a/vertx/README.md b/vertx-modules/vertx/README.md similarity index 100% rename from vertx/README.md rename to vertx-modules/vertx/README.md diff --git a/vertx/pom.xml b/vertx-modules/vertx/pom.xml similarity index 98% rename from vertx/pom.xml rename to vertx-modules/vertx/pom.xml index 7608b3e355..f8d72f8ae8 100644 --- a/vertx/pom.xml +++ b/vertx-modules/vertx/pom.xml @@ -10,7 +10,7 @@ com.baeldung - parent-modules + vertx-modules 1.0.0-SNAPSHOT diff --git a/vertx/src/main/java/com/baeldung/HelloVerticle.java b/vertx-modules/vertx/src/main/java/com/baeldung/HelloVerticle.java similarity index 100% rename from vertx/src/main/java/com/baeldung/HelloVerticle.java rename to vertx-modules/vertx/src/main/java/com/baeldung/HelloVerticle.java diff --git a/vertx/src/main/java/com/baeldung/SimpleServerVerticle.java b/vertx-modules/vertx/src/main/java/com/baeldung/SimpleServerVerticle.java similarity index 100% rename from vertx/src/main/java/com/baeldung/SimpleServerVerticle.java rename to vertx-modules/vertx/src/main/java/com/baeldung/SimpleServerVerticle.java diff --git a/vertx/src/main/java/com/baeldung/model/Article.java b/vertx-modules/vertx/src/main/java/com/baeldung/model/Article.java similarity index 100% rename from vertx/src/main/java/com/baeldung/model/Article.java rename to vertx-modules/vertx/src/main/java/com/baeldung/model/Article.java diff --git a/vertx/src/main/java/com/baeldung/rest/RestServiceVerticle.java b/vertx-modules/vertx/src/main/java/com/baeldung/rest/RestServiceVerticle.java similarity index 100% rename from vertx/src/main/java/com/baeldung/rest/RestServiceVerticle.java rename to vertx-modules/vertx/src/main/java/com/baeldung/rest/RestServiceVerticle.java diff --git a/vertx/src/main/resources/conf/conf.json b/vertx-modules/vertx/src/main/resources/conf/conf.json similarity index 100% rename from vertx/src/main/resources/conf/conf.json rename to vertx-modules/vertx/src/main/resources/conf/conf.json diff --git a/vertx/src/main/resources/logback.xml b/vertx-modules/vertx/src/main/resources/logback.xml similarity index 100% rename from vertx/src/main/resources/logback.xml rename to vertx-modules/vertx/src/main/resources/logback.xml diff --git a/vertx/src/test/java/com/baeldung/RestServiceVerticleUnitTest.java b/vertx-modules/vertx/src/test/java/com/baeldung/RestServiceVerticleUnitTest.java similarity index 100% rename from vertx/src/test/java/com/baeldung/RestServiceVerticleUnitTest.java rename to vertx-modules/vertx/src/test/java/com/baeldung/RestServiceVerticleUnitTest.java diff --git a/vertx/src/test/java/com/baeldung/SimpleServerVerticleUnitTest.java b/vertx-modules/vertx/src/test/java/com/baeldung/SimpleServerVerticleUnitTest.java similarity index 100% rename from vertx/src/test/java/com/baeldung/SimpleServerVerticleUnitTest.java rename to vertx-modules/vertx/src/test/java/com/baeldung/SimpleServerVerticleUnitTest.java From e151d4d1d00f171b36eff644516d733c52cad5ed Mon Sep 17 00:00:00 2001 From: panos-kakos <102670093+panos-kakos@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:54:56 +0100 Subject: [PATCH 65/73] [JAVA-13220] Added comment about failing test (#12644) Co-authored-by: panagiotiskakos --- .../baeldung/boot/embeddedRedis/TestRedisConfiguration.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java index b4748bcd38..c265d99c9b 100644 --- a/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java +++ b/spring-boot-modules/spring-boot-testing/src/test/java/com/baeldung/boot/embeddedRedis/TestRedisConfiguration.java @@ -14,6 +14,9 @@ public class TestRedisConfiguration { public TestRedisConfiguration(final RedisProperties redisProperties) { this.redisServer = new RedisServer(redisProperties.getRedisPort()); + //Uncomment below if running on windows and can't start redis server +// this.redisServer = RedisServer.builder().setting("maxheap 200m").port(6379).setting("bind localhost").build(); +// redisServer.start(); } @PostConstruct From 7f6b12abcb5f907c8b4e49179e461f2b1fcc6028 Mon Sep 17 00:00:00 2001 From: Haroon Khan Date: Thu, 25 Aug 2022 17:00:13 +0100 Subject: [PATCH 66/73] [JAVA-13976] Fix integration tests after Spring Boot upgrade to 2.7.2 (#12647) --- .../src/main/resources/application.yml | 7 ++++-- apache-olingo/src/main/resources/data.sql | 18 +++++++-------- libraries-data-db/pom.xml | 3 +-- libraries-data-db/src/main/resources/db.sql | 12 +++++----- persistence-modules/r2dbc/pom.xml | 5 ----- ...lication-lazy-load-no-trans-off.properties | 1 + ...plication-lazy-load-no-trans-on.properties | 1 + .../application-persistent-on.properties | 1 + .../src/main/resources/application.properties | 2 ++ .../src/main/resources/application.yaml | 3 +++ .../src/main/resources/data-h2.sql | 10 ++++----- .../src/main/resources/data-trans.sql | 22 +++++++++---------- .../spring-boot-persistence-mongodb/pom.xml | 5 ----- .../com/baeldung/boot/config/H2JpaConfig.java | 1 + .../src/main/resources/application.properties | 4 +++- .../SpringBootProfileIntegrationTest.java | 2 +- .../config/H2TestProfileJPAConfig.java | 1 + ...BootSqlGroupAnnotationIntegrationTest.java | 6 +++-- .../src/test/resources/application.properties | 1 + .../src/test/resources/import_employees.sql | 8 ++++--- .../resources/import_senior_employees.sql | 4 ++-- .../src/main/resources/schema.sql | 2 +- .../repositories/CompanyRepository.java | 2 +- .../src/main/resources/application.properties | 2 ++ .../src/main/resources/application.properties | 1 + .../boot/daos/user/UserRepository.java | 10 ++++----- .../com/baeldung/config/StudentJpaConfig.java | 1 + .../resources/persistence-student.properties | 4 +++- .../baeldung/config/PersistenceConfig.java | 4 ++-- .../src/main/resources/fetching.cfg.xml | 4 ++-- .../src/main/resources/fetchingLazy.cfg.xml | 1 + .../src/main/resources/insert_users.sql | 12 +++++----- .../HibernateFetchingIntegrationTest.java | 2 +- .../src/test/resources/fetching.cfg.xml | 3 ++- .../src/test/resources/fetchingLazy.cfg.xml | 1 + .../src/main/resources/import_entities.sql | 6 ++--- .../repository/CommentRepository.java | 2 +- .../src/main/resources/application.properties | 4 +++- .../src/main/resources/db/import_joins.sql | 18 +++++++-------- .../src/test/resources/entitygraph-data.sql | 12 +++++----- .../test/resources/test-aggregation-data.sql | 14 ++++++------ .../src/test/resources/test-movie-cleanup.sql | 2 +- .../src/test/resources/test-movie-data.sql | 14 ++++++------ .../src/main/resources/schema-all.sql | 2 +- .../baeldung/openapi/OpenApiApplication.java | 15 +++++++++++++ .../main/java/com/baeldung/sprq/SpqrApp.java | 3 +++ .../openapi/OpenApiPetsIntegrationTest.java | 2 +- .../spring-boot-properties/pom.xml | 2 +- .../spring-boot-runtime/pom.xml | 6 +---- 49 files changed, 150 insertions(+), 118 deletions(-) create mode 100644 persistence-modules/spring-data-jpa-crud-2/src/main/resources/application.properties create mode 100644 spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/openapi/OpenApiApplication.java diff --git a/apache-olingo/src/main/resources/application.yml b/apache-olingo/src/main/resources/application.yml index 3e09ea8dd5..e97fec0031 100644 --- a/apache-olingo/src/main/resources/application.yml +++ b/apache-olingo/src/main/resources/application.yml @@ -1,16 +1,19 @@ server: port: 8080 - + spring: jersey: application-path: /odata - + jpa: defer-datasource-initialization: true show-sql: true open-in-view: false hibernate: ddl-auto: update + properties: + hibernate: + globally_quoted_identifiers: true sql: init: diff --git a/apache-olingo/src/main/resources/data.sql b/apache-olingo/src/main/resources/data.sql index 327f2688c5..e872cec10f 100644 --- a/apache-olingo/src/main/resources/data.sql +++ b/apache-olingo/src/main/resources/data.sql @@ -1,12 +1,10 @@ -insert into car_maker(id,name) values (1,'Special Motors'); -insert into car_maker(id,name) values (2,'BWM'); -insert into car_maker(id,name) values (3,'Dolores'); +insert into "car_maker"("id", "name") values (1,'Special Motors'); +insert into "car_maker"("id", "name") values (2,'BWM'); +insert into "car_maker"("id", "name") values (3,'Dolores'); -insert into car_model(id,maker_fk,name,sku,year) values(1,1,'Muze','SM001',2018); -insert into car_model(id,maker_fk,name,sku,year) values(2,1,'Empada','SM002',2008); +insert into "car_model"("id", "maker_fk", "name", "sku", "year") values(1,1,'Muze','SM001',2018); +insert into "car_model"("id", "maker_fk", "name", "sku", "year") values(2,1,'Empada','SM002',2008); -insert into car_model(id,maker_fk,name,sku,year) values(4,2,'BWM-100','BWM100',2008); -insert into car_model(id,maker_fk,name,sku,year) values(5,2,'BWM-200','BWM200',2009); -insert into car_model(id,maker_fk,name,sku,year) values(6,2,'BWM-300','BWM300',2008); - -alter sequence hibernate_sequence restart with 100; \ No newline at end of file +insert into "car_model"("id", "maker_fk", "name", "sku", "year") values(4,2,'BWM-100','BWM100',2008); +insert into "car_model"("id", "maker_fk", "name", "sku", "year") values(5,2,'BWM-200','BWM200',2009); +insert into "car_model"("id", "maker_fk", "name", "sku", "year") values(6,2,'BWM-300','BWM300',2008); diff --git a/libraries-data-db/pom.xml b/libraries-data-db/pom.xml index c0f2848705..8e5140458e 100644 --- a/libraries-data-db/pom.xml +++ b/libraries-data-db/pom.xml @@ -159,7 +159,6 @@ classname="com.gs.fw.common.mithra.generator.MithraGenerator" /> @@ -268,7 +267,7 @@ 11.11.2 - 16.5.1 + 18.1.0 3.0.0 1.8 5.0 diff --git a/libraries-data-db/src/main/resources/db.sql b/libraries-data-db/src/main/resources/db.sql index e6a9ed3fc2..7bcf6f816e 100644 --- a/libraries-data-db/src/main/resources/db.sql +++ b/libraries-data-db/src/main/resources/db.sql @@ -8,7 +8,7 @@ create table dept( loc varchar(13), constraint pk_dept primary key (deptno) ); - + create table emp( empno numeric, ename varchar(10), @@ -26,25 +26,25 @@ insert into dept values(10, 'ACCOUNTING', 'NEW YORK'); insert into dept values(20, 'RESEARCH', 'DALLAS'); insert into dept values(30, 'SALES', 'CHICAGO'); insert into dept values(40, 'OPERATIONS', 'BOSTON'); - + insert into emp values( 7839, 'KING', 'PRESIDENT', null, - to_date('17-11-1981','dd-mm-yyyy'), + parsedatetime('17-11-1981','dd-MM-yyyy'), 7698, null, 10 ); insert into emp values( 7698, 'BLAKE', 'MANAGER', 7839, - to_date('1-5-1981','dd-mm-yyyy'), + parsedatetime('01-05-1981','dd-MM-yyyy'), 7782, null, 20 ); insert into emp values( 7782, 'CLARK', 'MANAGER', 7839, - to_date('9-6-1981','dd-mm-yyyy'), + parsedatetime('09-06-1981','dd-MM-yyyy'), 7566, null, 30 ); insert into emp values( 7566, 'JONES', 'MANAGER', 7839, - to_date('2-4-1981','dd-mm-yyyy'), + parsedatetime('02-04-1981','dd-MM-yyyy'), 7839, null, 40 ); diff --git a/persistence-modules/r2dbc/pom.xml b/persistence-modules/r2dbc/pom.xml index 1ce5eb3e96..f32b37974b 100644 --- a/persistence-modules/r2dbc/pom.xml +++ b/persistence-modules/r2dbc/pom.xml @@ -39,7 +39,6 @@ io.r2dbc r2dbc-h2 - ${r2dbc-h2.version} org.springframework.boot @@ -61,8 +60,4 @@ - - 0.8.1.RELEASE - - \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-off.properties b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-off.properties index a1243dc1df..b030527cca 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-off.properties +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-off.properties @@ -11,4 +11,5 @@ logging.level.org.hibernate.SQL=INFO logging.level.org.hibernate.type=INFO spring.jpa.properties.hibernate.validator.apply_to_ddl=false spring.jpa.properties.hibernate.enable_lazy_load_no_trans=false +spring.jpa.properties.hibernate.globally_quoted_identifiers=true spring.jpa.open-in-view=false \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-on.properties b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-on.properties index 2ea89b2ee6..972a7bb0f3 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-on.properties +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-lazy-load-no-trans-on.properties @@ -11,4 +11,5 @@ logging.level.org.hibernate.SQL=INFO logging.level.org.hibernate.type=INFO spring.jpa.properties.hibernate.validator.apply_to_ddl=false spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true +spring.jpa.properties.hibernate.globally_quoted_identifiers=true spring.jpa.open-in-view=false \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties index be939ffa69..e745c7455e 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application-persistent-on.properties @@ -8,3 +8,4 @@ spring.h2.console.enabled=true spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.database-platform=org.hibernate.dialect.H2Dialect spring.h2.console.path=/h2-console +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.properties b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.properties index 2499d7cd06..4dd2caf075 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.properties +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.properties @@ -7,6 +7,8 @@ spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=false spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.validator.apply_to_ddl=false +spring.jpa.properties.hibernate.globally_quoted_identifiers=true + #spring.jpa.properties.hibernate.check_nullability=true spring.h2.console.enabled=true spring.h2.console.path=/h2-console diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.yaml b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.yaml index aeb33f797a..1b8cfbb558 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.yaml +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/application.yaml @@ -12,3 +12,6 @@ spring: driverClassName: org.h2.Driver jpa: spring.jpa.database-platform: org.hibernate.dialect.H2Dialect + properties: + hibernate: + globally_quoted_identifiers: true diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-h2.sql b/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-h2.sql index 3d04b578d2..2566a8d125 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-h2.sql +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-h2.sql @@ -1,5 +1,5 @@ -INSERT INTO countries (id, name) VALUES (1, 'USA'); -INSERT INTO countries (id, name) VALUES (2, 'France'); -INSERT INTO countries (id, name) VALUES (3, 'Brazil'); -INSERT INTO countries (id, name) VALUES (4, 'Italy'); -INSERT INTO countries (id, name) VALUES (5, 'Canada'); \ No newline at end of file +INSERT INTO "countries" VALUES (1, 'USA'); +INSERT INTO "countries" VALUES (2, 'France'); +INSERT INTO "countries" VALUES (3, 'Brazil'); +INSERT INTO "countries" VALUES (4, 'Italy'); +INSERT INTO "countries" VALUES (5, 'Canada'); \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-trans.sql b/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-trans.sql index e4fda99437..2b4aa92542 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-trans.sql +++ b/persistence-modules/spring-boot-persistence-h2/src/main/resources/data-trans.sql @@ -1,12 +1,12 @@ -insert into USER values (101, 'user1', 'comment1'); -insert into USER values (102, 'user2', 'comment2'); -insert into USER values (103, 'user3', 'comment3'); -insert into USER values (104, 'user4', 'comment4'); -insert into USER values (105, 'user5', 'comment5'); +insert into "user" values (101, 'user1', 'comment1'); +insert into "user" values (102, 'user2', 'comment2'); +insert into "user" values (103, 'user3', 'comment3'); +insert into "user" values (104, 'user4', 'comment4'); +insert into "user" values (105, 'user5', 'comment5'); -insert into DOCUMENT values (1, 'doc1', 101); -insert into DOCUMENT values (2, 'doc2', 101); -insert into DOCUMENT values (3, 'doc3', 101); -insert into DOCUMENT values (4, 'doc4', 101); -insert into DOCUMENT values (5, 'doc5', 102); -insert into DOCUMENT values (6, 'doc6', 102); \ No newline at end of file +insert into "document" values (1, 'doc1', 101); +insert into "document" values (2, 'doc2', 101); +insert into "document" values (3, 'doc3', 101); +insert into "document" values (4, 'doc4', 101); +insert into "document" values (5, 'doc5', 102); +insert into "document" values (6, 'doc6', 102); \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-mongodb/pom.xml b/persistence-modules/spring-boot-persistence-mongodb/pom.xml index 8b36474777..724fa38f7e 100644 --- a/persistence-modules/spring-boot-persistence-mongodb/pom.xml +++ b/persistence-modules/spring-boot-persistence-mongodb/pom.xml @@ -32,13 +32,8 @@ de.flapdoodle.embed de.flapdoodle.embed.mongo - ${embed.mongo.version} test - - 3.2.6 - - \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java index 6325d2cd2e..d3a09c08ff 100644 --- a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java +++ b/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/boot/config/H2JpaConfig.java @@ -66,6 +66,7 @@ public class H2JpaConfig { hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); hibernateProperties.setProperty("hibernate.show_sql", env.getProperty("hibernate.show_sql")); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", env.getProperty("hibernate.globally_quoted_identifiers")); return hibernateProperties; } diff --git a/persistence-modules/spring-boot-persistence/src/main/resources/application.properties b/persistence-modules/spring-boot-persistence/src/main/resources/application.properties index 7b5a467a2b..52bfc00712 100644 --- a/persistence-modules/spring-boot-persistence/src/main/resources/application.properties +++ b/persistence-modules/spring-boot-persistence/src/main/resources/application.properties @@ -8,4 +8,6 @@ spring.jpa.hibernate.ddl-auto = create spring.h2.console.enabled=true # Uppercase Table Names -spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl \ No newline at end of file +spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + +hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java index d7bb44e133..226a5a550a 100644 --- a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/SpringBootProfileIntegrationTest.java @@ -22,7 +22,7 @@ public class SpringBootProfileIntegrationTest { private GenericEntityRepository genericEntityRepository; @Test - public void givenGenericEntityRepository_whenSaveAndRetreiveEntity_thenOK() { + public void givenGenericEntityRepository_whenSaveAndRetrieveEntity_thenOK() { GenericEntity genericEntity = genericEntityRepository.save(new GenericEntity("test")); GenericEntity foundEntity = genericEntityRepository.findById(genericEntity.getId()).orElse(null); assertNotNull(foundEntity); diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/config/H2TestProfileJPAConfig.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/config/H2TestProfileJPAConfig.java index f73000a10e..515350fe0a 100644 --- a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/config/H2TestProfileJPAConfig.java +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/config/H2TestProfileJPAConfig.java @@ -62,6 +62,7 @@ public class H2TestProfileJPAConfig { hibernateProperties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); hibernateProperties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); hibernateProperties.setProperty("hibernate.show_sql", env.getProperty("hibernate.show_sql")); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", env.getProperty("hibernate.globally_quoted_identifiers")); return hibernateProperties; } diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootinitialload/tests/SpringBootSqlGroupAnnotationIntegrationTest.java b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootinitialload/tests/SpringBootSqlGroupAnnotationIntegrationTest.java index 0153d463a2..e584645742 100644 --- a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootinitialload/tests/SpringBootSqlGroupAnnotationIntegrationTest.java +++ b/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/springbootinitialload/tests/SpringBootSqlGroupAnnotationIntegrationTest.java @@ -17,8 +17,10 @@ import com.baeldung.boot.repository.EmployeeRepository; @RunWith(SpringRunner.class) @SpringBootTest(classes = Application.class) -@SqlGroup({ @Sql(scripts = "/employees_schema.sql", config = @SqlConfig(transactionMode = TransactionMode.ISOLATED)), - @Sql("/import_employees.sql")}) +@SqlGroup({ + @Sql(scripts = "/employees_schema.sql", config = @SqlConfig(transactionMode = TransactionMode.ISOLATED)), + @Sql("/import_employees.sql")} +) public class SpringBootSqlGroupAnnotationIntegrationTest { @Autowired diff --git a/persistence-modules/spring-boot-persistence/src/test/resources/application.properties b/persistence-modules/spring-boot-persistence/src/test/resources/application.properties index b268f46094..9f6f3f60d2 100644 --- a/persistence-modules/spring-boot-persistence/src/test/resources/application.properties +++ b/persistence-modules/spring-boot-persistence/src/test/resources/application.properties @@ -19,6 +19,7 @@ hibernate.hbm2ddl.auto=create-drop hibernate.cache.use_second_level_cache=true hibernate.cache.use_query_cache=true hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory +hibernate.globally_quoted_identifiers=true spring.jpa.properties.hibernate.hbm2ddl.import_files=import_books.sql spring.sql.init.data-locations=import_*_users.sql \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/src/test/resources/import_employees.sql b/persistence-modules/spring-boot-persistence/src/test/resources/import_employees.sql index 40442d2804..f234d02fd9 100644 --- a/persistence-modules/spring-boot-persistence/src/test/resources/import_employees.sql +++ b/persistence-modules/spring-boot-persistence/src/test/resources/import_employees.sql @@ -1,3 +1,5 @@ -insert into EMPLOYEES values(1, 'Harsha', 'Developer'); -insert into EMPLOYEES values(2, 'John', 'Tester'); -insert into EMPLOYEES values(3, 'Ram', 'Manager'); \ No newline at end of file +delete from "employees"; + +insert into "employees" values(1, 'Harsha', 'Developer'); +insert into "employees" values(2, 'John', 'Tester'); +insert into "employees" values(3, 'Ram', 'Manager'); \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/src/test/resources/import_senior_employees.sql b/persistence-modules/spring-boot-persistence/src/test/resources/import_senior_employees.sql index 3d0819175b..e4af4651a7 100644 --- a/persistence-modules/spring-boot-persistence/src/test/resources/import_senior_employees.sql +++ b/persistence-modules/spring-boot-persistence/src/test/resources/import_senior_employees.sql @@ -1,2 +1,2 @@ -insert into EMPLOYEES values(4, 'Eric', 'Senior Developer'); -insert into EMPLOYEES values(5, 'Vidhyaah', 'Senior Manager'); \ No newline at end of file +insert into "employees" values(4, 'Eric', 'Senior Developer'); +insert into "employees" values(5, 'Vidhyaah', 'Senior Manager'); \ No newline at end of file diff --git a/persistence-modules/spring-data-jdbc/src/main/resources/schema.sql b/persistence-modules/spring-data-jdbc/src/main/resources/schema.sql index 5618822bf9..2c431d2340 100644 --- a/persistence-modules/spring-data-jdbc/src/main/resources/schema.sql +++ b/persistence-modules/spring-data-jdbc/src/main/resources/schema.sql @@ -1,5 +1,5 @@ create table person ( - id integer identity primary key, + id int GENERATED ALWAYS AS IDENTITY PRIMARY KEY, first_name varchar(30), last_name varchar(30) ); \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/embeddable/repositories/CompanyRepository.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/embeddable/repositories/CompanyRepository.java index f456b15652..cfef3a6a5e 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/embeddable/repositories/CompanyRepository.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/embeddable/repositories/CompanyRepository.java @@ -13,6 +13,6 @@ public interface CompanyRepository extends JpaRepository { @Query("SELECT C FROM Company C WHERE C.contactPerson.firstName = ?1") List findByContactPersonFirstNameWithJPQL(String firstName); - @Query(value = "SELECT * FROM company WHERE contact_first_name = ?1", nativeQuery = true) + @Query(value = "SELECT * FROM \"company\" WHERE \"contact_first_name\" = ?1", nativeQuery = true) List findByContactPersonFirstNameWithNativeQuery(String firstName); } diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-annotations/src/main/resources/application.properties index f127dd5e50..6f871a25b7 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/resources/application.properties +++ b/persistence-modules/spring-data-jpa-annotations/src/main/resources/application.properties @@ -4,3 +4,5 @@ spring.jpa.properties.hibernate.jdbc.batch_size=4 spring.jpa.properties.hibernate.order_inserts=true spring.jpa.properties.hibernate.order_updates=true spring.jpa.properties.hibernate.generate_statistics=true + +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-data-jpa-crud-2/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-crud-2/src/main/resources/application.properties new file mode 100644 index 0000000000..ead0df89a3 --- /dev/null +++ b/persistence-modules/spring-data-jpa-crud-2/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-data-jpa-enterprise/src/main/java/com/baeldung/boot/daos/user/UserRepository.java b/persistence-modules/spring-data-jpa-enterprise/src/main/java/com/baeldung/boot/daos/user/UserRepository.java index cfa99414c6..a2c816b1c4 100644 --- a/persistence-modules/spring-data-jpa-enterprise/src/main/java/com/baeldung/boot/daos/user/UserRepository.java +++ b/persistence-modules/spring-data-jpa-enterprise/src/main/java/com/baeldung/boot/daos/user/UserRepository.java @@ -21,7 +21,7 @@ public interface UserRepository extends JpaRepository , UserRepos @Query("SELECT u FROM User u WHERE u.status = 1") Collection findAllActiveUsers(); - + @Query("select u from User u where u.email like '%@gmail.com'") List findUsersWithGmailAddress(); @@ -75,14 +75,14 @@ public interface UserRepository extends JpaRepository , UserRepos @Query(value = "INSERT INTO Users (name, age, email, status, active) VALUES (:name, :age, :email, :status, :active)", nativeQuery = true) @Modifying void insertUser(@Param("name") String name, @Param("age") Integer age, @Param("email") String email, @Param("status") Integer status, @Param("active") boolean active); - + @Modifying @Query(value = "UPDATE Users u SET status = ? WHERE u.name = ?", nativeQuery = true) int updateUserSetStatusForNameNativePostgres(Integer status, String name); - + @Query(value = "SELECT u FROM User u WHERE u.name IN :names") List findUserByNameList(@Param("names") Collection names); - + void deleteAllByCreationDateAfter(LocalDate date); @Modifying(clearAutomatically = true, flushAutomatically = true) @@ -97,6 +97,6 @@ public interface UserRepository extends JpaRepository , UserRepos int deleteDeactivatedUsersWithNoModifyingAnnotation(); @Modifying(clearAutomatically = true, flushAutomatically = true) - @Query(value = "alter table USERS add column deleted int(1) not null default 0", nativeQuery = true) + @Query(value = "alter table USERS add column deleted int not null default 0", nativeQuery = true) void addDeletedColumn(); } diff --git a/persistence-modules/spring-data-jpa-filtering/src/main/java/com/baeldung/config/StudentJpaConfig.java b/persistence-modules/spring-data-jpa-filtering/src/main/java/com/baeldung/config/StudentJpaConfig.java index 08f37ea806..bcb3b2fc8c 100644 --- a/persistence-modules/spring-data-jpa-filtering/src/main/java/com/baeldung/config/StudentJpaConfig.java +++ b/persistence-modules/spring-data-jpa-filtering/src/main/java/com/baeldung/config/StudentJpaConfig.java @@ -62,6 +62,7 @@ public class StudentJpaConfig { hibernateProperties.setProperty("hibernate.show_sql", env.getProperty("hibernate.show_sql")); hibernateProperties.setProperty("hibernate.cache.use_second_level_cache", env.getProperty("hibernate.cache.use_second_level_cache")); hibernateProperties.setProperty("hibernate.cache.use_query_cache", env.getProperty("hibernate.cache.use_query_cache")); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", env.getProperty("hibernate.globally_quoted_identifiers")); return hibernateProperties; } diff --git a/persistence-modules/spring-data-jpa-filtering/src/test/resources/persistence-student.properties b/persistence-modules/spring-data-jpa-filtering/src/test/resources/persistence-student.properties index 3b6b580630..a2a83f5dee 100644 --- a/persistence-modules/spring-data-jpa-filtering/src/test/resources/persistence-student.properties +++ b/persistence-modules/spring-data-jpa-filtering/src/test/resources/persistence-student.properties @@ -6,4 +6,6 @@ hibernate.show_sql=true hibernate.hbm2ddl.auto=create hibernate.cache.use_second_level_cache=false -hibernate.cache.use_query_cache=false \ No newline at end of file +hibernate.cache.use_query_cache=false + +hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java index a0d70ed006..64fe4d7724 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java +++ b/persistence-modules/spring-data-jpa-query-2/src/main/java/com/baeldung/config/PersistenceConfig.java @@ -64,7 +64,7 @@ public class PersistenceConfig { public AuditorAware auditorProvider() { return new AuditorAwareImpl(); } - + @Bean public LocalSessionFactoryBean sessionFactory() { final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean(); @@ -175,7 +175,7 @@ public class PersistenceConfig { hibernateProperties.setProperty("hibernate.show_sql", "true"); // hibernateProperties.setProperty("hibernate.format_sql", "true"); - // hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); + hibernateProperties.setProperty("hibernate.globally_quoted_identifiers", "true"); // Envers properties hibernateProperties.setProperty("org.hibernate.envers.audit_table_suffix", env.getProperty("envers.audit_table_suffix")); diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml index 1b9a4a191c..dcc3e76cf5 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetching.cfg.xml @@ -12,8 +12,8 @@ org.hibernate.dialect.MySQLDialect true validate - - + true + diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml index c5f608e1a7..8fe08b10c3 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/fetchingLazy.cfg.xml @@ -11,6 +11,7 @@ iamtheking org.hibernate.dialect.MySQLDialect true + true diff --git a/persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_users.sql b/persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_users.sql index 330b2e36b0..e0aca9ac41 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_users.sql +++ b/persistence-modules/spring-data-jpa-query-2/src/main/resources/insert_users.sql @@ -1,8 +1,8 @@ -insert into Users(id, name, creation_date, last_login_date, active, age, email, status) -values(1, 'John', TO_DATE('01/01/2018', 'DD/MM/YYYY'), TO_DATE('01/01/2020', 'DD/MM/YYYY'), 1, 23, 'john@email.com', 1); +insert into Users(name, creation_date, last_login_date, active, age, email, status) +values('John', PARSEDATETIME('01/01/2018', 'dd/MM/yyyy'), PARSEDATETIME('01/01/2020', 'dd/MM/yyyy'), 1, 23, 'john@email.com', 1); -insert into Users(id, name, creation_date, last_login_date, active, age, email, status) -values(2, 'Bob', TO_DATE('02/02/2019', 'DD/MM/YYYY'), TO_DATE('02/02/2020', 'DD/MM/YYYY'), 1, 56, 'bob@email.com', 1); +insert into Users(name, creation_date, last_login_date, active, age, email, status) +values('Bob', PARSEDATETIME('02/02/2019', 'dd/MM/yyyy'), PARSEDATETIME('02/02/2020', 'dd/MM/yyyy'), 1, 56, 'bob@email.com', 1); -insert into Users(id, name, creation_date, last_login_date, active, age, email, status) -values(3, 'Cindy', TO_DATE('02/02/2019', 'DD/MM/YYYY'), TO_DATE('02/02/2020', 'DD/MM/YYYY'), 1, 18, 'cindy@email.com', 0); \ No newline at end of file +insert into Users(name, creation_date, last_login_date, active, age, email, status) +values('Cindy', PARSEDATETIME('02/02/2019', 'dd/MM/yyyy'), PARSEDATETIME('02/02/2020', 'dd/MM/yyyy'), 1, 18, 'cindy@email.com', 0); \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java index 65bf36f8bf..e90207a170 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java +++ b/persistence-modules/spring-data-jpa-query-2/src/test/java/com/baeldung/hibernate/fetching/HibernateFetchingIntegrationTest.java @@ -15,7 +15,7 @@ public class HibernateFetchingIntegrationTest { // this loads sample data in the database @Before - public void addFecthingTestData() { + public void addFetchingTestData() { FetchingAppView fav = new FetchingAppView(); fav.createTestData(); } diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml index 4d3ff2ae63..c14a3ecd7a 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml +++ b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetching.cfg.xml @@ -12,7 +12,8 @@ org.hibernate.dialect.H2Dialect update false - + true + diff --git a/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml index 8a2bf593cb..ad6ee0ed46 100644 --- a/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml +++ b/persistence-modules/spring-data-jpa-query-2/src/test/resources/fetchingLazy.cfg.xml @@ -12,6 +12,7 @@ org.hibernate.dialect.H2Dialect update false + true diff --git a/persistence-modules/spring-data-jpa-query-3/src/main/resources/import_entities.sql b/persistence-modules/spring-data-jpa-query-3/src/main/resources/import_entities.sql index 4fe18bf4aa..ce71bc744c 100644 --- a/persistence-modules/spring-data-jpa-query-3/src/main/resources/import_entities.sql +++ b/persistence-modules/spring-data-jpa-query-3/src/main/resources/import_entities.sql @@ -1,3 +1,3 @@ -insert into Article(id, publication_date, publication_time, creation_date_time) values(1, TO_DATE('01/01/2018', 'DD/MM/YYYY'), TO_DATE('15:00', 'HH24:MI'), TO_DATE('31/12/2017 07:30', 'DD/MM/YYYY HH24:MI')); -insert into Article(id, publication_date, publication_time, creation_date_time) values(2, TO_DATE('01/01/2018', 'DD/MM/YYYY'), TO_DATE('15:30', 'HH24:MI'), TO_DATE('15/12/2017 08:00', 'DD/MM/YYYY HH24:MI')); -insert into Article(id, publication_date, publication_time, creation_date_time) values(3, TO_DATE('15/12/2017', 'DD/MM/YYYY'), TO_DATE('16:00', 'HH24:MI'), TO_DATE('01/12/2017 13:45', 'DD/MM/YYYY HH24:MI')); \ No newline at end of file +insert into Article(id, publication_date, publication_time, creation_date_time) values(1, PARSEDATETIME('01/01/2018', 'dd/MM/yyyy'), PARSEDATETIME('15:00', 'HH:mm'), PARSEDATETIME('31/12/2017 07:30', 'dd/MM/yyyy HH:mm')); +insert into Article(id, publication_date, publication_time, creation_date_time) values(2, PARSEDATETIME('01/01/2018', 'dd/MM/yyyy'), PARSEDATETIME('15:30', 'HH:mm'), PARSEDATETIME('15/12/2017 08:00', 'dd/MM/yyyy HH:mm')); +insert into Article(id, publication_date, publication_time, creation_date_time) values(3, PARSEDATETIME('15/12/2017', 'dd/MM/yyyy'), PARSEDATETIME('16:00', 'HH:mm'), PARSEDATETIME('01/12/2017 13:45', 'dd/MM/yyyy HH:mm')); \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/repository/CommentRepository.java b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/repository/CommentRepository.java index 89e9345e94..5309581638 100644 --- a/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/repository/CommentRepository.java +++ b/persistence-modules/spring-data-jpa-query/src/main/java/com/baeldung/aggregation/repository/CommentRepository.java @@ -21,7 +21,7 @@ public interface CommentRepository extends JpaRepository { @Query("SELECT c.year AS yearComment, COUNT(c.year) AS totalComment FROM Comment AS c GROUP BY c.year ORDER BY c.year DESC") List countTotalCommentsByYearInterface(); - @Query(value = "SELECT c.year AS yearComment, COUNT(c.*) AS totalComment FROM comment AS c GROUP BY c.year ORDER BY c.year DESC", nativeQuery = true) + @Query(value = "SELECT c.\"year\" AS yearComment, COUNT(c.*) AS totalComment FROM \"comment\" AS c GROUP BY c.\"year\" ORDER BY c.\"year\" DESC", nativeQuery = true) List countTotalCommentsByYearNative(); } diff --git a/persistence-modules/spring-data-jpa-query/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-query/src/main/resources/application.properties index eb0e519ef0..7850367c64 100644 --- a/persistence-modules/spring-data-jpa-query/src/main/resources/application.properties +++ b/persistence-modules/spring-data-jpa-query/src/main/resources/application.properties @@ -1,2 +1,4 @@ spring.jpa.show-sql=false -spring.jpa.defer-datasource-initialization=true \ No newline at end of file +spring.jpa.defer-datasource-initialization=true + +spring.jpa.properties.hibernate.globally_quoted_identifiers=true diff --git a/persistence-modules/spring-data-jpa-query/src/main/resources/db/import_joins.sql b/persistence-modules/spring-data-jpa-query/src/main/resources/db/import_joins.sql index e4772d6ff2..7598064278 100644 --- a/persistence-modules/spring-data-jpa-query/src/main/resources/db/import_joins.sql +++ b/persistence-modules/spring-data-jpa-query/src/main/resources/db/import_joins.sql @@ -1,13 +1,13 @@ -INSERT INTO department (id, name) VALUES (1, 'Infra'); -INSERT INTO department (id, name) VALUES (2, 'Accounting'); -INSERT INTO department (id, name) VALUES (3, 'Management'); +INSERT INTO "department" ("id", "name") VALUES (1, 'Infra'); +INSERT INTO "department" ("id", "name") VALUES (2, 'Accounting'); +INSERT INTO "department" ("id", "name") VALUES (3, 'Management'); -INSERT INTO joins_employee (id, name, age, department_id) VALUES (1, 'Baeldung', '35', 1); -INSERT INTO joins_employee (id, name, age, department_id) VALUES (2, 'John', '35', 2); -INSERT INTO joins_employee (id, name, age, department_id) VALUES (3, 'Jane', '35', 2); +INSERT INTO "joins_employee" ("id", "name", "age", "department_id") VALUES (1, 'Baeldung', '35', 1); +INSERT INTO "joins_employee" ("id", "name", "age", "department_id") VALUES (2, 'John', '35', 2); +INSERT INTO "joins_employee" ("id", "name", "age", "department_id") VALUES (3, 'Jane', '35', 2); -INSERT INTO phone (id, number, employee_id) VALUES (1, '111', 1); -INSERT INTO phone (id, number, employee_id) VALUES (2, '222', 1); -INSERT INTO phone (id, number, employee_id) VALUES (3, '333', 1); +INSERT INTO "phone" ("id", "number", "employee_id") VALUES (1, '111', 1); +INSERT INTO "phone" ("id", "number", "employee_id") VALUES (2, '222', 1); +INSERT INTO "phone" ("id", "number", "employee_id") VALUES (3, '333', 1); COMMIT; diff --git a/persistence-modules/spring-data-jpa-query/src/test/resources/entitygraph-data.sql b/persistence-modules/spring-data-jpa-query/src/test/resources/entitygraph-data.sql index 685ec2c605..73994d88cc 100644 --- a/persistence-modules/spring-data-jpa-query/src/test/resources/entitygraph-data.sql +++ b/persistence-modules/spring-data-jpa-query/src/test/resources/entitygraph-data.sql @@ -1,7 +1,7 @@ -INSERT INTO Item(id,name) VALUES (1,'Table'); -INSERT INTO Item(id,name) VALUES (2,'Bottle'); +INSERT INTO "item" ("id", "name") VALUES (1,'Table'); +INSERT INTO "item" ("id", "name") VALUES (2,'Bottle'); -INSERT INTO Characteristic(id,item_id, type) VALUES (1,1,'Rigid'); -INSERT INTO Characteristic(id,item_id,type) VALUES (2,1,'Big'); -INSERT INTO Characteristic(id,item_id,type) VALUES (3,2,'Fragile'); -INSERT INTO Characteristic(id,item_id,type) VALUES (4,2,'Small'); \ No newline at end of file +INSERT INTO "characteristic" ("id", "item_id", "type") VALUES (1,1,'Rigid'); +INSERT INTO "characteristic" ("id", "item_id", "type") VALUES (2,1,'Big'); +INSERT INTO "characteristic" ("id", "item_id", "type") VALUES (3,2,'Fragile'); +INSERT INTO "characteristic" ("id", "item_id", "type") VALUES (4,2,'Small'); \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query/src/test/resources/test-aggregation-data.sql b/persistence-modules/spring-data-jpa-query/src/test/resources/test-aggregation-data.sql index 12409a124e..ece64240ae 100644 --- a/persistence-modules/spring-data-jpa-query/src/test/resources/test-aggregation-data.sql +++ b/persistence-modules/spring-data-jpa-query/src/test/resources/test-aggregation-data.sql @@ -1,7 +1,7 @@ -INSERT INTO post (id, title, content) VALUES (1, 'Comment 1', 'Content 1'); -INSERT INTO post (id, title, content) VALUES (2, 'Comment 2', 'Content 2'); -INSERT INTO post (id, title, content) VALUES (3, 'Comment 3', 'Content 3'); -INSERT INTO comment (id, year, approved, content, post_id) VALUES (1, 2019, false, 'Comment 1', 1); -INSERT INTO comment (id, year, approved, content, post_id) VALUES (2, 2018, true, 'Comment 2', 1); -INSERT INTO comment (id, year, approved, content, post_id) VALUES (3, 2018, true, 'Comment 3', 2); -INSERT INTO comment (id, year, approved, content, post_id) VALUES (4, 2017, false, 'Comment 4', 3); \ No newline at end of file +INSERT INTO "post" ("id", "title", "content") VALUES (1, 'Comment 1', 'Content 1'); +INSERT INTO "post" ("id", "title", "content") VALUES (2, 'Comment 2', 'Content 2'); +INSERT INTO "post" ("id", "title", "content") VALUES (3, 'Comment 3', 'Content 3'); +INSERT INTO "comment" ("id", "year", "approved", "content", "post_id") VALUES (1, 2019, false, 'Comment 1', 1); +INSERT INTO "comment" ("id", "year", "approved", "content", "post_id") VALUES (2, 2018, true, 'Comment 2', 1); +INSERT INTO "comment" ("id", "year", "approved", "content", "post_id") VALUES (3, 2018, true, 'Comment 3', 2); +INSERT INTO "comment" ("id", "year", "approved", "content", "post_id") VALUES (4, 2017, false, 'Comment 4', 3); \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-cleanup.sql b/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-cleanup.sql index 90aa15307c..0ba0ba0694 100644 --- a/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-cleanup.sql +++ b/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-cleanup.sql @@ -1 +1 @@ -DELETE FROM Movie; \ No newline at end of file +DELETE FROM "movie"; \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-data.sql b/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-data.sql index 37f8e4fe64..0eb9638f43 100644 --- a/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-data.sql +++ b/persistence-modules/spring-data-jpa-repo-2/src/test/resources/test-movie-data.sql @@ -1,7 +1,7 @@ -INSERT INTO movie(id, title, director, rating, duration) VALUES(1, 'Godzilla: King of the Monsters', ' Michael Dougherty', 'PG-13', 132); -INSERT INTO movie(id, title, director, rating, duration) VALUES(2, 'Avengers: Endgame', 'Anthony Russo', 'PG-13', 181); -INSERT INTO movie(id, title, director, rating, duration) VALUES(3, 'Captain Marvel', 'Anna Boden', 'PG-13', 123); -INSERT INTO movie(id, title, director, rating, duration) VALUES(4, 'Dumbo', 'Tim Burton', 'PG', 112); -INSERT INTO movie(id, title, director, rating, duration) VALUES(5, 'Booksmart', 'Olivia Wilde', 'R', 102); -INSERT INTO movie(id, title, director, rating, duration) VALUES(6, 'Aladdin', 'Guy Ritchie', 'PG', 128); -INSERT INTO movie(id, title, director, rating, duration) VALUES(7, 'The Sun Is Also a Star', 'Ry Russo-Young', 'PG-13', 100); +INSERT INTO "movie" ("id", "title", "director", "rating", "duration") VALUES(1, 'Godzilla: King of the Monsters', ' Michael Dougherty', 'PG-13', 132); +INSERT INTO "movie" ("id", "title", "director", "rating", "duration") VALUES(2, 'Avengers: Endgame', 'Anthony Russo', 'PG-13', 181); +INSERT INTO "movie" ("id", "title", "director", "rating", "duration") VALUES(3, 'Captain Marvel', 'Anna Boden', 'PG-13', 123); +INSERT INTO "movie" ("id", "title", "director", "rating", "duration") VALUES(4, 'Dumbo', 'Tim Burton', 'PG', 112); +INSERT INTO "movie" ("id", "title", "director", "rating", "duration") VALUES(5, 'Booksmart', 'Olivia Wilde', 'R', 102); +INSERT INTO "movie" ("id", "title", "director", "rating", "duration") VALUES(6, 'Aladdin', 'Guy Ritchie', 'PG', 128); +INSERT INTO "movie" ("id", "title", "director", "rating", "duration") VALUES(7, 'The Sun Is Also a Star', 'Ry Russo-Young', 'PG-13', 100); diff --git a/spring-batch-2/src/main/resources/schema-all.sql b/spring-batch-2/src/main/resources/schema-all.sql index 9f698f7d81..c17b9f9749 100644 --- a/spring-batch-2/src/main/resources/schema-all.sql +++ b/spring-batch-2/src/main/resources/schema-all.sql @@ -1,7 +1,7 @@ DROP TABLE coffee IF EXISTS; CREATE TABLE coffee ( - coffee_id BIGINT IDENTITY NOT NULL PRIMARY KEY, + coffee_id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, brand VARCHAR(20), origin VARCHAR(20), characteristics VARCHAR(30) diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/openapi/OpenApiApplication.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/openapi/OpenApiApplication.java new file mode 100644 index 0000000000..3fd8dbd6c5 --- /dev/null +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/openapi/OpenApiApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.openapi; + +import org.jobrunr.autoconfigure.JobRunrAutoConfiguration; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +@EnableAutoConfiguration(exclude = { JobRunrAutoConfiguration.class}) +public class OpenApiApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiApplication.class, args); + } +} diff --git a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java index 4a205dcc1f..ec471aa8eb 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/main/java/com/baeldung/sprq/SpqrApp.java @@ -1,9 +1,12 @@ package com.baeldung.sprq; +import org.jobrunr.autoconfigure.JobRunrAutoConfiguration; import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication +@EnableAutoConfiguration(exclude = { JobRunrAutoConfiguration.class}) public class SpqrApp { public static void main(String[] args) { diff --git a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/openapi/OpenApiPetsIntegrationTest.java b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/openapi/OpenApiPetsIntegrationTest.java index b56c19d94c..e56ff445d7 100644 --- a/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/openapi/OpenApiPetsIntegrationTest.java +++ b/spring-boot-modules/spring-boot-libraries-2/src/test/java/com/baeldung/openapi/OpenApiPetsIntegrationTest.java @@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes = OpenApiApplication.class) @AutoConfigureMockMvc public class OpenApiPetsIntegrationTest { diff --git a/spring-boot-modules/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml index 41baf3bb82..378864a1df 100644 --- a/spring-boot-modules/spring-boot-properties/pom.xml +++ b/spring-boot-modules/spring-boot-properties/pom.xml @@ -122,7 +122,7 @@ - 2021.0.0 + 2021.0.3 1.10 @ diff --git a/spring-boot-modules/spring-boot-runtime/pom.xml b/spring-boot-modules/spring-boot-runtime/pom.xml index 04c8ddc525..7b2ed6976b 100644 --- a/spring-boot-modules/spring-boot-runtime/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/pom.xml @@ -71,7 +71,6 @@ javax.persistence javax.persistence-api - ${jpa.version} com.google.guava @@ -87,15 +86,12 @@ org.apache.httpcomponents httpclient - ${httpclient.version} - 2.2 3.1.7 - 3.1.0 - 4.5.8 + 3.1.3 \ No newline at end of file From 3e867be8c85f8f9846d04b78d99338d76a12eba0 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:29:14 +0500 Subject: [PATCH 67/73] Created README.md added link back to the article: https://www.baeldung.com/spring-security-pkce-secret-clients --- spring-security-modules/spring-security-pkce/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 spring-security-modules/spring-security-pkce/README.md diff --git a/spring-security-modules/spring-security-pkce/README.md b/spring-security-modules/spring-security-pkce/README.md new file mode 100644 index 0000000000..e23ed602bc --- /dev/null +++ b/spring-security-modules/spring-security-pkce/README.md @@ -0,0 +1,3 @@ + +### Relevant Articles: +- [PKCE Support for Secret Clients with Spring Security](https://www.baeldung.com/spring-security-pkce-secret-clients) From 6a2c013bf12ca2e92ac0e4d54cdaeeab1dabbe68 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:31:46 +0500 Subject: [PATCH 68/73] Updated README.md added link back to the article: https://www.baeldung.com/locked-ownable-synchronizers --- core-java-modules/core-java-concurrency-advanced-4/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-concurrency-advanced-4/README.md b/core-java-modules/core-java-concurrency-advanced-4/README.md index b9881fd475..376c5cc711 100644 --- a/core-java-modules/core-java-concurrency-advanced-4/README.md +++ b/core-java-modules/core-java-concurrency-advanced-4/README.md @@ -8,3 +8,4 @@ - [Acquire a Lock by a Key in Java](https://www.baeldung.com/java-acquire-lock-by-key) - [Differences Between set() and lazySet() in Java Atomic Variables](https://www.baeldung.com/java-atomic-set-vs-lazyset) - [Volatile vs. Atomic Variables in Java](https://www.baeldung.com/java-volatile-vs-atomic) +- [What Is “Locked Ownable Synchronizers” in Thread Dump?](https://www.baeldung.com/locked-ownable-synchronizers) From c086d40875fa73ee3cfecf1d695a0ffd8b35aea3 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:35:11 +0500 Subject: [PATCH 69/73] Updated README.md added link back to the article: https://www.baeldung.com/java-arrays-aslist-vs-list-of --- core-java-modules/core-java-collections-list-4/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-collections-list-4/README.md b/core-java-modules/core-java-collections-list-4/README.md index 34b680e7dc..61401f1de7 100644 --- a/core-java-modules/core-java-collections-list-4/README.md +++ b/core-java-modules/core-java-collections-list-4/README.md @@ -8,4 +8,5 @@ This module contains articles about the Java List collection - [Sort a List Alphabetically in Java](https://www.baeldung.com/java-sort-list-alphabetically) - [Arrays.asList() vs Collections.singletonList()](https://www.baeldung.com/java-aslist-vs-singletonlist) - [Replace Element at a Specific Index in a Java ArrayList](https://www.baeldung.com/java-arraylist-replace-at-index) +- [Difference Between Arrays.asList() and List.of()](https://www.baeldung.com/java-arrays-aslist-vs-list-of) - [[<-- Prev]](/core-java-modules/core-java-collections-list-3) From 966a49f0b61dae78d6598b2be2bb43fe5630c5a2 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:37:45 +0500 Subject: [PATCH 70/73] Updated README.md added link back to the article: https://www.baeldung.com/swagger-two-responses-one-response-code --- spring-boot-modules/spring-boot-swagger-2/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-swagger-2/README.md b/spring-boot-modules/spring-boot-swagger-2/README.md index 97c76dc431..e607b56299 100644 --- a/spring-boot-modules/spring-boot-swagger-2/README.md +++ b/spring-boot-modules/spring-boot-swagger-2/README.md @@ -1,2 +1,3 @@ -## Relevant Articles: +### Relevant Articles: +- [Swagger: Specify Two Responses with the Same Response Code](https://www.baeldung.com/swagger-two-responses-one-response-code) From 4acb523a5de6b4dfb4641aa4ea15e6bc06c3e37e Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:40:17 +0500 Subject: [PATCH 71/73] Updated README.md added link back to the article: https://www.baeldung.com/java-validate-cc-number --- algorithms-modules/algorithms-miscellaneous-7/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/algorithms-modules/algorithms-miscellaneous-7/README.md b/algorithms-modules/algorithms-miscellaneous-7/README.md index d220afd678..918fcd21dd 100644 --- a/algorithms-modules/algorithms-miscellaneous-7/README.md +++ b/algorithms-modules/algorithms-miscellaneous-7/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: +- [Algorithm to Identify and Validate a Credit Card Number](https://www.baeldung.com/java-validate-cc-number) - More articles: [[<-- prev]](/algorithms-miscellaneous-6) From a4116d2f9f7f458eddb7233d9e84c7de05a21447 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:42:38 +0500 Subject: [PATCH 72/73] Updated README.md added link back to the article: https://www.baeldung.com/multitenancy-with-spring-data-jpa/ --- persistence-modules/spring-jpa-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-jpa-2/README.md b/persistence-modules/spring-jpa-2/README.md index 59543cade7..2eee4015a8 100644 --- a/persistence-modules/spring-jpa-2/README.md +++ b/persistence-modules/spring-jpa-2/README.md @@ -6,4 +6,5 @@ - [Transactions with Spring and JPA](https://www.baeldung.com/transaction-configuration-with-jpa-and-spring) - [The DAO with Spring and Hibernate](https://www.baeldung.com/persistence-layer-with-spring-and-hibernate) - [Simplify the DAO with Spring and Java Generics](https://www.baeldung.com/simplifying-the-data-access-layer-with-spring-and-java-generics) +- [Multitenancy With Spring Data JPA](https://www.baeldung.com/multitenancy-with-spring-data-jpa/) - More articles: [[<-- prev]](/spring-jpa) From 2da3b9df1d1cf7feb98963b63412892dc0aa0495 Mon Sep 17 00:00:00 2001 From: Asjad J <97493880+Asjad-J@users.noreply.github.com> Date: Thu, 25 Aug 2022 21:45:03 +0500 Subject: [PATCH 73/73] Updated README.md added link back to the article: https://www.baeldung.com/java-armstrong-numbers --- core-java-modules/core-java-numbers-5/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-numbers-5/README.md b/core-java-modules/core-java-numbers-5/README.md index 37501ea31a..f54894a227 100644 --- a/core-java-modules/core-java-numbers-5/README.md +++ b/core-java-modules/core-java-numbers-5/README.md @@ -2,3 +2,4 @@ - [Check if a Number Is Odd or Even](https://www.baeldung.com/java-check-number-parity) - [How to Check Whether an Integer Exists in a Range with Java](https://www.baeldung.com/java-interval-contains-integer) - [Check if a Number Is Positive or Negative in Java](https://www.baeldung.com/java-check-number-positive-negative) +- [Armstrong Numbers in Java](https://www.baeldung.com/java-armstrong-numbers)