From fe69a3cb56666fb5cccf7eaddd45e720eb49bfdf Mon Sep 17 00:00:00 2001 From: 13400152 Date: Tue, 16 Feb 2021 23:59:11 +0530 Subject: [PATCH 01/72] JAVA-2395 Fixed compilation issue --- .../core-java-jpms/decoupling-pattern2/consumermodule/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml index e6b351b1b9..816f5cf9e8 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml @@ -17,7 +17,7 @@ com.baeldung.servicemodule - servicemodule + servicemodule2 ${servicemodule.version} @@ -41,4 +41,4 @@ 1.0 - \ No newline at end of file + From 37c6fe33d76962fed32a2f9c206a0a8f3adec392 Mon Sep 17 00:00:00 2001 From: Stefan de Konink Date: Thu, 1 Apr 2021 21:28:29 +0200 Subject: [PATCH 02/72] Implement a functional logout for spring-boot-keycloak --- .../main/java/com/baeldung/keycloak/WebController.java | 8 ++++++++ .../src/main/resources/templates/customers.html | 1 + 2 files changed, 9 insertions(+) diff --git a/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java index 3bafe1f195..bbd96c8135 100644 --- a/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java +++ b/spring-boot-modules/spring-boot-keycloak/src/main/java/com/baeldung/keycloak/WebController.java @@ -8,6 +8,8 @@ import java.security.Principal; import org.springframework.beans.factory.annotation.Autowired; +import javax.servlet.http.HttpServletRequest; + @Controller public class WebController { @@ -19,6 +21,12 @@ public class WebController { return "external"; } + @GetMapping("/logout") + public String logout(HttpServletRequest request) throws Exception { + request.logout(); + return "redirect:/"; + } + @GetMapping(path = "/customers") public String customers(Principal principal, Model model) { addCustomers(); diff --git a/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/customers.html b/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/customers.html index 5a060d31da..de2df93ef1 100644 --- a/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/customers.html +++ b/spring-boot-modules/spring-boot-keycloak/src/main/resources/templates/customers.html @@ -27,6 +27,7 @@ + Logout From e783f0c74836e733f967cbeb5ec5fceba8472120 Mon Sep 17 00:00:00 2001 From: Hendro Steven Date: Thu, 22 Apr 2021 09:43:02 +0700 Subject: [PATCH 03/72] Adding soft delete --- .../spring-data-jpa-crud/pom.xml | 5 ++ .../java/com/baeldung/softdelete/Product.java | 69 +++++++++++++++++++ .../softdelete/ProductController.java | 34 +++++++++ .../softdelete/ProductRepository.java | 7 ++ .../baeldung/softdelete/ProductService.java | 36 ++++++++++ .../src/main/resources/application.properties | 8 ++- 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java create mode 100644 persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductController.java create mode 100644 persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductRepository.java create mode 100644 persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java diff --git a/persistence-modules/spring-data-jpa-crud/pom.xml b/persistence-modules/spring-data-jpa-crud/pom.xml index 16ee74aa62..4afb75d737 100644 --- a/persistence-modules/spring-data-jpa-crud/pom.xml +++ b/persistence-modules/spring-data-jpa-crud/pom.xml @@ -33,6 +33,11 @@ com.h2database h2 + + mysql + mysql-connector-java + runtime + net.ttddyy datasource-proxy diff --git a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java new file mode 100644 index 0000000000..543252e474 --- /dev/null +++ b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java @@ -0,0 +1,69 @@ +package com.baeldung.softdelete; + + +import java.io.Serializable; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +import org.hibernate.annotations.Filter; +import org.hibernate.annotations.FilterDef; +import org.hibernate.annotations.ParamDef; +import org.hibernate.annotations.SQLDelete; + +@Entity +@Table(name = "tbl_products") +@SQLDelete(sql = "UPDATE tbl_products SET deleted = true WHERE id=?") +// @Where(clause = "deleted=false") +@FilterDef(name = "deletedProductFilter", parameters = @ParamDef(name = "isDeleted", type = "boolean")) +@Filter(name = "deletedProductFilter", condition = "deleted = :isDeleted") +public class Product implements Serializable { + + private static final long serialVersionUID = 1L; + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String name; + + private double price; + + private boolean deleted = Boolean.FALSE; + + 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; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public boolean isDeleted() { + return deleted; + } + + public void setDeleted(boolean deleted) { + this.deleted = deleted; + } + +} diff --git a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductController.java b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductController.java new file mode 100644 index 0000000000..ebfdfbb2e7 --- /dev/null +++ b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductController.java @@ -0,0 +1,34 @@ +package com.baeldung.softdelete; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/products") +public class ProductController { + + @Autowired + private ProductService productService; + + @PostMapping + public Product createOne(@RequestBody Product product) { + return productService.create(product); + } + + @DeleteMapping("/{id}") + public void removeOne(@PathVariable("id") Long id) { + productService.remove(id); + } + + @GetMapping + public Iterable findAll(@RequestParam(value = "isDeleted", required = false, defaultValue = "false") boolean isDeleted) { + return productService.findAll(isDeleted); + } +} diff --git a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductRepository.java b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductRepository.java new file mode 100644 index 0000000000..a305a142aa --- /dev/null +++ b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductRepository.java @@ -0,0 +1,7 @@ +package com.baeldung.softdelete; + +import org.springframework.data.repository.CrudRepository; + +public interface ProductRepository extends CrudRepository{ + +} diff --git a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java new file mode 100644 index 0000000000..2bced0c4d8 --- /dev/null +++ b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java @@ -0,0 +1,36 @@ +package com.baeldung.softdelete; + +import javax.persistence.EntityManager; + +import org.hibernate.Filter; +import org.hibernate.Session; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class ProductService { + + @Autowired + private ProductRepository productRepository; + + @Autowired + private EntityManager entityManager; + + public Product create(Product product) { + return productRepository.save(product); + } + + public void remove(Long id){ + productRepository.deleteById(id); + } + + public Iterable findAll(boolean isDeleted){ + //return productRepository.findAll(); + Session session = entityManager.unwrap(Session.class); + Filter filter = session.enableFilter("deletedProductFilter"); + filter.setParameter("isDeleted", isDeleted); + Iterable products = productRepository.findAll(); + session.disableFilter("deletedProductFilter"); + return products; + } +} \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties index af0df308cd..a11e224a1b 100644 --- a/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties +++ b/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties @@ -11,4 +11,10 @@ spring.jpa.properties.hibernate.generate_statistics=true #spring.jpa.properties.javax.persistence.schema-generation.scripts.action=create #spring.jpa.properties.javax.persistence.schema-generation.scripts.create-target=create.sql #spring.jpa.properties.javax.persistence.schema-generation.scripts.create-source=metadata -#spring.jpa.properties.hibernate.format_sql=true \ No newline at end of file +#spring.jpa.properties.hibernate.format_sql=true + +spring.datasource.url=jdbc:mysql://localhost:3306/db_products?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC +spring.datasource.username=root +spring.datasource.password=root + +spring.jpa.hibernate.ddl-auto= update \ No newline at end of file From 754a18a728202c44e4282467d8f1852e40ae63d5 Mon Sep 17 00:00:00 2001 From: Mladen Savic Date: Tue, 27 Apr 2021 12:33:32 +0200 Subject: [PATCH 04/72] return auto generated ids --- persistence-modules/java-jpa-3/pom.xml | 6 +++ .../com/baeldung/jpa/IdGeneration/User.java | 41 ++++++++++++++++ .../jpa/IdGeneration/UserService.java | 19 ++++++++ .../main/resources/META-INF/persistence.xml | 16 +++++++ .../IdGenerationIntegrationTest.java | 47 +++++++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/User.java create mode 100644 persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/UserService.java create mode 100644 persistence-modules/java-jpa-3/src/test/java/com/baeldung/jpa/IdGeneration/IdGenerationIntegrationTest.java diff --git a/persistence-modules/java-jpa-3/pom.xml b/persistence-modules/java-jpa-3/pom.xml index f931cd90b8..1c3754c02a 100644 --- a/persistence-modules/java-jpa-3/pom.xml +++ b/persistence-modules/java-jpa-3/pom.xml @@ -68,6 +68,12 @@ ${assertj.version} test + + junit + junit + ${junit.version} + test + diff --git a/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/User.java b/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/User.java new file mode 100644 index 0000000000..88e742adce --- /dev/null +++ b/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/User.java @@ -0,0 +1,41 @@ +package com.baeldung.jpa.IdGeneration; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class User { + + @Id +// @GeneratedValue(strategy = GenerationType.SEQUENCE) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private long id; + private String username; + private String password; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + 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/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/UserService.java b/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/UserService.java new file mode 100644 index 0000000000..9c34ef9bb4 --- /dev/null +++ b/persistence-modules/java-jpa-3/src/main/java/com/baeldung/jpa/IdGeneration/UserService.java @@ -0,0 +1,19 @@ +package com.baeldung.jpa.IdGeneration; + +import javax.persistence.EntityManager; +import javax.transaction.Transactional; + +public class UserService { + + EntityManager entityManager; + + public UserService(EntityManager entityManager) { + this.entityManager = entityManager; + } + + @Transactional + public long saveUser(User user){ + entityManager.persist(user); + return user.getId(); + } +} diff --git a/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml b/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml index 19ecae8491..bc41f35c01 100644 --- a/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml +++ b/persistence-modules/java-jpa-3/src/main/resources/META-INF/persistence.xml @@ -97,4 +97,20 @@ + + + org.hibernate.jpa.HibernatePersistenceProvider + com.baeldung.jpa.IdGeneration.User + true + + + + + + + + + + + diff --git a/persistence-modules/java-jpa-3/src/test/java/com/baeldung/jpa/IdGeneration/IdGenerationIntegrationTest.java b/persistence-modules/java-jpa-3/src/test/java/com/baeldung/jpa/IdGeneration/IdGenerationIntegrationTest.java new file mode 100644 index 0000000000..941ad52344 --- /dev/null +++ b/persistence-modules/java-jpa-3/src/test/java/com/baeldung/jpa/IdGeneration/IdGenerationIntegrationTest.java @@ -0,0 +1,47 @@ +package com.baeldung.jpa.IdGeneration; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import java.util.UUID; + +public class IdGenerationIntegrationTest { + + private static EntityManager entityManager; + private static UserService service; + + @BeforeClass + public static void setup() { + EntityManagerFactory factory = Persistence.createEntityManagerFactory("jpa-h2-id-generation"); + entityManager = factory.createEntityManager(); + service = new UserService(entityManager); + } + + @Test + public void whenNewUserIsPersisted_thenEntityHasNoId() { + User user = new User(); + user.setUsername("test"); + user.setPassword(UUID.randomUUID().toString()); + + long index = service.saveUser(user); + Assert.assertEquals(0L, index); + } + + @Test + public void whenTransactionIsControlled_thenEntityHasId() { + User user = new User(); + user.setUsername("test"); + user.setPassword(UUID.randomUUID().toString()); + + entityManager.getTransaction().begin(); + long index = service.saveUser(user); + entityManager.getTransaction().commit(); + + Assert.assertEquals(2L, index); + } + +} From 0fbcc6fe5e0b7f72e3d6afe8705ea63b859edefa Mon Sep 17 00:00:00 2001 From: Dasun Nirmitha Date: Wed, 28 Apr 2021 21:44:19 +0530 Subject: [PATCH 05/72] Create IgnoringPatternMetacharactersUnitTest.java BAEL-4881 Understanding the Pattern.quote method --- ...IgnoringPatternMetacharactersUnitTest.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java diff --git a/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java b/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java new file mode 100644 index 0000000000..47c5089248 --- /dev/null +++ b/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java @@ -0,0 +1,54 @@ +package com.baeldung.ignore.pattern.metacharacters; + +import static org.junit.Assert.assertEquals; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.junit.Test; + +public class IgnoringPatternMetacharactersUnitTest { + private static final String dollarValues = "$100.25, $100.50, $150.50, $100.50, $100.75"; + private static final String patternStr = "$100.50"; + + @Test + public void givenPatternStringHasMetacharacters_whenPatternMatchedWithoutEscapingMetacharacters_thenNoMatchesFound() { + Pattern pattern = Pattern.compile(patternStr); + Matcher matcher = pattern.matcher(dollarValues); + + int matches = 0; + while (matcher.find()) { + matches++; + } + + assertEquals(0, matches); + } + + @Test + public void givenPatternStringHasMetacharacters_whenPatternCompiledUsingManuallyMetaEscapedPattern_thenMatchingSuccessful() { + String metaEscapedPatternStr = "\\Q" + patternStr + "\\E"; + Pattern pattern = Pattern.compile(metaEscapedPatternStr); + Matcher matcher = pattern.matcher(dollarValues); + + int matches = 0; + while (matcher.find()) { + matches++; + } + + assertEquals(2, matches); + } + + @Test + public void givenPatternStringHasMetacharacters_whenPatternCompiledUsingLiteralPatternFromQuote_thenMatchingSuccessful() { + String literalPatternStr = Pattern.quote(patternStr); + Pattern pattern = Pattern.compile(literalPatternStr); + Matcher matcher = pattern.matcher(dollarValues); + + int matches = 0; + while (matcher.find()) { + matches++; + } + + assertEquals(2, matches); + } +} From d34fdfd40af7843eea911e1a6c8acf8f196c16a8 Mon Sep 17 00:00:00 2001 From: Jacek Polom Date: Thu, 29 Apr 2021 21:20:09 +0200 Subject: [PATCH 06/72] BAEL-4900 AttributeOverwrite explained --- .../attribute/overwrite/entity/Address.java | 26 +++++++++ .../attribute/overwrite/entity/Brand.java | 29 ++++++++++ .../attribute/overwrite/entity/Car.java | 51 +++++++++++++++++ .../attribute/overwrite/entity/Owner.java | 25 +++++++++ .../attribute/overwrite/entity/Vehicle.java | 38 +++++++++++++ .../overwrite/repository/CarRepository.java | 7 +++ .../AttributeOverwriteIntegrationTest.java | 56 +++++++++++++++++++ 7 files changed, 232 insertions(+) create mode 100644 persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java create mode 100644 persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Brand.java create mode 100644 persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java create mode 100644 persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Owner.java create mode 100644 persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Vehicle.java create mode 100644 persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/repository/CarRepository.java create mode 100644 persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java new file mode 100644 index 0000000000..b1d7c60acd --- /dev/null +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java @@ -0,0 +1,26 @@ +package com.baeldung.attribute.overwrite.entity; + +import javax.persistence.Embeddable; + +@Embeddable +public class Address { + private String name; + private String city; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } +} diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Brand.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Brand.java new file mode 100644 index 0000000000..7541b52a4d --- /dev/null +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Brand.java @@ -0,0 +1,29 @@ +package com.baeldung.attribute.overwrite.entity; + +import javax.persistence.Embeddable; +import javax.persistence.Embedded; +import java.time.LocalDate; + +@Embeddable +public class Brand { + private String name; + private LocalDate foundationDate; + @Embedded + private Address address; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public LocalDate getFoundationDate() { + return foundationDate; + } + + public void setFoundationDate(LocalDate foundationDate) { + this.foundationDate = foundationDate; + } +} diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java new file mode 100644 index 0000000000..6213927e50 --- /dev/null +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java @@ -0,0 +1,51 @@ +package com.baeldung.attribute.overwrite.entity; + + +import javax.persistence.*; +import java.util.Map; + +@Entity +@AttributeOverride(name = "identifier", column = @Column(name = "VIN")) +public class Car extends Vehicle { + + private String model; + private String name; + @Embedded + @AttributeOverrides({ + @AttributeOverride(name = "name", column = @Column(name = "BRAND_NAME", length = 5)), + @AttributeOverride(name = "address.name", column = @Column(name = "ADDRESS_NAME")) + }) + private Brand brand; + @ElementCollection + @AttributeOverrides({ + @AttributeOverride(name = "key.name", column = @Column(name = "OWNER_NAME")), + @AttributeOverride(name = "key.surname", column = @Column(name = "OWNER_SURNAME")), + @AttributeOverride(name = "value.name", column = @Column(name = "ADDRESS_NAME")), + }) + Map owners; + + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Brand getBrand() { + return brand; + } + + public void setBrand(Brand brand) { + this.brand = brand; + } +} diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Owner.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Owner.java new file mode 100644 index 0000000000..134bac75ee --- /dev/null +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Owner.java @@ -0,0 +1,25 @@ +package com.baeldung.attribute.overwrite.entity; + +import javax.persistence.Embeddable; + +@Embeddable +public class Owner { + private String name; + private String surname; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String surname) { + this.surname = surname; + } +} diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Vehicle.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Vehicle.java new file mode 100644 index 0000000000..99cb4c58e4 --- /dev/null +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Vehicle.java @@ -0,0 +1,38 @@ +package com.baeldung.attribute.overwrite.entity; + +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.MappedSuperclass; + +@MappedSuperclass +public class Vehicle { + @Id + @GeneratedValue + private Integer id; + private String identifier; + private Integer numberOfWheels; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public Integer getNumberOfWheels() { + return numberOfWheels; + } + + public void setNumberOfWheels(Integer numberOfWheels) { + this.numberOfWheels = numberOfWheels; + } +} diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/repository/CarRepository.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/repository/CarRepository.java new file mode 100644 index 0000000000..1152de2d7f --- /dev/null +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/repository/CarRepository.java @@ -0,0 +1,7 @@ +package com.baeldung.attribute.overwrite.repository; + +import com.baeldung.attribute.overwrite.entity.Car; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface CarRepository extends JpaRepository { +} diff --git a/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java new file mode 100644 index 0000000000..57a880ba16 --- /dev/null +++ b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java @@ -0,0 +1,56 @@ +package com.baeldung.attribute.overwrite; + +import com.baeldung.Application; +import com.baeldung.attribute.overwrite.entity.Address; +import com.baeldung.attribute.overwrite.entity.Brand; +import com.baeldung.attribute.overwrite.entity.Car; +import com.baeldung.attribute.overwrite.repository.CarRepository; +import org.assertj.core.api.Assertions; +import org.jetbrains.annotations.NotNull; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {Application.class}) +public class AttributeOverwriteIntegrationTest { + + private static final LocalDate FORD_FOUNDATION_DATE = LocalDate.parse("1903-06-16"); + @Autowired + CarRepository carRepository; + + @Test + @Transactional + public void whenInsertingCar_thenEmbeddedAndMappedFieldsArePopulated() { + + Car fordMustang = createMustang(); + + carRepository.save(fordMustang); + Car actualCar = carRepository.getOne(fordMustang.getId()); + + Assertions.assertThat(actualCar).isEqualTo(fordMustang); + } + + @NotNull + private Car createMustang() { + Address address = new Address(); + address.setName("Ford United States"); + address.setCity("Dearborn"); + + Brand ford = new Brand(); + ford.setName("Ford"); + ford.setFoundationDate(FORD_FOUNDATION_DATE); + + Car fordMustang = new Car(); + fordMustang.setIdentifier("WP1AB29P88LA47599"); + fordMustang.setModel("Ford"); + fordMustang.setName("My car"); + fordMustang.setBrand(ford); + return fordMustang; + } +} From d160a09b014bd2204c26bcaac8752784e9c87423 Mon Sep 17 00:00:00 2001 From: Daniel Strmecki Date: Mon, 3 May 2021 11:18:02 +0200 Subject: [PATCH 07/72] BAEL-4876: Parallel stream examples added --- core-java-modules/core-java-streams-3/pom.xml | 1 + .../streams/parallel/ParallelStream.java | 14 ++++++ .../streams/parallel/SequentialStream.java | 14 ++++++ .../streams/parallel/ForkJoinUnitTest.java | 45 +++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java create mode 100644 core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java create mode 100644 core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java diff --git a/core-java-modules/core-java-streams-3/pom.xml b/core-java-modules/core-java-streams-3/pom.xml index 6597c999d8..2ec2fa7c48 100644 --- a/core-java-modules/core-java-streams-3/pom.xml +++ b/core-java-modules/core-java-streams-3/pom.xml @@ -47,6 +47,7 @@ + 1.18.20 3.6.1 diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java new file mode 100644 index 0000000000..deeaf9ed59 --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java @@ -0,0 +1,14 @@ +package com.baeldung.streams.parallel; + +import java.util.List; + +public class ParallelStream { + + public static void main(String[] args) { + List listOfNumbers = List.of(1, 2, 3, 4); + listOfNumbers.parallelStream().forEach(number -> + System.out.println(number + " " + Thread.currentThread().getName()) + ); + } + +} diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java new file mode 100644 index 0000000000..0e9c42640b --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java @@ -0,0 +1,14 @@ +package com.baeldung.streams.parallel; + +import java.util.List; + +public class SequentialStream { + + public static void main(String[] args) { + List listOfNumbers = List.of(1, 2, 3, 4); + listOfNumbers.stream().forEach(number -> + System.out.println(number + " " + Thread.currentThread().getName()) + ); + } + +} diff --git a/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java new file mode 100644 index 0000000000..12cf5ceb16 --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java @@ -0,0 +1,45 @@ +package com.baeldung.streams.parallel; + +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ForkJoinPool; + +import static org.assertj.core.api.Assertions.assertThat; + +class ForkJoinUnitTest { + + @Test + void givenSequentialStreamOfNumbers_whenReducingSumWithIdentityFive_thenResultIsCorrect() { + List listOfNumbers = List.of(1, 2, 3, 4); + int sum = listOfNumbers.stream().reduce(5, Integer::sum); + assertThat(sum).isEqualTo(15); + } + + @Test + void givenParallelStreamOfNumbers_whenReducingSumWithIdentityFive_thenResultIsNotCorrect() { + List listOfNumbers = List.of(1, 2, 3, 4); + int sum = listOfNumbers.parallelStream().reduce(5, Integer::sum); + assertThat(sum).isNotEqualTo(15); + } + + @Test + void givenParallelStreamOfNumbers_whenReducingSumWithIdentityZero_thenResultIsCorrect() { + List listOfNumbers = List.of(1, 2, 3, 4); + int sum = listOfNumbers.parallelStream().reduce(0, Integer::sum) + 5; + assertThat(sum).isEqualTo(15); + } + + @Test + public void givenParallelStreamOfNumbers_whenUsingCustomThreadPool_thenResultIsCorrect() + throws InterruptedException, ExecutionException { + List listOfNumbers = List.of(1, 2, 3, 4); + ForkJoinPool customThreadPool = new ForkJoinPool(4); + int sum = customThreadPool.submit( + () -> listOfNumbers.parallelStream().reduce(0, Integer::sum)).get(); + customThreadPool.shutdown(); + assertThat(sum).isEqualTo(10); + } + +} From b0ade9d58b6741362a0ce4676df7c1a2c1033922 Mon Sep 17 00:00:00 2001 From: Daniel Strmecki Date: Mon, 3 May 2021 11:52:32 +0200 Subject: [PATCH 08/72] BAEL-4876: Use Java 8 API --- .../com/baeldung/streams/parallel/ParallelStream.java | 3 ++- .../com/baeldung/streams/parallel/SequentialStream.java | 3 ++- .../com/baeldung/streams/parallel/ForkJoinUnitTest.java | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java index deeaf9ed59..f236f418e8 100644 --- a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/ParallelStream.java @@ -1,11 +1,12 @@ package com.baeldung.streams.parallel; +import java.util.Arrays; import java.util.List; public class ParallelStream { public static void main(String[] args) { - List listOfNumbers = List.of(1, 2, 3, 4); + List listOfNumbers = Arrays.asList(1, 2, 3, 4); listOfNumbers.parallelStream().forEach(number -> System.out.println(number + " " + Thread.currentThread().getName()) ); diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java index 0e9c42640b..01379130fa 100644 --- a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SequentialStream.java @@ -1,11 +1,12 @@ package com.baeldung.streams.parallel; +import java.util.Arrays; import java.util.List; public class SequentialStream { public static void main(String[] args) { - List listOfNumbers = List.of(1, 2, 3, 4); + List listOfNumbers = Arrays.asList(1, 2, 3, 4); listOfNumbers.stream().forEach(number -> System.out.println(number + " " + Thread.currentThread().getName()) ); diff --git a/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java index 12cf5ceb16..f9aab8ed6c 100644 --- a/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java +++ b/core-java-modules/core-java-streams-3/src/test/java/com/baeldung/streams/parallel/ForkJoinUnitTest.java @@ -2,6 +2,7 @@ package com.baeldung.streams.parallel; import org.junit.jupiter.api.Test; +import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.ForkJoinPool; @@ -12,21 +13,21 @@ class ForkJoinUnitTest { @Test void givenSequentialStreamOfNumbers_whenReducingSumWithIdentityFive_thenResultIsCorrect() { - List listOfNumbers = List.of(1, 2, 3, 4); + List listOfNumbers = Arrays.asList(1, 2, 3, 4); int sum = listOfNumbers.stream().reduce(5, Integer::sum); assertThat(sum).isEqualTo(15); } @Test void givenParallelStreamOfNumbers_whenReducingSumWithIdentityFive_thenResultIsNotCorrect() { - List listOfNumbers = List.of(1, 2, 3, 4); + List listOfNumbers = Arrays.asList(1, 2, 3, 4); int sum = listOfNumbers.parallelStream().reduce(5, Integer::sum); assertThat(sum).isNotEqualTo(15); } @Test void givenParallelStreamOfNumbers_whenReducingSumWithIdentityZero_thenResultIsCorrect() { - List listOfNumbers = List.of(1, 2, 3, 4); + List listOfNumbers = Arrays.asList(1, 2, 3, 4); int sum = listOfNumbers.parallelStream().reduce(0, Integer::sum) + 5; assertThat(sum).isEqualTo(15); } @@ -34,7 +35,7 @@ class ForkJoinUnitTest { @Test public void givenParallelStreamOfNumbers_whenUsingCustomThreadPool_thenResultIsCorrect() throws InterruptedException, ExecutionException { - List listOfNumbers = List.of(1, 2, 3, 4); + List listOfNumbers = Arrays.asList(1, 2, 3, 4); ForkJoinPool customThreadPool = new ForkJoinPool(4); int sum = customThreadPool.submit( () -> listOfNumbers.parallelStream().reduce(0, Integer::sum)).get(); From 48aa7c542513627e7c878e10e16e7062a97e4ca4 Mon Sep 17 00:00:00 2001 From: Jacek Polom Date: Mon, 3 May 2021 12:08:57 +0200 Subject: [PATCH 09/72] BAEL-4900 Code formatting fixed --- .../baeldung/attribute/overwrite/entity/Car.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java index 6213927e50..25d96ecc33 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java @@ -1,8 +1,8 @@ package com.baeldung.attribute.overwrite.entity; +import java.util.Map; import javax.persistence.*; -import java.util.Map; @Entity @AttributeOverride(name = "identifier", column = @Column(name = "VIN")) @@ -12,19 +12,18 @@ public class Car extends Vehicle { private String name; @Embedded @AttributeOverrides({ - @AttributeOverride(name = "name", column = @Column(name = "BRAND_NAME", length = 5)), - @AttributeOverride(name = "address.name", column = @Column(name = "ADDRESS_NAME")) + @AttributeOverride(name = "name", column = @Column(name = "BRAND_NAME", length = 5)), + @AttributeOverride(name = "address.name", column = @Column(name = "ADDRESS_NAME")) }) private Brand brand; @ElementCollection @AttributeOverrides({ - @AttributeOverride(name = "key.name", column = @Column(name = "OWNER_NAME")), - @AttributeOverride(name = "key.surname", column = @Column(name = "OWNER_SURNAME")), - @AttributeOverride(name = "value.name", column = @Column(name = "ADDRESS_NAME")), + @AttributeOverride(name = "key.name", column = @Column(name = "OWNER_NAME")), + @AttributeOverride(name = "key.surname", column = @Column(name = "OWNER_SURNAME")), + @AttributeOverride(name = "value.name", column = @Column(name = "ADDRESS_NAME")), }) Map owners; - public String getModel() { return model; } From bce6207f03bebbc3b5d19c95a59d258969aaa461 Mon Sep 17 00:00:00 2001 From: Daniel Strmecki Date: Mon, 3 May 2021 19:43:16 +0200 Subject: [PATCH 10/72] BAEL-4876: Add benchmark --- core-java-modules/core-java-streams-3/pom.xml | 11 ++++ .../parallel/DifferentSourceSplitting.java | 52 +++++++++++++++++++ .../streams/parallel/SplittingCosts.java | 26 ++++++++++ 3 files changed, 89 insertions(+) create mode 100644 core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java create mode 100644 core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java diff --git a/core-java-modules/core-java-streams-3/pom.xml b/core-java-modules/core-java-streams-3/pom.xml index 2ec2fa7c48..fb525decc3 100644 --- a/core-java-modules/core-java-streams-3/pom.xml +++ b/core-java-modules/core-java-streams-3/pom.xml @@ -27,6 +27,17 @@ ${lombok.version} provided + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + test + org.assertj diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java new file mode 100644 index 0000000000..37d7d25bf6 --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java @@ -0,0 +1,52 @@ +package com.baeldung.streams.parallel; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Mode; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.IntStream; + +public class DifferentSourceSplitting { + + private static final List arrayListOfNumbers = new ArrayList<>(); + private static final List linkedListOfNumbers = new LinkedList<>(); + + static { + IntStream.rangeClosed(1, 100_000_000).forEach(i -> { + arrayListOfNumbers.add(i); + linkedListOfNumbers.add(i); + }); + } + + public static void main(String[] args) throws Exception { + org.openjdk.jmh.Main.main(args); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + public static void arrayListSequential() { + arrayListOfNumbers.stream().reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + public static void arrayListParallel() { + arrayListOfNumbers.parallelStream().reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + public static void linkedListSequential() { + linkedListOfNumbers.stream().reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + public static void linkedListParallel() { + linkedListOfNumbers.parallelStream().reduce(0, Integer::sum); + } + +} diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java new file mode 100644 index 0000000000..1f9f7f062b --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java @@ -0,0 +1,26 @@ +package com.baeldung.streams.parallel; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Mode; +import java.util.stream.IntStream; + +public class SplittingCosts { + + public static void main(String[] args) throws Exception { + org.openjdk.jmh.Main.main(args); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + public static void arrayListSequential() { + IntStream.rangeClosed(1, 1_000).reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + public static void arrayListParallel() { + IntStream.rangeClosed(1, 1_000).parallel().reduce(0, Integer::sum); + } + +} From f9ae7b18a7894ea457121c3f337f854ca5c7b37d Mon Sep 17 00:00:00 2001 From: Jacek Polom Date: Tue, 4 May 2021 20:20:34 +0200 Subject: [PATCH 11/72] BAEL-4900 Code formatting fixed with intellij formatter --- .../com/baeldung/attribute/overwrite/entity/Address.java | 1 - .../java/com/baeldung/attribute/overwrite/entity/Car.java | 8 ++++++-- .../overwrite/AttributeOverwriteIntegrationTest.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java index b1d7c60acd..300d547c88 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java @@ -15,7 +15,6 @@ public class Address { this.name = name; } - public String getCity() { return city; } diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java index 25d96ecc33..383a46a893 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java @@ -1,9 +1,13 @@ package com.baeldung.attribute.overwrite.entity; +import javax.persistence.AttributeOverride; +import javax.persistence.AttributeOverrides; +import javax.persistence.Column; +import javax.persistence.ElementCollection; +import javax.persistence.Embedded; +import javax.persistence.Entity; import java.util.Map; -import javax.persistence.*; - @Entity @AttributeOverride(name = "identifier", column = @Column(name = "VIN")) public class Car extends Vehicle { diff --git a/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java index 57a880ba16..24578edb5c 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java +++ b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java @@ -17,7 +17,7 @@ import org.springframework.transaction.annotation.Transactional; import java.time.LocalDate; @RunWith(SpringRunner.class) -@SpringBootTest(classes = {Application.class}) +@SpringBootTest(classes = { Application.class }) public class AttributeOverwriteIntegrationTest { private static final LocalDate FORD_FOUNDATION_DATE = LocalDate.parse("1903-06-16"); From 09eaca991499892267d99062bd0e6a5a9f9b5c00 Mon Sep 17 00:00:00 2001 From: Hendro Steven Date: Thu, 6 May 2021 21:01:54 +0700 Subject: [PATCH 12/72] remove mysql and using h2 db --- persistence-modules/spring-data-jpa-crud/pom.xml | 5 ----- .../src/main/resources/application.properties | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/persistence-modules/spring-data-jpa-crud/pom.xml b/persistence-modules/spring-data-jpa-crud/pom.xml index 4afb75d737..16ee74aa62 100644 --- a/persistence-modules/spring-data-jpa-crud/pom.xml +++ b/persistence-modules/spring-data-jpa-crud/pom.xml @@ -33,11 +33,6 @@ com.h2database h2 - - mysql - mysql-connector-java - runtime - net.ttddyy datasource-proxy diff --git a/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties index a11e224a1b..a3a7bd42f7 100644 --- a/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties +++ b/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties @@ -13,8 +13,10 @@ spring.jpa.properties.hibernate.generate_statistics=true #spring.jpa.properties.javax.persistence.schema-generation.scripts.create-source=metadata #spring.jpa.properties.hibernate.format_sql=true -spring.datasource.url=jdbc:mysql://localhost:3306/db_products?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC -spring.datasource.username=root -spring.datasource.password=root +# spring.datasource.url=jdbc:mysql://localhost:3306/db_products?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC +# spring.datasource.username=root +# spring.datasource.password=root -spring.jpa.hibernate.ddl-auto= update \ No newline at end of file +# spring.jpa.hibernate.ddl-auto= update + +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect \ No newline at end of file From 908930799168785d4346a33fde7d0ce73f6c7dde Mon Sep 17 00:00:00 2001 From: wlesniak Date: Thu, 6 May 2021 16:06:09 +0100 Subject: [PATCH 13/72] BAEL-4564 Sample code for article filters vs spring handler interceptor --- .../spring-boot-mvc-3/README.md | 1 + .../FilterInterceptorApp.java | 12 +++++++ .../filtersinterceptors/HelloConroller.java | 19 ++++++++++ .../filtersinterceptors/LogFilter.java | 27 ++++++++++++++ .../filtersinterceptors/LogInterceptor.java | 36 +++++++++++++++++++ .../filtersinterceptors/WebMvcConfig.java | 21 +++++++++++ .../src/main/resources/templates/hello.html | 10 ++++++ 7 files changed, 126 insertions(+) create mode 100644 spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java create mode 100644 spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java create mode 100644 spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java create mode 100644 spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java create mode 100644 spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java create mode 100644 spring-boot-modules/spring-boot-mvc-3/src/main/resources/templates/hello.html diff --git a/spring-boot-modules/spring-boot-mvc-3/README.md b/spring-boot-modules/spring-boot-mvc-3/README.md index bc3eb9e496..2c18acd70e 100644 --- a/spring-boot-modules/spring-boot-mvc-3/README.md +++ b/spring-boot-modules/spring-boot-mvc-3/README.md @@ -9,4 +9,5 @@ This module contains articles about Spring Web MVC in Spring Boot projects. - [Spring MVC Async vs Spring WebFlux](https://www.baeldung.com/spring-mvc-async-vs-webflux) - [Differences in @Valid and @Validated Annotations in Spring](https://www.baeldung.com/spring-valid-vs-validated) - [CharacterEncodingFilter In SpringBoot](https://www.baeldung.com/spring-boot-characterencodingfilter) + [Difference Between Interceptors and Filters in Spring MVC](https://www.baeldung.com/difference-between-interceptors-and-filters-in-spring-mvc/) - More articles: [[prev -->]](/spring-boot-modules/spring-boot-mvc-2) diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java new file mode 100644 index 0000000000..e9ff9e8785 --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java @@ -0,0 +1,12 @@ +package com.baeldung.filtersinterceptors; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; + +@SpringBootApplication(scanBasePackages = "com.baeldung.filtersinterceptors") +public class FilterInterceptorApp { + public static void main(String[] args) { + SpringApplication.run(FilterInterceptorApp.class, args); + } +} \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java new file mode 100644 index 0000000000..bb3fdfe179 --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java @@ -0,0 +1,19 @@ +package com.baeldung.filtersinterceptors; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class HelloConroller { + + private Logger logger = LoggerFactory.getLogger(HelloConroller.class); + + @GetMapping("/hello") + public String hello() { + logger.info("Hello from the controller"); + return "hello"; + } + +} diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java new file mode 100644 index 0000000000..59774d4771 --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java @@ -0,0 +1,27 @@ +package com.baeldung.filtersinterceptors; + +import java.io.IOException; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Component +public class LogFilter implements Filter { + + private Logger logger = LoggerFactory.getLogger(LogFilter.class); + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + logger.info("Hello from: "+request.getLocalAddr()); + chain.doFilter(request, response); + } + +} diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java new file mode 100644 index 0000000000..89e82dd004 --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java @@ -0,0 +1,36 @@ +package com.baeldung.filtersinterceptors; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +@Component +public class LogInterceptor implements HandlerInterceptor{ + + private Logger logger = LoggerFactory.getLogger(LogInterceptor.class); + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) + throws Exception { + logger.info("preHandle"); + return true; + } + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, + ModelAndView modelAndView) throws Exception { + logger.info("postHandle"); + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) + throws Exception { + logger.info("afterCompletion"); + } + +} diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java new file mode 100644 index 0000000000..460651ebfb --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java @@ -0,0 +1,21 @@ +package com.baeldung.filtersinterceptors; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class WebMvcConfig implements WebMvcConfigurer { + + private final LogInterceptor logInterceptor; + + public WebMvcConfig(LogInterceptor logInterceptor) { + this.logInterceptor = new LogInterceptor(); + } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(logInterceptor).addPathPatterns("/**"); + } + +} diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/resources/templates/hello.html b/spring-boot-modules/spring-boot-mvc-3/src/main/resources/templates/hello.html new file mode 100644 index 0000000000..9a9b0e707b --- /dev/null +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/resources/templates/hello.html @@ -0,0 +1,10 @@ + + + +Spring Filters vs Interceptors + + + +

Hello

+ + \ No newline at end of file From 8e5ebe813c48653cb4af2cb6d68e17aa6675738f Mon Sep 17 00:00:00 2001 From: wlesniak Date: Thu, 6 May 2021 16:18:12 +0100 Subject: [PATCH 14/72] BAEL-4564 fixed code formatting --- .../FilterInterceptorApp.java | 1 - .../filtersinterceptors/HelloConroller.java | 18 ++++---- .../filtersinterceptors/LogFilter.java | 15 ++++--- .../filtersinterceptors/LogInterceptor.java | 42 +++++++++---------- .../filtersinterceptors/WebMvcConfig.java | 18 +++----- 5 files changed, 41 insertions(+), 53 deletions(-) diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java index e9ff9e8785..b1e6badd43 100644 --- a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/FilterInterceptorApp.java @@ -2,7 +2,6 @@ package com.baeldung.filtersinterceptors; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication(scanBasePackages = "com.baeldung.filtersinterceptors") public class FilterInterceptorApp { diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java index bb3fdfe179..db2da63d43 100644 --- a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/HelloConroller.java @@ -7,13 +7,13 @@ import org.springframework.web.bind.annotation.GetMapping; @Controller public class HelloConroller { - - private Logger logger = LoggerFactory.getLogger(HelloConroller.class); - - @GetMapping("/hello") - public String hello() { - logger.info("Hello from the controller"); - return "hello"; - } - + + private Logger logger = LoggerFactory.getLogger(HelloConroller.class); + + @GetMapping("/hello") + public String hello() { + logger.info("Hello from the controller"); + return "hello"; + } + } diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java index 59774d4771..dc78cfbbb9 100644 --- a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogFilter.java @@ -15,13 +15,12 @@ import org.springframework.stereotype.Component; @Component public class LogFilter implements Filter { - private Logger logger = LoggerFactory.getLogger(LogFilter.class); - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) - throws IOException, ServletException { - logger.info("Hello from: "+request.getLocalAddr()); - chain.doFilter(request, response); - } + private Logger logger = LoggerFactory.getLogger(LogFilter.class); + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { + logger.info("Hello from: " + request.getLocalAddr()); + chain.doFilter(request, response); + } } diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java index 89e82dd004..b43b69415a 100644 --- a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/LogInterceptor.java @@ -9,28 +9,24 @@ import org.springframework.stereotype.Component; import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.ModelAndView; -@Component -public class LogInterceptor implements HandlerInterceptor{ +public class LogInterceptor implements HandlerInterceptor { + + private Logger logger = LoggerFactory.getLogger(LogInterceptor.class); + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { + logger.info("preHandle"); + return true; + } + + @Override + public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { + logger.info("postHandle"); + } + + @Override + public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { + logger.info("afterCompletion"); + } - private Logger logger = LoggerFactory.getLogger(LogInterceptor.class); - - @Override - public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) - throws Exception { - logger.info("preHandle"); - return true; - } - - @Override - public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, - ModelAndView modelAndView) throws Exception { - logger.info("postHandle"); - } - - @Override - public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) - throws Exception { - logger.info("afterCompletion"); - } - } diff --git a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java index 460651ebfb..9f4c1c2166 100644 --- a/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java +++ b/spring-boot-modules/spring-boot-mvc-3/src/main/java/com/baeldung/filtersinterceptors/WebMvcConfig.java @@ -5,17 +5,11 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @Configuration -public class WebMvcConfig implements WebMvcConfigurer { +public class WebMvcConfig implements WebMvcConfigurer { + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new LogInterceptor()); + } - private final LogInterceptor logInterceptor; - - public WebMvcConfig(LogInterceptor logInterceptor) { - this.logInterceptor = new LogInterceptor(); - } - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(logInterceptor).addPathPatterns("/**"); - } - } From 656d3a9ad79cd8436d98a17ed9f597e3e2d77c7c Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 May 2021 18:38:50 +0000 Subject: [PATCH 15/72] BAEL-4878 | How to split a string, but also keep the delimiters? --- .../SplitAndKeepDelimitersUnitTest.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 core-java-modules/core-java-string-operations/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java new file mode 100644 index 0000000000..7a9e0cd710 --- /dev/null +++ b/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java @@ -0,0 +1,53 @@ +package com.baeldung.splitkeepdelimiters; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.regex.Pattern; + +import org.apache.commons.lang3.StringUtils; +import org.junit.jupiter.api.Test; + +import com.google.common.base.Splitter; + +public class SplitAndKeepDelimitersUnitTest { + + private final String positivelookAheadRegex = "((?=@))"; + private final String positivelookBehindRegex = "((?<=@))"; + private final String positivelookAroundRegex = "((?=@)|(?<=@))"; + private final String positiveLookAroundMultiDelimiterRegex = "((?<=;|:|,|#|@|~)|(?=;|:|,|#|@|~))"; + + private String text = "Hello@World@This@Is@A@Java@Program"; + private String textMixed = "@Hello;World@This:Is,A#Java~Program"; + private String textMixed2 = "pg-no.10@hello;world@this:is,a#10words|Java~Program"; + + @Test + public void givenString_splitAndKeepDelimiters_using_javaLangString() { + + assertThat(text.split(positivelookAheadRegex)).containsExactly("Hello", "@World", "@This", "@Is", "@A", "@Java", "@Program"); + + assertThat(text.split(positivelookBehindRegex)).containsExactly("Hello@", "World@", "This@", "Is@", "A@", "Java@", "Program"); + + assertThat(text.split(positivelookAroundRegex)).containsExactly("Hello", "@", "World", "@", "This", "@", "Is", "@", "A", "@", "Java", "@", "Program"); + + assertThat(textMixed.split(positiveLookAroundMultiDelimiterRegex)).containsExactly("@", "Hello", ";", "World", "@", "This", ":", "Is", ",", "A", "#", "Java", "~", "Program"); + + } + + @Test + public void givenString_splitAndKeepDelimiters_using_ApacheCommonsLang3StringUtils() { + + assertThat(StringUtils.splitByCharacterType(textMixed2)).containsExactly("pg", "-", "no", ".", "10", "@", "hello", ";", "world", "@", "this", ":", "is", ",", "a", "#", "10", "words", "|", "J", "ava", "~", "P", "rogram"); + + } + + @Test + public void givenString_splitAndKeepDelimiters_using_GuavaSplitter() { + + assertThat(Splitter.onPattern(positiveLookAroundMultiDelimiterRegex) + .splitToList(textMixed)).containsExactly("@", "Hello", ";", "World", "@", "This", ":", "Is", ",", "A", "#", "Java", "~", "Program"); + + assertThat(Splitter.on(Pattern.compile(positiveLookAroundMultiDelimiterRegex)) + .splitToList(textMixed)).containsExactly("@", "Hello", ";", "World", "@", "This", ":", "Is", ",", "A", "#", "Java", "~", "Program"); + + } +} From 26992a22c2dc3e0db94350eaf9e0bcdaf09afa78 Mon Sep 17 00:00:00 2001 From: wlesniak Date: Sat, 8 May 2021 21:55:18 +0100 Subject: [PATCH 16/72] BAEL-4564 revertt readme file as it will be auto updated --- spring-boot-modules/spring-boot-mvc-3/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-mvc-3/README.md b/spring-boot-modules/spring-boot-mvc-3/README.md index 2c18acd70e..bc3eb9e496 100644 --- a/spring-boot-modules/spring-boot-mvc-3/README.md +++ b/spring-boot-modules/spring-boot-mvc-3/README.md @@ -9,5 +9,4 @@ This module contains articles about Spring Web MVC in Spring Boot projects. - [Spring MVC Async vs Spring WebFlux](https://www.baeldung.com/spring-mvc-async-vs-webflux) - [Differences in @Valid and @Validated Annotations in Spring](https://www.baeldung.com/spring-valid-vs-validated) - [CharacterEncodingFilter In SpringBoot](https://www.baeldung.com/spring-boot-characterencodingfilter) - [Difference Between Interceptors and Filters in Spring MVC](https://www.baeldung.com/difference-between-interceptors-and-filters-in-spring-mvc/) - More articles: [[prev -->]](/spring-boot-modules/spring-boot-mvc-2) From 86c36061c98ec35d012f35c8a1612b61d96c1fd7 Mon Sep 17 00:00:00 2001 From: Daniel Strmecki Date: Sun, 9 May 2021 11:41:35 +0200 Subject: [PATCH 17/72] BAEL-4876: Add more benchmarks --- core-java-modules/core-java-streams-3/pom.xml | 22 +++++++- .../streams/parallel/BenchmarkRunner.java | 9 ++++ .../parallel/DifferentSourceSplitting.java | 20 +++---- .../streams/parallel/MemoryLocalityCosts.java | 52 +++++++++++++++++++ .../streams/parallel/MergingCosts.java | 52 +++++++++++++++++++ .../streams/parallel/SplittingCosts.java | 21 ++++---- 6 files changed, 155 insertions(+), 21 deletions(-) create mode 100644 core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/BenchmarkRunner.java create mode 100644 core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java create mode 100644 core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java diff --git a/core-java-modules/core-java-streams-3/pom.xml b/core-java-modules/core-java-streams-3/pom.xml index fb525decc3..068d6df74f 100644 --- a/core-java-modules/core-java-streams-3/pom.xml +++ b/core-java-modules/core-java-streams-3/pom.xml @@ -30,12 +30,12 @@ org.openjdk.jmh jmh-core - ${jmh-core.version} + ${jmh.version} org.openjdk.jmh jmh-generator-annprocess - ${jmh-generator.version} + ${jmh.version} test @@ -55,12 +55,30 @@ true + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh.version} + + + + + 1.18.20 3.6.1 + 1.29 diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/BenchmarkRunner.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/BenchmarkRunner.java new file mode 100644 index 0000000000..461d728ad0 --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/BenchmarkRunner.java @@ -0,0 +1,9 @@ +package com.baeldung.streams.parallel; + +public class BenchmarkRunner { + + public static void main(String[] args) throws Exception { + org.openjdk.jmh.Main.main(args); + } + +} diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java index 37d7d25bf6..3e133c21b1 100644 --- a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java @@ -3,10 +3,12 @@ package com.baeldung.streams.parallel; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; +import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; public class DifferentSourceSplitting { @@ -15,37 +17,37 @@ public class DifferentSourceSplitting { private static final List linkedListOfNumbers = new LinkedList<>(); static { - IntStream.rangeClosed(1, 100_000_000).forEach(i -> { + IntStream.rangeClosed(1, 100_000).forEach(i -> { arrayListOfNumbers.add(i); linkedListOfNumbers.add(i); }); } - public static void main(String[] args) throws Exception { - org.openjdk.jmh.Main.main(args); - } - @Benchmark @BenchmarkMode(Mode.AverageTime) - public static void arrayListSequential() { + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void differentSourceArrayListSequential() { arrayListOfNumbers.stream().reduce(0, Integer::sum); } @Benchmark @BenchmarkMode(Mode.AverageTime) - public static void arrayListParallel() { + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void differentSourceArrayListParallel() { arrayListOfNumbers.parallelStream().reduce(0, Integer::sum); } @Benchmark @BenchmarkMode(Mode.AverageTime) - public static void linkedListSequential() { + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void differentSourceLinkedListSequential() { linkedListOfNumbers.stream().reduce(0, Integer::sum); } @Benchmark @BenchmarkMode(Mode.AverageTime) - public static void linkedListParallel() { + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void differentSourceLinkedListParallel() { linkedListOfNumbers.parallelStream().reduce(0, Integer::sum); } diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java new file mode 100644 index 0000000000..9bb6fcaa81 --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java @@ -0,0 +1,52 @@ +package com.baeldung.streams.parallel; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; + +import java.util.Arrays; +import java.util.concurrent.TimeUnit; +import java.util.stream.IntStream; + +public class MemoryLocalityCosts { + + private static final int[] intArray = new int[100_000]; + private static final Integer[] integerArray = new Integer[100_000]; + + static { + IntStream.rangeClosed(1, 100_000).forEach(i -> { + intArray[i-1] = i; + integerArray[i-1] = i; + }); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void localityIntArraySequential() { + Arrays.stream(intArray).reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void localityIntArrayParallel() { + Arrays.stream(intArray).parallel().reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void localityIntegerArraySequential() { + Arrays.stream(integerArray).reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void localityIntegerArrayParallel() { + Arrays.stream(integerArray).parallel().reduce(0, Integer::sum); + } + +} diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java new file mode 100644 index 0000000000..7266f6954f --- /dev/null +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java @@ -0,0 +1,52 @@ +package com.baeldung.streams.parallel; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +public class MergingCosts { + + private static final List arrayListOfNumbers = new ArrayList<>(); + + static { + IntStream.rangeClosed(1, 100_000).forEach(i -> { + arrayListOfNumbers.add(i); + }); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void mergingCostsSumSequential() { + arrayListOfNumbers.stream().reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void mergingCostsSumParallel() { + arrayListOfNumbers.stream().parallel().reduce(0, Integer::sum); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void mergingCostsGroupingSequential() { + arrayListOfNumbers.stream().collect(Collectors.groupingBy(i -> i % 2 == 0)); + } + + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void mergingCostsGroupingParallel() { + arrayListOfNumbers.stream().parallel().collect(Collectors.groupingBy(i -> i % 2 == 0)); + } + +} diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java index 1f9f7f062b..d1e878df1f 100644 --- a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/SplittingCosts.java @@ -3,24 +3,25 @@ package com.baeldung.streams.parallel; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; + +import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; public class SplittingCosts { - public static void main(String[] args) throws Exception { - org.openjdk.jmh.Main.main(args); + @Benchmark + @BenchmarkMode(Mode.AverageTime) + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void sourceSplittingIntStreamSequential() { + IntStream.rangeClosed(1, 100).reduce(0, Integer::sum); } @Benchmark @BenchmarkMode(Mode.AverageTime) - public static void arrayListSequential() { - IntStream.rangeClosed(1, 1_000).reduce(0, Integer::sum); - } - - @Benchmark - @BenchmarkMode(Mode.AverageTime) - public static void arrayListParallel() { - IntStream.rangeClosed(1, 1_000).parallel().reduce(0, Integer::sum); + @OutputTimeUnit(TimeUnit.NANOSECONDS) + public static void sourceSplittingIntStreamParallel() { + IntStream.rangeClosed(1, 100).parallel().reduce(0, Integer::sum); } } From 2c5bd5e207e4a3411edac3a792db17ab1e6154cd Mon Sep 17 00:00:00 2001 From: Daniel Strmecki Date: Sun, 9 May 2021 20:29:29 +0200 Subject: [PATCH 18/72] BAEL-4876: Add more data --- .../baeldung/streams/parallel/DifferentSourceSplitting.java | 2 +- .../com/baeldung/streams/parallel/MemoryLocalityCosts.java | 6 +++--- .../java/com/baeldung/streams/parallel/MergingCosts.java | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java index 3e133c21b1..9ad569df30 100644 --- a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/DifferentSourceSplitting.java @@ -17,7 +17,7 @@ public class DifferentSourceSplitting { private static final List linkedListOfNumbers = new LinkedList<>(); static { - IntStream.rangeClosed(1, 100_000).forEach(i -> { + IntStream.rangeClosed(1, 1_000_000).forEach(i -> { arrayListOfNumbers.add(i); linkedListOfNumbers.add(i); }); diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java index 9bb6fcaa81..bc5cbf491b 100644 --- a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MemoryLocalityCosts.java @@ -11,11 +11,11 @@ import java.util.stream.IntStream; public class MemoryLocalityCosts { - private static final int[] intArray = new int[100_000]; - private static final Integer[] integerArray = new Integer[100_000]; + private static final int[] intArray = new int[1_000_000]; + private static final Integer[] integerArray = new Integer[1_000_000]; static { - IntStream.rangeClosed(1, 100_000).forEach(i -> { + IntStream.rangeClosed(1, 1_000_000).forEach(i -> { intArray[i-1] = i; integerArray[i-1] = i; }); diff --git a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java index 7266f6954f..a9919dbe72 100644 --- a/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java +++ b/core-java-modules/core-java-streams-3/src/main/java/com/baeldung/streams/parallel/MergingCosts.java @@ -16,7 +16,7 @@ public class MergingCosts { private static final List arrayListOfNumbers = new ArrayList<>(); static { - IntStream.rangeClosed(1, 100_000).forEach(i -> { + IntStream.rangeClosed(1, 1_000_000).forEach(i -> { arrayListOfNumbers.add(i); }); } @@ -39,14 +39,14 @@ public class MergingCosts { @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public static void mergingCostsGroupingSequential() { - arrayListOfNumbers.stream().collect(Collectors.groupingBy(i -> i % 2 == 0)); + arrayListOfNumbers.stream().collect(Collectors.toSet()); } @Benchmark @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) public static void mergingCostsGroupingParallel() { - arrayListOfNumbers.stream().parallel().collect(Collectors.groupingBy(i -> i % 2 == 0)); + arrayListOfNumbers.stream().parallel().collect(Collectors.toSet()); } } From 10b8125b094d536c5d4c7bcbd38ffbd51735bd03 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 9 May 2021 20:25:34 +0000 Subject: [PATCH 19/72] BAEL-4878 | How to split a string, but also keep the delimiters? | moved src --- .../SplitAndKeepDelimitersUnitTest.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) rename core-java-modules/{core-java-string-operations => core-java-string-operations-3}/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java (63%) diff --git a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java b/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java similarity index 63% rename from core-java-modules/core-java-string-operations/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java rename to core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java index 7a9e0cd710..ede8be4c05 100644 --- a/core-java-modules/core-java-string-operations/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java +++ b/core-java-modules/core-java-string-operations-3/src/test/java/com/baeldung/splitkeepdelimiters/SplitAndKeepDelimitersUnitTest.java @@ -14,11 +14,11 @@ public class SplitAndKeepDelimitersUnitTest { private final String positivelookAheadRegex = "((?=@))"; private final String positivelookBehindRegex = "((?<=@))"; private final String positivelookAroundRegex = "((?=@)|(?<=@))"; - private final String positiveLookAroundMultiDelimiterRegex = "((?<=;|:|,|#|@|~)|(?=;|:|,|#|@|~))"; + private final String positiveLookAroundMultiDelimiterRegex = "((?=:|#|@)|(?<=:|#|@))"; private String text = "Hello@World@This@Is@A@Java@Program"; - private String textMixed = "@Hello;World@This:Is,A#Java~Program"; - private String textMixed2 = "pg-no.10@hello;world@this:is,a#10words|Java~Program"; + private String textMixed = "@HelloWorld@This:Is@A#Java#Program"; + private String textMixed2 = "pg@no;10@hello;world@this;is@a#10words;Java#Program"; @Test public void givenString_splitAndKeepDelimiters_using_javaLangString() { @@ -29,25 +29,31 @@ public class SplitAndKeepDelimitersUnitTest { assertThat(text.split(positivelookAroundRegex)).containsExactly("Hello", "@", "World", "@", "This", "@", "Is", "@", "A", "@", "Java", "@", "Program"); - assertThat(textMixed.split(positiveLookAroundMultiDelimiterRegex)).containsExactly("@", "Hello", ";", "World", "@", "This", ":", "Is", ",", "A", "#", "Java", "~", "Program"); + assertThat(textMixed.split(positiveLookAroundMultiDelimiterRegex)).containsExactly("@", "HelloWorld", "@", "This", ":", "Is", "@", "A", "#", "Java", "#", "Program"); } @Test public void givenString_splitAndKeepDelimiters_using_ApacheCommonsLang3StringUtils() { - assertThat(StringUtils.splitByCharacterType(textMixed2)).containsExactly("pg", "-", "no", ".", "10", "@", "hello", ";", "world", "@", "this", ":", "is", ",", "a", "#", "10", "words", "|", "J", "ava", "~", "P", "rogram"); + assertThat(StringUtils.splitByCharacterType(textMixed2)).containsExactly("pg", "@", "no", ";", "10", "@", "hello", ";", "world", "@", "this", ";", "is", "@", "a", "#", "10", "words", ";", "J", "ava", "#", "P", "rogram"); } @Test public void givenString_splitAndKeepDelimiters_using_GuavaSplitter() { + assertThat(Splitter.onPattern(positivelookAroundRegex) + .splitToList(text)).containsExactly("Hello", "@", "World", "@", "This", "@", "Is", "@", "A", "@", "Java", "@", "Program"); + + assertThat(Splitter.on(Pattern.compile(positivelookAroundRegex)) + .splitToList(text)).containsExactly("Hello", "@", "World", "@", "This", "@", "Is", "@", "A", "@", "Java", "@", "Program"); + assertThat(Splitter.onPattern(positiveLookAroundMultiDelimiterRegex) - .splitToList(textMixed)).containsExactly("@", "Hello", ";", "World", "@", "This", ":", "Is", ",", "A", "#", "Java", "~", "Program"); + .splitToList(textMixed)).containsExactly("@", "HelloWorld", "@", "This", ":", "Is", "@", "A", "#", "Java", "#", "Program"); assertThat(Splitter.on(Pattern.compile(positiveLookAroundMultiDelimiterRegex)) - .splitToList(textMixed)).containsExactly("@", "Hello", ";", "World", "@", "This", ":", "Is", ",", "A", "#", "Java", "~", "Program"); + .splitToList(textMixed)).containsExactly("@", "HelloWorld", "@", "This", ":", "Is", "@", "A", "#", "Java", "#", "Program"); } } From 76e45f3b084b787798d502b32f982fe26a4a8495 Mon Sep 17 00:00:00 2001 From: Dasun Nirmitha Date: Mon, 10 May 2021 14:54:53 +0530 Subject: [PATCH 20/72] Update IgnoringPatternMetacharactersUnitTest.java Implemented improvements suggested by Editor. --- .../IgnoringPatternMetacharactersUnitTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java b/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java index 47c5089248..921876c0d5 100644 --- a/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java +++ b/core-java-modules/core-java-regex/src/test/java/com/baeldung/ignore/pattern/metacharacters/IgnoringPatternMetacharactersUnitTest.java @@ -8,13 +8,13 @@ import java.util.regex.Pattern; import org.junit.Test; public class IgnoringPatternMetacharactersUnitTest { - private static final String dollarValues = "$100.25, $100.50, $150.50, $100.50, $100.75"; + private static final String dollarAmounts = "$100.25, $100.50, $150.50, $100.50, $100.75"; private static final String patternStr = "$100.50"; @Test public void givenPatternStringHasMetacharacters_whenPatternMatchedWithoutEscapingMetacharacters_thenNoMatchesFound() { Pattern pattern = Pattern.compile(patternStr); - Matcher matcher = pattern.matcher(dollarValues); + Matcher matcher = pattern.matcher(dollarAmounts); int matches = 0; while (matcher.find()) { @@ -28,7 +28,7 @@ public class IgnoringPatternMetacharactersUnitTest { public void givenPatternStringHasMetacharacters_whenPatternCompiledUsingManuallyMetaEscapedPattern_thenMatchingSuccessful() { String metaEscapedPatternStr = "\\Q" + patternStr + "\\E"; Pattern pattern = Pattern.compile(metaEscapedPatternStr); - Matcher matcher = pattern.matcher(dollarValues); + Matcher matcher = pattern.matcher(dollarAmounts); int matches = 0; while (matcher.find()) { @@ -42,7 +42,7 @@ public class IgnoringPatternMetacharactersUnitTest { public void givenPatternStringHasMetacharacters_whenPatternCompiledUsingLiteralPatternFromQuote_thenMatchingSuccessful() { String literalPatternStr = Pattern.quote(patternStr); Pattern pattern = Pattern.compile(literalPatternStr); - Matcher matcher = pattern.matcher(dollarValues); + Matcher matcher = pattern.matcher(dollarAmounts); int matches = 0; while (matcher.find()) { From a2bf1605fcfecca0f31ab8512d0f0839d9b8f0e4 Mon Sep 17 00:00:00 2001 From: Jacek Polom Date: Wed, 12 May 2021 20:34:36 +0200 Subject: [PATCH 21/72] BAEL-4900 Rename package name from overwrite to override, to be consist with annotation name. --- .../{overwrite => override}/entity/Address.java | 2 +- .../{overwrite => override}/entity/Brand.java | 2 +- .../{overwrite => override}/entity/Car.java | 2 +- .../{overwrite => override}/entity/Owner.java | 2 +- .../{overwrite => override}/entity/Vehicle.java | 2 +- .../repository/CarRepository.java | 4 ++-- .../AttributeOverrideIntegrationTest.java} | 12 ++++++------ 7 files changed, 13 insertions(+), 13 deletions(-) rename persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/{overwrite => override}/entity/Address.java (88%) rename persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/{overwrite => override}/entity/Brand.java (92%) rename persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/{overwrite => override}/entity/Car.java (96%) rename persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/{overwrite => override}/entity/Owner.java (89%) rename persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/{overwrite => override}/entity/Vehicle.java (93%) rename persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/{overwrite => override}/repository/CarRepository.java (56%) rename persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/{overwrite/AttributeOverwriteIntegrationTest.java => override/AttributeOverrideIntegrationTest.java} (82%) diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Address.java similarity index 88% rename from persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java rename to persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Address.java index 300d547c88..95a3708173 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Address.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Address.java @@ -1,4 +1,4 @@ -package com.baeldung.attribute.overwrite.entity; +package com.baeldung.attribute.override.entity; import javax.persistence.Embeddable; diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Brand.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Brand.java similarity index 92% rename from persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Brand.java rename to persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Brand.java index 7541b52a4d..9918cbaa70 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Brand.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Brand.java @@ -1,4 +1,4 @@ -package com.baeldung.attribute.overwrite.entity; +package com.baeldung.attribute.override.entity; import javax.persistence.Embeddable; import javax.persistence.Embedded; diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Car.java similarity index 96% rename from persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java rename to persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Car.java index 383a46a893..5421090e58 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Car.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Car.java @@ -1,4 +1,4 @@ -package com.baeldung.attribute.overwrite.entity; +package com.baeldung.attribute.override.entity; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Owner.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Owner.java similarity index 89% rename from persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Owner.java rename to persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Owner.java index 134bac75ee..28ef6c7974 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Owner.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Owner.java @@ -1,4 +1,4 @@ -package com.baeldung.attribute.overwrite.entity; +package com.baeldung.attribute.override.entity; import javax.persistence.Embeddable; diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Vehicle.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Vehicle.java similarity index 93% rename from persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Vehicle.java rename to persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Vehicle.java index 99cb4c58e4..2d4c0c04b3 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/entity/Vehicle.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/entity/Vehicle.java @@ -1,4 +1,4 @@ -package com.baeldung.attribute.overwrite.entity; +package com.baeldung.attribute.override.entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; diff --git a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/repository/CarRepository.java b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/repository/CarRepository.java similarity index 56% rename from persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/repository/CarRepository.java rename to persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/repository/CarRepository.java index 1152de2d7f..17cea77d89 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/overwrite/repository/CarRepository.java +++ b/persistence-modules/spring-data-jpa-annotations/src/main/java/com/baeldung/attribute/override/repository/CarRepository.java @@ -1,6 +1,6 @@ -package com.baeldung.attribute.overwrite.repository; +package com.baeldung.attribute.override.repository; -import com.baeldung.attribute.overwrite.entity.Car; +import com.baeldung.attribute.override.entity.Car; import org.springframework.data.jpa.repository.JpaRepository; public interface CarRepository extends JpaRepository { diff --git a/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/override/AttributeOverrideIntegrationTest.java similarity index 82% rename from persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java rename to persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/override/AttributeOverrideIntegrationTest.java index 24578edb5c..4cc599c7de 100644 --- a/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/overwrite/AttributeOverwriteIntegrationTest.java +++ b/persistence-modules/spring-data-jpa-annotations/src/test/java/com/baeldung/attribute/override/AttributeOverrideIntegrationTest.java @@ -1,10 +1,10 @@ -package com.baeldung.attribute.overwrite; +package com.baeldung.attribute.override; import com.baeldung.Application; -import com.baeldung.attribute.overwrite.entity.Address; -import com.baeldung.attribute.overwrite.entity.Brand; -import com.baeldung.attribute.overwrite.entity.Car; -import com.baeldung.attribute.overwrite.repository.CarRepository; +import com.baeldung.attribute.override.entity.Address; +import com.baeldung.attribute.override.entity.Brand; +import com.baeldung.attribute.override.entity.Car; +import com.baeldung.attribute.override.repository.CarRepository; import org.assertj.core.api.Assertions; import org.jetbrains.annotations.NotNull; import org.junit.Test; @@ -18,7 +18,7 @@ import java.time.LocalDate; @RunWith(SpringRunner.class) @SpringBootTest(classes = { Application.class }) -public class AttributeOverwriteIntegrationTest { +public class AttributeOverrideIntegrationTest { private static final LocalDate FORD_FOUNDATION_DATE = LocalDate.parse("1903-06-16"); @Autowired From 567a71fdbcebdf00a3d700060c6571598cc9da5b Mon Sep 17 00:00:00 2001 From: Hendro Steven Date: Thu, 13 May 2021 19:13:06 +0700 Subject: [PATCH 22/72] remove comments --- .../java/com/baeldung/softdelete/Product.java | 1 - .../com/baeldung/softdelete/ProductService.java | 1 - .../src/main/resources/application.properties | 15 +-------------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java index 543252e474..ef06f77c45 100644 --- a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java +++ b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/Product.java @@ -17,7 +17,6 @@ import org.hibernate.annotations.SQLDelete; @Entity @Table(name = "tbl_products") @SQLDelete(sql = "UPDATE tbl_products SET deleted = true WHERE id=?") -// @Where(clause = "deleted=false") @FilterDef(name = "deletedProductFilter", parameters = @ParamDef(name = "isDeleted", type = "boolean")) @Filter(name = "deletedProductFilter", condition = "deleted = :isDeleted") public class Product implements Serializable { diff --git a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java index 2bced0c4d8..82d02fa87c 100644 --- a/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java +++ b/persistence-modules/spring-data-jpa-crud/src/main/java/com/baeldung/softdelete/ProductService.java @@ -25,7 +25,6 @@ public class ProductService { } public Iterable findAll(boolean isDeleted){ - //return productRepository.findAll(); Session session = entityManager.unwrap(Session.class); Filter filter = session.enableFilter("deletedProductFilter"); filter.setParameter("isDeleted", isDeleted); diff --git a/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties b/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties index a3a7bd42f7..18ef8d4e60 100644 --- a/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties +++ b/persistence-modules/spring-data-jpa-crud/src/main/resources/application.properties @@ -5,18 +5,5 @@ spring.jpa.properties.hibernate.order_inserts=true spring.jpa.properties.hibernate.order_updates=true spring.jpa.properties.hibernate.generate_statistics=true -# JPA-Schema-Generation -# Use below configuration to generate database schema create commands based on the entity models -# and export them into the create.sql file -#spring.jpa.properties.javax.persistence.schema-generation.scripts.action=create -#spring.jpa.properties.javax.persistence.schema-generation.scripts.create-target=create.sql -#spring.jpa.properties.javax.persistence.schema-generation.scripts.create-source=metadata -#spring.jpa.properties.hibernate.format_sql=true +spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -# spring.datasource.url=jdbc:mysql://localhost:3306/db_products?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC -# spring.datasource.username=root -# spring.datasource.password=root - -# spring.jpa.hibernate.ddl-auto= update - -spring.jpa.database-platform=org.hibernate.dialect.H2Dialect \ No newline at end of file From 8b115f4c8a75956caf964ae1d14dbe8a3f78cfaa Mon Sep 17 00:00:00 2001 From: Liam Garvie Date: Thu, 13 May 2021 20:48:03 +0100 Subject: [PATCH 23/72] BAEL-4946 added in code for java deserialization vulnerabilities article --- .../vulnerabilities/BadThing.java | 28 ++++++++++++++ .../vulnerabilities/MyCustomAttackObject.java | 14 +++++++ .../vulnerabilities/BadThingTest.java | 38 +++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java create mode 100644 core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java create mode 100644 core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java b/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java new file mode 100644 index 0000000000..ce13a9c372 --- /dev/null +++ b/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java @@ -0,0 +1,28 @@ +package com.baeldung.deserialization.vulnerabilities; + +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.lang.reflect.Method; + +public class BadThing implements Serializable { + private static final long serialVersionUID = 0L; + + Object looselyDefinedThing; + String methodName; + + private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException { + ois.defaultReadObject(); + try { + Method method = looselyDefinedThing.getClass().getMethod(methodName); + method.invoke(looselyDefinedThing); + } catch (Exception e) { + // handle error... + } + } + + private void writeObject(ObjectOutputStream oos) throws IOException { + oos.defaultWriteObject(); + } +} diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java b/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java new file mode 100644 index 0000000000..9b4e2d4b76 --- /dev/null +++ b/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java @@ -0,0 +1,14 @@ +package com.baeldung.deserialization.vulnerabilities; + +import java.io.IOException; +import java.io.Serializable; + +public class MyCustomAttackObject implements Serializable { + public static void methodThatTriggersAttack() { + try { + Runtime.getRuntime().exec("echo \"Oh, no! I've been hacked\""); + } catch (IOException e) { + // handle error... + } + } +} diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java new file mode 100644 index 0000000000..1d12403bec --- /dev/null +++ b/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java @@ -0,0 +1,38 @@ +package com.baeldung.deserialization.vulnerabilities; + +import org.junit.Test; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +public class BadThingTest { + + @Test + public void testCodeExecution() throws Exception { + BadThing bt = new BadThing(); + + bt.looselyDefinedThing = new MyCustomAttackObject(); + bt.methodName = "methodThatTriggersAttack"; + + byte[] serializedObject = serialize(bt); + + try (InputStream bis = new ByteArrayInputStream(serializedObject); + ObjectInputStream ois = new ObjectInputStream(bis)) { + + ois.readObject(); // malicious code is run + } + } + + private static byte[] serialize(Object object) throws Exception { + try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(bos)) { + + oos.writeObject(object); + oos.flush(); + return bos.toByteArray(); + } + } +} \ No newline at end of file From ab5b85c81c7587485b59b7d89c9fa3ac05a6eddf Mon Sep 17 00:00:00 2001 From: Liam Garvie Date: Thu, 13 May 2021 21:17:37 +0100 Subject: [PATCH 24/72] BAEL-4946 added in code for java deserialization vulnerabilities article --- .../baeldung/deserialization/vulnerabilities/BadThingTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java index 1d12403bec..e533a07c3d 100644 --- a/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java @@ -1,6 +1,7 @@ package com.baeldung.deserialization.vulnerabilities; import org.junit.Test; +import org.junit.jupiter.api.DisplayName; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -11,6 +12,7 @@ import java.io.ObjectOutputStream; public class BadThingTest { @Test + @DisplayName("When a BadThing object is deserialized, then code execution in MyCustomAttackObject is run.") public void testCodeExecution() throws Exception { BadThing bt = new BadThing(); From 06aa7787bf8b8f89aaca1e94a24d37553ec8df44 Mon Sep 17 00:00:00 2001 From: Liam Garvie Date: Thu, 13 May 2021 21:19:33 +0100 Subject: [PATCH 25/72] BAEL-4946 added in code for java deserialization vulnerabilities article --- .../{BadThingTest.java => BadThingUnitTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/{BadThingTest.java => BadThingUnitTest.java} (97%) diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java similarity index 97% rename from core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java rename to core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java index e533a07c3d..5db51ba132 100644 --- a/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java @@ -9,7 +9,7 @@ import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -public class BadThingTest { +public class BadThingUnitTest { @Test @DisplayName("When a BadThing object is deserialized, then code execution in MyCustomAttackObject is run.") From b59a0ba668efe5ae992285ea1d9bde1d9413d335 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Fri, 14 May 2021 17:42:38 +0530 Subject: [PATCH 26/72] JAVA-5409: Fix formatting of POMs (Part 1) --- spring-boot-modules/spring-boot-xml/pom.xml | 2 +- spring-boot-rest-2/pom.xml | 4 +- spring-boot-rest/pom.xml | 14 ++--- spring-caching/pom.xml | 8 +-- spring-core-2/pom.xml | 9 ++-- spring-core-3/pom.xml | 4 +- spring-core-4/pom.xml | 7 ++- spring-core-5/pom.xml | 6 +-- spring-core/pom.xml | 5 +- spring-cucumber/pom.xml | 7 +-- spring-data-rest-querydsl/pom.xml | 7 +-- spring-data-rest/pom.xml | 5 +- spring-di-2/pom.xml | 5 +- spring-di/pom.xml | 29 +++++----- spring-drools/pom.xml | 7 +-- spring-ejb/ejb-beans/pom.xml | 9 ++-- spring-ejb/pom.xml | 53 ++++++++++--------- spring-ejb/spring-ejb-client/pom.xml | 12 ++--- spring-ejb/spring-ejb-remote/pom.xml | 9 +--- spring-ejb/wildfly/pom.xml | 5 +- spring-ejb/wildfly/widlfly-web/pom.xml | 7 +-- spring-ejb/wildfly/wildfly-ear/pom.xml | 5 +- .../wildfly/wildfly-ejb-interfaces/pom.xml | 5 +- spring-ejb/wildfly/wildfly-ejb/pom.xml | 5 +- spring-ejb/wildfly/wildfly-jpa/pom.xml | 5 +- spring-ejb/wildfly/wildfly-mdb/pom.xml | 5 +- spring-exceptions/pom.xml | 32 ++--------- spring-freemarker/pom.xml | 7 +-- spring-integration/pom.xml | 10 ++-- spring-webflux-threads/pom.xml | 38 ++++--------- 30 files changed, 139 insertions(+), 187 deletions(-) diff --git a/spring-boot-modules/spring-boot-xml/pom.xml b/spring-boot-modules/spring-boot-xml/pom.xml index b3fd343e4f..bee9c7ddd3 100644 --- a/spring-boot-modules/spring-boot-xml/pom.xml +++ b/spring-boot-modules/spring-boot-xml/pom.xml @@ -18,7 +18,7 @@ spring-boot-starter
- org.springframework.boot + Forg.springframework.boot spring-boot-starter-test diff --git a/spring-boot-rest-2/pom.xml b/spring-boot-rest-2/pom.xml index d74c393f27..32eff262dd 100644 --- a/spring-boot-rest-2/pom.xml +++ b/spring-boot-rest-2/pom.xml @@ -1,7 +1,7 @@ + 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 com.baeldung.web spring-boot-rest-2 diff --git a/spring-boot-rest/pom.xml b/spring-boot-rest/pom.xml index 10dacf99e8..72d4ecfaa6 100644 --- a/spring-boot-rest/pom.xml +++ b/spring-boot-rest/pom.xml @@ -1,7 +1,7 @@ + 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 com.baeldung.web spring-boot-rest @@ -35,7 +35,6 @@ xstream ${xstream.version} - com.h2database h2 @@ -44,26 +43,21 @@ org.springframework.boot spring-boot-starter-data-jpa - org.springframework.boot spring-boot-starter-data-rest - org.springframework.boot spring-boot-starter-hateoas - - com.google.guava guava ${guava.version} - org.springframework.boot spring-boot-starter-test @@ -96,5 +90,5 @@ 1.4.11.1 2.3.5 - - + + \ No newline at end of file diff --git a/spring-caching/pom.xml b/spring-caching/pom.xml index c620072604..34c035a8ec 100644 --- a/spring-caching/pom.xml +++ b/spring-caching/pom.xml @@ -1,7 +1,7 @@ + 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 spring-caching 0.1-SNAPSHOT @@ -76,7 +76,9 @@ spring-data-commons + 3.5.2 - + + \ No newline at end of file diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index 3f8e84e13d..de5c7c0d4d 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-core-2 0.1-SNAPSHOT @@ -143,7 +144,6 @@ mockito-core test - net.javacrumbs.shedlock @@ -202,7 +202,6 @@ 1.3.2 5.2.5.Final - 25.1-jre 3.6 @@ -212,4 +211,4 @@ 3.2.2 - + \ No newline at end of file diff --git a/spring-core-3/pom.xml b/spring-core-3/pom.xml index 618800529c..50d2e7ac5e 100644 --- a/spring-core-3/pom.xml +++ b/spring-core-3/pom.xml @@ -1,7 +1,7 @@ + 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 spring-core-3 spring-core-3 diff --git a/spring-core-4/pom.xml b/spring-core-4/pom.xml index d2e948c475..5706b2ee75 100644 --- a/spring-core-4/pom.xml +++ b/spring-core-4/pom.xml @@ -1,7 +1,7 @@ + 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 spring-core-4 spring-core-4 @@ -84,7 +84,6 @@ javax.servlet-api 4.0.0 - @@ -95,4 +94,4 @@ 2.9.1 - + \ No newline at end of file diff --git a/spring-core-5/pom.xml b/spring-core-5/pom.xml index 05ee1c5f5d..68229b80b8 100644 --- a/spring-core-5/pom.xml +++ b/spring-core-5/pom.xml @@ -1,7 +1,7 @@ + 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 spring-core-5 spring-core-5 @@ -37,4 +37,4 @@ 2.4.2 - + \ No newline at end of file diff --git a/spring-core/pom.xml b/spring-core/pom.xml index 7d83fc198c..ab41670224 100644 --- a/spring-core/pom.xml +++ b/spring-core/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-core 0.0.1-SNAPSHOT diff --git a/spring-cucumber/pom.xml b/spring-cucumber/pom.xml index a945797ee1..c6c163d7d1 100644 --- a/spring-cucumber/pom.xml +++ b/spring-cucumber/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cucumber 0.0.1-SNAPSHOT @@ -57,4 +58,4 @@ 1.3.2 - + \ No newline at end of file diff --git a/spring-data-rest-querydsl/pom.xml b/spring-data-rest-querydsl/pom.xml index 5e47f4979e..0b1cdd8928 100644 --- a/spring-data-rest-querydsl/pom.xml +++ b/spring-data-rest-querydsl/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-data-rest-querydsl 1.0 @@ -99,10 +99,11 @@ + 1.8 1.8 1.1.3 - + \ No newline at end of file diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index bfbd66a280..4a22ce92d1 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-rest 1.0 diff --git a/spring-di-2/pom.xml b/spring-di-2/pom.xml index 4dd92ca18c..7d3f4c7b33 100644 --- a/spring-di-2/pom.xml +++ b/spring-di-2/pom.xml @@ -1,7 +1,7 @@ + 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 spring-di-2 1.0-SNAPSHOT @@ -78,4 +78,5 @@ 1.11 1 + \ No newline at end of file diff --git a/spring-di/pom.xml b/spring-di/pom.xml index df0b685ae2..cbd49242e4 100644 --- a/spring-di/pom.xml +++ b/spring-di/pom.xml @@ -1,7 +1,7 @@ + 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 spring-di 1.0-SNAPSHOT @@ -90,26 +90,22 @@ aspectjweaver ${aspectjweaver.version} - - - - - - + + + + javax.annotation javax.annotation-api ${annotation-api.version} - - - - - - - - + + + + + + @@ -155,7 +151,6 @@ 5.0.6.RELEASE 1.3.2 - 1.4.4.RELEASE 1 20.0 diff --git a/spring-drools/pom.xml b/spring-drools/pom.xml index 8b105158ec..b8c025893c 100644 --- a/spring-drools/pom.xml +++ b/spring-drools/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-drools 1.0.0-SNAPSHOT @@ -14,7 +15,6 @@ - org.kie kie-ci @@ -77,4 +77,5 @@ 7.0.0.Final + \ No newline at end of file diff --git a/spring-ejb/ejb-beans/pom.xml b/spring-ejb/ejb-beans/pom.xml index 8f2bf31ee4..cdc28ef5d7 100644 --- a/spring-ejb/ejb-beans/pom.xml +++ b/spring-ejb/ejb-beans/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.singletonsession ejb-beans @@ -41,7 +42,7 @@ spring-context ${springframework.version} - + javax.ejb javax.ejb-api @@ -188,4 +189,4 @@ 8.2.1.Final - + \ No newline at end of file diff --git a/spring-ejb/pom.xml b/spring-ejb/pom.xml index 1b3a52184e..383cde1e69 100755 --- a/spring-ejb/pom.xml +++ b/spring-ejb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.ejb spring-ejb @@ -16,22 +17,12 @@ ../ - - - jboss-public-repository-group - JBoss Public Maven Repository Group - http://repository.jboss.org/nexus/content/groups/public/ - default - - true - never - - - true - never - - - + + spring-ejb-remote + ejb-beans + spring-ejb-client + wildfly + @@ -57,6 +48,23 @@ + + + jboss-public-repository-group + JBoss Public Maven Repository Group + http://repository.jboss.org/nexus/content/groups/public/ + default + + true + never + + + true + never + + + + @@ -71,13 +79,6 @@ - - spring-ejb-remote - ejb-beans - spring-ejb-client - wildfly - - 1.0.0-SNAPSHOT 8.0 @@ -86,4 +87,4 @@ 3.2 - + \ No newline at end of file diff --git a/spring-ejb/spring-ejb-client/pom.xml b/spring-ejb/spring-ejb-client/pom.xml index 6c335e8982..ecf9d0eb49 100644 --- a/spring-ejb/spring-ejb-client/pom.xml +++ b/spring-ejb/spring-ejb-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-ejb-client spring-ejb-client @@ -30,30 +31,25 @@ org.springframework.boot spring-boot-starter-web - org.wildfly wildfly-ejb-client-bom pom - com.baeldung.spring.ejb spring-ejb-remote ejb - org.springframework.boot spring-boot-starter-test test - io.undertow undertow-servlet - @@ -70,4 +66,4 @@ 2.0.4.RELEASE - + \ No newline at end of file diff --git a/spring-ejb/spring-ejb-remote/pom.xml b/spring-ejb/spring-ejb-remote/pom.xml index 28d5398b97..b7bf2aa79b 100644 --- a/spring-ejb/spring-ejb-remote/pom.xml +++ b/spring-ejb/spring-ejb-remote/pom.xml @@ -1,7 +1,7 @@ + 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 spring-ejb-remote spring-ejb-remote @@ -40,16 +40,13 @@ org.codehaus.cargo cargo-maven2-plugin ${cargo-maven2-plugin.version} - - wildfly10x https://download.jboss.org/wildfly/12.0.0.Final/wildfly-12.0.0.Final.zip - 127.0.0.1 @@ -58,13 +55,11 @@ testUser:admin1234! - - wildfly-runtime diff --git a/spring-ejb/wildfly/pom.xml b/spring-ejb/wildfly/pom.xml index fdf2517139..ae90f71b7c 100644 --- a/spring-ejb/wildfly/pom.xml +++ b/spring-ejb/wildfly/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.wildfly wildfly diff --git a/spring-ejb/wildfly/widlfly-web/pom.xml b/spring-ejb/wildfly/widlfly-web/pom.xml index 79d0dca470..fb8a7678af 100644 --- a/spring-ejb/wildfly/widlfly-web/pom.xml +++ b/spring-ejb/wildfly/widlfly-web/pom.xml @@ -1,11 +1,12 @@ - 4.0.0 widlfly-web - widlfly-web + widlfly-web war - + com.baeldung.wildfly wildfly diff --git a/spring-ejb/wildfly/wildfly-ear/pom.xml b/spring-ejb/wildfly/wildfly-ear/pom.xml index 07f53358bf..da321cb9eb 100644 --- a/spring-ejb/wildfly/wildfly-ear/pom.xml +++ b/spring-ejb/wildfly/wildfly-ear/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 wildfly-ear wildfly-ear diff --git a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml index 21fc26106a..bc9159b667 100644 --- a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 wildfly-ejb-interfaces wildfly-ejb-interfaces diff --git a/spring-ejb/wildfly/wildfly-ejb/pom.xml b/spring-ejb/wildfly/wildfly-ejb/pom.xml index c35e340ac9..36574bf984 100644 --- a/spring-ejb/wildfly/wildfly-ejb/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 wildfly-ejb wildfly-ejb diff --git a/spring-ejb/wildfly/wildfly-jpa/pom.xml b/spring-ejb/wildfly/wildfly-jpa/pom.xml index 1bc618a296..603e337510 100644 --- a/spring-ejb/wildfly/wildfly-jpa/pom.xml +++ b/spring-ejb/wildfly/wildfly-jpa/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 wildfly-jpa wildfly-jpa diff --git a/spring-ejb/wildfly/wildfly-mdb/pom.xml b/spring-ejb/wildfly/wildfly-mdb/pom.xml index 109cff861b..0784725cde 100644 --- a/spring-ejb/wildfly/wildfly-mdb/pom.xml +++ b/spring-ejb/wildfly/wildfly-mdb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 wildfly-mdb wildfly-mdb diff --git a/spring-exceptions/pom.xml b/spring-exceptions/pom.xml index 29ed7d5caa..337597a741 100644 --- a/spring-exceptions/pom.xml +++ b/spring-exceptions/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-exceptions 0.1-SNAPSHOT @@ -14,9 +15,7 @@ - - org.springframework spring-web @@ -49,9 +48,7 @@ spring-context ${org.springframework.version} - - org.hibernate hibernate-core @@ -73,33 +70,26 @@ tomcat-dbcp ${tomcat-dbcp.version} - - org.hibernate hibernate-validator ${hibernate-validator.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - - com.google.guava guava @@ -111,22 +101,18 @@ ${commons-lang3.version} test - - org.springframework spring-test ${org.springframework.version} test - javax.el el-api ${javax.el.version} - org.apache.derby derby @@ -157,9 +143,7 @@ true - - org.apache.maven.plugins maven-war-plugin @@ -168,40 +152,30 @@ false - - - 4.3.4.RELEASE 4.2.0.RELEASE 3.21.0-GA - 5.2.5.Final 5.1.40 7.0.73 10.13.1.1 - 5.3.3.Final 2.2 - 19.0 - 4.4.5 4.5.2 - 2.9.0 - 2.7 1.6.1 - \ No newline at end of file diff --git a/spring-freemarker/pom.xml b/spring-freemarker/pom.xml index bdf7e97bce..07d37736b6 100644 --- a/spring-freemarker/pom.xml +++ b/spring-freemarker/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.freemarker spring-freemarker @@ -61,4 +62,4 @@ 1.5.10.RELEASE - + \ No newline at end of file diff --git a/spring-integration/pom.xml b/spring-integration/pom.xml index f46445a39f..f5aaa93ff7 100644 --- a/spring-integration/pom.xml +++ b/spring-integration/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.samples.spring.integration spring-integration @@ -16,7 +17,6 @@ - org.springframework.integration @@ -74,14 +74,12 @@ spring-integration-jdbc ${spring.version} - org.springframework.security spring-security-test ${spring.version} test - com.h2database h2 @@ -124,4 +122,4 @@ 1.4.197 - + \ No newline at end of file diff --git a/spring-webflux-threads/pom.xml b/spring-webflux-threads/pom.xml index 15224fcd14..bc5050b660 100644 --- a/spring-webflux-threads/pom.xml +++ b/spring-webflux-threads/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring spring-webflux-threads @@ -21,33 +22,16 @@ org.springframework.boot spring-boot-starter-webflux - + - + - + io.reactivex.rxjava2 rxjava @@ -87,4 +71,4 @@ - + \ No newline at end of file From 776e3ca7c852efdcc7e9e15b42cd5842b2583ad7 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Fri, 14 May 2021 17:43:24 +0530 Subject: [PATCH 27/72] JAVA-5409: Fix formatting of POMs (Spring Cloud - Part 1) --- .../additional-sources-simple/pom.xml | 8 +++--- .../basic-config/pom.xml | 8 +++--- .../dynamodb-config/pom.xml | 9 ++++--- .../extra-configs/pom.xml | 8 +++--- .../spring-cloud-archaius/jdbc-config/pom.xml | 9 ++++--- spring-cloud/spring-cloud-archaius/pom.xml | 8 +++--- .../zookeeper-config/pom.xml | 9 ++++--- spring-cloud/spring-cloud-aws/pom.xml | 14 ++++------- .../spring-cloud-bootstrap/config/pom.xml | 6 ++--- .../customer-service/pom.xml | 9 ++++--- .../spring-cloud-bootstrap/discovery/pom.xml | 7 +++--- .../spring-cloud-bootstrap/gateway/pom.xml | 25 ++++++++----------- .../order-service/order-client/pom.xml | 6 +++-- .../order-service/order-server/pom.xml | 6 +++-- .../order-service/pom.xml | 8 +++--- spring-cloud/spring-cloud-bootstrap/pom.xml | 7 +++--- .../spring-cloud-bootstrap/svc-book/pom.xml | 11 +++----- .../spring-cloud-bootstrap/svc-rating/pom.xml | 12 +++------ .../spring-cloud-bootstrap/zipkin/pom.xml | 9 +++---- .../spring-cloud-circuit-breaker/pom.xml | 6 ++--- .../spring-cloud-config/client/pom.xml | 2 +- spring-cloud/spring-cloud-config/pom.xml | 7 +++--- .../spring-cloud-config/server/pom.xml | 2 +- .../spring-cloud-connectors-heroku/pom.xml | 7 +++--- spring-cloud/spring-cloud-consul/pom.xml | 18 ++++++------- spring-cloud/spring-cloud-contract/pom.xml | 7 +++--- .../spring-cloud-contract-consumer/pom.xml | 7 +++--- .../spring-cloud-contract-producer/pom.xml | 7 +++--- .../docker-message-server/pom.xml | 4 +-- .../docker-product-server/pom.xml | 4 +-- spring-cloud/spring-cloud-docker/pom.xml | 5 ++-- .../pom.xml | 7 +++--- .../spring-cloud-eureka-client/pom.xml | 7 +++--- .../spring-cloud-eureka-server/pom.xml | 7 +++--- spring-cloud/spring-cloud-eureka/pom.xml | 7 +++--- .../spring-cloud-eureka-client/pom.xml | 7 +++--- .../pom.xml | 15 +++-------- .../spring-cloud-eureka-feign-client/pom.xml | 7 +++--- .../spring-cloud-eureka-server/pom.xml | 7 +++--- spring-cloud/spring-cloud-functions/pom.xml | 13 +++++----- 40 files changed, 161 insertions(+), 171 deletions(-) diff --git a/spring-cloud/spring-cloud-archaius/additional-sources-simple/pom.xml b/spring-cloud/spring-cloud-archaius/additional-sources-simple/pom.xml index cc20511fc6..249cbe579f 100644 --- a/spring-cloud/spring-cloud-archaius/additional-sources-simple/pom.xml +++ b/spring-cloud/spring-cloud-archaius/additional-sources-simple/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 additional-sources-simple 1.0.0-SNAPSHOT @@ -21,5 +21,5 @@ spring-boot-starter-web - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-archaius/basic-config/pom.xml b/spring-cloud/spring-cloud-archaius/basic-config/pom.xml index a13fff2f9d..bdcef5b704 100644 --- a/spring-cloud/spring-cloud-archaius/basic-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/basic-config/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 basic-config 1.0.0-SNAPSHOT @@ -21,5 +21,5 @@ spring-boot-starter-web - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml index 9ff267425c..aa203670e0 100644 --- a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 dynamodb-config dynamodb-config @@ -45,5 +46,5 @@ 5.0.3 0.7.6 - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-archaius/extra-configs/pom.xml b/spring-cloud/spring-cloud-archaius/extra-configs/pom.xml index 70f736642c..0c8f1e16a7 100644 --- a/spring-cloud/spring-cloud-archaius/extra-configs/pom.xml +++ b/spring-cloud/spring-cloud-archaius/extra-configs/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 extra-configs 1.0.0-SNAPSHOT @@ -41,5 +41,5 @@ 2.0.1.RELEASE - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml index b7e4917bea..9523c187e1 100644 --- a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jdbc-config jdbc-config @@ -28,5 +29,5 @@ runtime - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-archaius/pom.xml b/spring-cloud/spring-cloud-archaius/pom.xml index df8162efa5..56d7f0bc93 100644 --- a/spring-cloud/spring-cloud-archaius/pom.xml +++ b/spring-cloud/spring-cloud-archaius/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-archaius 1.0.0-SNAPSHOT @@ -63,5 +63,5 @@ 2.0.1.RELEASE 1.2.0 - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml index 25eaf4435c..f54373d572 100644 --- a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 zookeeper-config zookeeper-config @@ -46,5 +47,5 @@ 2.0.0.RELEASE 3.4.13 - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index f65db6a2fe..a8225c7f02 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud-aws @@ -32,23 +33,19 @@ org.springframework.cloud spring-cloud-starter-aws-messaging - org.springframework.boot spring-boot-starter-test test - org.postgresql postgresql - mysql mysql-connector-java - @@ -67,7 +64,6 @@ com.baeldung.spring.cloud.aws.SpringCloudAwsApplication Dalston.SR4 2.2.1.RELEASE - - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/config/pom.xml b/spring-cloud/spring-cloud-bootstrap/config/pom.xml index 6ebf23637e..706c5695d3 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 config 1.0.0-SNAPSHOT @@ -42,7 +43,6 @@ Brixton.SR7 - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml index 729abb4f05..da2dee97d5 100644 --- a/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/customer-service/pom.xml @@ -1,7 +1,7 @@ - - + 4.0.0 com.baeldung.customerservice customer-service @@ -72,4 +72,5 @@ 1.8 1.8 - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml index d77e29768f..fb06c6052b 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 discovery 1.0.0-SNAPSHOT @@ -38,7 +39,6 @@ org.springframework.boot spring-boot-starter-security - org.springframework.session spring-session @@ -51,7 +51,6 @@ Edgware.SR5 - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index 34b7af7c0a..1a6296ac4f 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 gateway 1.0.0-SNAPSHOT @@ -42,7 +43,6 @@ org.springframework.boot spring-boot-starter-security - org.springframework.session spring-session @@ -51,7 +51,6 @@ org.springframework.boot spring-boot-starter-data-redis - org.springframework.cloud spring-cloud-starter-zipkin @@ -60,7 +59,6 @@ org.springframework.cloud spring-cloud-starter-feign - @@ -77,15 +75,15 @@ - - - + dir="${project.basedir}/src/main/angular/ui"> + + + - - + dir="${project.basedir}/src/main/angular/ui"> + + @@ -100,7 +98,6 @@ Dalston.RELEASE - - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml index 01e8afeec3..dc6e196325 100644 --- a/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.orderservice order-client @@ -14,4 +15,5 @@ order-service 1.0.0-SNAPSHOT + diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/order-server/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/pom.xml index d6c521c5df..85143b557e 100644 --- a/spring-cloud/spring-cloud-bootstrap/order-service/order-server/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/order-service/order-server/pom.xml @@ -1,16 +1,18 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + 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.orderservice order-server 1.0.0-SNAPSHOT + order-service com.baeldung.orderservice 1.0.0-SNAPSHOT + com.baeldung.orderservice diff --git a/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml index 2ebc673ef4..64be52f5f4 100644 --- a/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/order-service/pom.xml @@ -1,7 +1,7 @@ - - + 4.0.0 com.baeldung.orderservice order-service @@ -119,4 +119,4 @@ com.baeldung.orderservice.OrderApplication - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/pom.xml b/spring-cloud/spring-cloud-bootstrap/pom.xml index eb1a55c2a9..deba342d69 100644 --- a/spring-cloud/spring-cloud-bootstrap/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-bootstrap 1.0.0-SNAPSHOT @@ -24,4 +25,4 @@ order-service - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml index de0785bd45..b1aa205af5 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud svc-book @@ -43,7 +44,6 @@ org.springframework.boot spring-boot-starter-security - org.springframework.session spring-session @@ -52,28 +52,23 @@ org.springframework.boot spring-boot-starter-data-redis - org.springframework.boot spring-boot-starter-data-jpa - com.h2database h2 runtime - org.springframework.cloud spring-cloud-starter-zipkin - Dalston.RELEASE - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index 0cce78276a..e189eeea81 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud svc-rating @@ -31,7 +32,6 @@ org.springframework.boot spring-boot-starter-security - org.springframework.session spring-session @@ -40,12 +40,10 @@ org.springframework.boot spring-boot-starter-data-redis - org.springframework.boot spring-boot-starter-data-jpa - org.springframework.cloud spring-cloud-starter-hystrix @@ -54,18 +52,15 @@ org.springframework.boot spring-boot-starter-actuator - com.h2database h2 runtime - org.springframework.cloud spring-cloud-starter-zipkin - @@ -82,7 +77,6 @@ Dalston.RELEASE - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml index b83c5a2aaa..ba96f23795 100644 --- a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 zipkin 1.0.0-SNAPSHOT @@ -22,18 +23,15 @@ org.springframework.cloud spring-cloud-starter-eureka - io.zipkin.java zipkin-server - io.zipkin.java zipkin-autoconfigure-ui runtime - @@ -50,7 +48,6 @@ Brixton.SR7 - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-circuit-breaker/pom.xml b/spring-cloud/spring-cloud-circuit-breaker/pom.xml index 680d835c19..f30c764d9b 100644 --- a/spring-cloud/spring-cloud-circuit-breaker/pom.xml +++ b/spring-cloud/spring-cloud-circuit-breaker/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-circuit-breaker spring-cloud-circuit-breaker @@ -56,4 +56,4 @@ 1.0.2.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-config/client/pom.xml b/spring-cloud/spring-cloud-config/client/pom.xml index 2400520d2b..00b5ba2edc 100644 --- a/spring-cloud/spring-cloud-config/client/pom.xml +++ b/spring-cloud/spring-cloud-config/client/pom.xml @@ -47,4 +47,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-config/pom.xml b/spring-cloud/spring-cloud-config/pom.xml index bfe17044e0..1e46b9accb 100644 --- a/spring-cloud/spring-cloud-config/pom.xml +++ b/spring-cloud/spring-cloud-config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud-config @@ -36,4 +37,4 @@ 2020.0.0 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-config/server/pom.xml b/spring-cloud/spring-cloud-config/server/pom.xml index f0f1e43612..c59b6583f2 100644 --- a/spring-cloud/spring-cloud-config/server/pom.xml +++ b/spring-cloud/spring-cloud-config/server/pom.xml @@ -51,4 +51,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-connectors-heroku/pom.xml b/spring-cloud/spring-cloud-connectors-heroku/pom.xml index d318aa3c64..e02da23f6c 100644 --- a/spring-cloud/spring-cloud-connectors-heroku/pom.xml +++ b/spring-cloud/spring-cloud-connectors-heroku/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud-connectors-heroku @@ -59,5 +60,5 @@ Hoxton.SR4 42.2.10 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-consul/pom.xml b/spring-cloud/spring-cloud-consul/pom.xml index 4d4ac0aa01..f21550e360 100644 --- a/spring-cloud/spring-cloud-consul/pom.xml +++ b/spring-cloud/spring-cloud-consul/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-consul @@ -12,7 +13,7 @@ spring-cloud 1.0.0-SNAPSHOT - + jitpack.io @@ -26,7 +27,6 @@ spring-cloud-starter-consul-all ${spring-cloud-starter-consul.version} - org.springframework.cloud spring-cloud-starter-consul-config @@ -45,12 +45,12 @@ com.github.kinguinltdhk leadership-consul ${kinguinltdhk.version} - + - com.ecwid.consul - consul-api + com.ecwid.consul + consul-api - + @@ -60,4 +60,4 @@ com.baeldung.spring.cloud.consul.discovery.DiscoveryClientApplication - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-contract/pom.xml b/spring-cloud/spring-cloud-contract/pom.xml index f26f1d7e3b..1d12656f98 100644 --- a/spring-cloud/spring-cloud-contract/pom.xml +++ b/spring-cloud/spring-cloud-contract/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-contract 1.0.0-SNAPSHOT @@ -56,5 +57,5 @@ 2.1.1.RELEASE 2.1.4.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml b/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml index 7616032320..c99dd0bd5a 100644 --- a/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml +++ b/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-contract-consumer 1.0.0-SNAPSHOT @@ -42,4 +43,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml b/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml index e909dbc253..736a2530b2 100644 --- a/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml +++ b/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-contract-producer 1.0.0-SNAPSHOT @@ -49,4 +50,4 @@ 2.1.1.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-docker/docker-message-server/pom.xml b/spring-cloud/spring-cloud-docker/docker-message-server/pom.xml index fafd291c00..0cc235f706 100644 --- a/spring-cloud/spring-cloud-docker/docker-message-server/pom.xml +++ b/spring-cloud/spring-cloud-docker/docker-message-server/pom.xml @@ -2,7 +2,6 @@ - 4.0.0 docker-message-server docker-message-server @@ -52,4 +51,5 @@ - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-docker/docker-product-server/pom.xml b/spring-cloud/spring-cloud-docker/docker-product-server/pom.xml index a5bd6c50ea..be65a6d7d3 100644 --- a/spring-cloud/spring-cloud-docker/docker-product-server/pom.xml +++ b/spring-cloud/spring-cloud-docker/docker-product-server/pom.xml @@ -2,7 +2,6 @@ - 4.0.0 docker-product-server docker-product-server @@ -52,4 +51,5 @@ - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-docker/pom.xml b/spring-cloud/spring-cloud-docker/pom.xml index a9d978c9d4..3e407df6a1 100644 --- a/spring-cloud/spring-cloud-docker/pom.xml +++ b/spring-cloud/spring-cloud-docker/pom.xml @@ -1,8 +1,7 @@ - + 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 spring-cloud-docker spring-cloud-docker diff --git a/spring-cloud/spring-cloud-eureka-self-preservation/pom.xml b/spring-cloud/spring-cloud-eureka-self-preservation/pom.xml index 41ebba7d79..26353f8297 100644 --- a/spring-cloud/spring-cloud-eureka-self-preservation/pom.xml +++ b/spring-cloud/spring-cloud-eureka-self-preservation/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud.eureka spring-cloud-eureka-self-preservation @@ -34,4 +35,4 @@ Greenwich.SR3 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/pom.xml index fc7d8bec33..f2670a5114 100644 --- a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-eureka-client spring-cloud-eureka-client @@ -37,4 +38,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/pom.xml index 02d1c8c354..b21e5100ef 100644 --- a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-eureka-server spring-cloud-eureka-server @@ -33,4 +34,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/pom.xml b/spring-cloud/spring-cloud-eureka/pom.xml index 9d7350e774..5cf0a74868 100644 --- a/spring-cloud/spring-cloud-eureka/pom.xml +++ b/spring-cloud/spring-cloud-eureka/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-eureka 1.0.0-SNAPSHOT @@ -36,4 +37,4 @@ Greenwich.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml index dc6a1ae236..a3c78154a2 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-eureka-client 1.0.0-SNAPSHOT @@ -45,4 +46,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client-integration-test/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client-integration-test/pom.xml index 95b1275e2c..4fdfe2d9c2 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client-integration-test/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client-integration-test/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-eureka-feign-client-integration-test 1.0.0-SNAPSHOT @@ -38,48 +39,40 @@ org.springframework.cloud spring-cloud-starter-openfeign - org.springframework.cloud spring-cloud-starter-netflix-ribbon - org.springframework.cloud spring-cloud-starter-netflix-eureka-client - org.springframework.boot spring-boot-starter-web - com.github.tomakehurst wiremock 2.27.2 test - org.projectlombok lombok - org.testcontainers testcontainers 1.14.3 test - org.awaitility awaitility 4.0.3 test - @@ -94,4 +87,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml index e0d63dc15d..b51fd11e29 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-eureka-feign-client 1.0.0-SNAPSHOT @@ -53,4 +54,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml index 9c0a933753..9c8e6f3e70 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-eureka-server 1.0.0-SNAPSHOT @@ -41,4 +42,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml index 0be3941db1..5f5376ddc9 100644 --- a/spring-cloud/spring-cloud-functions/pom.xml +++ b/spring-cloud/spring-cloud-functions/pom.xml @@ -1,7 +1,7 @@ + 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 com.baeldung.spring spring-cloud-functions @@ -16,15 +16,15 @@ 0.0.1-SNAPSHOT ../../parent-boot-2 - + org.springframework.cloud spring-cloud-function-adapter-aws ${spring-cloud-function.version} - - + + org.springframework.cloud spring-cloud-starter-function-web @@ -86,7 +86,6 @@ 2.0.2 1.1.0 1.0.10.RELEASE - - + \ No newline at end of file From f451361625c0003dda9a7d0e9acee90ecd63d9c1 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Fri, 14 May 2021 17:43:57 +0530 Subject: [PATCH 28/72] JAVA-5409: Fix formatting of POMs (Spring Cloud - Part 2) --- spring-cloud/pom.xml | 9 +++++---- spring-cloud/spring-cloud-gateway/pom.xml | 7 +------ .../feign-rest-consumer/pom.xml | 6 +++--- spring-cloud/spring-cloud-hystrix/pom.xml | 6 +++--- .../rest-consumer/pom.xml | 8 ++++---- .../rest-producer/pom.xml | 8 ++++---- .../kubernetes-guide/client-service/pom.xml | 7 ++++--- .../travel-agency-service/pom.xml | 6 +++--- .../kubernetes-minikube/demo-backend/pom.xml | 8 ++++---- .../kubernetes-minikube/demo-frontend/pom.xml | 9 +++++---- .../liveness-example/pom.xml | 6 ++---- .../readiness-example/pom.xml | 4 ++-- spring-cloud/spring-cloud-kubernetes/pom.xml | 5 +++-- .../spring-cloud-netflix-feign/pom.xml | 20 ++++++------------- .../spring-cloud-open-service-broker/pom.xml | 6 +++--- spring-cloud/spring-cloud-openfeign/pom.xml | 12 ++++------- spring-cloud/spring-cloud-rest/pom.xml | 7 ++++--- .../spring-cloud-rest-books-api/pom.xml | 7 +++---- .../spring-cloud-rest-config-server/pom.xml | 8 ++++---- .../pom.xml | 8 ++++---- .../spring-cloud-rest-reviews-api/pom.xml | 8 ++++---- .../spring-cloud-ribbon-client/pom.xml | 5 +++-- .../spring-cloud-ribbon-retry/pom.xml | 6 +++--- .../ribbon-client-service/pom.xml | 4 ++-- .../ribbon-weather-service/pom.xml | 4 ++-- .../spring-cloud-security/auth-client/pom.xml | 7 ++++--- .../auth-resource/pom.xml | 7 ++++--- .../spring-cloud-security/auth-server/pom.xml | 5 +++-- spring-cloud/spring-cloud-security/pom.xml | 7 ++++--- spring-cloud/spring-cloud-sentinel/pom.xml | 7 ++++--- .../twitterhdfs/pom.xml | 9 +++++---- spring-cloud/spring-cloud-stream/pom.xml | 7 ++++--- .../spring-cloud-stream-kafka/pom.xml | 14 +++---------- .../spring-cloud-stream-kinesis/pom.xml | 7 ++----- .../spring-cloud-stream-rabbit/pom.xml | 8 ++++---- spring-cloud/spring-cloud-task/pom.xml | 8 ++++---- .../springcloudtaskbatch/pom.xml | 9 +++------ .../springcloudtasksink/pom.xml | 8 ++++---- spring-cloud/spring-cloud-vault/pom.xml | 12 ++++------- .../spring-cloud-zookeeper/Greeting/pom.xml | 7 ++++--- .../spring-cloud-zookeeper/HelloWorld/pom.xml | 5 +++-- spring-cloud/spring-cloud-zookeeper/pom.xml | 5 +++-- .../bin/eureka-client/pom.xml | 7 ++++--- .../bin/eureka-server/pom.xml | 7 ++++--- .../bin/pom.xml | 9 +++++---- .../bin/zuul-server/pom.xml | 5 +++-- .../eureka-client/pom.xml | 8 ++++---- .../eureka-server/pom.xml | 8 ++++---- .../pom.xml | 6 +++--- .../zuul-server/pom.xml | 6 +++--- .../api-gateway/pom.xml | 6 +++--- .../spring-cloud-zuul-fallback/pom.xml | 8 ++++---- .../weather-service/pom.xml | 9 ++++----- spring-cloud/spring-cloud-zuul/pom.xml | 7 ++++--- .../spring-zuul-foos-resource/pom.xml | 5 +++-- .../spring-zuul-post-filter/pom.xml | 8 ++++---- .../spring-zuul-rate-limiting/pom.xml | 7 ++++--- .../spring-cloud-zuul/spring-zuul-ui/pom.xml | 7 ++++--- 58 files changed, 207 insertions(+), 222 deletions(-) diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index ac717e85da..83e7175869 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud @@ -43,7 +44,7 @@ spring-cloud-ribbon-retry spring-cloud-circuit-breaker spring-cloud-eureka-self-preservation - + spring-cloud-sentinel @@ -88,4 +89,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-gateway/pom.xml b/spring-cloud/spring-cloud-gateway/pom.xml index c9c087d738..eaa0d12cfd 100644 --- a/spring-cloud/spring-cloud-gateway/pom.xml +++ b/spring-cloud/spring-cloud-gateway/pom.xml @@ -45,19 +45,16 @@ org.springframework.cloud spring-cloud-starter-gateway - org.springframework.cloud spring-cloud-starter-circuitbreaker-reactor-resilience4j - org.springframework.boot spring-boot-starter-data-redis-reactive - it.ozimov @@ -65,7 +62,6 @@ ${redis.version} test - org.hibernate hibernate-validator-cdi @@ -79,7 +75,6 @@ org.springframework.boot spring-boot-starter-actuator - org.springframework.boot spring-boot-starter-test @@ -108,4 +103,4 @@ 5.5.2 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml index 204cb8765c..ea46ae3293 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 feign-rest-consumer 1.0.0-SNAPSHOT @@ -78,4 +78,4 @@ 1.0.0-SNAPSHOT - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-hystrix/pom.xml b/spring-cloud/spring-cloud-hystrix/pom.xml index 4aec8050ff..4fa0a31d62 100644 --- a/spring-cloud/spring-cloud-hystrix/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-hystrix 1.0.0-SNAPSHOT @@ -21,4 +21,4 @@ feign-rest-consumer - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml index e96dc478a4..73a0859785 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rest-consumer 1.0.0-SNAPSHOT @@ -56,7 +57,6 @@ org.springframework.boot spring-boot-starter-actuator - org.springframework.boot spring-boot-starter-test @@ -69,4 +69,4 @@ 1.10.19 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml index e7be8f2c58..4843c592c9 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rest-producer 1.0.0-SNAPSHOT @@ -19,7 +20,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -32,4 +32,4 @@ 1.10.19 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml index 8e543db326..e916f2bc3e 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 client-service client-service @@ -87,4 +88,4 @@ 1.1.8.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/pom.xml index 5ab017043c..c6c6de94c3 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 travel-agency-service 1.0-SNAPSHOT @@ -27,7 +28,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-actuator diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/pom.xml index 5bd7d3f5ea..81455eb259 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 demo-backend demo-backend @@ -17,7 +18,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -34,4 +34,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml index 004fabeb09..558b2cfc3c 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 demo-frontend demo-frontend @@ -17,7 +18,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -33,4 +33,5 @@ - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/pom.xml index 16e718a3be..725aa9cd3d 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/pom.xml @@ -1,7 +1,7 @@ + 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 liveness-example liveness-example @@ -19,12 +19,10 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-actuator - org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/pom.xml index 0ee40b6504..65434259f2 100644 --- a/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/pom.xml @@ -1,7 +1,7 @@ + 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 readiness-example readiness-example diff --git a/spring-cloud/spring-cloud-kubernetes/pom.xml b/spring-cloud/spring-cloud-kubernetes/pom.xml index 7e494b61d9..1a3e3826d4 100644 --- a/spring-cloud/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud-kubernetes diff --git a/spring-cloud/spring-cloud-netflix-feign/pom.xml b/spring-cloud/spring-cloud-netflix-feign/pom.xml index aa5ba5dbdb..6180ee7575 100644 --- a/spring-cloud/spring-cloud-netflix-feign/pom.xml +++ b/spring-cloud/spring-cloud-netflix-feign/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.cloud spring-cloud-netlix-feign @@ -32,23 +33,19 @@ org.springframework.cloud spring-cloud-starter-feign - com.netflix.feign feign-okhttp ${feign-ok.version} - org.springframework.boot spring-boot-starter-web - org.apache.httpcomponents httpcore - org.springframework.boot spring-boot-starter-test @@ -59,13 +56,8 @@ Camden.SR7 8.18.0 - - + + - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-open-service-broker/pom.xml b/spring-cloud/spring-cloud-open-service-broker/pom.xml index 42e90402e5..ca55bc2147 100644 --- a/spring-cloud/spring-cloud-open-service-broker/pom.xml +++ b/spring-cloud/spring-cloud-open-service-broker/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + 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 spring-cloud-open-service-broker @@ -38,4 +38,4 @@ 3.3.5.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-openfeign/pom.xml b/spring-cloud/spring-cloud-openfeign/pom.xml index bdde46fe96..1cb618c7e1 100644 --- a/spring-cloud/spring-cloud-openfeign/pom.xml +++ b/spring-cloud/spring-cloud-openfeign/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.cloud spring-cloud-openfeign @@ -32,29 +33,24 @@ org.springframework.cloud spring-cloud-starter-openfeign - io.github.openfeign feign-okhttp - org.springframework.boot spring-boot-starter-web - io.github.openfeign.form feign-form 3.8.0 - io.github.openfeign.form feign-form-spring 3.8.0 - org.springframework.boot spring-boot-starter-test @@ -66,4 +62,4 @@ Hoxton.SR6 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-rest/pom.xml b/spring-cloud/spring-cloud-rest/pom.xml index 1136fca020..8f0b7b8dcc 100644 --- a/spring-cloud/spring-cloud-rest/pom.xml +++ b/spring-cloud/spring-cloud-rest/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-rest @@ -48,4 +49,4 @@ 1.8 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml index 8ba0fc5cad..2fa003a634 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-rest-books-api @@ -74,6 +75,4 @@ - - diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml index c64341f652..9180283c2d 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-rest-config-server @@ -52,7 +53,6 @@ Camden.SR4 - - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml index 85790bf895..eb65395821 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-rest-discovery-server @@ -60,7 +61,6 @@ Edgware.SR4 - - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml index 35d0e79543..a8d5837320 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-rest-reviews-api @@ -82,7 +83,6 @@ 3.0.1 0.6 - - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-ribbon-client/pom.xml b/spring-cloud/spring-cloud-ribbon-client/pom.xml index 2c9820d179..77c25b2f6b 100644 --- a/spring-cloud/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-client/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 spring-cloud-ribbon-client 0.0.1-SNAPSHOT diff --git a/spring-cloud/spring-cloud-ribbon-retry/pom.xml b/spring-cloud/spring-cloud-ribbon-retry/pom.xml index 99eb882421..e0075b4f41 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-retry/pom.xml @@ -1,7 +1,7 @@ + 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 com.baeldung.spring.cloud spring-cloud-ribbon-retry @@ -55,6 +55,6 @@ Hoxton.SR3 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/pom.xml b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/pom.xml index ad47eb6c84..34d4d372bc 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-retry/ribbon-client-service/pom.xml @@ -1,7 +1,7 @@ + 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 ribbon-client-service diff --git a/spring-cloud/spring-cloud-ribbon-retry/ribbon-weather-service/pom.xml b/spring-cloud/spring-cloud-ribbon-retry/ribbon-weather-service/pom.xml index f091341025..d3edb6062b 100644 --- a/spring-cloud/spring-cloud-ribbon-retry/ribbon-weather-service/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-retry/ribbon-weather-service/pom.xml @@ -1,7 +1,7 @@ + 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 ribbon-weather-service diff --git a/spring-cloud/spring-cloud-security/auth-client/pom.xml b/spring-cloud/spring-cloud-security/auth-client/pom.xml index c7606719f9..cdbb056a45 100644 --- a/spring-cloud/spring-cloud-security/auth-client/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 auth-client auth-client @@ -82,4 +83,4 @@ 4.3.1 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-security/auth-resource/pom.xml b/spring-cloud/spring-cloud-security/auth-resource/pom.xml index d3f9eaf795..c999030c07 100644 --- a/spring-cloud/spring-cloud-security/auth-resource/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-resource/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 auth-resource auth-resource @@ -47,4 +48,4 @@ 1.0.10.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-security/auth-server/pom.xml b/spring-cloud/spring-cloud-security/auth-server/pom.xml index 59ddedf1b2..c0330aad43 100644 --- a/spring-cloud/spring-cloud-security/auth-server/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 auth-server auth-server diff --git a/spring-cloud/spring-cloud-security/pom.xml b/spring-cloud/spring-cloud-security/pom.xml index 53b95380ed..0227989f99 100644 --- a/spring-cloud/spring-cloud-security/pom.xml +++ b/spring-cloud/spring-cloud-security/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-security 1.0.0-SNAPSHOT @@ -36,4 +37,4 @@ 2020.0.1 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-sentinel/pom.xml b/spring-cloud/spring-cloud-sentinel/pom.xml index 612cbcbfbe..a36dcc51bc 100644 --- a/spring-cloud/spring-cloud-sentinel/pom.xml +++ b/spring-cloud/spring-cloud-sentinel/pom.xml @@ -1,13 +1,13 @@ + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 spring-cloud-sentinel spring-cloud-sentinel http://maven.apache.org pom + com.baeldung.spring.cloud spring-cloud @@ -39,4 +39,5 @@ UTF-8 - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-stream-starters/twitterhdfs/pom.xml b/spring-cloud/spring-cloud-stream-starters/twitterhdfs/pom.xml index c9a73b9aa1..9c8d4ac707 100644 --- a/spring-cloud/spring-cloud-stream-starters/twitterhdfs/pom.xml +++ b/spring-cloud/spring-cloud-stream-starters/twitterhdfs/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.twitterhdfs twitterhdfs @@ -12,7 +13,7 @@ org.springframework.boot spring-boot-starter-parent 2.1.13.RELEASE - + @@ -32,7 +33,7 @@ javax.servlet jstl - + org.springframework.boot spring-boot-starter-test test diff --git a/spring-cloud/spring-cloud-stream/pom.xml b/spring-cloud/spring-cloud-stream/pom.xml index 17c788c000..96a7ad012b 100644 --- a/spring-cloud/spring-cloud-stream/pom.xml +++ b/spring-cloud/spring-cloud-stream/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-stream @@ -40,4 +41,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml index 32a31c3042..00e9e7c328 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml @@ -1,6 +1,6 @@ + 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 spring-cloud-stream-kafka spring-cloud-stream-kafka @@ -27,41 +27,34 @@ - org.springframework.cloud spring-cloud-stream-binder-kafka - org.springframework.cloud spring-cloud-stream-schema - org.springframework.cloud spring-cloud-stream-test-support test - io.confluent kafka-avro-serializer ${kafka-avro-serializer.version} - org.apache.avro avro-compiler ${avro.version} - org.apache.avro avro-maven-plugin ${avro.version} - @@ -104,7 +97,6 @@ Greenwich.SR1 4.0.0 1.8.2 - - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml index 9e706cc239..f542d78620 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kinesis/pom.xml @@ -1,7 +1,7 @@ + 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 spring-cloud-stream-kinesis spring-cloud-stream-kinesis @@ -18,19 +18,16 @@ org.springframework.boot spring-boot-starter-web - org.springframework.cloud spring-cloud-stream-binder-kinesis ${spring-cloud-stream-kinesis-binder.version} - com.amazonaws aws-java-sdk-kinesis ${aws-sdk.version} - org.springframework.cloud spring-cloud-stream-test-support diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml index 4aa42f03d7..6ca9e89031 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-stream-rabbit spring-cloud-stream-rabbit @@ -19,7 +20,6 @@ org.springframework.cloud spring-cloud-starter-stream-rabbit - org.springframework.cloud spring-cloud-stream-test-support @@ -27,4 +27,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-task/pom.xml b/spring-cloud/spring-cloud-task/pom.xml index 21d8a4e42b..bf43799d2d 100644 --- a/spring-cloud/spring-cloud-task/pom.xml +++ b/spring-cloud/spring-cloud-task/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud-task @@ -49,7 +50,6 @@ Hoxton.SR4 2.2.3.RELEASE - - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml b/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml index fd10322efb..7dbbb27a77 100644 --- a/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml +++ b/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml @@ -1,7 +1,7 @@ + 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 com.baeldung.cloud springcloudtaskbatch @@ -30,17 +30,14 @@ org.springframework.cloud spring-cloud-starter-task - org.springframework.cloud spring-cloud-task-core - org.springframework.boot spring-boot-starter-batch - org.springframework.cloud spring-cloud-task-batch @@ -65,4 +62,4 @@ com.baeldung.TaskDemo - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml b/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml index 33f6ccde74..ad7035ffe5 100644 --- a/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml +++ b/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 springcloudtasksink springcloudtasksink @@ -32,7 +33,6 @@ spring-boot-starter-test test - org.springframework.cloud spring-cloud-deployer-local @@ -53,4 +53,4 @@ 2.3.1.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-vault/pom.xml b/spring-cloud/spring-cloud-vault/pom.xml index d9ae6b515f..131d58c967 100644 --- a/spring-cloud/spring-cloud-vault/pom.xml +++ b/spring-cloud/spring-cloud-vault/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud-vault @@ -28,28 +29,23 @@ - org.springframework.cloud spring-cloud-starter-vault-config - org.springframework.cloud spring-cloud-vault-config-databases - org.springframework.boot spring-boot-starter-test test - mysql mysql-connector-java - org.springframework.boot spring-boot-starter-jdbc @@ -85,4 +81,4 @@ Greenwich.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml index 24e783ff30..8e7b87c220 100644 --- a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 Greeting Greeting @@ -79,4 +80,4 @@ 1.3 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml b/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml index 777b857403..57a1cc029c 100644 --- a/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 HelloWorld HelloWorld diff --git a/spring-cloud/spring-cloud-zookeeper/pom.xml b/spring-cloud/spring-cloud-zookeeper/pom.xml index 31bf043ac0..79eabf74f0 100644 --- a/spring-cloud/spring-cloud-zookeeper/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-zookeeper spring-cloud-zookeeper diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml index 321da7527a..9989893f2f 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 eureka-client 1.0.0-SNAPSHOT @@ -38,4 +39,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml index 08854b02fd..34f82a7347 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 eureka-server 1.0.0-SNAPSHOT @@ -39,4 +40,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml index c6658d70a2..81a4b9202c 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-zuul-eureka-integration 1.0.0-SNAPSHOT @@ -26,5 +27,5 @@ 1.4.2.RELEASE 1.10 - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml index 2a899760dd..37fe4815bb 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 zuul-server diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml index 77e8ef7c20..3514924198 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 eureka-client 1.0.0-SNAPSHOT @@ -37,7 +38,6 @@ spring-boot-starter-web ${spring-boot.version} - org.springframework.boot spring-boot-starter-test @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml index c3f6642351..dcd912df07 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 eureka-server 1.0.0-SNAPSHOT @@ -37,7 +38,6 @@ commons-configuration ${commons-config.version} - org.springframework.boot spring-boot-starter-test @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml index 996110f875..89d0d2c942 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-zuul-eureka-integration 1.0.0-SNAPSHOT @@ -30,4 +30,4 @@ Finchley.SR2 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml index ddffe540c5..bb38ec1351 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 zuul-server zuul-server @@ -46,7 +47,6 @@ rxjava ${rxjava.version} - org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml index 4e092736a5..cfee3ce656 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml @@ -1,7 +1,7 @@ + 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 api-gateway api-gateway @@ -50,4 +50,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-fallback/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/pom.xml index 42925a6ab9..1c426503e5 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/pom.xml @@ -1,7 +1,7 @@ + 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 spring-cloud-zuul-fallback spring-cloud-zuul-fallback @@ -24,5 +24,5 @@ Finchley.SR2 3.1.1 - - + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml index e66110fb23..239be5e134 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml @@ -1,7 +1,7 @@ + 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 weather-service weather-service @@ -31,13 +31,12 @@ - + org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -45,4 +44,4 @@ - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul/pom.xml b/spring-cloud/spring-cloud-zuul/pom.xml index 13834848fe..fc3a127e90 100644 --- a/spring-cloud/spring-cloud-zuul/pom.xml +++ b/spring-cloud/spring-cloud-zuul/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud spring-cloud-zuul @@ -84,4 +85,4 @@ 2.2.2.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml index f5a8c3b613..7a5f9f602b 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 spring-zuul-foos-resource spring-zuul-foos-resource diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml index 0ca9f0d050..851ad0fd8f 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-post-filter/pom.xml @@ -1,15 +1,15 @@ - + 4.0.0 + spring-zuul-post-filter + spring-cloud-zuul com.baeldung.spring.cloud 0.0.1-SNAPSHOT - 4.0.0 - spring-zuul-post-filter diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml index bb735a71ed..e09fcd3711 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-zuul-rate-limiting 0.0.1-SNAPSHOT @@ -43,4 +44,4 @@ 2.2.0.RELEASE - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml index b7e1702558..7c3f668473 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-zuul-ui spring-zuul-ui @@ -47,5 +48,5 @@ - + \ No newline at end of file From b1bf1bf8200f6a86a3fbe10c7fc2c4bd893b8875 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Fri, 14 May 2021 17:44:24 +0530 Subject: [PATCH 29/72] JAVA-5409: Fix formatting of POMs (Part 2) --- spring-cloud-bus/pom.xml | 6 ++--- .../spring-cloud-config-client/pom.xml | 11 ++++----- .../spring-cloud-config-server/pom.xml | 11 ++++----- .../apache-spark-job/pom.xml | 4 ++-- spring-cloud-data-flow/batch-job/pom.xml | 11 ++++----- spring-cloud-data-flow/pom.xml | 7 +++--- .../customer-mongodb-sink/pom.xml | 7 +++--- .../customer-transform/pom.xml | 7 +++--- .../spring-cloud-data-flow-etl/pom.xml | 7 +++--- .../data-flow-server/pom.xml | 6 ++--- .../data-flow-shell/pom.xml | 7 +++--- .../log-sink/pom.xml | 9 +++---- .../pom.xml | 11 +++++---- .../time-processor/pom.xml | 7 +++--- .../time-source/pom.xml | 7 +++--- spring-jenkins-pipeline/pom.xml | 7 +++--- spring-jersey/pom.xml | 18 ++++---------- spring-jinq/pom.xml | 11 ++++----- spring-jms/pom.xml | 16 ++++++------- spring-katharsis/pom.xml | 11 ++++----- spring-mobile/pom.xml | 10 +++++--- spring-mockito/pom.xml | 7 +++--- spring-protobuf/pom.xml | 9 ++++--- spring-quartz/pom.xml | 5 ++-- spring-reactor/pom.xml | 7 +++--- spring-remoting/pom.xml | 24 ++++++++++--------- spring-remoting/remoting-amqp/pom.xml | 7 +++--- .../remoting-amqp-client/pom.xml | 7 +++--- .../remoting-amqp-server/pom.xml | 7 +++--- .../remoting-hessian-burlap/pom.xml | 6 ++--- .../remoting-hessian-burlap-client/pom.xml | 6 ++--- .../remoting-hessian-burlap-server/pom.xml | 4 ++-- spring-remoting/remoting-http/pom.xml | 4 ++-- .../remoting-http/remoting-http-api/pom.xml | 4 ++-- .../remoting-http-client/pom.xml | 4 ++-- .../remoting-http-server/pom.xml | 4 ++-- spring-remoting/remoting-jms/pom.xml | 4 ++-- .../remoting-jms/remoting-jms-client/pom.xml | 4 ++-- .../remoting-jms/remoting-jms-server/pom.xml | 4 ++-- spring-remoting/remoting-rmi/pom.xml | 4 ++-- .../remoting-rmi/remoting-rmi-client/pom.xml | 4 ++-- .../remoting-rmi/remoting-rmi-server/pom.xml | 4 ++-- spring-roo/pom.xml | 21 ++++++---------- spring-scheduling/pom.xml | 5 ++-- 44 files changed, 169 insertions(+), 177 deletions(-) diff --git a/spring-cloud-bus/pom.xml b/spring-cloud-bus/pom.xml index 82d0bccd0b..938d6d4bb8 100644 --- a/spring-cloud-bus/pom.xml +++ b/spring-cloud-bus/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + 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.spring.cloud spring-cloud-bus @@ -37,4 +37,4 @@ 2020.0.0 - + \ No newline at end of file diff --git a/spring-cloud-bus/spring-cloud-config-client/pom.xml b/spring-cloud-bus/spring-cloud-config-client/pom.xml index cc1c237646..28e7568266 100644 --- a/spring-cloud-bus/spring-cloud-config-client/pom.xml +++ b/spring-cloud-bus/spring-cloud-config-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-config-client spring-cloud-config-client @@ -22,23 +23,19 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test test - org.springframework.boot spring-boot-actuator - org.springframework.boot spring-boot-actuator-autoconfigure - org.springframework.cloud spring-cloud-starter-bus-amqp @@ -54,4 +51,4 @@ - + \ No newline at end of file diff --git a/spring-cloud-bus/spring-cloud-config-server/pom.xml b/spring-cloud-bus/spring-cloud-config-server/pom.xml index a61008f3dd..03616b26af 100644 --- a/spring-cloud-bus/spring-cloud-config-server/pom.xml +++ b/spring-cloud-bus/spring-cloud-config-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-config-server spring-cloud-config-server @@ -18,23 +19,19 @@ org.springframework.cloud spring-cloud-config-server - org.springframework.boot spring-boot-starter-security - org.springframework.boot spring-boot-starter-test test - org.springframework.cloud spring-cloud-config-monitor - org.springframework.cloud spring-cloud-starter-stream-rabbit @@ -50,4 +47,4 @@ - + \ No newline at end of file diff --git a/spring-cloud-data-flow/apache-spark-job/pom.xml b/spring-cloud-data-flow/apache-spark-job/pom.xml index a4816a30ba..4f2ef6cd6c 100644 --- a/spring-cloud-data-flow/apache-spark-job/pom.xml +++ b/spring-cloud-data-flow/apache-spark-job/pom.xml @@ -1,7 +1,7 @@ + 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 apache-spark-job apache-spark-job diff --git a/spring-cloud-data-flow/batch-job/pom.xml b/spring-cloud-data-flow/batch-job/pom.xml index 6b02b000e1..edb7e34389 100644 --- a/spring-cloud-data-flow/batch-job/pom.xml +++ b/spring-cloud-data-flow/batch-job/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud batch-job @@ -26,18 +27,16 @@ - + org.springframework.cloud spring-cloud-starter-task - org.springframework.boot spring-boot-starter-batch - com.h2database h2 @@ -49,4 +48,4 @@ 2.2.3.RELEASE - + \ No newline at end of file diff --git a/spring-cloud-data-flow/pom.xml b/spring-cloud-data-flow/pom.xml index 5b516146ae..f81daeeabc 100644 --- a/spring-cloud-data-flow/pom.xml +++ b/spring-cloud-data-flow/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-data-flow 0.0.1-SNAPSHOT @@ -21,4 +22,4 @@ apache-spark-job - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml index f4557335d6..a2a9bf1980 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 customer-mongodb-sink customer-mongodb-sink @@ -63,4 +64,4 @@ Hoxton.SR4 - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml index 81f194c772..067d25ec26 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 customer-transform customer-transform @@ -55,4 +56,4 @@ Hoxton.SR4 - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/pom.xml index 91abdf3442..ffdd153f15 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-cloud-data-flow-etl 0.0.1-SNAPSHOT @@ -18,4 +19,4 @@ customer-transform - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml index 34da489cd1..5dc8459e10 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml @@ -1,7 +1,7 @@ + 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 data-flow-server 0.0.1-SNAPSHOT @@ -64,4 +64,4 @@ 5.2.12.Final - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/pom.xml index cc37e76aa4..61c1b16581 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 data-flow-shell 0.0.1-SNAPSHOT @@ -46,4 +47,4 @@ 1.1.0.RELEASE - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/log-sink/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/log-sink/pom.xml index 186e5b1886..79d1447207 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/log-sink/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/log-sink/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 log-sink 0.0.1-SNAPSHOT @@ -25,7 +26,7 @@ - + org.springframework.cloud @@ -37,4 +38,4 @@ Hoxton.SR4 - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/pom.xml index e794287e10..678ba1c6ac 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-cloud-data-flow-stream-processing @@ -21,13 +22,13 @@ time-processor log-sink - + - + org.springframework.boot spring-boot-starter-test test - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-processor/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-processor/pom.xml index b4ad84cfe9..083ce87ae6 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-processor/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-processor/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 time-processor 0.0.1-SNAPSHOT @@ -37,4 +38,4 @@ Hoxton.SR4 - + \ No newline at end of file diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml index 05908d3c52..1808198a5d 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring.cloud time-source @@ -38,4 +39,4 @@ Hoxton.SR4 - + \ No newline at end of file diff --git a/spring-jenkins-pipeline/pom.xml b/spring-jenkins-pipeline/pom.xml index 152e107409..f2fd4191fd 100644 --- a/spring-jenkins-pipeline/pom.xml +++ b/spring-jenkins-pipeline/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-jenkins-pipeline 0.0.1-SNAPSHOT @@ -83,4 +84,4 @@ 2.0.0 - + \ No newline at end of file diff --git a/spring-jersey/pom.xml b/spring-jersey/pom.xml index 50d377b73f..08c19f1d3b 100644 --- a/spring-jersey/pom.xml +++ b/spring-jersey/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-jersey 0.1-SNAPSHOT @@ -14,9 +15,7 @@ - - org.glassfish.jersey.containers jersey-container-servlet @@ -32,7 +31,6 @@ jersey-client ${jersey.version} - javax.servlet @@ -40,7 +38,6 @@ ${javax.servlet-api.version} provided - org.glassfish.jersey.ext @@ -53,9 +50,7 @@ - - org.apache.httpcomponents httpclient @@ -68,14 +63,12 @@ - org.apache.httpcomponents httpcore ${httpcore.version} test - org.glassfish.jersey.inject jersey-hk2 @@ -118,7 +111,6 @@ ${assertj-core.version} test - org.springframework.boot @@ -126,7 +118,6 @@ ${spring-boot.version} test - @@ -199,7 +190,6 @@ false - org.codehaus.cargo cargo-maven2-plugin @@ -231,4 +221,4 @@ 1.5.10.RELEASE - + \ No newline at end of file diff --git a/spring-jinq/pom.xml b/spring-jinq/pom.xml index 1f5d8cd915..14ac366e74 100644 --- a/spring-jinq/pom.xml +++ b/spring-jinq/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-jinq 0.1-SNAPSHOT @@ -20,24 +21,20 @@ jinq-jpa ${jinq.version} - com.h2database h2 - org.springframework.boot spring-boot-starter-data-jpa - org.springframework spring-orm - org.springframework.boot @@ -64,4 +61,4 @@ 1.8.29 - + \ No newline at end of file diff --git a/spring-jms/pom.xml b/spring-jms/pom.xml index 9cd9126fac..09bf854221 100644 --- a/spring-jms/pom.xml +++ b/spring-jms/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-jms @@ -33,14 +34,13 @@ activemq-all ${activemq.version} - - org.springframework.boot - spring-boot-starter-test - ${spring-boot-test.version} - test - + org.springframework.boot + spring-boot-starter-test + ${spring-boot-test.version} + test + @@ -67,4 +67,4 @@ 1.5.10.RELEASE - + \ No newline at end of file diff --git a/spring-katharsis/pom.xml b/spring-katharsis/pom.xml index 674d9a2a14..b836a42bca 100644 --- a/spring-katharsis/pom.xml +++ b/spring-katharsis/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.springframework.samples spring-katharsis @@ -20,19 +21,15 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa - com.h2database h2 - - io.katharsis katharsis-spring @@ -140,4 +137,4 @@ 1.6.1 - + \ No newline at end of file diff --git a/spring-mobile/pom.xml b/spring-mobile/pom.xml index 465458ba49..8b98e6d429 100644 --- a/spring-mobile/pom.xml +++ b/spring-mobile/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mobile 1.0-SNAPSHOT @@ -30,6 +31,7 @@ spring-boot-starter-freemarker + spring-milestones @@ -40,7 +42,9 @@ + 2.0.0.M3 - + + \ No newline at end of file diff --git a/spring-mockito/pom.xml b/spring-mockito/pom.xml index 5d2cd7c445..0753935d0c 100644 --- a/spring-mockito/pom.xml +++ b/spring-mockito/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mockito 0.0.1-SNAPSHOT @@ -31,4 +32,4 @@ 2.24.0 - + \ No newline at end of file diff --git a/spring-protobuf/pom.xml b/spring-protobuf/pom.xml index f43faef0d1..44a83803bd 100644 --- a/spring-protobuf/pom.xml +++ b/spring-protobuf/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-protobuf 0.1-SNAPSHOT @@ -24,12 +25,10 @@ protobuf-java-format ${protobuf-java-format.version} - org.springframework.boot spring-boot-starter-web - org.apache.httpcomponents httpclient @@ -42,4 +41,4 @@ com.baeldung.protobuf.Application - + \ No newline at end of file diff --git a/spring-quartz/pom.xml b/spring-quartz/pom.xml index 283d1a1734..19ea302a1d 100644 --- a/spring-quartz/pom.xml +++ b/spring-quartz/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-quartz spring-quartz diff --git a/spring-reactor/pom.xml b/spring-reactor/pom.xml index 0115826fd6..c64d449553 100644 --- a/spring-reactor/pom.xml +++ b/spring-reactor/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-reactor 1.0-SNAPSHOT @@ -41,4 +42,4 @@ 2.0.8.RELEASE - + \ No newline at end of file diff --git a/spring-remoting/pom.xml b/spring-remoting/pom.xml index 59cb9f863e..ba76b56dbd 100644 --- a/spring-remoting/pom.xml +++ b/spring-remoting/pom.xml @@ -1,13 +1,15 @@ - + 4.0.0 spring-remoting 1.0-SNAPSHOT spring-remoting pom Parent for all projects related to Spring Remoting, except remoting-hessian-burlap - + com.baeldung @@ -16,6 +18,14 @@ ../parent-boot-2 + + remoting-hessian-burlap + remoting-http + remoting-amqp + remoting-jms + remoting-rmi + + @@ -27,12 +37,4 @@ - - remoting-hessian-burlap - remoting-http - remoting-amqp - remoting-jms - remoting-rmi - - \ No newline at end of file diff --git a/spring-remoting/remoting-amqp/pom.xml b/spring-remoting/remoting-amqp/pom.xml index ea0b605980..8ce70f86c2 100644 --- a/spring-remoting/remoting-amqp/pom.xml +++ b/spring-remoting/remoting-amqp/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 remoting-amqp remoting-amqp @@ -17,4 +18,4 @@ remoting-amqp-client - + \ No newline at end of file diff --git a/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml b/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml index 17c5b31e62..1bcab004f1 100644 --- a/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml +++ b/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 remoting-amqp-client remoting-amqp-client @@ -31,4 +32,4 @@ - + \ No newline at end of file diff --git a/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml b/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml index 13d0c0a6da..6b6c12b41a 100644 --- a/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml +++ b/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 remoting-amqp-server remoting-amqp-server @@ -34,4 +35,4 @@ 1.0-SNAPSHOT - + \ No newline at end of file diff --git a/spring-remoting/remoting-hessian-burlap/pom.xml b/spring-remoting/remoting-hessian-burlap/pom.xml index 67e3e3eab4..e5975b9f37 100644 --- a/spring-remoting/remoting-hessian-burlap/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-hessian-burlap 1.0-SNAPSHOT @@ -9,7 +9,7 @@ pom - + com.baeldung parent-boot-1 0.0.1-SNAPSHOT diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml index 20680d5880..63458ef278 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-hessian-burlap-client remoting-hessian-burlap-client @@ -33,7 +33,6 @@ hessian ${hessian.version} - ${project.groupId} @@ -58,6 +57,7 @@ + 4.0.38 diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml index 6e4f2e81e4..d64e8c94c1 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-hessian-burlap-server remoting-hessian-burlap-server diff --git a/spring-remoting/remoting-http/pom.xml b/spring-remoting/remoting-http/pom.xml index 2e5195a909..22627c638c 100644 --- a/spring-remoting/remoting-http/pom.xml +++ b/spring-remoting/remoting-http/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-http remoting-http diff --git a/spring-remoting/remoting-http/remoting-http-api/pom.xml b/spring-remoting/remoting-http/remoting-http-api/pom.xml index 697c3f44e5..1f088a9ac1 100644 --- a/spring-remoting/remoting-http/remoting-http-api/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-api/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-http-api remoting-http-api diff --git a/spring-remoting/remoting-http/remoting-http-client/pom.xml b/spring-remoting/remoting-http/remoting-http-client/pom.xml index 03de2d3e4d..909db5f902 100644 --- a/spring-remoting/remoting-http/remoting-http-client/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-client/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-http-client remoting-http-client diff --git a/spring-remoting/remoting-http/remoting-http-server/pom.xml b/spring-remoting/remoting-http/remoting-http-server/pom.xml index 872688e683..be304b9e92 100644 --- a/spring-remoting/remoting-http/remoting-http-server/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-server/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-http-server remoting-http-server diff --git a/spring-remoting/remoting-jms/pom.xml b/spring-remoting/remoting-jms/pom.xml index 33299cd2c5..61bd1d4cfd 100644 --- a/spring-remoting/remoting-jms/pom.xml +++ b/spring-remoting/remoting-jms/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-jms remoting-jms diff --git a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml index 2f3f993b2e..9e8f230e26 100644 --- a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-jms-client remoting-jms-client diff --git a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml index 53d95edcd7..ae105627a0 100644 --- a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-jms-server remoting-jms-server diff --git a/spring-remoting/remoting-rmi/pom.xml b/spring-remoting/remoting-rmi/pom.xml index 037e73658e..ee65c799a4 100644 --- a/spring-remoting/remoting-rmi/pom.xml +++ b/spring-remoting/remoting-rmi/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-rmi remoting-rmi diff --git a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml index 5d8d82d6ab..91630a88e9 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-rmi-client remoting-rmi-client diff --git a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml index cb5eaa1031..ecf57018ec 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml @@ -1,7 +1,7 @@ + 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 remoting-rmi-server remoting-rmi-server diff --git a/spring-roo/pom.xml b/spring-roo/pom.xml index a3680ade70..2c5d5590fa 100644 --- a/spring-roo/pom.xml +++ b/spring-roo/pom.xml @@ -1,7 +1,9 @@ - - + + 4.0.0 com.baeldung spring-roo @@ -13,7 +15,7 @@ io.spring.platform platform-bom Athens-RELEASE - + @@ -27,40 +29,33 @@ spring-boot-starter-test test - org.springframework.boot spring-boot-devtools true - org.springframework.roo org.springframework.roo.annotations pom - org.aspectj aspectjrt - org.apache.commons commons-lang3 - org.assertj assertj-core - - org.springframework.boot spring-boot-starter-data-jpa @@ -367,7 +362,6 @@ - org.springframework.boot @@ -427,7 +421,6 @@ pom provided - io.springlets springlets-data-jpa @@ -640,4 +633,4 @@ 2.0.0.RELEASE - + \ No newline at end of file diff --git a/spring-scheduling/pom.xml b/spring-scheduling/pom.xml index b27f33196d..8df35c4844 100644 --- a/spring-scheduling/pom.xml +++ b/spring-scheduling/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-scheduling 0.1-SNAPSHOT From 1bb3a14c94e88cc2e3ae9d61de598397ab7b8f41 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Fri, 14 May 2021 17:48:04 +0530 Subject: [PATCH 30/72] JAVA-5409: corrected typo --- spring-boot-modules/spring-boot-xml/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-xml/pom.xml b/spring-boot-modules/spring-boot-xml/pom.xml index bee9c7ddd3..b3fd343e4f 100644 --- a/spring-boot-modules/spring-boot-xml/pom.xml +++ b/spring-boot-modules/spring-boot-xml/pom.xml @@ -18,7 +18,7 @@ spring-boot-starter - Forg.springframework.boot + org.springframework.boot spring-boot-starter-test From 3c5b7234d945061b3d80b5e2d5f0473d2e27fe3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Traumat?= Date: Fri, 14 May 2021 17:58:18 +0200 Subject: [PATCH 31/72] Adding cassandre tutorial (#10757) * Adding Cassandre * Added a logger * Added a logger * Change test name * Change test name * Moved to spring-boot-modules * remove cassandre from the spring-boot-modules pom, and add it in the main pom. --- pom.xml | 1 + .../spring-boot-cassandre/README.md | 11 +++ .../spring-boot-cassandre/pom.xml | 68 ++++++++++++++ .../com/example/demo/DemoApplication.java | 13 +++ .../com/example/demo/MyFirstStrategy.java | 66 ++++++++++++++ .../src/main/resources/application.properties | 22 +++++ .../example/demo/DemoApplicationTests.java | 13 +++ .../example/demo/MyFirstStrategyUnitTest.java | 55 ++++++++++++ .../src/test/resources/application.properties | 22 +++++ .../src/test/resources/tickers-btc-usdt.tsv | 89 +++++++++++++++++++ .../src/test/resources/user-trade.tsv | 3 + 11 files changed, 363 insertions(+) create mode 100644 spring-boot-modules/spring-boot-cassandre/README.md create mode 100644 spring-boot-modules/spring-boot-cassandre/pom.xml create mode 100644 spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/DemoApplication.java create mode 100644 spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/MyFirstStrategy.java create mode 100644 spring-boot-modules/spring-boot-cassandre/src/main/resources/application.properties create mode 100644 spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/DemoApplicationTests.java create mode 100644 spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/MyFirstStrategyUnitTest.java create mode 100644 spring-boot-modules/spring-boot-cassandre/src/test/resources/application.properties create mode 100644 spring-boot-modules/spring-boot-cassandre/src/test/resources/tickers-btc-usdt.tsv create mode 100644 spring-boot-modules/spring-boot-cassandre/src/test/resources/user-trade.tsv diff --git a/pom.xml b/pom.xml index f4606ec368..d8bf527184 100644 --- a/pom.xml +++ b/pom.xml @@ -1276,6 +1276,7 @@ + spring-boot-modules/spring-boot-cassandre core-java-modules/core-java-9 core-java-modules/core-java-9-improvements core-java-modules/core-java-9-jigsaw diff --git a/spring-boot-modules/spring-boot-cassandre/README.md b/spring-boot-modules/spring-boot-cassandre/README.md new file mode 100644 index 0000000000..14ffbb7d6b --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/README.md @@ -0,0 +1,11 @@ +# Cassandre trading bot example + +This project is an example of a trading bot developed with Cassandre + +## Running the examples + +* `mvn test` - Run strategy backtesting +* `mvn spring-boot:run` - Run the bot + +## Relevant Articles +- [Build a Trading Bot with Cassandre Spring Boot Starter](https://www.baeldung.com/build-a-trading-bot-with-cassandre-spring-boot-starter/) diff --git a/spring-boot-modules/spring-boot-cassandre/pom.xml b/spring-boot-modules/spring-boot-cassandre/pom.xml new file mode 100644 index 0000000000..75163d2c2b --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/pom.xml @@ -0,0 +1,68 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.4.5 + + + com.example + demo + 0.0.1-SNAPSHOT + Cassandre trading bot tutorial + Cassandre trading bot tutorial + + 11 + + + + org.springframework.boot + spring-boot-starter + + + + + tech.cassandre.trading.bot + cassandre-trading-bot-spring-boot-starter + 4.2.1 + + + org.knowm.xchange + xchange-kucoin + 5.0.7 + + + org.hsqldb + hsqldb + 2.5.1 + + + + org.springframework.boot + spring-boot-starter-test + test + + + + tech.cassandre.trading.bot + cassandre-trading-bot-spring-boot-starter-test + 4.2.1 + test + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 2.4.5 + + + + + diff --git a/spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/DemoApplication.java b/spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/DemoApplication.java new file mode 100644 index 0000000000..094d95b93f --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/DemoApplication.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/MyFirstStrategy.java b/spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/MyFirstStrategy.java new file mode 100644 index 0000000000..ea8ae74aa6 --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/main/java/com/example/demo/MyFirstStrategy.java @@ -0,0 +1,66 @@ +package com.example.demo; + +import static tech.cassandre.trading.bot.dto.position.PositionStatusDTO.CLOSED; +import static tech.cassandre.trading.bot.dto.position.PositionStatusDTO.OPENED; +import static tech.cassandre.trading.bot.dto.util.CurrencyDTO.BTC; +import static tech.cassandre.trading.bot.dto.util.CurrencyDTO.USDT; + +import java.math.BigDecimal; +import java.util.Optional; +import java.util.Set; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import tech.cassandre.trading.bot.dto.market.TickerDTO; +import tech.cassandre.trading.bot.dto.position.PositionDTO; +import tech.cassandre.trading.bot.dto.position.PositionRulesDTO; +import tech.cassandre.trading.bot.dto.user.AccountDTO; +import tech.cassandre.trading.bot.dto.util.CurrencyPairDTO; +import tech.cassandre.trading.bot.strategy.BasicCassandreStrategy; +import tech.cassandre.trading.bot.strategy.CassandreStrategy; + +@CassandreStrategy +public class MyFirstStrategy extends BasicCassandreStrategy { + + private final Logger logger = LoggerFactory.getLogger(MyFirstStrategy.class); + + @Override + public Set getRequestedCurrencyPairs() { + return Set.of(new CurrencyPairDTO(BTC, USDT)); + } + + @Override + public Optional getTradeAccount(Set accounts) { + return accounts.stream() + .filter(a -> "trade".equals(a.getName())) + .findFirst(); + } + + @Override + public void onTickerUpdate(TickerDTO ticker) { + logger.info("Received a new ticker : {}", ticker); + + if (new BigDecimal("56000").compareTo(ticker.getLast()) == -1) { + + if (canBuy(new CurrencyPairDTO(BTC, USDT), new BigDecimal("0.01"))) { + PositionRulesDTO rules = PositionRulesDTO.builder() + .stopGainPercentage(4f) + .stopLossPercentage(25f) + .build(); + createLongPosition(new CurrencyPairDTO(BTC, USDT), new BigDecimal("0.01"), rules); + } + + } + } + + @Override + public void onPositionStatusUpdate(PositionDTO position) { + if (position.getStatus() == OPENED) { + logger.info("> New position opened : {}", position.getPositionId()); + } + if (position.getStatus() == CLOSED) { + logger.info("> Position closed : {}", position.getDescription()); + } + } + +} diff --git a/spring-boot-modules/spring-boot-cassandre/src/main/resources/application.properties b/spring-boot-modules/spring-boot-cassandre/src/main/resources/application.properties new file mode 100644 index 0000000000..5ecdabd47a --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/main/resources/application.properties @@ -0,0 +1,22 @@ +# +# Exchange configuration. +cassandre.trading.bot.exchange.name=kucoin +cassandre.trading.bot.exchange.username=kucoin.cassandre.test@gmail.com +cassandre.trading.bot.exchange.passphrase=cassandre +cassandre.trading.bot.exchange.key=6054ad25365ac6000689a998 +cassandre.trading.bot.exchange.secret=af080d55-afe3-47c9-8ec1-4b479fbcc5e7 +# +# Modes +cassandre.trading.bot.exchange.modes.sandbox=true +cassandre.trading.bot.exchange.modes.dry=false +# +# Exchange API calls rates (ms or standard ISO 8601 duration like 'PT5S'). +cassandre.trading.bot.exchange.rates.account=2000 +cassandre.trading.bot.exchange.rates.ticker=2000 +cassandre.trading.bot.exchange.rates.trade=2000 +# +# Database configuration. +cassandre.trading.bot.database.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver +cassandre.trading.bot.database.datasource.url=jdbc:hsqldb:mem:cassandre +cassandre.trading.bot.database.datasource.username=sa +cassandre.trading.bot.database.datasource.password= diff --git a/spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/DemoApplicationTests.java b/spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/DemoApplicationTests.java new file mode 100644 index 0000000000..eaa99696e2 --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/DemoApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DemoApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/MyFirstStrategyUnitTest.java b/spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/MyFirstStrategyUnitTest.java new file mode 100644 index 0000000000..bf7c353821 --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/test/java/com/example/demo/MyFirstStrategyUnitTest.java @@ -0,0 +1,55 @@ +package com.example.demo; + +import static org.awaitility.Awaitility.await; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static tech.cassandre.trading.bot.dto.position.PositionStatusDTO.OPENED; +import static tech.cassandre.trading.bot.dto.util.CurrencyDTO.USDT; + +import java.util.HashMap; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Import; + +import tech.cassandre.trading.bot.dto.util.CurrencyDTO; +import tech.cassandre.trading.bot.dto.util.GainDTO; +import tech.cassandre.trading.bot.test.mock.TickerFluxMock; + +@SpringBootTest +@Import(TickerFluxMock.class) +@DisplayName("Simple strategy test") +public class MyFirstStrategyUnitTest { + + private final Logger logger = LoggerFactory.getLogger(MyFirstStrategyUnitTest.class); + + @Autowired + private MyFirstStrategy strategy; + + @Autowired + private TickerFluxMock tickerFluxMock; + + @Test + @DisplayName("Check gains") + public void whenTickersArrives_thenCheckGains() { + await().forever().until(() -> tickerFluxMock.isFluxDone()); + + final HashMap gains = strategy.getGains(); + + logger.info("Cumulated gains:"); + gains.forEach((currency, gain) -> logger.info(currency + " : " + gain.getAmount())); + + logger.info("Position still opened :"); + strategy.getPositions() + .values() + .stream() + .filter(p -> p.getStatus().equals(OPENED)) + .forEach(p -> logger.info(" - {} " + p.getDescription())); + + assertTrue(gains.get(USDT).getPercentage() > 0); + } + +} diff --git a/spring-boot-modules/spring-boot-cassandre/src/test/resources/application.properties b/spring-boot-modules/spring-boot-cassandre/src/test/resources/application.properties new file mode 100644 index 0000000000..3d6feb09d7 --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/test/resources/application.properties @@ -0,0 +1,22 @@ +# +# Exchange configuration. +cassandre.trading.bot.exchange.name=kucoin +cassandre.trading.bot.exchange.username=kucoin.cassandre.test@gmail.com +cassandre.trading.bot.exchange.passphrase=cassandre +cassandre.trading.bot.exchange.key=6054ad25365ac6000689a998 +cassandre.trading.bot.exchange.secret=af080d55-afe3-47c9-8ec1-4b479fbcc5e7 +# +# Modes +cassandre.trading.bot.exchange.modes.sandbox=true +cassandre.trading.bot.exchange.modes.dry=true +# +# Exchange API calls rates (ms or standard ISO 8601 duration like 'PT5S'). +cassandre.trading.bot.exchange.rates.account=2000 +cassandre.trading.bot.exchange.rates.ticker=2000 +cassandre.trading.bot.exchange.rates.trade=2000 +# +# Database configuration. +cassandre.trading.bot.database.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver +cassandre.trading.bot.database.datasource.url=jdbc:hsqldb:mem:cassandre +cassandre.trading.bot.database.datasource.username=sa +cassandre.trading.bot.database.datasource.password= diff --git a/spring-boot-modules/spring-boot-cassandre/src/test/resources/tickers-btc-usdt.tsv b/spring-boot-modules/spring-boot-cassandre/src/test/resources/tickers-btc-usdt.tsv new file mode 100644 index 0000000000..b89bd96bdc --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/test/resources/tickers-btc-usdt.tsv @@ -0,0 +1,89 @@ +1612569600 38294.4 39195.5 40964.2 38217.5 3882.29460938 153897343.463150723 +1612656000 39195.4 38807.6 39623.6 37341.4 2389.96820017 91972455.834535369 +1612742400 38807.6 46373.5 46767.9 38010 4971.54731481 212132648.426718929 +1612828800 46374.6 46434.8 48139.3 44961 4330.72854712 201891604.027160303 +1612915200 46430 44812.2 47300 43687.5 4351.84907778 198189685.592028516 +1613001600 44806.1 47941.5 48647.6 44005.8 4045.91883504 188171651.974437139 +1613088000 47963.1 47310.7 48958.8 46181.2 3356.01832119 159561721.419695848 +1613174400 47305.4 47152.6 48120.5 46225.5 2740.99221759 129227867.922246174 +1613260800 47152.5 48591.9 49686.9 47026.3 3359.4690565 163299915.839307312 +1613347200 48587.2 47904.4 49003.6 42841.6 3974.98461358 188990056.26923591 +1613433600 47913.1 49147.7 50619.3 47023.9 3599.85370182 176084748.845657596 +1613520000 49147.7 52118.1 52609.6 48931.1 3356.85082847 170893567.530348564 +1613606400 52114.3 51568.9 52522.9 50906.4 2183.18379408 113272339.172174965 +1613692800 51561.1 55890.5 56317.7 50727 3749.6920105 200656740.865959032 +1613779200 55893.6 55851.5 57622.6 53463.3 3394.87226216 190744601.429330887 +1613865600 55851.4 57423 58336.3 55489.6 2514.02340013 143658132.671448082 +1613952000 57420.6 54096.6 57517.8 44160 6125.32442907 330513978.457310237 +1614038400 54085.9 48908.3 54174.2 44900 8048.96505298 389277314.445372085 +1614124800 48902.9 49685.2 51361.9 47003.2 4816.75027676 239303706.844272809 +1614211200 49676.5 47082.7 52019.6 46624.4 3701.80236678 184044004.383578525 +1614297600 47082 46289.6 48408.8 44135 5329.77125908 247604118.914146591 +1614384000 46290.2 46114.4 48381.9 44836.5 2872.64640734 134946360.020429589 +1614470400 46111.3 45141.6 46626.1 43004.3 3940.17863714 175990962.484551548 +1614556800 45136.5 49590.3 49771.3 44958.9 3548.51026561 169389196.772247159 +1614643200 49590.3 48441.2 50201.6 47052.8 2936.94454126 142575425.463057812 +1614729600 48440.6 50345.5 52623.9 48100 3177.38943911 160801620.821885745 +1614816000 50347.6 48374.5 51762.1 47505.7 3624.17683614 178873453.27515484 +1614902400 48374.5 48758.9 49450 46189.8 3697.34556922 176318969.507294567 +1614988800 48746.9 48871.9 49255.1 47001 1949.15311354 94201823.810314647 +1615075200 48885 50930.4 51424.7 48885 2444.3584982 122962479.787996993 +1615161600 50956.6 52377 52387.5 49287.5 2710.99151191 137751640.241286989 +1615248000 52376.9 54867.6 54867.6 51833.8 3070.93581512 165487483.114064122 +1615334400 54867.5 55865.5 57364 52911.4 4049.50553851 224565244.752334892 +1615420800 55863.7 57781.1 58150 54238 3403.69441456 191915265.020541521 +1615507200 57781 57238.5 58057.5 55013.7 4031.0376629 228810606.091302364 +1615593600 57220.7 61180.9 61815.3 56059.3 4394.62318443 259602986.875738328 +1615680000 61174.3 59000 61700 59000 3084.33952274 186155667.656432156 +1615766400 59000 55607.1 60632.9 54525.6 5910.33518227 338468393.188725572 +1615852800 55607.1 56880.3 56918.9 53240.3 7410.49057723 409052587.523700888 +1615939200 56880.3 58875.8 58951.8 54147.5 5828.79026943 328135601.648660052 +1616025600 58882.9 57648.9 60107.7 57000 5073.7458698 297279816.540519693 +1616112000 57648.9 58024.2 59450.1 56071 3727.09434161 217005823.723994618 +1616198400 58024.3 58113.5 59874.6 57825.6 2746.52973805 161565114.165299707 +1616284800 58113.5 57350.2 58591.6 55501 3265.35649781 186845535.507151609 +1616371200 57345.3 54096.1 58415.5 53667 4219.99501831 237141977.003568352 +1616457600 54086.8 54348.4 55823.1 52986.3 4374.34046303 239135883.538398977 +1616544000 54348.4 52307.4 57200 51499.6 6416.76024581 351202326.218690674 +1616630400 52307.1 51301.7 53239.1 50455 7242.6466396 375950351.557038048 +1616716800 51301.7 55032 55062.5 51225.3 4609.48192944 245299757.451540308 +1616803200 55031.9 55820.4 56628.6 53967.5 3634.73588532 200758048.816804103 +1616889600 55820.3 55772.9 56541 54666.6 3158.20452681 176119911.151714842 +1616976000 55772.8 57628.9 58400.5 54926.5 4413.63121553 251384747.301649587 +1617062400 57630.8 58754.6 59351.9 57072.8 3563.87315049 208118726.050535887 +1617148800 58753.2 58745.9 59800 56357.5 4921.45848213 288469053.074870873 +1617235200 58745.5 58735.7 59487.1 57879 3163.98213108 186078130.901422269 +1617321600 58735.7 58963.6 60179.1 58460.7 2553.76427314 151446539.609794648 +1617408000 58963.6 57058.3 59795 56721.2 2512.19109578 147434403.06515736 +1617494400 57052.5 58201.4 58481.2 56432.6 2069.14670128 119228330.17272614 +1617580800 58201.4 59116.2 59254.1 56501 3003.76043377 174821106.684799505 +1617667200 59116.2 57988.3 59497.5 57304.8 2964.86183859 173169186.845682699 +1617753600 57988.3 55958.2 58668.6 55439 5277.04906389 299996660.411940246 +1617840000 55958.2 58076.7 58141 55700.6 3175.60482079 181817013.517575328 +1617926400 58076.7 58131.6 58900 57666.9 3516.19104669 204849717.059779284 +1618012800 58138.2 59770.2 61350 57902.1 5533.50675561 332014577.538990658 +1618099200 59770.2 60007.6 60687.4 59247.6 3896.37426019 233158562.799039154 +1618185600 60007.6 59863.4 61270.7 59417.4 4611.409014 277430208.743380477 +1618272000 59863.4 63578.7 63759.7 59815 6906.310253 430518557.569547626 +1618358400 63578.7 62958.7 64840 61000 7696.509177 487298143.928065301 +1618444800 62954.4 63152.6 63772.1 62023.9 4709.82427144 296178401.81115496 +1618531200 63152.6 61342.6 63509.7 59930.8 8295.32523869 510423835.691643255 +1618617600 61342.7 59995.2 62497.8 59599.6 5367.42979289 328364887.709585395 +1618704000 59995.3 56150.6 60409.5 49001 11485.97101449 637797282.448645379 +1618790400 56152.7 55618.8 57583.4 54205.2 7721.306905 432634348.931871989 +1618876800 55618.7 56427.8 57061.6 53328 8677.75606016 480164200.559836543 +1618963200 56426.1 53793.6 56761.7 53602 6240.82191836 345339357.806167462 +1619049600 53793.5 51696.4 55474.7 50400 8879.16016304 475394174.249706678 +1619136000 51691.2 51102.7 52112.1 47502.1 8885.07060366 441295812.644904319 +1619222400 51109.8 50033 51157.9 48676.5 4833.41744745 241336360.887795675 +1619308800 50041.5 49086.9 50554.6 46966.2 4805.34664069 237153315.222670555 +1619395200 49069 54000.2 54336.4 48775.8 6695.12934907 353727728.269533971 +1619481600 53997.1 55014.3 55439 53240.8 4344.22291318 237020455.905144335 +1619568000 55014.2 54833.2 56399.1 53808.3 4801.04618634 262912695.604761319 +1619654400 54833.1 53558.4 55181.2 52340.1 4356.05177188 234153663.397444462 +1619740800 53558.5 57697.3 57936.4 53042.6 5000.47557303 277531927.921795199 +1619827200 57697.3 57794.7 58471.4 57006.3 3639.78966647 210179438.189007639 +1619913600 57794.7 56568.5 57903.7 56044.3 3508.52428767 199206958.05741809 +1620000000 56568.5 57159.7 58977.9 56451.3 4780.43387226 276554749.540429296 +1620086400 57159.7 53196.3 57188.2 53083.3 7079.55804728 390469293.396018923 +1620172800 53196.3 57834.5 57979.7 52888 4224.63060355 233779565.506303973 diff --git a/spring-boot-modules/spring-boot-cassandre/src/test/resources/user-trade.tsv b/spring-boot-modules/spring-boot-cassandre/src/test/resources/user-trade.tsv new file mode 100644 index 0000000000..d0fa4e9767 --- /dev/null +++ b/spring-boot-modules/spring-boot-cassandre/src/test/resources/user-trade.tsv @@ -0,0 +1,3 @@ +BTC 1 +USDT 100000 +ETH 10 \ No newline at end of file From b7bf539a69668a701628467c331f1bfb2b8797e9 Mon Sep 17 00:00:00 2001 From: Mainak Majumder Date: Sat, 15 May 2021 04:44:22 +0200 Subject: [PATCH 32/72] Code for the Baeldung article "HTTP PUT vs POST in REST (#10707) * Application source code for the Baeldung article "HTTP PUT vs POST method in REST API" * update indention in pom file, update code in Address class * update indention * rename application * update pom --- spring-boot-rest-2/pom.xml | 9 +++ .../java/com/baeldung/putvspost/Address.java | 57 +++++++++++++++++++ .../baeldung/putvspost/AddressController.java | 57 +++++++++++++++++++ .../baeldung/putvspost/AddressRepository.java | 7 +++ .../putvspost/PutVsPostApplication.java | 13 +++++ 5 files changed, 143 insertions(+) create mode 100644 spring-boot-rest-2/src/main/java/com/baeldung/putvspost/Address.java create mode 100644 spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressController.java create mode 100644 spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressRepository.java create mode 100644 spring-boot-rest-2/src/main/java/com/baeldung/putvspost/PutVsPostApplication.java diff --git a/spring-boot-rest-2/pom.xml b/spring-boot-rest-2/pom.xml index d74c393f27..b32e1c153d 100644 --- a/spring-boot-rest-2/pom.xml +++ b/spring-boot-rest-2/pom.xml @@ -30,6 +30,15 @@ springfox-boot-starter 3.0.0 + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + runtime + diff --git a/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/Address.java b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/Address.java new file mode 100644 index 0000000000..5c005c70f0 --- /dev/null +++ b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/Address.java @@ -0,0 +1,57 @@ +package com.baeldung.putvspost; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Address { + + private @Id @GeneratedValue Long id; + private String name; + private String city; + private String postalCode; + + Address() { + } + + public Address(String name, String city, String postalCode) { + this.name = name; + this.city = city; + this.postalCode = postalCode; + } + + public Long getId() { + return id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getPostalCode() { + return postalCode; + } + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + @Override + public String toString() { + return "Address [id=" + id + ", name=" + name + ", city=" + city + ", postalCode=" + postalCode + "]"; + } + +} diff --git a/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressController.java b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressController.java new file mode 100644 index 0000000000..f989d5c211 --- /dev/null +++ b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressController.java @@ -0,0 +1,57 @@ +package com.baeldung.putvspost; + +import java.util.List; +import java.util.Optional; + +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class AddressController { + + private final AddressRepository repository; + + AddressController(AddressRepository repository) { + this.repository = repository; + } + + @GetMapping("/addresses") + List
getAllAddresses() { + return repository.findAll(); + } + + @GetMapping("/addresses/{id}") + Optional
getAddressesById(@PathVariable Long id) { + return repository.findById(id); + } + + @PostMapping("/addresses") + Address createNewAddress(@RequestBody Address newAddress) { + return repository.save(newAddress); + } + + @PutMapping("/addresses/{id}") + Address replaceEmployee(@RequestBody Address newAddress, @PathVariable Long id) { + + return repository.findById(id) + .map(address -> { + address.setCity(newAddress.getCity()); + address.setPostalCode(newAddress.getPostalCode()); + return repository.save(address); + }) + .orElseGet(() -> { + return repository.save(newAddress); + }); + } + + @DeleteMapping("/addresses/{id}") + void deleteEmployee(@PathVariable Long id) { + repository.deleteById(id); + } + +} diff --git a/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressRepository.java b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressRepository.java new file mode 100644 index 0000000000..415a3c9030 --- /dev/null +++ b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/AddressRepository.java @@ -0,0 +1,7 @@ +package com.baeldung.putvspost; + +import org.springframework.data.jpa.repository.JpaRepository; + +public interface AddressRepository extends JpaRepository { + +} diff --git a/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/PutVsPostApplication.java b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/PutVsPostApplication.java new file mode 100644 index 0000000000..8cea53d269 --- /dev/null +++ b/spring-boot-rest-2/src/main/java/com/baeldung/putvspost/PutVsPostApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.putvspost; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class PutVsPostApplication { + + public static void main(String[] args) { + SpringApplication.run(PutVsPostApplication.class, args); + } + +} From dda6b7583fea1456eaaa5f722e0c602e895fb38b Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sat, 15 May 2021 10:20:22 -0500 Subject: [PATCH 33/72] BAEL-4934: update README (#10766) --- spring-boot-rest-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-rest-2/README.md b/spring-boot-rest-2/README.md index f09159198c..41270d58ea 100644 --- a/spring-boot-rest-2/README.md +++ b/spring-boot-rest-2/README.md @@ -1,3 +1,4 @@ ### Relevant Article: - [Get All Endpoints in Spring Boot](https://www.baeldung.com/spring-boot-get-all-endpoints) +- [HTTP PUT vs. POST in REST API](https://www.baeldung.com/rest-http-put-vs-post) From c3e386eb022b76ef5a69d52866f9a18caa513202 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Sun, 16 May 2021 16:40:29 +0530 Subject: [PATCH 34/72] JAVA-5550 Removed Spring Milestones/RC dependencies from projects and upgraded them to their respective central versions --- netflix-modules/mantis/pom.xml | 12 +++--------- spring-boot-modules/spring-boot-properties/pom.xml | 11 +---------- spring-cloud/spring-cloud-circuit-breaker/pom.xml | 14 -------------- spring-mobile/pom.xml | 12 +----------- spring-roo/pom.xml | 12 ------------ 5 files changed, 5 insertions(+), 56 deletions(-) diff --git a/netflix-modules/mantis/pom.xml b/netflix-modules/mantis/pom.xml index 474b8f6dbf..1f8b377b94 100644 --- a/netflix-modules/mantis/pom.xml +++ b/netflix-modules/mantis/pom.xml @@ -19,7 +19,6 @@ org.springframework.boot spring-boot-starter - 2.1.3.RELEASE io.mantisrx @@ -35,36 +34,31 @@ com.fasterxml.jackson.core jackson-databind - 2.10.2 net.andreinc.mockneat mockneat - 0.3.8 + 0.4.2 org.projectlombok lombok - 1.18.12 org.springframework spring-webflux - 5.0.9.RELEASE test io.projectreactor.netty reactor-netty - 0.9.12.RELEASE test - - SpringLibReleaseRepo - https://repo.spring.io/libs-release/ + jcenter + https://jcenter.bintray.com/ diff --git a/spring-boot-modules/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml index adeb41e976..2acc66487c 100644 --- a/spring-boot-modules/spring-boot-properties/pom.xml +++ b/spring-boot-modules/spring-boot-properties/pom.xml @@ -121,17 +121,8 @@ - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - 2020.0.0-M5 + Hoxton.SR11 1.10 20.0 @ diff --git a/spring-cloud/spring-cloud-circuit-breaker/pom.xml b/spring-cloud/spring-cloud-circuit-breaker/pom.xml index 680d835c19..3cf63f3db1 100644 --- a/spring-cloud/spring-cloud-circuit-breaker/pom.xml +++ b/spring-cloud/spring-cloud-circuit-breaker/pom.xml @@ -14,20 +14,6 @@ .. - - - spring-release - Spring Release - https://repo.spring.io/release - - false - - - true - - - - diff --git a/spring-mobile/pom.xml b/spring-mobile/pom.xml index 465458ba49..05d1df0d41 100644 --- a/spring-mobile/pom.xml +++ b/spring-mobile/pom.xml @@ -30,17 +30,7 @@ spring-boot-starter-freemarker - - - spring-milestones - Spring Milestones - https://repo.spring.io/libs-milestone - - false - - - - 2.0.0.M3 + 1.1.5.RELEASE diff --git a/spring-roo/pom.xml b/spring-roo/pom.xml index a3680ade70..71a1a35957 100644 --- a/spring-roo/pom.xml +++ b/spring-roo/pom.xml @@ -397,18 +397,6 @@ - - - maven-snapshot-repository - Maven Snapshot Repository - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - spring-roo-repository From d8e5930766425d9966059e08a5e533d91f58fe9c Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Sun, 16 May 2021 16:59:44 +0530 Subject: [PATCH 35/72] JAVA-5550 Reverted changes done in spring-boot-properties as spring-cloud hoxton release is not compatible with spring boot 2.4 --- spring-boot-modules/spring-boot-properties/pom.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml index 2acc66487c..adeb41e976 100644 --- a/spring-boot-modules/spring-boot-properties/pom.xml +++ b/spring-boot-modules/spring-boot-properties/pom.xml @@ -121,8 +121,17 @@ + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + + - Hoxton.SR11 + 2020.0.0-M5 1.10 20.0 @ From b744d8e6ee36042dae1055f5011c1df50fd5dd25 Mon Sep 17 00:00:00 2001 From: akhil90s <46933461+akhil90s@users.noreply.github.com> Date: Sun, 16 May 2021 22:12:35 +0530 Subject: [PATCH 36/72] Code Coverage with SonarQube and Jacoco (#10674) * Code Coverage with SonarQube and Jacoco * SonarQube and Jacoco * Delete SonarQube and Jacoco From the Root directory * SonarQube and JaCoCo * SonarQube And JaCoCo * BAEL-4636 : Code Coverage with SonarQube and Jacoco * Shifted to testing-modules/testing-libraries-2 * Removing this project to make a single project * Code Coverage with SonarQube and Jacoco * Formatting in pom.xml file * Delete Directory * Delete unused directory * SonarQube And JaCoCo * SonarQube And JaCoCo --- testing-modules/testing-libraries-2/pom.xml | 47 +++++++++++++--- .../sonarqubeandjacoco/product/Product.java | 54 +++++++++++++++++++ .../product/ProductUnitTest.java | 26 +++++++++ 3 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 testing-modules/testing-libraries-2/src/main/java/com/baeldung/sonarqubeandjacoco/product/Product.java create mode 100644 testing-modules/testing-libraries-2/src/test/java/com/baeldung/sonarqubeandjacoco/product/ProductUnitTest.java diff --git a/testing-modules/testing-libraries-2/pom.xml b/testing-modules/testing-libraries-2/pom.xml index 7f96280cac..b01a1a918b 100644 --- a/testing-modules/testing-libraries-2/pom.xml +++ b/testing-modules/testing-libraries-2/pom.xml @@ -12,6 +12,15 @@ ../ + + 0.8.6 + 1.19.0 + 1.0.0 + 1.1.0 + 5.6.2 + 3.16.1 + + org.assertj @@ -72,6 +81,36 @@ + + + maven-war-plugin + 2.4 + + false + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + package + + report + + + + + testing-libraries @@ -81,11 +120,5 @@ - - 1.19.0 - 1.0.0 - 1.1.0 - 5.6.2 - 3.16.1 - + diff --git a/testing-modules/testing-libraries-2/src/main/java/com/baeldung/sonarqubeandjacoco/product/Product.java b/testing-modules/testing-libraries-2/src/main/java/com/baeldung/sonarqubeandjacoco/product/Product.java new file mode 100644 index 0000000000..42f103a317 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/main/java/com/baeldung/sonarqubeandjacoco/product/Product.java @@ -0,0 +1,54 @@ +package com.baeldung.sonarqubeandjacoco.product; + +public class Product { + + private int id; + private String name; + private int units; + private double price; + + public Product() { + super(); + } + + public Product(int id, String name, int units, double price) { + super(); + this.id = id; + this.name = name; + this.units = units; + this.price = price; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getUnits() { + return units; + } + + public void setUnits(int units) { + this.units = units; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + +} \ No newline at end of file diff --git a/testing-modules/testing-libraries-2/src/test/java/com/baeldung/sonarqubeandjacoco/product/ProductUnitTest.java b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/sonarqubeandjacoco/product/ProductUnitTest.java new file mode 100644 index 0000000000..da649851e0 --- /dev/null +++ b/testing-modules/testing-libraries-2/src/test/java/com/baeldung/sonarqubeandjacoco/product/ProductUnitTest.java @@ -0,0 +1,26 @@ +package com.baeldung.sonarqubeandjacoco.product; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import org.junit.Test; + +import com.baeldung.sonarqubeandjacoco.product.Product; + +public class ProductUnitTest { + + @Test + public void test() { + Product product = new Product(); + product.setId(1); + assertNull(product.getName()); + assert (product.getId() == 1); + } + + @Test + public void testProduct() { + Product product = new Product(1, "product", 1, 2.0); + assertNotNull(product.getName()); + } + +} From bdd7733443ccc81ef7eadb84f428a2dd38ff43ff Mon Sep 17 00:00:00 2001 From: kwoyke Date: Mon, 17 May 2021 14:15:19 +0200 Subject: [PATCH 37/72] BAEL-4953: Fix FindBugs annotations (#10772) Co-authored-by: Krzysztof Woyke --- patterns/design-patterns-behavioral/pom.xml | 6 ++++++ .../main/java/com/baeldung/nulls/FindBugsAnnotations.java | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/patterns/design-patterns-behavioral/pom.xml b/patterns/design-patterns-behavioral/pom.xml index 93e07bb477..bc032a0f8f 100644 --- a/patterns/design-patterns-behavioral/pom.xml +++ b/patterns/design-patterns-behavioral/pom.xml @@ -26,6 +26,11 @@ ${lombok.version} provided + + com.google.code.findbugs + annotations + ${findbugs.annotations.version} + org.apache.commons commons-lang3 @@ -41,6 +46,7 @@ 16.0.2 + 3.0.1 3.9.1 diff --git a/patterns/design-patterns-behavioral/src/main/java/com/baeldung/nulls/FindBugsAnnotations.java b/patterns/design-patterns-behavioral/src/main/java/com/baeldung/nulls/FindBugsAnnotations.java index 697d5e4959..594516e3f2 100644 --- a/patterns/design-patterns-behavioral/src/main/java/com/baeldung/nulls/FindBugsAnnotations.java +++ b/patterns/design-patterns-behavioral/src/main/java/com/baeldung/nulls/FindBugsAnnotations.java @@ -1,12 +1,12 @@ package com.baeldung.nulls; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import edu.umd.cs.findbugs.annotations.NonNull; +import edu.umd.cs.findbugs.annotations.Nullable; public class FindBugsAnnotations { - public void accept(@NotNull Object param) { + public void accept(@NonNull Object param) { System.out.println(param.toString()); } @@ -14,7 +14,7 @@ public class FindBugsAnnotations { System.out.println("Printing " + param); } - @NotNull + @NonNull public Object process() throws Exception { Object result = doSomething(); if (result == null) { From 55e113fe328d841aeae96c5bd3764982b064a2d4 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 17 May 2021 20:21:04 +0530 Subject: [PATCH 38/72] JAVA-5223: Fix formatting of POMs (Others) --- core-java-modules/core-java-9-jigsaw/pom.xml | 2 +- core-java-modules/core-java-9-streams/pom.xml | 4 ++-- jws/pom.xml | 7 +++--- libraries-4/pom.xml | 4 ++-- libraries-5/pom.xml | 4 ++-- libraries-6/pom.xml | 8 +++---- libraries/pom.xml | 8 ++++--- static-analysis/pom.xml | 5 ++-- stripe/pom.xml | 7 +++--- structurizr/pom.xml | 5 ++-- struts-2/pom.xml | 5 ++-- tensorflow-java/pom.xml | 4 ++-- twilio/pom.xml | 7 +++--- twitter4j/pom.xml | 7 +++--- vaadin/pom.xml | 10 ++++---- vavr-2/pom.xml | 15 ++++++------ vavr/pom.xml | 5 ++-- vertx-and-rxjava/pom.xml | 5 ++-- vertx/pom.xml | 12 ++++++---- video-tutorials/jackson-annotations/pom.xml | 24 +++---------------- video-tutorials/pom.xml | 8 +++---- vraptor/pom.xml | 18 +++----------- webrtc/pom.xml | 6 ++--- wicket/pom.xml | 6 ++--- wildfly/pom.xml | 5 ++-- xml/pom.xml | 15 ++++-------- xstream/pom.xml | 5 ++-- 27 files changed, 92 insertions(+), 119 deletions(-) diff --git a/core-java-modules/core-java-9-jigsaw/pom.xml b/core-java-modules/core-java-9-jigsaw/pom.xml index 0797003174..a26a88f4b0 100644 --- a/core-java-modules/core-java-9-jigsaw/pom.xml +++ b/core-java-modules/core-java-9-jigsaw/pom.xml @@ -34,4 +34,4 @@ 1.9 - + \ No newline at end of file diff --git a/core-java-modules/core-java-9-streams/pom.xml b/core-java-modules/core-java-9-streams/pom.xml index e59cc347c7..aeaf2c7f57 100644 --- a/core-java-modules/core-java-9-streams/pom.xml +++ b/core-java-modules/core-java-9-streams/pom.xml @@ -7,7 +7,7 @@ 0.1.0-SNAPSHOT core-java-9-streams jar - + com.baeldung.core-java-modules core-java-modules @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/jws/pom.xml b/jws/pom.xml index be42798fd1..3d2f67c691 100644 --- a/jws/pom.xml +++ b/jws/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.example jws @@ -66,4 +67,4 @@ 3.0.2 - + \ No newline at end of file diff --git a/libraries-4/pom.xml b/libraries-4/pom.xml index decd467de9..756bfbd3a8 100644 --- a/libraries-4/pom.xml +++ b/libraries-4/pom.xml @@ -1,7 +1,7 @@ + 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 libraries-4 diff --git a/libraries-5/pom.xml b/libraries-5/pom.xml index ff6c208f5f..a3ca204995 100644 --- a/libraries-5/pom.xml +++ b/libraries-5/pom.xml @@ -1,7 +1,7 @@ + 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 libraries-5 diff --git a/libraries-6/pom.xml b/libraries-6/pom.xml index 6db3b1b77b..289597adc9 100644 --- a/libraries-6/pom.xml +++ b/libraries-6/pom.xml @@ -1,7 +1,7 @@ + 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 libraries-6 @@ -112,12 +112,12 @@ renjin-script-engine ${renjin.version} - + com.googlecode.libphonenumber libphonenumber ${libphonenumber.version} - + diff --git a/libraries/pom.xml b/libraries/pom.xml index 13f91fddd0..40cc1b4671 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libraries libraries @@ -335,7 +336,8 @@ benchmarks - + org.openjdk.jmh.Main diff --git a/static-analysis/pom.xml b/static-analysis/pom.xml index 87e5f55977..577440117c 100644 --- a/static-analysis/pom.xml +++ b/static-analysis/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 static-analysis 1.0-SNAPSHOT diff --git a/stripe/pom.xml b/stripe/pom.xml index 48505c9e4e..cfd281b4a8 100644 --- a/stripe/pom.xml +++ b/stripe/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.stripe stripe @@ -40,4 +41,4 @@ 4.2.0 - + \ No newline at end of file diff --git a/structurizr/pom.xml b/structurizr/pom.xml index b8efba0937..85e3fc87d1 100644 --- a/structurizr/pom.xml +++ b/structurizr/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 structurizr structurizr diff --git a/struts-2/pom.xml b/struts-2/pom.xml index 3211ad7253..87663cf545 100644 --- a/struts-2/pom.xml +++ b/struts-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 struts-2 0.0.1-SNAPSHOT diff --git a/tensorflow-java/pom.xml b/tensorflow-java/pom.xml index 379a901925..2ac4d28a37 100644 --- a/tensorflow-java/pom.xml +++ b/tensorflow-java/pom.xml @@ -1,7 +1,7 @@ + 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 tensorflow-java 1.0-SNAPSHOT diff --git a/twilio/pom.xml b/twilio/pom.xml index 76ad5faafb..327242749b 100644 --- a/twilio/pom.xml +++ b/twilio/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 twilio 1.0-SNAPSHOT @@ -24,4 +25,4 @@ 7.20.0 - + \ No newline at end of file diff --git a/twitter4j/pom.xml b/twitter4j/pom.xml index e2579bf73e..3e9bcd550a 100644 --- a/twitter4j/pom.xml +++ b/twitter4j/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 twitter4j twitter4j @@ -24,4 +25,4 @@ 4.0.6 - + \ No newline at end of file diff --git a/vaadin/pom.xml b/vaadin/pom.xml index 4814e70ae3..9025205527 100644 --- a/vaadin/pom.xml +++ b/vaadin/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.test vaadin @@ -107,7 +108,8 @@ - + org.eclipse.jetty jetty-maven-plugin @@ -189,4 +191,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/vavr-2/pom.xml b/vavr-2/pom.xml index d20dd9afef..f3640d7c6e 100644 --- a/vavr-2/pom.xml +++ b/vavr-2/pom.xml @@ -1,17 +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 1.0.0-SNAPSHOT - 4.0.0 - - vavr-2 - vavr-2 - jar @@ -24,4 +24,5 @@ 0.9.1 + \ No newline at end of file diff --git a/vavr/pom.xml b/vavr/pom.xml index 16097af848..1604ecc06e 100644 --- a/vavr/pom.xml +++ b/vavr/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 vavr 1.0 diff --git a/vertx-and-rxjava/pom.xml b/vertx-and-rxjava/pom.xml index 20b022a773..fb04ba784c 100644 --- a/vertx-and-rxjava/pom.xml +++ b/vertx-and-rxjava/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 vertx-and-rxjava vertx-and-rxjava diff --git a/vertx/pom.xml b/vertx/pom.xml index 81ede1ba0b..9a22e2dd72 100644 --- a/vertx/pom.xml +++ b/vertx/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 vertx 1.0-SNAPSHOT @@ -46,14 +47,15 @@ - + io.vertx.core.Starter com.baeldung.SimpleServerVerticle - + ${project.build.directory}/${project.artifactId}-${project.version}-app.jar @@ -67,4 +69,4 @@ 3.2.1 - + \ No newline at end of file diff --git a/video-tutorials/jackson-annotations/pom.xml b/video-tutorials/jackson-annotations/pom.xml index f396baf80b..827715fe5f 100644 --- a/video-tutorials/jackson-annotations/pom.xml +++ b/video-tutorials/jackson-annotations/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson-annotations 1.0.0-SNAPSHOT @@ -13,73 +14,60 @@ - commons-io commons-io ${commons-io.version} - com.fasterxml.jackson.dataformat jackson-dataformat-xml ${jackson.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson.version} - com.fasterxml.jackson.datatype jackson-datatype-joda ${jackson.version} - com.fasterxml.jackson.module jackson-module-jsonSchema ${jackson.version} - joda-time joda-time ${joda-time.version} - com.google.code.gson gson ${gson.version} - io.rest-assured @@ -93,7 +81,6 @@ - io.rest-assured @@ -101,28 +88,24 @@ ${rest-assured-json-schema-validator.version} test - io.rest-assured json-path ${json-path.version} test - com.github.fge json-schema-validator ${json-schema-validator.version} test - org.assertj assertj-core ${assertj-core.version} test - @@ -140,7 +123,6 @@ 2.9.6 2.8.0 4.1 - 3.0.1 3.0.0 diff --git a/video-tutorials/pom.xml b/video-tutorials/pom.xml index 53ff0c6d89..52c4f2af2a 100644 --- a/video-tutorials/pom.xml +++ b/video-tutorials/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 video-tutorials 1.0.0-SNAPSHOT @@ -18,5 +19,4 @@ jackson-annotations - - + \ No newline at end of file diff --git a/vraptor/pom.xml b/vraptor/pom.xml index 9956305e98..ab78c0d97a 100644 --- a/vraptor/pom.xml +++ b/vraptor/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 vraptor 1.0.0 @@ -20,7 +21,6 @@ vraptor ${vraptor.version} - org.jboss.weld.servlet weld-servlet-core @@ -32,7 +32,6 @@ - org.jboss.weld weld-core-impl @@ -44,69 +43,58 @@ - javax.el el-api ${el.version} provided - org.hibernate hibernate-validator-cdi ${hibernate-validator.version} - javax.servlet jstl ${jstl.version} - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - org.slf4j slf4j-log4j12 ${slf4j-log4j12.version} - br.com.caelum.vraptor vraptor-freemarker ${vraptor-freemarker.version} - br.com.caelum.vraptor vraptor-hibernate ${vraptor-hibernate.version} - mysql mysql-connector-java ${mysql-connector.version} - org.mindrot jbcrypt ${jbcrypt.version} - org.freemarker freemarker ${freemarker.version} - diff --git a/webrtc/pom.xml b/webrtc/pom.xml index 191ff11dd6..9b238d75f2 100644 --- a/webrtc/pom.xml +++ b/webrtc/pom.xml @@ -1,10 +1,8 @@ - 4.0.0 - webrtc 0.0.1 @@ -31,4 +29,4 @@ - + \ No newline at end of file diff --git a/wicket/pom.xml b/wicket/pom.xml index 68bc2f3e6b..55baf64032 100644 --- a/wicket/pom.xml +++ b/wicket/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -23,7 +22,6 @@ wicket-core ${wicket.version} - org.eclipse.jetty.aggregate @@ -89,4 +87,4 @@ 2.6 - + \ No newline at end of file diff --git a/wildfly/pom.xml b/wildfly/pom.xml index 6d823bb4c9..c5d9bce37a 100644 --- a/wildfly/pom.xml +++ b/wildfly/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -76,4 +75,4 @@ - + \ No newline at end of file diff --git a/xml/pom.xml b/xml/pom.xml index d2fa5c0727..b4c78b514d 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -88,31 +87,26 @@ commons-io ${commons-io.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.jibx jibx-run ${jibx-version} - commons-lang commons-lang ${commons-lang.version} - org.junit.jupiter junit-jupiter @@ -270,7 +264,6 @@ - bindGen @@ -327,7 +320,8 @@ - + maven-assembly-plugin ${project.basedir} @@ -378,10 +372,9 @@ 0.9.6 2.4 - 1.3.1 3.8.0 - + \ No newline at end of file diff --git a/xstream/pom.xml b/xstream/pom.xml index 618df1a7c2..c4104d29c4 100644 --- a/xstream/pom.xml +++ b/xstream/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -35,4 +34,4 @@ 1.3.8 - + \ No newline at end of file From 4b1f2c50a521114fbe1563da8ada2682e27de521 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 17 May 2021 20:22:27 +0530 Subject: [PATCH 39/72] JAVA-5223: Fix formatting of POMs (Spring Security Modules) --- spring-security-modules/pom.xml | 9 +++-- .../spring-5-security-cognito/pom.xml | 6 +-- .../spring-5-security-oauth/pom.xml | 7 ++-- .../spring-5-security/pom.xml | 7 ++-- spring-security-modules/spring-ldap/pom.xml | 11 ++--- .../spring-security-acl/pom.xml | 7 ++-- .../spring-security-auth0/pom.xml | 34 ++++++++-------- .../cache-control/pom.xml | 6 +-- .../spring-security-config/cors/pom.xml | 8 ++-- .../spring-security-config/pom.xml | 7 ++-- .../spring-security-core/pom.xml | 5 ++- .../spring-security-ldap/pom.xml | 13 +++--- .../spring-security-legacy-oidc/pom.xml | 6 +-- .../spring-security-oauth2-sso/pom.xml | 7 ++-- .../spring-security-sso-auth-server/pom.xml | 7 ++-- .../spring-security-sso-kerberos/pom.xml | 8 ++-- .../spring-security-sso-ui-2/pom.xml | 13 ++---- .../spring-security-sso-ui/pom.xml | 14 ++----- .../spring-security-oidc/pom.xml | 2 +- .../spring-security-okta/pom.xml | 10 +++-- .../spring-security-saml/pom.xml | 4 +- .../server/pom.xml | 8 ++-- .../spring-security-web-boot-1/pom.xml | 9 ++--- .../spring-security-web-boot-2/pom.xml | 18 ++++----- .../spring-security-web-boot-3/pom.xml | 6 +-- .../spring-security-web-digest-auth/pom.xml | 30 ++------------ .../spring-security-web-login/pom.xml | 21 ++-------- .../spring-security-web-mvc-custom/pom.xml | 28 ++----------- .../spring-security-web-mvc/pom.xml | 13 ++---- .../pom.xml | 40 ++++--------------- .../spring-security-web-react/pom.xml | 29 +++----------- .../pom.xml | 35 ++-------------- .../spring-security-web-rest-custom/pom.xml | 33 ++------------- .../spring-security-web-rest/pom.xml | 37 +++-------------- .../spring-security-web-sockets/pom.xml | 14 ++----- .../spring-security-web-thymeleaf/pom.xml | 7 ++-- .../spring-security-web-x509/pom.xml | 7 ++-- .../pom.xml | 7 ++-- .../pom.xml | 7 ++-- .../spring-session/pom.xml | 7 ++-- .../spring-session-jdbc/pom.xml | 4 +- .../spring-session-mongodb/pom.xml | 8 +--- .../spring-session-redis/pom.xml | 7 ++-- .../spring-social-login/pom.xml | 22 ++-------- 44 files changed, 182 insertions(+), 406 deletions(-) diff --git a/spring-security-modules/pom.xml b/spring-security-modules/pom.xml index bb2702fc9d..0f4ba872ba 100644 --- a/spring-security-modules/pom.xml +++ b/spring-security-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-modules 0.0.1-SNAPSHOT @@ -37,7 +38,7 @@ spring-security-web-mvc-custom spring-security-web-mvc spring-security-web-persisted-remember-me - spring-security-web-react + spring-security-web-react spring-security-web-rest-basic-auth spring-security-web-rest-custom spring-security-web-rest @@ -48,4 +49,4 @@ spring-social-login - + \ No newline at end of file diff --git a/spring-security-modules/spring-5-security-cognito/pom.xml b/spring-security-modules/spring-5-security-cognito/pom.xml index 877dbd52fa..4da8b2fae5 100644 --- a/spring-security-modules/spring-5-security-cognito/pom.xml +++ b/spring-security-modules/spring-5-security-cognito/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-5-security-cognito @@ -32,7 +33,6 @@ org.thymeleaf.extras thymeleaf-extras-springsecurity5 - org.springframework.security @@ -62,4 +62,4 @@ com.baeldung.cognito.SpringCognitoApplication - + \ No newline at end of file diff --git a/spring-security-modules/spring-5-security-oauth/pom.xml b/spring-security-modules/spring-5-security-oauth/pom.xml index d31cf293a3..03e1880431 100644 --- a/spring-security-modules/spring-5-security-oauth/pom.xml +++ b/spring-security-modules/spring-5-security-oauth/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-5-security-oauth @@ -36,7 +37,6 @@ org.springframework.boot spring-boot-starter-jersey - org.springframework.security.oauth.boot @@ -51,7 +51,6 @@ org.springframework.security spring-security-oauth2-jose - org.springframework spring-test @@ -72,4 +71,4 @@ com.baeldung.oauth2.SpringOAuthApplication - + \ No newline at end of file diff --git a/spring-security-modules/spring-5-security/pom.xml b/spring-security-modules/spring-5-security/pom.xml index d009115c92..73b956d1e7 100644 --- a/spring-security-modules/spring-5-security/pom.xml +++ b/spring-security-modules/spring-5-security/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-5-security 0.0.1-SNAPSHOT @@ -76,4 +77,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-ldap/pom.xml b/spring-security-modules/spring-ldap/pom.xml index 60da7d4c0d..44f754673f 100644 --- a/spring-security-modules/spring-ldap/pom.xml +++ b/spring-security-modules/spring-ldap/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-ldap 0.1-SNAPSHOT @@ -14,7 +15,6 @@ - org.springframework.ldap spring-ldap-core @@ -26,13 +26,11 @@ - org.springframework spring-context ${spring-context.version} - org.springframework.ldap @@ -46,7 +44,6 @@ - org.apache.directory.server @@ -84,8 +81,6 @@ ${shared-ldap.version} test - - org.springframework.data diff --git a/spring-security-modules/spring-security-acl/pom.xml b/spring-security-modules/spring-security-acl/pom.xml index 5c04aaa9ca..7facc1b14b 100644 --- a/spring-security-modules/spring-security-acl/pom.xml +++ b/spring-security-modules/spring-security-acl/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-acl 0.0.1-SNAPSHOT @@ -58,4 +59,4 @@ 2.6.11 - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-auth0/pom.xml b/spring-security-modules/spring-security-auth0/pom.xml index 0bd879a40b..106a0db29f 100644 --- a/spring-security-modules/spring-security-auth0/pom.xml +++ b/spring-security-modules/spring-security-auth0/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-auth0 1.0-SNAPSHOT @@ -23,20 +24,20 @@ org.springframework.boot spring-boot-starter-security - - org.springframework.security - spring-security-core - - - org.springframework.security - spring-security-oauth2-resource-server - - - com.auth0 - mvc-auth-commons - ${mvc-auth-commons.version} - - + + org.springframework.security + spring-security-core + + + org.springframework.security + spring-security-oauth2-resource-server + + + com.auth0 + mvc-auth-commons + ${mvc-auth-commons.version} + + org.json json ${json.version} @@ -72,4 +73,5 @@ 20190722 1.2.0 + \ No newline at end of file diff --git a/spring-security-modules/spring-security-config/cache-control/pom.xml b/spring-security-modules/spring-security-config/cache-control/pom.xml index 753307493d..b10d65615e 100644 --- a/spring-security-modules/spring-security-config/cache-control/pom.xml +++ b/spring-security-modules/spring-security-config/cache-control/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 cache-control 1.0-SNAPSHOT @@ -26,7 +27,6 @@ org.springframework.boot spring-boot-starter-security - org.springframework.boot spring-boot-starter-test diff --git a/spring-security-modules/spring-security-config/cors/pom.xml b/spring-security-modules/spring-security-config/cors/pom.xml index 175b21a77d..2b8efb9add 100644 --- a/spring-security-modules/spring-security-config/cors/pom.xml +++ b/spring-security-modules/spring-security-config/cors/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 cors cors @@ -35,7 +36,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -57,4 +57,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-config/pom.xml b/spring-security-modules/spring-security-config/pom.xml index 2b6b6b6b4e..860a602aeb 100644 --- a/spring-security-modules/spring-security-config/pom.xml +++ b/spring-security-modules/spring-security-config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-config 0.0.1-SNAPSHOT @@ -19,4 +20,4 @@ cors - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-core/pom.xml b/spring-security-modules/spring-security-core/pom.xml index 9f1e7cda29..0eb70c0853 100644 --- a/spring-security-modules/spring-security-core/pom.xml +++ b/spring-security-modules/spring-security-core/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-security-core @@ -99,4 +100,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-ldap/pom.xml b/spring-security-modules/spring-security-ldap/pom.xml index baed682186..3755c33125 100644 --- a/spring-security-modules/spring-security-ldap/pom.xml +++ b/spring-security-modules/spring-security-ldap/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-ldap 0.1-SNAPSHOT @@ -15,7 +16,6 @@ - org.springframework.boot @@ -33,24 +33,21 @@ org.springframework.boot spring-boot-starter-actuator - org.springframework.security spring-security-ldap - org.apache.directory.server apacheds-server-jndi ${apacheds.version} - - spring-security-mvc-ldap + spring-security-ldap src/main/resources @@ -63,4 +60,4 @@ 1.5.5 - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-legacy-oidc/pom.xml b/spring-security-modules/spring-security-legacy-oidc/pom.xml index a4ead0f6e0..148b836137 100644 --- a/spring-security-modules/spring-security-legacy-oidc/pom.xml +++ b/spring-security-modules/spring-security-legacy-oidc/pom.xml @@ -24,24 +24,20 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-tomcat - org.springframework.security.oauth spring-security-oauth2 ${spring-security-oauth2.version} - org.springframework.security spring-security-jwt ${spring-security-jwt.version} - com.auth0 jwks-rsa @@ -55,4 +51,4 @@ 0.3.0 - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-oauth2-sso/pom.xml b/spring-security-modules/spring-security-oauth2-sso/pom.xml index a272ba5b50..c9f9274c98 100644 --- a/spring-security-modules/spring-security-oauth2-sso/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-security-oauth2-sso @@ -30,4 +31,4 @@ 2.0.0-M2 - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml index 20a43eaf04..1a8d1b580f 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-auth-server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-sso-auth-server spring-security-sso-auth-server @@ -24,4 +25,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml index f17ca171a5..c18769df1e 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-kerberos/pom.xml @@ -1,7 +1,7 @@ + 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 spring-security-sso-kerberos @@ -91,9 +91,9 @@ - + - com.baeldung.intro.Application + com.baeldung.intro.Application \ No newline at end of file diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml index 514dd0d0f7..cd510a972a 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-sso-ui-2 spring-security-sso-ui-2 @@ -13,33 +14,27 @@ - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-security - org.springframework.security.oauth.boot spring-security-oauth2-autoconfigure ${oauth-auto.version} - org.springframework.boot spring-boot-starter-thymeleaf - org.thymeleaf.extras thymeleaf-extras-springsecurity5 - - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml index 5076b1878b..ec2da615f4 100644 --- a/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml +++ b/spring-security-modules/spring-security-oauth2-sso/spring-security-sso-ui/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-sso-ui spring-security-sso-ui @@ -13,34 +14,27 @@ - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-security - org.springframework.security.oauth.boot spring-security-oauth2-autoconfigure ${oauth-auto.version} - - org.springframework.boot spring-boot-starter-thymeleaf - org.thymeleaf.extras thymeleaf-extras-springsecurity5 - - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-oidc/pom.xml b/spring-security-modules/spring-security-oidc/pom.xml index b9a4b340a3..2a413b1d27 100644 --- a/spring-security-modules/spring-security-oidc/pom.xml +++ b/spring-security-modules/spring-security-oidc/pom.xml @@ -26,4 +26,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-okta/pom.xml b/spring-security-modules/spring-security-okta/pom.xml index c5ff9013b5..98b8abedb4 100644 --- a/spring-security-modules/spring-security-okta/pom.xml +++ b/spring-security-modules/spring-security-okta/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-okta 1.0-SNAPSHOT @@ -55,8 +56,9 @@ - + 1.4.0 - + + \ No newline at end of file diff --git a/spring-security-modules/spring-security-saml/pom.xml b/spring-security-modules/spring-security-saml/pom.xml index 561582045a..8a9b418374 100644 --- a/spring-security-modules/spring-security-saml/pom.xml +++ b/spring-security-modules/spring-security-saml/pom.xml @@ -14,6 +14,7 @@ 0.0.1-SNAPSHOT ../../parent-boot-2 + Shibboleth @@ -70,4 +71,5 @@ 1.0.10.RELEASE - + + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-angular/server/pom.xml b/spring-security-modules/spring-security-web-angular/server/pom.xml index 07d5d44e8d..2e9ff9969d 100644 --- a/spring-security-modules/spring-security-web-angular/server/pom.xml +++ b/spring-security-modules/spring-security-web-angular/server/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 server 0.0.1-SNAPSHOT @@ -40,7 +41,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -62,4 +62,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-boot-1/pom.xml b/spring-security-modules/spring-security-web-boot-1/pom.xml index 1f80b62765..a376a49b4c 100644 --- a/spring-security-modules/spring-security-web-boot-1/pom.xml +++ b/spring-security-modules/spring-security-web-boot-1/pom.xml @@ -1,7 +1,7 @@ + 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 spring-security-web-boot-1 0.0.1-SNAPSHOT @@ -223,10 +223,9 @@ com.baeldung.roles.custom.Application - + - 1.1.2 1.6.1 2.6.11 diff --git a/spring-security-modules/spring-security-web-boot-2/pom.xml b/spring-security-modules/spring-security-web-boot-2/pom.xml index ca357509a3..ade644741d 100644 --- a/spring-security-modules/spring-security-web-boot-2/pom.xml +++ b/spring-security-modules/spring-security-web-boot-2/pom.xml @@ -1,7 +1,7 @@ + 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 spring-security-web-boot-2 0.0.1-SNAPSHOT @@ -184,7 +184,6 @@ - entryPoints @@ -222,19 +221,18 @@ - + com.baeldung.multiplelogin.MultipleLoginApplication - + - + - 1.1.2 1.6.1 2.6.11 - + \ 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 a6e2b48d75..1fff259c16 100644 --- a/spring-security-modules/spring-security-web-boot-3/pom.xml +++ b/spring-security-modules/spring-security-web-boot-3/pom.xml @@ -1,7 +1,7 @@ + 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 spring-security-web-boot-3 0.0.1-SNAPSHOT @@ -27,4 +27,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-digest-auth/pom.xml b/spring-security-modules/spring-security-web-digest-auth/pom.xml index 39433c1295..710a3dd3b6 100644 --- a/spring-security-modules/spring-security-web-digest-auth/pom.xml +++ b/spring-security-modules/spring-security-web-digest-auth/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-security-web-digest-auth @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -28,9 +27,7 @@ spring-security-config ${org.springframework.security.version} - - org.springframework spring-core @@ -72,7 +69,6 @@ spring-expression ${spring.version} - org.springframework spring-web @@ -83,37 +79,30 @@ spring-webmvc ${spring.version} - org.springframework spring-oxm ${spring.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - - com.google.guava guava ${guava.version} - org.apache.httpcomponents httpcore @@ -125,7 +114,6 @@ - org.apache.httpcomponents httpclient @@ -137,35 +125,28 @@ - - org.springframework spring-test ${spring.version} test - - - spring-security-mvc-digest-auth + spring-security-web-digest-auth src/main/resources true - - org.apache.maven.plugins maven-war-plugin ${maven-war-plugin.version} - org.codehaus.cargo cargo-maven2-plugin @@ -186,21 +167,16 @@ - - 4.2.6.RELEASE - 19.0 - 4.4.5 4.5.2 - 1.6.1 diff --git a/spring-security-modules/spring-security-web-login/pom.xml b/spring-security-modules/spring-security-web-login/pom.xml index 2b64d157d3..ac5393c1a0 100644 --- a/spring-security-modules/spring-security-web-login/pom.xml +++ b/spring-security-modules/spring-security-web-login/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-security-web-login @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -33,9 +32,7 @@ spring-security-taglibs ${spring-security.version} - - org.springframework spring-core @@ -77,7 +74,6 @@ spring-expression ${spring.version} - org.springframework spring-web @@ -88,25 +84,20 @@ spring-webmvc ${spring.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - - org.springframework spring-test @@ -119,20 +110,17 @@ ${spring-security.version} test - - spring-security-mvc-login + spring-security-web-login src/main/resources true - - org.apache.maven.plugins maven-war-plugin @@ -147,7 +135,6 @@ - org.codehaus.cargo cargo-maven2-plugin @@ -168,9 +155,7 @@ - - diff --git a/spring-security-modules/spring-security-web-mvc-custom/pom.xml b/spring-security-modules/spring-security-web-mvc-custom/pom.xml index bd4a800bc5..539f83d7b8 100644 --- a/spring-security-modules/spring-security-web-mvc-custom/pom.xml +++ b/spring-security-modules/spring-security-web-mvc-custom/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-security-web-mvc-custom @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -33,9 +32,7 @@ spring-security-taglibs ${spring-security.version} - - org.springframework spring-core @@ -77,7 +74,6 @@ spring-expression ${spring.version} - org.springframework spring-web @@ -88,59 +84,48 @@ spring-webmvc ${spring.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - com.google.guava guava ${guava.version} - - org.springframework spring-test ${spring.version} test - org.springframework.security spring-security-test @@ -150,22 +135,19 @@ - spring-security-mvc-custom + spring-security-web-mvc-custom src/main/resources true - - org.apache.maven.plugins maven-war-plugin ${maven-war-plugin.version} - org.codehaus.cargo cargo-maven2-plugin @@ -186,18 +168,14 @@ - - 19.0 - 1.6.1 - \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-mvc/pom.xml b/spring-security-modules/spring-security-web-mvc/pom.xml index b1e94b2db3..505826d1a2 100644 --- a/spring-security-modules/spring-security-web-mvc/pom.xml +++ b/spring-security-modules/spring-security-web-mvc/pom.xml @@ -1,7 +1,7 @@ + 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 spring-security-web-mvc 0.1-SNAPSHOT @@ -16,9 +16,7 @@ - - org.springframework.boot spring-boot-starter-security @@ -27,7 +25,6 @@ org.springframework.security spring-security-taglibs - org.springframework.boot @@ -42,19 +39,16 @@ org.springframework.boot spring-boot-starter-tomcat - javax.servlet jstl runtime - io.dropwizard.metrics metrics-core - org.springframework.boot @@ -67,7 +61,6 @@ ${javax.version} - @@ -86,4 +79,4 @@ 4.0.1 - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-persisted-remember-me/pom.xml b/spring-security-modules/spring-security-web-persisted-remember-me/pom.xml index 25c5ddd9d0..66a2b3866b 100644 --- a/spring-security-modules/spring-security-web-persisted-remember-me/pom.xml +++ b/spring-security-modules/spring-security-web-persisted-remember-me/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-security-web-persisted-remember-me @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -38,9 +37,7 @@ spring-orm ${spring.version} - - org.springframework spring-core @@ -82,7 +79,6 @@ spring-expression ${spring.version} - org.springframework spring-web @@ -93,81 +89,66 @@ spring-webmvc ${spring.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - - com.h2database h2 ${h2.version} - org.postgresql postgresql ${postgresql.version} runtime - - com.google.guava guava ${guava.version} - - org.springframework.boot - spring-boot-starter-test - ${spring-boot.version} - test - - + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + test + - - - spring-security-mvc-persisted-remember-me + spring-security-web-persisted-remember-me src/main/resources true - - org.apache.maven.plugins maven-war-plugin ${maven-war-plugin.version} - org.codehaus.cargo cargo-maven2-plugin @@ -188,21 +169,16 @@ - - 4.2.6.RELEASE - 9.4.1212 - 19.0 - 1.6.1 1.5.10.RELEASE diff --git a/spring-security-modules/spring-security-web-react/pom.xml b/spring-security-modules/spring-security-web-react/pom.xml index 663c7d76c3..e8f74413ff 100644 --- a/spring-security-modules/spring-security-web-react/pom.xml +++ b/spring-security-modules/spring-security-web-react/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-web-react 0.1-SNAPSHOT @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -33,9 +32,7 @@ spring-security-taglibs ${spring-security.version} - - org.springframework spring-core @@ -56,7 +53,6 @@ spring-aop ${spring.version} - org.springframework spring-web @@ -67,9 +63,7 @@ spring-webmvc ${spring.version} - - javax.servlet javax.servlet-api @@ -82,7 +76,6 @@ ${jstl.version} runtime - org.springframework.boot @@ -90,20 +83,17 @@ 1.5.10.RELEASE test - - spring-security-react + spring-security-web-react src/main/resources true - - org.apache.maven.plugins maven-war-plugin @@ -118,7 +108,6 @@ - com.github.eirslett frontend-maven-plugin @@ -152,27 +141,22 @@ - org.eclipse.jetty jetty-maven-plugin 9.4.11.v20180605 - - default-first - com.github.eirslett frontend-maven-plugin - install node and npm @@ -193,13 +177,11 @@ default-second - com.github.eirslett frontend-maven-plugin - install node and npm @@ -223,14 +205,13 @@ 19.0 - 2.7 1.6 9.4.11.v20180605 - v8.11.3 6.1.0 + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-rest-basic-auth/pom.xml b/spring-security-modules/spring-security-web-rest-basic-auth/pom.xml index 0dc0b9cc42..de28df1933 100644 --- a/spring-security-modules/spring-security-web-rest-basic-auth/pom.xml +++ b/spring-security-modules/spring-security-web-rest-basic-auth/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-security-web-rest-basic-auth @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -28,9 +27,7 @@ spring-security-config ${spring-security.version} - - org.springframework spring-core @@ -72,7 +69,6 @@ spring-expression ${spring.version} - org.springframework spring-web @@ -83,23 +79,18 @@ spring-webmvc ${spring.version} - org.springframework spring-oxm ${spring.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - - @@ -111,7 +102,6 @@ - org.apache.httpcomponents httpcore @@ -123,7 +113,6 @@ - org.apache.httpcomponents httpclient @@ -135,59 +124,48 @@ - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - - com.google.guava guava ${guava.version} - - org.springframework spring-test ${spring.version} test - - spring-security-rest-basic-auth + spring-security-web-rest-basic-auth src/main/resources true - - org.apache.maven.plugins maven-war-plugin ${maven-war-plugin.version} - org.codehaus.cargo cargo-maven2-plugin @@ -208,9 +186,7 @@ - - @@ -238,7 +214,6 @@ - org.apache.maven.plugins maven-surefire-plugin @@ -262,21 +237,17 @@ - - 4.4.11 4.5.8 - 19.0 - 1.6.1 diff --git a/spring-security-modules/spring-security-web-rest-custom/pom.xml b/spring-security-modules/spring-security-web-rest-custom/pom.xml index 0ba7f95de7..85e50412ad 100644 --- a/spring-security-modules/spring-security-web-rest-custom/pom.xml +++ b/spring-security-modules/spring-security-web-rest-custom/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-web-rest-custom 0.1-SNAPSHOT @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -34,9 +33,7 @@ org.thymeleaf thymeleaf-spring5 - - org.springframework spring-core @@ -65,7 +62,6 @@ org.springframework spring-expression - org.springframework spring-web @@ -74,53 +70,41 @@ org.springframework spring-webmvc - org.springframework spring-oxm - commons-logging commons-logging ${commons-logging.version} - - com.fasterxml.jackson.core jackson-databind - - javax.servlet javax.servlet-api provided - javax.servlet jstl runtime - - org.apache.httpcomponents httpcore - org.apache.httpcomponents httpclient - - com.google.guava guava @@ -131,32 +115,27 @@ commons-lang3 ${commons-lang3.version} - - org.hamcrest hamcrest test - org.mockito mockito-core test - - spring-security-rest-custom + spring-security-web-rest-custom src/main/resources true - org.springframework.boot @@ -172,7 +151,6 @@ false - org.codehaus.cargo cargo-maven2-plugin @@ -193,16 +171,13 @@ - - 19.0 1.2 - 1.6.1 diff --git a/spring-security-modules/spring-security-web-rest/pom.xml b/spring-security-modules/spring-security-web-rest/pom.xml index 2330243aa6..c3f2c09e9e 100644 --- a/spring-security-modules/spring-security-web-rest/pom.xml +++ b/spring-security-modules/spring-security-web-rest/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-web-rest 0.1-SNAPSHOT @@ -15,9 +16,7 @@ - - org.springframework.security spring-security-web @@ -28,9 +27,7 @@ spring-security-config ${spring-security.version} - - org.springframework spring-core @@ -72,7 +69,6 @@ spring-expression ${spring.version} - org.springframework spring-web @@ -83,37 +79,30 @@ spring-webmvc ${spring.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - javax.validation validation-api ${javax.validation.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - com.google.guava @@ -125,7 +114,6 @@ commons-lang3 ${commons-lang3.version} - org.springframework @@ -133,15 +121,12 @@ ${spring.version} test - org.springframework.security spring-security-test ${spring-security.version} test - - com.jayway.restassured rest-assured @@ -154,37 +139,32 @@ - io.springfox springfox-swagger2 ${springfox-swagger.version} - io.springfox springfox-swagger-ui ${springfox-swagger.version} - commons-fileupload commons-fileupload ${commons-fileupload.version} - - spring-security-rest + spring-security-web-rest src/main/resources true - org.codehaus.cargo @@ -205,9 +185,7 @@ - - @@ -235,7 +213,6 @@ - org.apache.maven.plugins maven-surefire-plugin @@ -267,18 +244,14 @@ 1.1.0.Final - 26.0-jre - 2.9.0 - 2.9.2 - 1.6.1 - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-sockets/pom.xml b/spring-security-modules/spring-security-web-sockets/pom.xml index 4aecf296b4..e822b6beda 100644 --- a/spring-security-modules/spring-security-web-sockets/pom.xml +++ b/spring-security-modules/spring-security-web-sockets/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.springsecuredsockets spring-security-web-sockets @@ -50,7 +51,6 @@ - org.springframework.security @@ -62,7 +62,6 @@ spring-security-config ${spring-security.version} - org.springframework.data @@ -79,7 +78,6 @@ h2 ${h2.version} - org.springframework @@ -96,7 +94,6 @@ spring-security-messaging ${spring-security.version} - org.slf4j @@ -108,7 +105,6 @@ logback-classic ${logback-classic.version} - javax.servlet @@ -130,7 +126,6 @@ jstl ${jstl.version} - com.fasterxml.jackson.core @@ -147,7 +142,6 @@ jackson-annotations ${jackson.version} - org.springframework.boot @@ -158,7 +152,7 @@ - spring-security-mvc-socket + spring-security-web-sockets org.apache.tomcat.maven diff --git a/spring-security-modules/spring-security-web-thymeleaf/pom.xml b/spring-security-modules/spring-security-web-thymeleaf/pom.xml index 196ec0b86f..8e6e0856af 100644 --- a/spring-security-modules/spring-security-web-thymeleaf/pom.xml +++ b/spring-security-modules/spring-security-web-thymeleaf/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-web-thymeleaf 0.0.1-SNAPSHOT @@ -54,4 +55,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-x509/pom.xml b/spring-security-modules/spring-security-web-x509/pom.xml index 045c0aba6a..5282ab7d83 100644 --- a/spring-security-modules/spring-security-web-x509/pom.xml +++ b/spring-security-modules/spring-security-web-x509/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-web-x509 0.0.1-SNAPSHOT @@ -34,4 +35,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-x509/spring-security-web-x509-basic-auth/pom.xml b/spring-security-modules/spring-security-web-x509/spring-security-web-x509-basic-auth/pom.xml index 917ffa6b0e..9598843b63 100644 --- a/spring-security-modules/spring-security-web-x509/spring-security-web-x509-basic-auth/pom.xml +++ b/spring-security-modules/spring-security-web-x509/spring-security-web-x509-basic-auth/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-web-x509-basic-auth 0.0.1-SNAPSHOT @@ -35,4 +36,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-security-web-x509/spring-security-web-x509-client-auth/pom.xml b/spring-security-modules/spring-security-web-x509/spring-security-web-x509-client-auth/pom.xml index fdbc90c0f6..f310ab1e5c 100644 --- a/spring-security-modules/spring-security-web-x509/spring-security-web-x509-client-auth/pom.xml +++ b/spring-security-modules/spring-security-web-x509/spring-security-web-x509-client-auth/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-security-web-x509-client-auth 0.0.1-SNAPSHOT @@ -71,4 +72,4 @@ - + \ No newline at end of file diff --git a/spring-security-modules/spring-session/pom.xml b/spring-security-modules/spring-session/pom.xml index ac10700240..aec64da088 100644 --- a/spring-security-modules/spring-session/pom.xml +++ b/spring-security-modules/spring-session/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung spring-session @@ -21,4 +22,4 @@ spring-session-mongodb - + \ No newline at end of file diff --git a/spring-security-modules/spring-session/spring-session-jdbc/pom.xml b/spring-security-modules/spring-session/spring-session-jdbc/pom.xml index 95c366fc2e..64bbce44f2 100644 --- a/spring-security-modules/spring-session/spring-session-jdbc/pom.xml +++ b/spring-security-modules/spring-session/spring-session-jdbc/pom.xml @@ -1,7 +1,7 @@ + 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 spring-session-jdbc 0.0.1-SNAPSHOT diff --git a/spring-security-modules/spring-session/spring-session-mongodb/pom.xml b/spring-security-modules/spring-session/spring-session-mongodb/pom.xml index 82c8520356..878dfeb690 100644 --- a/spring-security-modules/spring-session/spring-session-mongodb/pom.xml +++ b/spring-security-modules/spring-session/spring-session-mongodb/pom.xml @@ -1,7 +1,7 @@ + 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 spring-session-mongodb 0.0.1-SNAPSHOT @@ -21,23 +21,19 @@ org.springframework.boot spring-boot-starter-web - org.springframework.session spring-session-data-mongodb - org.springframework.boot spring-boot-starter-data-mongodb - org.springframework.boot spring-boot-starter-test test - de.flapdoodle.embed de.flapdoodle.embed.mongo diff --git a/spring-security-modules/spring-session/spring-session-redis/pom.xml b/spring-security-modules/spring-session/spring-session-redis/pom.xml index 36eb632e1c..6824a3632d 100644 --- a/spring-security-modules/spring-session/spring-session-redis/pom.xml +++ b/spring-security-modules/spring-session/spring-session-redis/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-session-redis 1.0.0-SNAPSHOT @@ -36,7 +37,7 @@ embedded-redis ${embedded-redis.version} - + redis.clients jedis jar diff --git a/spring-security-modules/spring-social-login/pom.xml b/spring-security-modules/spring-social-login/pom.xml index 209a546a5a..ad4b7c72a6 100644 --- a/spring-security-modules/spring-social-login/pom.xml +++ b/spring-security-modules/spring-social-login/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-social-login spring-social-login @@ -14,68 +15,54 @@ - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-thymeleaf - org.springframework.security spring-security-web - org.springframework.security spring-security-config - org.springframework.security spring-security-taglibs - org.thymeleaf.extras thymeleaf-extras-springsecurity5 - - org.springframework.social spring-social-facebook ${spring.social.facebook.version} - org.springframework.boot spring-boot-starter-data-jpa - com.h2database h2 - - org.springframework spring-test test - org.apache.commons commons-lang3 ${commons-lang3.version} - @@ -86,7 +73,6 @@ true - org.apache.maven.plugins @@ -94,7 +80,7 @@ - + 2.0.3.RELEASE From e5aba6f8616aaaa1c63a5bbecb8a1cd5677a68ab Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 17 May 2021 20:23:08 +0530 Subject: [PATCH 40/72] JAVA-5223: Fix formatting of POMs (Other Spring Modules) --- spring-shell/pom.xml | 7 +- spring-sleuth/pom.xml | 7 +- spring-soap/pom.xml | 9 +- spring-spel/pom.xml | 5 +- spring-state-machine/pom.xml | 5 +- spring-static-resources/pom.xml | 17 +--- spring-swagger-codegen/pom.xml | 7 +- .../pom.xml | 90 +++++++++---------- .../spring-swagger-codegen-api-client/pom.xml | 13 +-- .../spring-swagger-codegen-app/pom.xml | 7 +- spring-threads/pom.xml | 7 +- spring-vault/pom.xml | 8 +- spring-vertx/pom.xml | 9 +- spring-webflux-amqp/pom.xml | 13 ++- spring-websockets/pom.xml | 7 +- 15 files changed, 96 insertions(+), 115 deletions(-) diff --git a/spring-shell/pom.xml b/spring-shell/pom.xml index be1562b942..4e64436486 100644 --- a/spring-shell/pom.xml +++ b/spring-shell/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-shell 0.1-SNAPSHOT @@ -26,4 +27,4 @@ 1.2.0.RELEASE - + \ No newline at end of file diff --git a/spring-sleuth/pom.xml b/spring-sleuth/pom.xml index c37086558d..5fd109e968 100644 --- a/spring-sleuth/pom.xml +++ b/spring-sleuth/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-sleuth 1.0.0-SNAPSHOT @@ -41,4 +42,4 @@ 2.0.2.RELEASE - + \ No newline at end of file diff --git a/spring-soap/pom.xml b/spring-soap/pom.xml index bea3d033e6..8188178d61 100644 --- a/spring-soap/pom.xml +++ b/spring-soap/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-soap 1.0.0 @@ -37,7 +38,6 @@ org.springframework.boot spring-boot-maven-plugin - org.codehaus.mojo @@ -58,7 +58,6 @@ - org.jvnet.jaxb2.maven2 maven-jaxb2-plugin @@ -84,4 +83,4 @@ - + \ No newline at end of file diff --git a/spring-spel/pom.xml b/spring-spel/pom.xml index 2109117a86..9ea51cd796 100644 --- a/spring-spel/pom.xml +++ b/spring-spel/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-spel 1.0-SNAPSHOT diff --git a/spring-state-machine/pom.xml b/spring-state-machine/pom.xml index acb14a7613..bc2b67cc38 100644 --- a/spring-state-machine/pom.xml +++ b/spring-state-machine/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-state-machine spring-state-machine diff --git a/spring-static-resources/pom.xml b/spring-static-resources/pom.xml index 662c757f54..2841da9028 100644 --- a/spring-static-resources/pom.xml +++ b/spring-static-resources/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-static-resources 0.1.0-SNAPSHOT @@ -31,7 +32,6 @@ spring-security-taglibs ${spring-security.version} - org.springframework @@ -74,7 +74,6 @@ spring-expression ${spring.version} - org.springframework spring-web @@ -85,7 +84,6 @@ spring-webmvc ${spring.version} - org.aspectj @@ -97,7 +95,6 @@ javax.inject ${inject.version} - javax.servlet @@ -119,41 +116,35 @@ jackson-databind ${jackson.version} - org.hibernate hibernate-validator ${hibernate-validator.version} - joda-time joda-time ${joda-time.version} - com.github.jknack handlebars ${handlebars.version} - commons-io commons-io ${commons-io.version} - org.springframework spring-test ${spring.version} test - @@ -204,14 +195,12 @@ 1.8.9 2.3.2-b02 - 6.0.10.Final 4.1.0 2.10 4.0.1 1 - 1.5.1 diff --git a/spring-swagger-codegen/pom.xml b/spring-swagger-codegen/pom.xml index 39d8902956..93cb51d07c 100644 --- a/spring-swagger-codegen/pom.xml +++ b/spring-swagger-codegen/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-swagger-codegen 0.0.1-SNAPSHOT @@ -19,4 +20,4 @@ spring-swagger-codegen-app - + \ No newline at end of file diff --git a/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml index 3074849e4c..c3e694ba80 100644 --- a/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml +++ b/spring-swagger-codegen/spring-openapi-generator-api-client/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.baeldung spring-openapi-generator-api-client @@ -13,7 +14,6 @@ scm:git:git@github.com:openapitools/openapi-generator.git https://github.com/openapitools/openapi-generator - Unlicense @@ -21,7 +21,6 @@ repo - OpenAPI-Generator Contributors @@ -31,51 +30,24 @@ - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - io.swagger swagger-annotations ${swagger-annotations-version} - com.google.code.findbugs jsr305 3.0.2 - org.springframework spring-web ${spring-web-version} - com.fasterxml.jackson.core @@ -102,17 +74,16 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + junit @@ -174,7 +145,6 @@ - org.apache.maven.plugins @@ -191,7 +161,6 @@ - org.codehaus.mojo build-helper-maven-plugin @@ -228,8 +197,8 @@ maven-compiler-plugin 3.6.1 - 1.8 - 1.8 + 1.8 + 1.8 @@ -261,14 +230,39 @@ + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + 1.5.22 4.3.9.RELEASE 2.11.1 - + 0.2.1 2.9.10 1.0.0 4.13 - + + \ No newline at end of file diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml index b9b97139d6..c9ba912feb 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml @@ -1,19 +1,18 @@ - + 4.0.0 spring-swagger-codegen-api-client spring-swagger-codegen-api-client jar https://github.com/swagger-api/swagger-codegen Swagger Java - scm:git:git@github.com:swagger-api/swagger-codegen.git scm:git:git@github.com:swagger-api/swagger-codegen.git https://github.com/swagger-api/swagger-codegen - Unlicense @@ -21,7 +20,6 @@ repo - Swagger @@ -44,14 +42,12 @@ swagger-annotations ${swagger-annotations-version} - org.springframework spring-web ${spring-web-version} - com.fasterxml.jackson.core @@ -103,7 +99,6 @@ - org.codehaus.mojo build-helper-maven-plugin @@ -199,4 +194,4 @@ 1.10 - + \ No newline at end of file diff --git a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml index cb3fe89c8f..493b7201ee 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-swagger-codegen-app spring-swagger-codegen-app @@ -46,4 +47,4 @@ 1.5.10.RELEASE - + \ No newline at end of file diff --git a/spring-threads/pom.xml b/spring-threads/pom.xml index 4513c627b9..31984bfbf5 100644 --- a/spring-threads/pom.xml +++ b/spring-threads/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-threads 0.0.1-SNAPSHOT @@ -22,4 +23,4 @@ - + \ No newline at end of file diff --git a/spring-vault/pom.xml b/spring-vault/pom.xml index a39c5575a9..759de80a6b 100644 --- a/spring-vault/pom.xml +++ b/spring-vault/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 spring-vault 0.0.1-SNAPSHOT @@ -41,4 +41,4 @@ 2.1.1.RELEASE - + \ No newline at end of file diff --git a/spring-vertx/pom.xml b/spring-vertx/pom.xml index ef169c9a27..bd2dfa6cf6 100644 --- a/spring-vertx/pom.xml +++ b/spring-vertx/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-vertx spring-vertx @@ -29,13 +30,11 @@ - io.vertx vertx-web ${vertx.version} - com.h2database h2 @@ -61,4 +60,4 @@ 3.4.1 - + \ No newline at end of file diff --git a/spring-webflux-amqp/pom.xml b/spring-webflux-amqp/pom.xml index 7a7f6ef600..498556da2d 100755 --- a/spring-webflux-amqp/pom.xml +++ b/spring-webflux-amqp/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spring spring-webflux-amqp @@ -22,7 +23,7 @@ org.springframework.boot spring-boot-dependencies - + 2.1.3.RELEASE pom import @@ -39,25 +40,21 @@ org.springframework.boot spring-boot-starter-webflux - org.springframework.boot spring-boot-configuration-processor true - org.springframework.boot spring-boot-starter-test test - io.projectreactor reactor-test test - org.springframework.boot spring-boot-starter-integration @@ -73,4 +70,4 @@ - + \ No newline at end of file diff --git a/spring-websockets/pom.xml b/spring-websockets/pom.xml index d2a32a8eb6..a28ef8749a 100644 --- a/spring-websockets/pom.xml +++ b/spring-websockets/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-websockets spring-websockets @@ -43,4 +44,4 @@ - + \ No newline at end of file From 5b49805e3c8bfdd659c0bd98f4427b1e3f0c4bf9 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 17 May 2021 20:23:25 +0530 Subject: [PATCH 41/72] JAVA-5223: Fix formatting of POMs (Spring Web Modules) --- spring-web-modules/pom.xml | 9 ++-- spring-web-modules/spring-5-mvc/pom.xml | 6 +-- spring-web-modules/spring-boot-jsp/pom.xml | 20 ++++----- .../spring-mvc-basics-2/pom.xml | 12 ++--- .../spring-mvc-basics-3/pom.xml | 19 ++------ .../spring-mvc-basics-4/pom.xml | 4 +- spring-web-modules/spring-mvc-basics/pom.xml | 9 ++-- spring-web-modules/spring-mvc-crash/pom.xml | 27 +---------- .../spring-mvc-forms-jsp/pom.xml | 10 ++--- .../spring-mvc-forms-thymeleaf/pom.xml | 8 ++-- spring-web-modules/spring-mvc-java-2/pom.xml | 7 ++- spring-web-modules/spring-mvc-java/pom.xml | 26 ++--------- .../spring-mvc-velocity/pom.xml | 16 ++----- spring-web-modules/spring-mvc-views/pom.xml | 11 +---- spring-web-modules/spring-mvc-webflow/pom.xml | 16 +++---- spring-web-modules/spring-mvc-xml/pom.xml | 25 +---------- .../spring-rest-angular/pom.xml | 7 +-- spring-web-modules/spring-rest-http-2/pom.xml | 7 +-- spring-web-modules/spring-rest-http/pom.xml | 10 ++--- .../spring-rest-query-language/pom.xml | 45 ++----------------- spring-web-modules/spring-rest-shell/pom.xml | 8 ++-- spring-web-modules/spring-rest-simple/pom.xml | 27 ++--------- .../spring-rest-testing/pom.xml | 28 ++---------- .../spring-resttemplate-2/pom.xml | 14 ++---- .../spring-resttemplate-3/pom.xml | 7 +-- .../spring-resttemplate/pom.xml | 29 ++---------- spring-web-modules/spring-thymeleaf-2/pom.xml | 9 ++-- spring-web-modules/spring-thymeleaf-3/pom.xml | 8 ++-- spring-web-modules/spring-thymeleaf/pom.xml | 18 ++------ 29 files changed, 112 insertions(+), 330 deletions(-) diff --git a/spring-web-modules/pom.xml b/spring-web-modules/pom.xml index ca96dcff35..e498185c5e 100644 --- a/spring-web-modules/pom.xml +++ b/spring-web-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-web-modules 0.0.1-SNAPSHOT @@ -18,7 +19,7 @@ spring-mvc-basics spring-mvc-basics-2 spring-mvc-basics-3 - spring-mvc-basics-4 + spring-mvc-basics-4 spring-mvc-crash spring-mvc-forms-jsp spring-mvc-forms-thymeleaf @@ -44,4 +45,4 @@ spring-boot-jsp - + \ No newline at end of file diff --git a/spring-web-modules/spring-5-mvc/pom.xml b/spring-web-modules/spring-5-mvc/pom.xml index ddcce8207b..79a4f73ace 100644 --- a/spring-web-modules/spring-5-mvc/pom.xml +++ b/spring-web-modules/spring-5-mvc/pom.xml @@ -1,7 +1,7 @@ + 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 spring-5-mvc spring-5-mvc @@ -96,4 +96,4 @@ 0.18 - + \ No newline at end of file diff --git a/spring-web-modules/spring-boot-jsp/pom.xml b/spring-web-modules/spring-boot-jsp/pom.xml index d646b6058a..30335fcc65 100644 --- a/spring-web-modules/spring-boot-jsp/pom.xml +++ b/spring-web-modules/spring-boot-jsp/pom.xml @@ -1,7 +1,7 @@ + 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 spring-boot-jsp 0.0.1-SNAPSHOT @@ -35,8 +35,8 @@ org.apache.tomcat.embed tomcat-embed-jasper - - + + org.projectlombok @@ -48,12 +48,12 @@ org.springframework.boot spring-boot-starter-web - - - - - - + + + + + + org.springframework.boot spring-boot-starter-test diff --git a/spring-web-modules/spring-mvc-basics-2/pom.xml b/spring-web-modules/spring-mvc-basics-2/pom.xml index adc42d8db8..9136676d20 100644 --- a/spring-web-modules/spring-mvc-basics-2/pom.xml +++ b/spring-web-modules/spring-mvc-basics-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mvc-basics-2 0.0.1-SNAPSHOT @@ -60,7 +61,6 @@ spring-tx ${spring.version} - org.thymeleaf @@ -72,7 +72,6 @@ thymeleaf-spring5 ${org.thymeleaf-version} - org.freemarker @@ -89,21 +88,18 @@ spring-boot-starter-freemarker ${spring-boot.version} - org.codehaus.groovy groovy-templates ${groovy.version} - de.neuland-bfi spring-jade4j ${jade.version} - org.springframework @@ -171,4 +167,4 @@ 2.3.4.RELEASE - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-basics-3/pom.xml b/spring-web-modules/spring-mvc-basics-3/pom.xml index a9245814a8..f9710ff2d1 100644 --- a/spring-web-modules/spring-mvc-basics-3/pom.xml +++ b/spring-web-modules/spring-mvc-basics-3/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mvc-basics-3 spring-mvc-basics-3 @@ -15,69 +16,57 @@ - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-validation - org.springframework.boot spring-boot-starter-test test - org.springframework.boot spring-boot-starter-thymeleaf provided - org.springframework.boot spring-boot-starter-data-jpa - org.springframework.boot spring-boot-starter-mail - org.springframework.boot spring-boot-starter-actuator - com.h2database h2 runtime - javax.persistence javax.persistence-api ${jpa.version} - com.google.guava guava ${guava.version} - org.subethamail subethasmtp ${subethasmtp.version} test - org.apache.httpcomponents httpclient @@ -146,4 +135,4 @@ 4.5.8 - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-basics-4/pom.xml b/spring-web-modules/spring-mvc-basics-4/pom.xml index 07dddcde0c..067d1ed3b1 100644 --- a/spring-web-modules/spring-mvc-basics-4/pom.xml +++ b/spring-web-modules/spring-mvc-basics-4/pom.xml @@ -1,7 +1,7 @@ + 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 spring-mvc-basics-4 spring-mvc-basics-4 diff --git a/spring-web-modules/spring-mvc-basics/pom.xml b/spring-web-modules/spring-mvc-basics/pom.xml index ac92c7bfe5..9fe4494393 100644 --- a/spring-web-modules/spring-mvc-basics/pom.xml +++ b/spring-web-modules/spring-mvc-basics/pom.xml @@ -1,7 +1,7 @@ + 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 spring-mvc-basics 0.1-SNAPSHOT @@ -28,7 +28,7 @@ commons-fileupload commons-fileupload ${commons-fileupload.version} - + org.apache.tomcat.embed @@ -60,5 +60,4 @@ - - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-crash/pom.xml b/spring-web-modules/spring-mvc-crash/pom.xml index 9a0d97bae9..9574eff2a4 100644 --- a/spring-web-modules/spring-mvc-crash/pom.xml +++ b/spring-web-modules/spring-mvc-crash/pom.xml @@ -15,9 +15,7 @@ - - org.springframework spring-web @@ -28,37 +26,30 @@ spring-webmvc ${org.springframework.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - org.hibernate.validator hibernate-validator ${hibernate-validator.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - commons-io @@ -85,14 +76,12 @@ javax.el ${javax.el.version} - org.springframework.boot spring-boot-starter-test ${spring-boot.version} test - org.crashub @@ -115,7 +104,6 @@ - org.codehaus.groovy @@ -125,52 +113,41 @@ - spring-mvc-xml + spring-mvc-crash src/main/resources true - - org.apache.maven.plugins maven-war-plugin ${maven-war-plugin.version} - - 5.0.2.RELEASE 1.5.10.RELEASE - 5.1.40 - 4.4.5 4.5.2 - 6.0.10.Final 3.0.1-b08 - 19.0 2.8.0 - 1.6.1 - 1.3.2 3.0.0-rc-3 - - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-forms-jsp/pom.xml b/spring-web-modules/spring-mvc-forms-jsp/pom.xml index 0ca23bd6cb..94eb51a32d 100644 --- a/spring-web-modules/spring-mvc-forms-jsp/pom.xml +++ b/spring-web-modules/spring-mvc-forms-jsp/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 0.1-SNAPSHOT spring-mvc-forms-jsp @@ -91,7 +92,7 @@ - spring-mvc-forms + spring-mvc-forms-jsp @@ -102,5 +103,4 @@ 6.0.6 - - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml b/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml index 641f64b93c..fdd569d144 100644 --- a/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mvc-forms-thymeleaf spring-mvc-forms-thymeleaf @@ -23,7 +24,6 @@ org.springframework.boot spring-boot-starter-thymeleaf - org.springframework.boot @@ -42,4 +42,4 @@ com.baeldung.sessionattrs.SessionAttrsApplication - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-java-2/pom.xml b/spring-web-modules/spring-mvc-java-2/pom.xml index 8a025defac..1bbb066786 100644 --- a/spring-web-modules/spring-mvc-java-2/pom.xml +++ b/spring-web-modules/spring-mvc-java-2/pom.xml @@ -1,7 +1,7 @@ + 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 spring-mvc-java-2 0.1-SNAPSHOT @@ -53,5 +53,4 @@ 5.2.2.RELEASE - - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-java/pom.xml b/spring-web-modules/spring-mvc-java/pom.xml index 1324511215..b8f5ec7910 100644 --- a/spring-web-modules/spring-mvc-java/pom.xml +++ b/spring-web-modules/spring-mvc-java/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mvc-java 0.1-SNAPSHOT @@ -68,8 +69,6 @@ commons-fileupload ${commons-fileupload.version} - - org.thymeleaf @@ -81,7 +80,6 @@ thymeleaf ${thymeleaf.version} - com.jayway.jsonpath json-path @@ -93,14 +91,12 @@ spring-boot-starter-test test - org.apache.poi poi-ooxml ${poi.version} - org.hibernate.validator @@ -122,14 +118,11 @@ true - - maven-resources-plugin ${maven-resources-plugin.version} - org.apache.maven.plugins maven-war-plugin @@ -138,7 +131,6 @@ false - org.codehaus.cargo cargo-maven2-plugin @@ -217,43 +209,34 @@ - 3.0.9.RELEASE - 6.0.10.Final 5.1.40 - 6.0.10.Final - 19.0 2.2.0 - 4.4.5 4.5.2 3.0.7 2.23 - 3.2.2 2.7 1.6.1 3.1.0 - 1.9.1 - 3.16-beta1 - 3.0.1-b09 4.0.1 2.3.3 @@ -262,5 +245,4 @@ com.baeldung.SpringMVCApplication - - + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-velocity/pom.xml b/spring-web-modules/spring-mvc-velocity/pom.xml index 05016962a5..1b1e8b1ea4 100644 --- a/spring-web-modules/spring-mvc-velocity/pom.xml +++ b/spring-web-modules/spring-mvc-velocity/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mvc-velocity 0.1-SNAPSHOT @@ -15,9 +16,7 @@ - - org.springframework spring-web @@ -33,22 +32,18 @@ spring-context-support ${spring.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - org.apache.velocity velocity ${velocity.version} - org.apache.velocity velocity-tools @@ -60,7 +55,6 @@ - org.powermock @@ -80,7 +74,6 @@ ${spring.version} test - @@ -91,7 +84,6 @@ true - org.apache.maven.plugins @@ -107,13 +99,11 @@ 1.6.6 - 4.4.5 4.5.2 1.7 2.0 2.9.0 - 2.7 1.6.1 diff --git a/spring-web-modules/spring-mvc-views/pom.xml b/spring-web-modules/spring-mvc-views/pom.xml index 649814263c..7e48175ff2 100644 --- a/spring-web-modules/spring-mvc-views/pom.xml +++ b/spring-web-modules/spring-mvc-views/pom.xml @@ -1,7 +1,7 @@ + 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 spring-mvc-views war @@ -50,37 +50,31 @@ hibernate-core ${hibernate.version} - org.hsqldb hsqldb ${hsqldb.version} - org.springframework.security spring-security-web ${spring.security.version} - org.springframework.security spring-security-config ${spring.security.version} - org.springframework.security spring-security-taglibs ${spring.security.version} - org.apache.tiles tiles-jsp ${apache-tiles.version} - @@ -95,7 +89,6 @@ ${java.version} - org.apache.maven.plugins maven-war-plugin diff --git a/spring-web-modules/spring-mvc-webflow/pom.xml b/spring-web-modules/spring-mvc-webflow/pom.xml index ab0f86394a..2e150e2d01 100644 --- a/spring-web-modules/spring-mvc-webflow/pom.xml +++ b/spring-web-modules/spring-mvc-webflow/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mvc-webflow 0.1-SNAPSHOT @@ -14,7 +15,6 @@ - org.springframework @@ -26,14 +26,12 @@ spring-webmvc ${org.springframework.version} - org.springframework.webflow spring-webflow ${spring.webflow} - javax.servlet @@ -52,7 +50,6 @@ log4j-over-slf4j ${org.slf4j.version} - org.springframework.boot @@ -60,7 +57,6 @@ ${spring-boot-starter-test.version} test - @@ -86,7 +82,8 @@ .class - -Xmx2048m -XX:PermSize=256m -Dtomee.serialization.class.blacklist=- -Dtomee.serialization.class.whitelist=* + -Xmx2048m -XX:PermSize=256m -Dtomee.serialization.class.blacklist=- + -Dtomee.serialization.class.whitelist=* true @@ -104,13 +101,10 @@ 5.0.1.RELEASE - 2.5.0.RELEASE - 4.4.5 4.5.2 - 2.7 1.6.1 diff --git a/spring-web-modules/spring-mvc-xml/pom.xml b/spring-web-modules/spring-mvc-xml/pom.xml index 4812d5c979..354d652095 100644 --- a/spring-web-modules/spring-mvc-xml/pom.xml +++ b/spring-web-modules/spring-mvc-xml/pom.xml @@ -15,9 +15,7 @@ - - org.springframework spring-web @@ -28,37 +26,30 @@ spring-webmvc ${org.springframework.version} - - javax.servlet javax.servlet-api ${javax.servlet-api.version} provided - javax.servlet jstl ${jstl.version} runtime - org.hibernate.validator hibernate-validator ${hibernate-validator.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - commons-io @@ -85,14 +76,12 @@ javax.el ${javax.el.version} - org.springframework.boot spring-boot-starter-test ${spring-boot.version} test - org.crashub @@ -115,7 +104,6 @@ - org.codehaus.groovy @@ -132,45 +120,34 @@ true - - org.apache.maven.plugins maven-war-plugin ${maven-war-plugin.version} - - 5.0.2.RELEASE 1.5.10.RELEASE - 5.1.40 - 4.4.5 4.5.2 - 6.0.10.Final 3.0.1-b08 - 19.0 2.8.0 - 1.6.1 - 1.3.2 3.0.0-rc-3 - - + \ No newline at end of file diff --git a/spring-web-modules/spring-rest-angular/pom.xml b/spring-web-modules/spring-rest-angular/pom.xml index eb1ec8696c..ef14e78198 100644 --- a/spring-web-modules/spring-rest-angular/pom.xml +++ b/spring-web-modules/spring-rest-angular/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-rest-angular 1.0 @@ -77,4 +78,4 @@ com.baeldung.web.main.Application - + \ No newline at end of file diff --git a/spring-web-modules/spring-rest-http-2/pom.xml b/spring-web-modules/spring-rest-http-2/pom.xml index a349ac1116..10d904e302 100644 --- a/spring-web-modules/spring-rest-http-2/pom.xml +++ b/spring-web-modules/spring-rest-http-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-rest-http-2 0.1-SNAPSHOT @@ -53,4 +54,4 @@ 1.6.1 - + \ No newline at end of file diff --git a/spring-web-modules/spring-rest-http/pom.xml b/spring-web-modules/spring-rest-http/pom.xml index 94d1be7814..5a92b585e3 100644 --- a/spring-web-modules/spring-rest-http/pom.xml +++ b/spring-web-modules/spring-rest-http/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-rest-http 0.1-SNAPSHOT @@ -15,7 +16,6 @@ - org.springframework.boot spring-boot-starter-web @@ -54,13 +54,11 @@ json-patch ${jsonpatch.version} - - 1.4.9 1.12 - + \ No newline at end of file diff --git a/spring-web-modules/spring-rest-query-language/pom.xml b/spring-web-modules/spring-rest-query-language/pom.xml index 5e7ca023dd..c5a8c172f3 100644 --- a/spring-web-modules/spring-rest-query-language/pom.xml +++ b/spring-web-modules/spring-rest-query-language/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-rest-query-language 0.1-SNAPSHOT @@ -15,7 +16,6 @@ - org.springframework.boot @@ -25,7 +25,6 @@ org.springframework.boot spring-boot-starter-actuator - org.aspectj aspectjweaver @@ -35,9 +34,7 @@ tomcat-embed-jasper provided - - org.springframework spring-core @@ -84,16 +81,12 @@ org.springframework.data spring-data-commons - - org.springframework.boot spring-boot-starter-tomcat - - com.querydsl querydsl-apt @@ -102,17 +95,13 @@ com.querydsl querydsl-jpa - - cz.jirutka.rsql rsql-parser ${rsql.version} - - org.apache.httpcomponents httpclient @@ -127,9 +116,7 @@ org.apache.httpcomponents httpcore - - org.springframework spring-orm @@ -157,67 +144,53 @@ mysql-connector-java runtime - com.h2database h2 - - javax.servlet javax.servlet-api provided - javax.servlet jstl runtime - - com.fasterxml.jackson.core jackson-databind - com.thoughtworks.xstream xstream ${xstream.version} - - com.google.guava guava ${guava.version} - - org.springframework spring-test test - org.hamcrest hamcrest test - org.mockito mockito-core test - @@ -228,14 +201,11 @@ true - - org.apache.maven.plugins maven-war-plugin - org.codehaus.cargo cargo-maven2-plugin @@ -256,9 +226,7 @@ - - com.mysema.maven apt-maven-plugin @@ -275,9 +243,7 @@ - - @@ -342,18 +308,15 @@ 2.1.0 - 1.4.9 3.21.0-GA 1.4.01 - 19.0 - 1.7.0 1.1.3 - + \ No newline at end of file diff --git a/spring-web-modules/spring-rest-shell/pom.xml b/spring-web-modules/spring-rest-shell/pom.xml index f5792fd6ca..b83a0b6002 100644 --- a/spring-web-modules/spring-rest-shell/pom.xml +++ b/spring-web-modules/spring-rest-shell/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-rest-shell spring-rest-shell @@ -28,7 +29,6 @@ org.springframework.boot spring-boot-starter-data-rest - com.h2database @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/spring-web-modules/spring-rest-simple/pom.xml b/spring-web-modules/spring-rest-simple/pom.xml index b9d5100fbf..e7671e0af0 100644 --- a/spring-web-modules/spring-rest-simple/pom.xml +++ b/spring-web-modules/spring-rest-simple/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-rest-simple 0.1-SNAPSHOT @@ -15,7 +16,6 @@ - org.springframework.boot @@ -38,7 +38,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework @@ -64,7 +63,6 @@ ${commons-fileupload.version} - javax.servlet javax.servlet-api @@ -75,9 +73,7 @@ jstl runtime - - com.fasterxml.jackson.core jackson-databind @@ -91,9 +87,7 @@ xstream ${xstream.version} - - com.google.guava guava @@ -104,9 +98,7 @@ commons-lang3 ${commons-lang3.version} - - org.slf4j slf4j-api @@ -121,17 +113,13 @@ jcl-over-slf4j - - com.squareup.okhttp3 okhttp ${com.squareup.okhttp3.version} - - junit junit @@ -258,7 +246,6 @@ - live @@ -283,7 +270,6 @@ - org.apache.maven.plugins maven-surefire-plugin @@ -307,7 +293,6 @@ - @@ -318,19 +303,15 @@ 1.4 3.1.0 1.4.9 - 20.0 2.9.0 - 1.6.0 3.0.4 - 3.4.1 - 2.2.0 - + \ No newline at end of file diff --git a/spring-web-modules/spring-rest-testing/pom.xml b/spring-web-modules/spring-rest-testing/pom.xml index fea8d25e4d..dc5fdcd323 100644 --- a/spring-web-modules/spring-rest-testing/pom.xml +++ b/spring-web-modules/spring-rest-testing/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-rest-testing 0.1-SNAPSHOT @@ -15,7 +16,6 @@ - org.springframework.boot @@ -34,9 +34,7 @@ tomcat-embed-jasper provided - - org.springframework spring-core @@ -83,16 +81,12 @@ org.springframework.data spring-data-commons - - org.springframework.boot spring-boot-starter-tomcat - - org.apache.httpcomponents httpclient @@ -107,9 +101,7 @@ org.apache.httpcomponents httpcore - - org.springframework spring-orm @@ -145,9 +137,7 @@ net.bytebuddy byte-buddy - - javax.servlet javax.servlet-api @@ -158,41 +148,33 @@ jstl runtime - com.fasterxml.jackson.core jackson-databind - - com.google.guava guava ${guava.version} - - org.springframework spring-test test - org.hamcrest hamcrest test - org.mockito mockito-core test - @@ -285,14 +267,12 @@ 1.4.9 1.4.01 - 19.0 3.25.0-GA - 1.6.1 1.1.3 - + \ No newline at end of file diff --git a/spring-web-modules/spring-resttemplate-2/pom.xml b/spring-web-modules/spring-resttemplate-2/pom.xml index 158380b403..d0191b970e 100644 --- a/spring-web-modules/spring-resttemplate-2/pom.xml +++ b/spring-web-modules/spring-resttemplate-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-resttemplate-2 0.1-SNAPSHOT @@ -15,7 +16,6 @@ - org.springframework.boot @@ -27,29 +27,23 @@ - org.springframework.boot spring-boot-starter-jetty - org.apache.httpcomponents httpclient - commons-io commons-io ${commons-io.version} - org.springframework.boot spring-boot-starter-test - - org.springframework @@ -61,7 +55,6 @@ - org.slf4j @@ -71,7 +64,6 @@ ch.qos.logback logback-classic - diff --git a/spring-web-modules/spring-resttemplate-3/pom.xml b/spring-web-modules/spring-resttemplate-3/pom.xml index b1c26e002f..8e313ccf39 100644 --- a/spring-web-modules/spring-resttemplate-3/pom.xml +++ b/spring-web-modules/spring-resttemplate-3/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-resttemplate-3 0.1-SNAPSHOT @@ -26,4 +27,4 @@ - + \ No newline at end of file diff --git a/spring-web-modules/spring-resttemplate/pom.xml b/spring-web-modules/spring-resttemplate/pom.xml index 1db6b5db57..221efd77ee 100644 --- a/spring-web-modules/spring-resttemplate/pom.xml +++ b/spring-web-modules/spring-resttemplate/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-resttemplate 0.1-SNAPSHOT @@ -15,7 +16,6 @@ - org.springframework.boot @@ -37,14 +37,11 @@ org.springframework.boot spring-boot-starter-test - - au.com.dius pact-jvm-provider-junit_2.11 ${pact.version} - org.springframework @@ -64,9 +61,7 @@ org.springframework spring-oxm - - com.fasterxml.jackson.core jackson-databind @@ -80,9 +75,7 @@ xstream ${xstream.version} - - com.google.guava guava @@ -93,9 +86,7 @@ commons-lang3 ${commons-lang3.version} - - org.slf4j slf4j-api @@ -110,24 +101,19 @@ jcl-over-slf4j - - com.squareup.okhttp3 okhttp ${com.squareup.okhttp3.version} - - junit junit ${junit.version} - org.hamcrest hamcrest @@ -153,7 +139,6 @@ - org.apache.maven.plugins maven-compiler-plugin @@ -232,7 +217,6 @@ - @@ -260,7 +244,6 @@ - org.apache.maven.plugins maven-surefire-plugin @@ -284,7 +267,6 @@ - @@ -292,14 +274,11 @@ 1.4.9 - 20.0 - 1.6.1 3.0.4 - 3.4.1 3.5.11 @@ -309,4 +288,4 @@ 3.7.0 - + \ No newline at end of file diff --git a/spring-web-modules/spring-thymeleaf-2/pom.xml b/spring-web-modules/spring-thymeleaf-2/pom.xml index ddcd1e1005..b2b893ecd5 100644 --- a/spring-web-modules/spring-thymeleaf-2/pom.xml +++ b/spring-web-modules/spring-thymeleaf-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-thymeleaf-2 spring-thymeleaf-2 @@ -26,7 +27,6 @@ org.springframework.boot spring-boot-starter-thymeleaf - org.springframework.boot spring-boot-starter-test @@ -40,7 +40,6 @@ org.apache.maven.plugins maven-war-plugin - org.apache.tomcat.maven tomcat7-maven-plugin @@ -71,4 +70,4 @@ 2.2 - + \ No newline at end of file diff --git a/spring-web-modules/spring-thymeleaf-3/pom.xml b/spring-web-modules/spring-thymeleaf-3/pom.xml index 6a46dca117..8f39c17d8c 100644 --- a/spring-web-modules/spring-thymeleaf-3/pom.xml +++ b/spring-web-modules/spring-thymeleaf-3/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-thymeleaf-3 spring-thymeleaf-3 @@ -56,7 +57,6 @@ org.apache.maven.plugins maven-war-plugin - org.apache.tomcat.maven tomcat7-maven-plugin @@ -87,4 +87,4 @@ 2.2 - + \ No newline at end of file diff --git a/spring-web-modules/spring-thymeleaf/pom.xml b/spring-web-modules/spring-thymeleaf/pom.xml index 7b0cd2c510..8201cb5c5b 100644 --- a/spring-web-modules/spring-thymeleaf/pom.xml +++ b/spring-web-modules/spring-thymeleaf/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-thymeleaf 0.1-SNAPSHOT @@ -33,13 +34,11 @@ spring-webmvc ${spring.version} - org.springframework.data spring-data-commons ${spring-data.version} - javax.validation validation-api @@ -50,7 +49,6 @@ hibernate-validator ${hibernate-validator.version} - org.springframework.security @@ -62,7 +60,6 @@ spring-security-config ${spring-security.version} - org.thymeleaf @@ -84,7 +81,6 @@ thymeleaf-extras-java8time ${org.thymeleaf.extras-version} - javax.servlet @@ -92,7 +88,6 @@ ${javax.servlet-api.version} provided - org.springframework @@ -100,14 +95,12 @@ ${spring.version} test - org.springframework.security spring-security-test ${spring-security.version} test - @@ -120,7 +113,6 @@ false - org.codehaus.cargo cargo-maven2-plugin @@ -140,7 +132,6 @@ - @@ -151,9 +142,8 @@ 2.4.1 2.0.1.Final 6.0.11.Final - 1.6.1 - + \ No newline at end of file From d9db0949cbe7f8b86e5d55067d29e09afe39e96a Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Mon, 17 May 2021 20:23:43 +0530 Subject: [PATCH 42/72] JAVA-5223: Fix formatting of POMs (Testing Modules) --- testing-modules/assertion-libraries/pom.xml | 7 +- testing-modules/cucumber/pom.xml | 46 +++++---- testing-modules/easy-random/pom.xml | 4 +- testing-modules/easymock/pom.xml | 8 +- testing-modules/gatling/pom.xml | 6 +- testing-modules/groovy-spock/pom.xml | 7 +- testing-modules/hamcrest/pom.xml | 5 +- testing-modules/junit-4/pom.xml | 6 +- testing-modules/junit-5-advanced/pom.xml | 6 +- testing-modules/junit-5-basics/pom.xml | 6 +- testing-modules/junit-5/pom.xml | 8 +- testing-modules/junit5-annotations/pom.xml | 7 +- testing-modules/junit5-migration/pom.xml | 7 +- .../load-testing-comparison/pom.xml | 98 +++++++++---------- testing-modules/mockito-2/pom.xml | 7 +- testing-modules/mockito-3/pom.xml | 2 +- testing-modules/mockito/pom.xml | 9 +- testing-modules/mocks/pom.xml | 9 +- testing-modules/mockserver/pom.xml | 5 +- .../math-test-functions/pom.xml | 8 +- testing-modules/parallel-tests-junit/pom.xml | 7 +- .../string-test-functions/pom.xml | 8 +- testing-modules/pom.xml | 9 +- testing-modules/powermock/pom.xml | 11 ++- testing-modules/rest-assured/pom.xml | 27 +---- testing-modules/rest-testing/pom.xml | 20 +--- testing-modules/selenium-junit-testng/pom.xml | 2 +- testing-modules/spring-testing-2/pom.xml | 16 +-- testing-modules/spring-testing/pom.xml | 7 +- testing-modules/test-containers/pom.xml | 8 +- testing-modules/testing-assertions/pom.xml | 5 +- testing-modules/testing-libraries-2/pom.xml | 6 +- testing-modules/testing-libraries/pom.xml | 9 +- testing-modules/testng/pom.xml | 5 +- testing-modules/xmlunit-2/pom.xml | 7 +- testing-modules/zerocode/pom.xml | 16 ++- 36 files changed, 194 insertions(+), 230 deletions(-) diff --git a/testing-modules/assertion-libraries/pom.xml b/testing-modules/assertion-libraries/pom.xml index c8ab512e4b..19ebebce05 100644 --- a/testing-modules/assertion-libraries/pom.xml +++ b/testing-modules/assertion-libraries/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 assertion-libraries 0.1-SNAPSHOT @@ -72,4 +73,4 @@ 0.12 - + \ No newline at end of file diff --git a/testing-modules/cucumber/pom.xml b/testing-modules/cucumber/pom.xml index af1935aa17..531b16ddec 100644 --- a/testing-modules/cucumber/pom.xml +++ b/testing-modules/cucumber/pom.xml @@ -1,8 +1,11 @@ - + 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 + cucumber + 1.0-SNAPSHOT + cucumber com.baeldung @@ -12,25 +15,6 @@ - 4.0.0 - cucumber - 1.0-SNAPSHOT - cucumber - - - 14 - 14 - 6.10.3 - 5.4.0 - 2.22.2 - 3.141.59 - 4.3.1 - 0.40 - 3.0.0 - 4.5.3 - 2.2.5.RELEASE - - org.springframework.boot @@ -55,7 +39,6 @@ bootstrap ${bootstrap.version} - org.projectlombok lombok @@ -136,4 +119,19 @@ - + + + 14 + 14 + 6.10.3 + 5.4.0 + 2.22.2 + 3.141.59 + 4.3.1 + 0.40 + 3.0.0 + 4.5.3 + 2.2.5.RELEASE + + + \ No newline at end of file diff --git a/testing-modules/easy-random/pom.xml b/testing-modules/easy-random/pom.xml index 1a1f3f743d..1ea6fbc387 100644 --- a/testing-modules/easy-random/pom.xml +++ b/testing-modules/easy-random/pom.xml @@ -1,7 +1,7 @@ + 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 easy-random easy-random diff --git a/testing-modules/easymock/pom.xml b/testing-modules/easymock/pom.xml index 98458b724d..a8e37da8eb 100644 --- a/testing-modules/easymock/pom.xml +++ b/testing-modules/easymock/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 easymock easymock @@ -26,4 +26,4 @@ 4.0.2 - + \ No newline at end of file diff --git a/testing-modules/gatling/pom.xml b/testing-modules/gatling/pom.xml index 99eaaac044..281c74d6b3 100644 --- a/testing-modules/gatling/pom.xml +++ b/testing-modules/gatling/pom.xml @@ -1,7 +1,7 @@ + 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 org.baeldung gatling @@ -115,4 +115,4 @@ 3.0.4 - + \ No newline at end of file diff --git a/testing-modules/groovy-spock/pom.xml b/testing-modules/groovy-spock/pom.xml index fa2c98a884..3c1f00abdf 100644 --- a/testing-modules/groovy-spock/pom.xml +++ b/testing-modules/groovy-spock/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.spockframework groovy-spock @@ -53,4 +54,4 @@ 1.5 - + \ No newline at end of file diff --git a/testing-modules/hamcrest/pom.xml b/testing-modules/hamcrest/pom.xml index ec9177d8f2..df8c543edb 100644 --- a/testing-modules/hamcrest/pom.xml +++ b/testing-modules/hamcrest/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 hamcrest @@ -27,4 +28,4 @@ 2.0.0.0 - + \ No newline at end of file diff --git a/testing-modules/junit-4/pom.xml b/testing-modules/junit-4/pom.xml index be0f51ea23..0ae6b71f82 100644 --- a/testing-modules/junit-4/pom.xml +++ b/testing-modules/junit-4/pom.xml @@ -1,7 +1,7 @@ + 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 junit-4 1.0-SNAPSHOT @@ -28,4 +28,4 @@ 1.1.0 - + \ No newline at end of file diff --git a/testing-modules/junit-5-advanced/pom.xml b/testing-modules/junit-5-advanced/pom.xml index f53af9347f..5fc466bb67 100644 --- a/testing-modules/junit-5-advanced/pom.xml +++ b/testing-modules/junit-5-advanced/pom.xml @@ -1,7 +1,7 @@ + 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 junit-5-advanced 1.0-SNAPSHOT @@ -40,4 +40,4 @@ 5.4.2 - + \ No newline at end of file diff --git a/testing-modules/junit-5-basics/pom.xml b/testing-modules/junit-5-basics/pom.xml index cdb0c367ce..0358f0c29a 100644 --- a/testing-modules/junit-5-basics/pom.xml +++ b/testing-modules/junit-5-basics/pom.xml @@ -1,7 +1,7 @@ + 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 junit-5-basics 1.0-SNAPSHOT @@ -154,4 +154,4 @@ 5.0.6.RELEASE - + \ No newline at end of file diff --git a/testing-modules/junit-5/pom.xml b/testing-modules/junit-5/pom.xml index 90898ebb3f..125fa77423 100644 --- a/testing-modules/junit-5/pom.xml +++ b/testing-modules/junit-5/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 junit-5 @@ -88,7 +89,6 @@ ${mockito.junit.jupiter.version} test - org.powermock powermock-api-mockito2 @@ -140,4 +140,4 @@ 3.0.0-M3 - + \ No newline at end of file diff --git a/testing-modules/junit5-annotations/pom.xml b/testing-modules/junit5-annotations/pom.xml index 7ffc17c69b..127a1bf33f 100644 --- a/testing-modules/junit5-annotations/pom.xml +++ b/testing-modules/junit5-annotations/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 junit5-annotations 1.0-SNAPSHOT @@ -61,4 +62,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/testing-modules/junit5-migration/pom.xml b/testing-modules/junit5-migration/pom.xml index bab7bc0406..2e864f6434 100644 --- a/testing-modules/junit5-migration/pom.xml +++ b/testing-modules/junit5-migration/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 junit5-migration 1.0-SNAPSHOT @@ -56,4 +57,4 @@ 2.21.0 - + \ No newline at end of file diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml index 4c237aeb75..63f2d9ce2f 100644 --- a/testing-modules/load-testing-comparison/pom.xml +++ b/testing-modules/load-testing-comparison/pom.xml @@ -1,7 +1,7 @@ + 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 load-testing-comparison load-testing-comparison @@ -57,57 +57,57 @@ - - - - - - - - - - + + + + + + + + + + org.springframework.boot spring-boot-maven-plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -122,4 +122,4 @@ 5.0 - + \ No newline at end of file diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index 055debe615..558ac59d08 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mockito-2 0.0.1-SNAPSHOT @@ -32,4 +33,4 @@ 2.21.0 - + \ No newline at end of file diff --git a/testing-modules/mockito-3/pom.xml b/testing-modules/mockito-3/pom.xml index 8d506561ed..5a150ccbf9 100644 --- a/testing-modules/mockito-3/pom.xml +++ b/testing-modules/mockito-3/pom.xml @@ -35,4 +35,4 @@ 3.8.0 - + \ No newline at end of file diff --git a/testing-modules/mockito/pom.xml b/testing-modules/mockito/pom.xml index ea5ef4c322..a159f609a5 100644 --- a/testing-modules/mockito/pom.xml +++ b/testing-modules/mockito/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mockito 0.1-SNAPSHOT @@ -34,15 +35,12 @@ javax.persistence ${javax.persistence.version} - - org.apache.commons commons-lang3 ${commons-lang3.version} - org.springframework.boot @@ -74,7 +72,6 @@ 2.0.9.RELEASE 19.0 - 2.0.2 2.1.1 diff --git a/testing-modules/mocks/pom.xml b/testing-modules/mocks/pom.xml index abaf313dc5..17700a835e 100644 --- a/testing-modules/mocks/pom.xml +++ b/testing-modules/mocks/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mocks mocks @@ -36,14 +37,12 @@ ${mockito.version} test - org.easymock easymock ${easymock.version} test - com.google.jimfs jimfs @@ -60,4 +59,4 @@ 1.1 - + \ No newline at end of file diff --git a/testing-modules/mockserver/pom.xml b/testing-modules/mockserver/pom.xml index 6d553f4b90..c039d6a0ab 100644 --- a/testing-modules/mockserver/pom.xml +++ b/testing-modules/mockserver/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mockserver 1.0.0-SNAPSHOT diff --git a/testing-modules/parallel-tests-junit/math-test-functions/pom.xml b/testing-modules/parallel-tests-junit/math-test-functions/pom.xml index fdd45e19d6..39199834b9 100644 --- a/testing-modules/parallel-tests-junit/math-test-functions/pom.xml +++ b/testing-modules/parallel-tests-junit/math-test-functions/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 math-test-functions math-test-functions @@ -49,4 +49,4 @@ 2.22.0 - + \ No newline at end of file diff --git a/testing-modules/parallel-tests-junit/pom.xml b/testing-modules/parallel-tests-junit/pom.xml index f9c47c827c..f5a46b91e3 100644 --- a/testing-modules/parallel-tests-junit/pom.xml +++ b/testing-modules/parallel-tests-junit/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 parallel-tests-junit 0.0.1-SNAPSHOT @@ -19,4 +20,4 @@ string-test-functions - + \ No newline at end of file diff --git a/testing-modules/parallel-tests-junit/string-test-functions/pom.xml b/testing-modules/parallel-tests-junit/string-test-functions/pom.xml index 727a1f814a..39847444b5 100644 --- a/testing-modules/parallel-tests-junit/string-test-functions/pom.xml +++ b/testing-modules/parallel-tests-junit/string-test-functions/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 string-test-functions string-test-functions @@ -41,4 +41,4 @@ 2.22.0 - + \ No newline at end of file diff --git a/testing-modules/pom.xml b/testing-modules/pom.xml index d2afd4ae70..28c743b2b3 100644 --- a/testing-modules/pom.xml +++ b/testing-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 testing-modules testing-modules @@ -29,7 +30,7 @@ junit5-migration load-testing-comparison mockito-2 - mockito-3 + mockito-3 mockito mocks mockserver @@ -49,4 +50,4 @@ zerocode - + \ No newline at end of file diff --git a/testing-modules/powermock/pom.xml b/testing-modules/powermock/pom.xml index 39d5f96d0a..7179f3ffbe 100644 --- a/testing-modules/powermock/pom.xml +++ b/testing-modules/powermock/pom.xml @@ -1,15 +1,15 @@ + 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 + powermock + testing-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - powermock @@ -30,4 +30,5 @@ 2.21.0 2.0.7 + \ No newline at end of file diff --git a/testing-modules/rest-assured/pom.xml b/testing-modules/rest-assured/pom.xml index eeb5389f49..bd4c1456c1 100644 --- a/testing-modules/rest-assured/pom.xml +++ b/testing-modules/rest-assured/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rest-assured 1.0 @@ -70,41 +71,34 @@ org.eclipse.jetty jetty-util - org.apache.httpcomponents httpcore - org.apache.commons commons-lang3 - com.github.fge uri-template ${uri-template.version} - com.googlecode.libphonenumber libphonenumber ${libphonenumber.version} - javax.mail mail ${javax.mail.version} - joda-time joda-time ${joda-time.version} - com.fasterxml.jackson.core jackson-annotations @@ -113,36 +107,30 @@ com.fasterxml.jackson.core jackson-databind - com.github.fge msg-simple ${msg-simple.version} - com.github.fge jackson-coreutils ${jackson-coreutils.version} - com.github.fge btf ${btf.version} - org.apache.httpcomponents httpclient - org.codehaus.groovy groovy-all ${groovy.version} - com.github.tomakehurst wiremock @@ -153,8 +141,7 @@ commons-collections ${commons-collections.version} - - + io.rest-assured rest-assured @@ -185,12 +172,9 @@ 2.5 1.4.7 9.4.0.v20161208 - 3.2.2 - 4.4.5 4.5.2 - 0.9 8.0.0 2.9.6 @@ -198,8 +182,7 @@ 1.2 2.4.7 2.4.1 - 2.5.3 - + \ No newline at end of file diff --git a/testing-modules/rest-testing/pom.xml b/testing-modules/rest-testing/pom.xml index b3966c1b6a..42e15f5199 100644 --- a/testing-modules/rest-testing/pom.xml +++ b/testing-modules/rest-testing/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rest-testing 0.1-SNAPSHOT @@ -14,23 +15,18 @@ - - commons-io commons-io ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - - org.apache.httpcomponents httpclient @@ -47,15 +43,12 @@ httpcore ${httpcore.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - com.github.tomakehurst @@ -63,7 +56,6 @@ ${wiremock.version} test - io.cucumber cucumber-java @@ -75,20 +67,17 @@ cucumber-junit ${cucumber.version} - org.jbehave jbehave-core ${jbehave.version} test - com.intuit.karate karate-apache ${karate.version} - com.intuit.karate karate-junit4 @@ -139,16 +128,13 @@ 19.0 - 2.9.0 6.8.0 2.21.0 0.6.1 - 4.4.5 4.5.2 - 4.1 diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index 8d661997f8..f06d47247c 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/pom.xml @@ -67,4 +67,4 @@ 1.5.4 - + \ No newline at end of file diff --git a/testing-modules/spring-testing-2/pom.xml b/testing-modules/spring-testing-2/pom.xml index 40b556732a..419b8d512a 100644 --- a/testing-modules/spring-testing-2/pom.xml +++ b/testing-modules/spring-testing-2/pom.xml @@ -1,9 +1,7 @@ - + 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 spring-testing-2 0.1-SNAPSHOT @@ -21,24 +19,20 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa - com.h2database h2 ${h2.version} - org.postgresql postgresql runtime - org.testcontainers @@ -54,11 +48,10 @@ - + - + org.apache.maven.plugins maven-surefire-plugin @@ -74,4 +67,5 @@ 1.12.2 + \ No newline at end of file diff --git a/testing-modules/spring-testing/pom.xml b/testing-modules/spring-testing/pom.xml index 74d55d4c08..bf4c1e7a69 100644 --- a/testing-modules/spring-testing/pom.xml +++ b/testing-modules/spring-testing/pom.xml @@ -1,7 +1,7 @@ + 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 spring-testing 0.1-SNAPSHOT @@ -20,19 +20,16 @@ java-hamcrest ${java-hamcrest.version} - org.projectlombok lombok ${lombok.version} provided - org.springframework.boot spring-boot-starter - org.springframework.boot diff --git a/testing-modules/test-containers/pom.xml b/testing-modules/test-containers/pom.xml index 2280a89b4a..4a65611c7a 100644 --- a/testing-modules/test-containers/pom.xml +++ b/testing-modules/test-containers/pom.xml @@ -1,8 +1,8 @@ - + 4.0.0 - test-containers 1.0-SNAPSHOT @@ -92,4 +92,4 @@ 1.3.2 - + \ No newline at end of file diff --git a/testing-modules/testing-assertions/pom.xml b/testing-modules/testing-assertions/pom.xml index 8b8536462d..82a507a985 100644 --- a/testing-modules/testing-assertions/pom.xml +++ b/testing-modules/testing-assertions/pom.xml @@ -11,7 +11,7 @@ 0.0.1-SNAPSHOT ../../parent-java - + ch.qos.logback @@ -55,4 +55,5 @@ 4.4 5.6.2 - + + \ No newline at end of file diff --git a/testing-modules/testing-libraries-2/pom.xml b/testing-modules/testing-libraries-2/pom.xml index 7f96280cac..e7016a2387 100644 --- a/testing-modules/testing-libraries-2/pom.xml +++ b/testing-modules/testing-libraries-2/pom.xml @@ -43,7 +43,6 @@ ${system-stubs.version} test - org.junit.jupiter @@ -72,7 +71,7 @@ - testing-libraries + testing-libraries-2 src/test/resources @@ -88,4 +87,5 @@ 5.6.2 3.16.1 - + + \ No newline at end of file diff --git a/testing-modules/testing-libraries/pom.xml b/testing-modules/testing-libraries/pom.xml index 4edd13fa30..4bbe56fc18 100644 --- a/testing-modules/testing-libraries/pom.xml +++ b/testing-modules/testing-libraries/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 testing-libraries testing-libraries @@ -29,7 +30,6 @@ ${cucumber.version} test - io.cucumber cucumber-java8 @@ -63,7 +63,6 @@ true - org.apache.maven.plugins @@ -105,4 +104,4 @@ 2.4.3 - + \ No newline at end of file diff --git a/testing-modules/testng/pom.xml b/testing-modules/testng/pom.xml index c4a1284b0e..8b6a46a694 100644 --- a/testing-modules/testng/pom.xml +++ b/testing-modules/testng/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 testng 0.1.0-SNAPSHOT diff --git a/testing-modules/xmlunit-2/pom.xml b/testing-modules/xmlunit-2/pom.xml index 5689e680e6..07153ab042 100644 --- a/testing-modules/xmlunit-2/pom.xml +++ b/testing-modules/xmlunit-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 xmlunit-2 xmlunit-2 @@ -30,4 +31,4 @@ 2.3.0 - + \ No newline at end of file diff --git a/testing-modules/zerocode/pom.xml b/testing-modules/zerocode/pom.xml index 63f0dc9cbb..48030166b5 100644 --- a/testing-modules/zerocode/pom.xml +++ b/testing-modules/zerocode/pom.xml @@ -1,30 +1,29 @@ - + 4.0.0 + zerocode + 1.0-SNAPSHOT + testing-modules com.baeldung 1.0.0-SNAPSHOT - zerocode - 1.0-SNAPSHOT - org.springframework.boot spring-boot-starter-web ${spring.boot.version} - org.springframework.boot spring-boot-starter-test ${spring.boot.version} test - - org.jsmart zerocode-tdd @@ -64,7 +63,6 @@ - org.apache.maven.plugins maven-failsafe-plugin @@ -101,4 +99,4 @@ 1.3.27 - + \ No newline at end of file From d1e8164581e6c13331c1178cfbb04cc5c82b4325 Mon Sep 17 00:00:00 2001 From: Bhabani Prasad Patel Date: Mon, 17 May 2021 23:46:45 +0530 Subject: [PATCH 43/72] Code commit for "Converting String to BigDecimal in Java" - Article (#10775) --- .../StringToBigDecimalConversionUnitTest.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java diff --git a/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java new file mode 100644 index 0000000000..e951b393c2 --- /dev/null +++ b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java @@ -0,0 +1,74 @@ +package com.baeldung.stringtobigdecimal; + +import static org.junit.Assert.assertEquals; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; + +import org.junit.Test; + +public class StringToBigDecimalConversionUnitTest { + + @Test + public void givenValidString_WhenBigDecimalObjectWithStringParameter_ThenResultIsDecimalObject() { + BigDecimal bigDecimal = new BigDecimal(123); + assertEquals(bigDecimal, new BigDecimal("123")); + } + + @Test(expected = NullPointerException.class) + public void givenNullString_WhenBigDecimalObjectWithStringParameter_ThenNullPointerExceptionIsThrown() { + String bigDecimal = null; + new BigDecimal(bigDecimal); + } + + @Test(expected = NumberFormatException.class) + public void givenInalidString_WhenBigDecimalObjectWithStringParameter_ThenNumberFormatExceptionIsThrown() { + new BigDecimal("&"); + } + + @Test + public void givenValidString_WhenValueOfDoubleFromString_ThenResultIsDecimalObject() { + BigDecimal bigDecimal = new BigDecimal(123.42).setScale(2, BigDecimal.ROUND_HALF_UP); + assertEquals(bigDecimal, BigDecimal.valueOf(Double.valueOf("123.42"))); + } + + @Test(expected = NullPointerException.class) + public void givenNullString_WhenValueOfDoubleFromString_ThenNullPointerExceptionIsThrown() { + BigDecimal.valueOf(Double.valueOf(null)); + } + + @Test(expected = NumberFormatException.class) + public void givenInalidString_WhenValueOfDoubleFromString_ThenNumberFormatExceptionIsThrown() { + BigDecimal.valueOf(Double.valueOf("&")); + } + + @Test + public void givenValidString_WhenDecimalFormatOfString_ThenResultIsDecimalObject() throws ParseException { + BigDecimal bigDecimal = new BigDecimal(10692467440017.111).setScale(3, BigDecimal.ROUND_HALF_UP); + + DecimalFormatSymbols symbols = new DecimalFormatSymbols(); + symbols.setGroupingSeparator(','); + symbols.setDecimalSeparator('.'); + String pattern = "#,##0.0#"; + DecimalFormat decimalFormat = new DecimalFormat(pattern, symbols); + decimalFormat.setParseBigDecimal(true); + + // parse the string value + BigDecimal parsedStringValue = (BigDecimal) decimalFormat.parse("10,692,467,440,017.111"); + + assertEquals(bigDecimal, parsedStringValue); + } + + @Test(expected = NullPointerException.class) + public void givenNullString_WhenDecimalFormatOfString_ThenNullPointerExceptionIsThrown() throws ParseException { + new DecimalFormat("#").parse(null); + } + + @Test(expected = ParseException.class) + public void givenInalidString_WhenDecimalFormatOfString_ThenNumberFormatExceptionIsThrown() throws ParseException { + new DecimalFormat("#").parse("&"); + } + +} From 10346cd9d77cefc3d3d7955b4bef3a11b0ca3c87 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Tue, 18 May 2021 01:57:48 +0430 Subject: [PATCH 44/72] Fixed the wrong assertion issue in a test --- .../reactive/logging/WebClientLoggingIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/logging/WebClientLoggingIntegrationTest.java b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/logging/WebClientLoggingIntegrationTest.java index bb4e682481..dabfd22056 100644 --- a/spring-5-reactive-client/src/test/java/com/baeldung/reactive/logging/WebClientLoggingIntegrationTest.java +++ b/spring-5-reactive-client/src/test/java/com/baeldung/reactive/logging/WebClientLoggingIntegrationTest.java @@ -146,7 +146,7 @@ public class WebClientLoggingIntegrationTest { .exchange() .block(); - verify(mockAppender).doAppend(argThat(argument -> (((LoggingEvent) argument).getFormattedMessage()).contains("domain=.typicode.com;"))); + verify(mockAppender).doAppend(argThat(argument -> (((LoggingEvent) argument).getFormattedMessage()).contains(sampleUrl))); } From 1506fdef1f08e93e932a93efd4dfa7c5f733b7ea Mon Sep 17 00:00:00 2001 From: uzma khan Date: Sat, 15 May 2021 18:31:23 +0100 Subject: [PATCH 45/72] [BAEL-4829] Multipart request in spring --- .../spring-mvc-forms-thymeleaf/pom.xml | 5 ++ .../baeldung/multipartupload/Employee.java | 16 ++++++ .../multipartupload/EmployeeController.java | 49 ++++++++++++++++ .../multipartupload/EmployeeRepository.java | 8 +++ .../multipartupload/EmployeeService.java | 36 ++++++++++++ .../MultipartUploadApplication.java | 13 +++++ .../employee/createEmployeeForm.html | 16 ++++++ .../resources/templates/employee/success.html | 8 +++ .../EmployeeControllerIntegrationTest.java | 56 +++++++++++++++++++ 9 files changed, 207 insertions(+) create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/Employee.java create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeController.java create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeRepository.java create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeService.java create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/MultipartUploadApplication.java create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/createEmployeeForm.html create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/success.html create mode 100644 spring-web-modules/spring-mvc-forms-thymeleaf/src/test/java/com/baeldung/multipartupload/EmployeeControllerIntegrationTest.java diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml b/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml index fdd569d144..37bcee0b8d 100644 --- a/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/pom.xml @@ -24,6 +24,11 @@ org.springframework.boot spring-boot-starter-thymeleaf + + org.projectlombok + lombok + + org.springframework.boot diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/Employee.java b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/Employee.java new file mode 100644 index 0000000000..0bc600dd6a --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/Employee.java @@ -0,0 +1,16 @@ +package com.baeldung.multipartupload; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.web.multipart.MultipartFile; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class Employee { + private String name; + private MultipartFile document; +} diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeController.java b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeController.java new file mode 100644 index 0000000000..e02844233e --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeController.java @@ -0,0 +1,49 @@ +package com.baeldung.multipartupload; + +import lombok.AllArgsConstructor; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import static org.springframework.web.bind.annotation.RequestMethod.POST; + +@Controller +@AllArgsConstructor +public class EmployeeController { + + private final EmployeeService employeeService; + + @GetMapping(value = "/employee") + public String showEmployeeForm(Model model) { + model.addAttribute("employee", new Employee()); + return "employee/createEmployeeForm"; + } + + @RequestMapping(path = "/employee", method = POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + public String saveEmployee(@ModelAttribute Employee employee) { + employeeService.save(employee); + return "employee/success"; + } + + @RequestMapping(path = "/requestpart/employee", method = POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + public ResponseEntity saveEmployee(@RequestPart Employee employee, @RequestPart MultipartFile document) { + employee.setDocument(document); + employeeService.save(employee); + return ResponseEntity.ok().build(); + } + + @RequestMapping(path = "/requestparam/employee", method = POST, consumes = { MediaType.MULTIPART_FORM_DATA_VALUE }) + public ResponseEntity saveEmployee(@RequestParam String name, @RequestPart MultipartFile document) { + Employee employee = new Employee(name, document); + employeeService.save(employee); + return ResponseEntity.ok().build(); + } + +} \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeRepository.java b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeRepository.java new file mode 100644 index 0000000000..d4182e100d --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeRepository.java @@ -0,0 +1,8 @@ +package com.baeldung.multipartupload; + +import org.springframework.stereotype.Repository; + +@Repository +public interface EmployeeRepository { + void saveEmployee(Employee employee); +} \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeService.java b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeService.java new file mode 100644 index 0000000000..f6906c8ba9 --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/EmployeeService.java @@ -0,0 +1,36 @@ +package com.baeldung.multipartupload; + +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; + +@Service +public class EmployeeService { + + public void save(Employee employee) { + saveFile(employee.getDocument()); + // save other employee data + } + + private void saveFile(MultipartFile multipartFile) { + try { + saveToFilesystem(multipartFile); + } catch (Exception e) { + throw new RuntimeException("Unable to save file", e); + } + } + + private static void saveToFilesystem(MultipartFile multipartFile) throws IOException { + String dir = Files.createTempDirectory("tmpDir").toFile().getAbsolutePath(); + File file = new File(dir + File.pathSeparator + multipartFile.getName()); + + try (OutputStream os = new FileOutputStream(file)) { + os.write(multipartFile.getBytes()); + } + } +} diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/MultipartUploadApplication.java b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/MultipartUploadApplication.java new file mode 100644 index 0000000000..299a5c2325 --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/java/com/baeldung/multipartupload/MultipartUploadApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.multipartupload; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class MultipartUploadApplication { + + public static void main(String[] args) { + SpringApplication.run(MultipartUploadApplication.class, args); + } + +} diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/createEmployeeForm.html b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/createEmployeeForm.html new file mode 100644 index 0000000000..c88a8b9318 --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/createEmployeeForm.html @@ -0,0 +1,16 @@ + + + + Getting Started: Handling Form Submission + + + +

Form

+
+

name:

+

document: + +

+
+ + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/success.html b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/success.html new file mode 100644 index 0000000000..2a49c01613 --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/main/resources/templates/employee/success.html @@ -0,0 +1,8 @@ + + + + + + Employee data submitted. + + \ No newline at end of file diff --git a/spring-web-modules/spring-mvc-forms-thymeleaf/src/test/java/com/baeldung/multipartupload/EmployeeControllerIntegrationTest.java b/spring-web-modules/spring-mvc-forms-thymeleaf/src/test/java/com/baeldung/multipartupload/EmployeeControllerIntegrationTest.java new file mode 100644 index 0000000000..73cf905a34 --- /dev/null +++ b/spring-web-modules/spring-mvc-forms-thymeleaf/src/test/java/com/baeldung/multipartupload/EmployeeControllerIntegrationTest.java @@ -0,0 +1,56 @@ +package com.baeldung.multipartupload; + +import org.junit.jupiter.api.Test; +import org.mockito.BDDMockito; +import org.mockito.Mockito; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; + +import static org.apache.http.entity.ContentType.DEFAULT_BINARY; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.multipart; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@WebMvcTest +@EnableWebMvc +public class EmployeeControllerIntegrationTest { + + private static final MockMultipartFile A_FILE = new MockMultipartFile("document", null, DEFAULT_BINARY.toString(), "Employee Record".getBytes()); + + @Autowired + private MockMvc mockMvc; + + @MockBean + private EmployeeService employeeService; + + @Test + public void givenFormData_whenPost_thenReturns200OK() throws Exception { + + mockMvc.perform(multipart("/employee") + .file(A_FILE) + .param("name", "testname")) + .andExpect(status().isOk()); + } + + @Test + public void givenEmployeeJsonAndMultipartFile_whenPostWithRequestPart_thenReturnsOK() throws Exception { + MockMultipartFile employeeJson = new MockMultipartFile("employee", null, + "application/json", "{\"name\": \"Emp Name\"}".getBytes()); + + mockMvc.perform(multipart("/requestpart/employee") + .file(A_FILE) + .file(employeeJson)) + .andExpect(status().isOk()); + } + + @Test + public void givenRequestPartAndRequestParam_whenPost_thenReturns200OK() throws Exception { + mockMvc.perform(multipart("/requestparam/employee") + .file(A_FILE) + .param("name", "testname")) + .andExpect(status().isOk()); + } +} \ No newline at end of file From 3f3adc726e7352d5dd4faed9fc19e18a9de9d9ba Mon Sep 17 00:00:00 2001 From: Bhabani Prasad Patel Date: Wed, 19 May 2021 08:34:43 +0530 Subject: [PATCH 46/72] Please override with the latest change (#10780) * Code commit for "Converting String to BigDecimal in Java" - Article * modified the assert param for comparing actual and expected values * removed the conflict change --- .../StringToBigDecimalConversionUnitTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java index e951b393c2..cd8ef6c70f 100644 --- a/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java +++ b/core-java-modules/core-java-string-conversions-2/src/test/java/com/baeldung/stringtobigdecimal/StringToBigDecimalConversionUnitTest.java @@ -13,8 +13,8 @@ public class StringToBigDecimalConversionUnitTest { @Test public void givenValidString_WhenBigDecimalObjectWithStringParameter_ThenResultIsDecimalObject() { - BigDecimal bigDecimal = new BigDecimal(123); - assertEquals(bigDecimal, new BigDecimal("123")); + BigDecimal bigDecimal = new BigDecimal("123"); + assertEquals(new BigDecimal(123), bigDecimal); } @Test(expected = NullPointerException.class) @@ -30,8 +30,8 @@ public class StringToBigDecimalConversionUnitTest { @Test public void givenValidString_WhenValueOfDoubleFromString_ThenResultIsDecimalObject() { - BigDecimal bigDecimal = new BigDecimal(123.42).setScale(2, BigDecimal.ROUND_HALF_UP); - assertEquals(bigDecimal, BigDecimal.valueOf(Double.valueOf("123.42"))); + BigDecimal bigDecimal = BigDecimal.valueOf(Double.valueOf("123.42")); + assertEquals(new BigDecimal(123.42).setScale(2, BigDecimal.ROUND_HALF_UP), bigDecimal); } @Test(expected = NullPointerException.class) From ef8ca205411a55c37fd6cc8602893ade61169ddd Mon Sep 17 00:00:00 2001 From: Liam Garvie Date: Wed, 19 May 2021 08:47:02 +0100 Subject: [PATCH 47/72] BAEL-4946 moved deserialization vulnerabilities code to a new package --- .../com/baeldung/deserialization/vulnerabilities/BadThing.java | 0 .../deserialization/vulnerabilities/MyCustomAttackObject.java | 0 .../deserialization/vulnerabilities/BadThingUnitTest.java | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename core-java-modules/{core-java => core-java-io-4}/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java (100%) rename core-java-modules/{core-java => core-java-io-4}/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java (100%) rename core-java-modules/{core-java => core-java-io-4}/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java (92%) diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java b/core-java-modules/core-java-io-4/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java rename to core-java-modules/core-java-io-4/src/main/java/com/baeldung/deserialization/vulnerabilities/BadThing.java diff --git a/core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java b/core-java-modules/core-java-io-4/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java similarity index 100% rename from core-java-modules/core-java/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java rename to core-java-modules/core-java-io-4/src/main/java/com/baeldung/deserialization/vulnerabilities/MyCustomAttackObject.java diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java b/core-java-modules/core-java-io-4/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java similarity index 92% rename from core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java rename to core-java-modules/core-java-io-4/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java index 5db51ba132..ea2180d178 100644 --- a/core-java-modules/core-java/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java +++ b/core-java-modules/core-java-io-4/src/test/java/com/baeldung/deserialization/vulnerabilities/BadThingUnitTest.java @@ -13,7 +13,7 @@ public class BadThingUnitTest { @Test @DisplayName("When a BadThing object is deserialized, then code execution in MyCustomAttackObject is run.") - public void testCodeExecution() throws Exception { + public void givenABadThingObject_whenItsDeserialized_thenExecutionIsRun() throws Exception { BadThing bt = new BadThing(); bt.looselyDefinedThing = new MyCustomAttackObject(); From dda696ff4a3b16a6c66bb7df20c231f75565b7f4 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:05:57 +0800 Subject: [PATCH 48/72] Update README.md --- core-java-modules/core-java-11-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-11-2/README.md b/core-java-modules/core-java-11-2/README.md index c87936b07d..ca9a306b82 100644 --- a/core-java-modules/core-java-11-2/README.md +++ b/core-java-modules/core-java-11-2/README.md @@ -7,3 +7,4 @@ This module contains articles about Java 11 core features - [Guide to Java Reflection](http://www.baeldung.com/java-reflection) - [Guide to Java 8’s Collectors](https://www.baeldung.com/java-8-collectors) - [New Features in Java 11](https://www.baeldung.com/java-11-new-features) +- [Getting the Java Version at Runtime](https://www.baeldung.com/get-java-version-runtime) From cc8fc1843aca6ca991203a15b377aea32868eda4 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:07:46 +0800 Subject: [PATCH 49/72] Update README.md --- core-java-modules/core-java-lang-oop-patterns/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-lang-oop-patterns/README.md b/core-java-modules/core-java-lang-oop-patterns/README.md index 178a556a96..df68a1413a 100644 --- a/core-java-modules/core-java-lang-oop-patterns/README.md +++ b/core-java-modules/core-java-lang-oop-patterns/README.md @@ -7,3 +7,4 @@ This module contains articles about Object-oriented programming (OOP) patterns i - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](https://www.baeldung.com/java-inheritance-composition) - [Immutable Objects in Java](https://www.baeldung.com/java-immutable-object) - [How to Make a Deep Copy of an Object in Java](https://www.baeldung.com/java-deep-copy) +- [Using an Interface vs. Abstract Class in Java](https://www.baeldung.com/java-interface-vs-abstract-class) From 488df183045fda511d15319875cb4c4be5d09187 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:11:05 +0800 Subject: [PATCH 50/72] Update README.md --- core-java-modules/core-java-lang-4/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-lang-4/README.md b/core-java-modules/core-java-lang-4/README.md index 8b8dff4bd1..e1023513eb 100644 --- a/core-java-modules/core-java-lang-4/README.md +++ b/core-java-modules/core-java-lang-4/README.md @@ -5,3 +5,4 @@ This module contains articles about core features in the Java language - [The Java final Keyword – Impact on Performance](https://www.baeldung.com/java-final-performance) - [The package-info.java File](https://www.baeldung.com/java-package-info) - [What are Compile-time Constants in Java?](https://www.baeldung.com/java-compile-time-constants) +- [Java Objects.hash() vs Objects.hashCode()](https://www.baeldung.com/java-objects-hash-vs-objects-hashcode) From 3a8f904a345c16a34c7f7e5e66b34e779d838931 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:12:58 +0800 Subject: [PATCH 51/72] Create README.md --- maven-modules/maven-copy-files/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 maven-modules/maven-copy-files/README.md diff --git a/maven-modules/maven-copy-files/README.md b/maven-modules/maven-copy-files/README.md new file mode 100644 index 0000000000..1e3a75cb0b --- /dev/null +++ b/maven-modules/maven-copy-files/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Copying Files With Maven](https://www.baeldung.com/maven-copy-files) From 3f830fb1667260680276ab87a90eb02fca3aebe7 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:14:56 +0800 Subject: [PATCH 52/72] Update README.md --- core-java-modules/core-java-streams-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-streams-3/README.md b/core-java-modules/core-java-streams-3/README.md index 26b4dfe975..48ebf145d2 100644 --- a/core-java-modules/core-java-streams-3/README.md +++ b/core-java-modules/core-java-streams-3/README.md @@ -12,4 +12,5 @@ This module contains articles about the Stream API in Java. - [Should We Close a Java Stream?](https://www.baeldung.com/java-stream-close) - [Returning Stream vs. Collection](https://www.baeldung.com/java-return-stream-collection) - [Convert a Java Enumeration Into a Stream](https://www.baeldung.com/java-enumeration-to-stream) +- [When to Use a Parallel Stream in Java](https://www.baeldung.com/java-when-to-use-parallel-stream) - More articles: [[<-- prev>]](/../core-java-streams-2) From 823ec61b410f2d1a8fc8d45fe45be564442efe16 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:16:34 +0800 Subject: [PATCH 53/72] Update README.md --- persistence-modules/java-jpa-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/java-jpa-3/README.md b/persistence-modules/java-jpa-3/README.md index 9c9e040825..e607043880 100644 --- a/persistence-modules/java-jpa-3/README.md +++ b/persistence-modules/java-jpa-3/README.md @@ -10,3 +10,4 @@ This module contains articles about the Java Persistence API (JPA) in Java. - [JPA CascadeType.REMOVE vs orphanRemoval](https://www.baeldung.com/jpa-cascade-remove-vs-orphanremoval) - [A Guide to MultipleBagFetchException in Hibernate](https://www.baeldung.com/java-hibernate-multiplebagfetchexception) - [How to Convert a Hibernate Proxy to a Real Entity Object](https://www.baeldung.com/hibernate-proxy-to-real-entity-object) +- [Returning an Auto-Generated Id with JPA](https://www.baeldung.com/jpa-get-auto-generated-id) From 9929ffc1cceaa29ad08bec81a1bfa0de47f1cf8b Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:17:47 +0800 Subject: [PATCH 54/72] Update README.md --- testing-modules/testing-libraries-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/testing-modules/testing-libraries-2/README.md b/testing-modules/testing-libraries-2/README.md index f8361904b8..868d8f307d 100644 --- a/testing-modules/testing-libraries-2/README.md +++ b/testing-modules/testing-libraries-2/README.md @@ -2,3 +2,4 @@ - [Guide to the System Rules Library](https://www.baeldung.com/java-system-rules-junit) - [Guide to the System Stubs Library](https://www.baeldung.com/java-system-stubs) +- [Code Coverage with SonarQube and JaCoCo](https://www.baeldung.com/sonarqube-jacoco-code-coverage) From cbd8cee5b419a9d679aaa12c5b2daa6da262d325 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:20:46 +0800 Subject: [PATCH 55/72] Update README.md --- spring-boot-modules/spring-boot-mvc-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-modules/spring-boot-mvc-3/README.md b/spring-boot-modules/spring-boot-mvc-3/README.md index bc3eb9e496..f9c6989b3c 100644 --- a/spring-boot-modules/spring-boot-mvc-3/README.md +++ b/spring-boot-modules/spring-boot-mvc-3/README.md @@ -9,4 +9,5 @@ This module contains articles about Spring Web MVC in Spring Boot projects. - [Spring MVC Async vs Spring WebFlux](https://www.baeldung.com/spring-mvc-async-vs-webflux) - [Differences in @Valid and @Validated Annotations in Spring](https://www.baeldung.com/spring-valid-vs-validated) - [CharacterEncodingFilter In SpringBoot](https://www.baeldung.com/spring-boot-characterencodingfilter) +- [HandlerInterceptors vs. Filters in Spring MVC](https://www.baeldung.com/spring-mvc-handlerinterceptor-vs-filter) - More articles: [[prev -->]](/spring-boot-modules/spring-boot-mvc-2) From f04dd12217de5efb6127691d118845338f9a00e9 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:22:21 +0800 Subject: [PATCH 56/72] Update README.md --- core-java-modules/core-java-string-operations-3/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-string-operations-3/README.md b/core-java-modules/core-java-string-operations-3/README.md index bc4af852ed..ad4ada3a68 100644 --- a/core-java-modules/core-java-string-operations-3/README.md +++ b/core-java-modules/core-java-string-operations-3/README.md @@ -3,3 +3,4 @@ - [Version Comparison in Java](https://www.baeldung.com/java-comparing-versions) - [Java (String) or .toString()?](https://www.baeldung.com/java-string-casting-vs-tostring) - [Split Java String by Newline](https://www.baeldung.com/java-string-split-by-newline) +- [Split a String in Java and Keep the Delimiters](https://www.baeldung.com/java-split-string-keep-delimiters) From 90c4e239321c72b060b3e5f788c55e7fb6a9198a Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:25:36 +0800 Subject: [PATCH 57/72] Update README.md --- persistence-modules/spring-data-jpa-annotations/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-data-jpa-annotations/README.md b/persistence-modules/spring-data-jpa-annotations/README.md index 3892e75733..5a5440b1ed 100644 --- a/persistence-modules/spring-data-jpa-annotations/README.md +++ b/persistence-modules/spring-data-jpa-annotations/README.md @@ -9,6 +9,7 @@ This module contains articles about annotations used in Spring Data JPA - [Spring JPA @Embedded and @EmbeddedId](https://www.baeldung.com/spring-jpa-embedded-method-parameters) - [Programmatic Transaction Management in Spring](https://www.baeldung.com/spring-programmatic-transaction-management) - [JPA Entity Lifecycle Events](https://www.baeldung.com/jpa-entity-lifecycle-events) +- [Overriding Column Definition With @AttributeOverride](https://www.baeldung.com/jpa-attributeoverride) ### Eclipse Config After importing the project into Eclipse, you may see the following error: From e8c0d7bf5325ce671e879d10a44c0dccfdf801f0 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:27:41 +0800 Subject: [PATCH 58/72] Update README.md --- spring-boot-modules/spring-boot-cassandre/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-cassandre/README.md b/spring-boot-modules/spring-boot-cassandre/README.md index 14ffbb7d6b..4dfef587db 100644 --- a/spring-boot-modules/spring-boot-cassandre/README.md +++ b/spring-boot-modules/spring-boot-cassandre/README.md @@ -8,4 +8,4 @@ This project is an example of a trading bot developed with Cassandre * `mvn spring-boot:run` - Run the bot ## Relevant Articles -- [Build a Trading Bot with Cassandre Spring Boot Starter](https://www.baeldung.com/build-a-trading-bot-with-cassandre-spring-boot-starter/) +- [Build a Trading Bot with Cassandre Spring Boot Starter](https://www.baeldung.com/cassandre-spring-boot-trading-bot) From 56d69f922ba5a9b293e4b5833881aaf53cc868f4 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Wed, 19 May 2021 22:59:16 +0530 Subject: [PATCH 59/72] JAVA-2419: Move/rename module spring-boot-xml --- spring-boot-modules/pom.xml | 1 - .../README.md | 1 + .../spring-boot-basic-customization-2/pom.xml | 5 ++- .../java/com/baeldung/springbootxml/Pojo.java | 0 .../SpringBootXmlApplication.java | 0 .../src/main/resources/application.properties | 1 + .../src/main/resources/beans.xml | 0 ...ringBootXmlApplicationIntegrationTest.java | 1 + spring-boot-modules/spring-boot-xml/README.md | 3 -- spring-boot-modules/spring-boot-xml/pom.xml | 39 ------------------- .../src/main/resources/application.properties | 1 - 11 files changed, 7 insertions(+), 45 deletions(-) rename spring-boot-modules/{spring-boot-xml => spring-boot-basic-customization-2}/src/main/java/com/baeldung/springbootxml/Pojo.java (100%) rename spring-boot-modules/{spring-boot-xml => spring-boot-basic-customization-2}/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java (100%) rename spring-boot-modules/{spring-boot-xml => spring-boot-basic-customization-2}/src/main/resources/beans.xml (100%) rename spring-boot-modules/{spring-boot-xml/src/main/java => spring-boot-basic-customization-2/src/main/test}/com/baeldung/springbootxml/SpringBootXmlApplicationIntegrationTest.java (99%) delete mode 100644 spring-boot-modules/spring-boot-xml/README.md delete mode 100644 spring-boot-modules/spring-boot-xml/pom.xml delete mode 100644 spring-boot-modules/spring-boot-xml/src/main/resources/application.properties diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index 7c94d5b7d7..53af0de315 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -70,7 +70,6 @@ spring-boot-swagger-jwt spring-boot-testing spring-boot-vue - spring-boot-xml spring-boot-actuator spring-boot-data-2 spring-boot-react diff --git a/spring-boot-modules/spring-boot-basic-customization-2/README.md b/spring-boot-modules/spring-boot-basic-customization-2/README.md index bf7e4abb76..f041c1d38a 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/README.md +++ b/spring-boot-modules/spring-boot-basic-customization-2/README.md @@ -5,3 +5,4 @@ This module contains articles about Spring Boot customization 2 ### Relevant Articles: - [DispatcherServlet and web.xml in Spring Boot](https://www.baeldung.com/spring-boot-dispatcherservlet-web-xml) + - [XML Defined Beans in Spring Boot](https://www.baeldung.com/spring-boot-xml-beans) \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-basic-customization-2/pom.xml b/spring-boot-modules/spring-boot-basic-customization-2/pom.xml index d42a7fd3de..8c1bc22600 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/pom.xml +++ b/spring-boot-modules/spring-boot-basic-customization-2/pom.xml @@ -23,7 +23,10 @@ org.springframework.boot spring-boot-starter-test - test + + + junit + junit diff --git a/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/Pojo.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/springbootxml/Pojo.java similarity index 100% rename from spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/Pojo.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/springbootxml/Pojo.java diff --git a/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java similarity index 100% rename from spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplication.java diff --git a/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties b/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties index e69de29bb2..ab9de92c82 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/application.properties @@ -0,0 +1 @@ +sample=string loaded from properties! \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-xml/src/main/resources/beans.xml b/spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/beans.xml similarity index 100% rename from spring-boot-modules/spring-boot-xml/src/main/resources/beans.xml rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/resources/beans.xml diff --git a/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplicationIntegrationTest.java b/spring-boot-modules/spring-boot-basic-customization-2/src/main/test/com/baeldung/springbootxml/SpringBootXmlApplicationIntegrationTest.java similarity index 99% rename from spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplicationIntegrationTest.java rename to spring-boot-modules/spring-boot-basic-customization-2/src/main/test/com/baeldung/springbootxml/SpringBootXmlApplicationIntegrationTest.java index 2c3993d0d8..f3060de82a 100644 --- a/spring-boot-modules/spring-boot-xml/src/main/java/com/baeldung/springbootxml/SpringBootXmlApplicationIntegrationTest.java +++ b/spring-boot-modules/spring-boot-basic-customization-2/src/main/test/com/baeldung/springbootxml/SpringBootXmlApplicationIntegrationTest.java @@ -1,5 +1,6 @@ package com.baeldung.springbootxml; + import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring-boot-modules/spring-boot-xml/README.md b/spring-boot-modules/spring-boot-xml/README.md deleted file mode 100644 index 7a9a0bdc09..0000000000 --- a/spring-boot-modules/spring-boot-xml/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: - -- [XML Defined Beans in Spring Boot](https://www.baeldung.com/spring-boot-xml-beans) diff --git a/spring-boot-modules/spring-boot-xml/pom.xml b/spring-boot-modules/spring-boot-xml/pom.xml deleted file mode 100644 index b3fd343e4f..0000000000 --- a/spring-boot-modules/spring-boot-xml/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - spring-boot-xml - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-test - - - junit - junit - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-xml/src/main/resources/application.properties b/spring-boot-modules/spring-boot-xml/src/main/resources/application.properties deleted file mode 100644 index ab9de92c82..0000000000 --- a/spring-boot-modules/spring-boot-xml/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ -sample=string loaded from properties! \ No newline at end of file From 11941b70a1167d07c4a21e44f999b989d7d3f1f6 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:30:51 +0800 Subject: [PATCH 60/72] Update README.md --- 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 afdd7e5760..3bd3ba927e 100644 --- a/core-java-modules/core-java-string-conversions-2/README.md +++ b/core-java-modules/core-java-string-conversions-2/README.md @@ -6,4 +6,5 @@ This module contains articles about string conversions from/to another type. - [Java String Conversions](https://www.baeldung.com/java-string-conversions) - [Convert String to Byte Array and Reverse in Java](https://www.baeldung.com/java-string-to-byte-array) - [Convert Character Array to String in Java](https://www.baeldung.com/java-char-array-to-string) +- [Converting String to BigDecimal in Java](https://www.baeldung.com/java-string-to-bigdecimal) - More articles: [[<-- prev]](/core-java-string-conversions) From a281d31d1ba51554ede0e44149bec423850321bb Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Thu, 20 May 2021 01:32:52 +0800 Subject: [PATCH 61/72] Update README.md --- persistence-modules/spring-data-jpa-crud/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/spring-data-jpa-crud/README.md b/persistence-modules/spring-data-jpa-crud/README.md index dc0c78c87e..81559bb773 100644 --- a/persistence-modules/spring-data-jpa-crud/README.md +++ b/persistence-modules/spring-data-jpa-crud/README.md @@ -10,6 +10,7 @@ This module contains articles about CRUD operations in Spring Data JPA - [Batch Insert/Update with Hibernate/JPA](https://www.baeldung.com/jpa-hibernate-batch-insert-update) - [Difference Between save() and saveAndFlush() in Spring Data JPA](https://www.baeldung.com/spring-data-jpa-save-saveandflush) - [Generate Database Schema with Spring Data JPA](https://www.baeldung.com/spring-data-jpa-generate-db-schema) +- [How to Implement a Soft Delete with Spring JPA](https://www.baeldung.com/spring-jpa-soft-delete) ### Eclipse Config After importing the project into Eclipse, you may see the following error: From 270034a046f7c07a69713d14de15f469e0804033 Mon Sep 17 00:00:00 2001 From: makapszenna <66560584+makapszenna@users.noreply.github.com> Date: Thu, 20 May 2021 03:27:09 +0200 Subject: [PATCH 62/72] BAEL-4796 How to display a message in Maven - improvement (#10779) Co-authored-by: Adrianna Zychewicz --- maven-modules/maven-printing-plugins/pom.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/maven-modules/maven-printing-plugins/pom.xml b/maven-modules/maven-printing-plugins/pom.xml index 6ea1ab2a84..805c3c1633 100644 --- a/maven-modules/maven-printing-plugins/pom.xml +++ b/maven-modules/maven-printing-plugins/pom.xml @@ -49,9 +49,11 @@ echo - Hello, world - Embed a line break: ${line.separator} - ArtifactId is ${project.artifactId} + + Hello, world + Embed a line break: ${line.separator} + ArtifactId is ${project.artifactId} + INFO /logs/log-echo.txt true From 8ee60907ea91867d377f2282df194246dbe36863 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Wed, 19 May 2021 20:27:34 -0500 Subject: [PATCH 63/72] BAEL-4636: add link back to article (#10787) --- testing-modules/testing-libraries-2/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/testing-modules/testing-libraries-2/README.md b/testing-modules/testing-libraries-2/README.md index f8361904b8..868d8f307d 100644 --- a/testing-modules/testing-libraries-2/README.md +++ b/testing-modules/testing-libraries-2/README.md @@ -2,3 +2,4 @@ - [Guide to the System Rules Library](https://www.baeldung.com/java-system-rules-junit) - [Guide to the System Stubs Library](https://www.baeldung.com/java-system-stubs) +- [Code Coverage with SonarQube and JaCoCo](https://www.baeldung.com/sonarqube-jacoco-code-coverage) From 31f40d862359b24a45c02a15c6c8a7a282ee4fae Mon Sep 17 00:00:00 2001 From: kwoyke Date: Fri, 21 May 2021 07:16:08 +0200 Subject: [PATCH 64/72] "BAEL-3407: Add examples for injecting Spring components in MapStruct" (#10778) Co-authored-by: Krzysztof Woyke --- ...DestinationMapperUsingInjectedService.java | 22 ++++++++++++ .../com/baeldung/service/SimpleService.java | 11 ++++++ ...ionMapperUsingInjectedIntegrationTest.java | 35 +++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 mapstruct/src/main/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedService.java create mode 100644 mapstruct/src/main/java/com/baeldung/service/SimpleService.java create mode 100644 mapstruct/src/test/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedIntegrationTest.java diff --git a/mapstruct/src/main/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedService.java b/mapstruct/src/main/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedService.java new file mode 100644 index 0000000000..22e6499711 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedService.java @@ -0,0 +1,22 @@ +package com.baeldung.mapper; + +import com.baeldung.dto.SimpleSource; +import com.baeldung.entity.SimpleDestination; +import com.baeldung.service.SimpleService; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.springframework.beans.factory.annotation.Autowired; + +@Mapper(componentModel = "spring") +public abstract class SimpleDestinationMapperUsingInjectedService { + + @Autowired + protected SimpleService simpleService; + + @Mapping(target = "name", expression = "java(simpleService.enrichName(source.getName()))") + public abstract SimpleDestination sourceToDestination(SimpleSource source); + + public abstract SimpleSource destinationToSource(SimpleDestination destination); + + +} diff --git a/mapstruct/src/main/java/com/baeldung/service/SimpleService.java b/mapstruct/src/main/java/com/baeldung/service/SimpleService.java new file mode 100644 index 0000000000..14b6c09592 --- /dev/null +++ b/mapstruct/src/main/java/com/baeldung/service/SimpleService.java @@ -0,0 +1,11 @@ +package com.baeldung.service; + +import org.springframework.stereotype.Service; + +@Service +public class SimpleService { + + public String enrichName(String name) { + return "-:: " + name + " ::-"; + } +} diff --git a/mapstruct/src/test/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedIntegrationTest.java b/mapstruct/src/test/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedIntegrationTest.java new file mode 100644 index 0000000000..3bfbc60de6 --- /dev/null +++ b/mapstruct/src/test/java/com/baeldung/mapper/SimpleDestinationMapperUsingInjectedIntegrationTest.java @@ -0,0 +1,35 @@ +package com.baeldung.mapper; + +import com.baeldung.dto.SimpleSource; +import com.baeldung.entity.SimpleDestination; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.assertj.core.api.Assertions.assertThat; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("classpath:applicationContext.xml") +public class SimpleDestinationMapperUsingInjectedIntegrationTest { + + @Autowired + private SimpleDestinationMapperUsingInjectedService mapper; + + @Test + public void givenSourceToDestination_whenMaps_thenNameEnriched() { + // Given + SimpleSource source = new SimpleSource(); + source.setName("Bob"); + source.setDescription("The Builder"); + + // When + SimpleDestination destination = mapper.sourceToDestination(source); + + // Then + assertThat(destination).isNotNull(); + assertThat(destination.getName()).isEqualTo("-:: Bob ::-"); + assertThat(destination.getDescription()).isEqualTo("The Builder"); + } +} \ No newline at end of file From 2553a71828d0beea1dbf04d40d116c3a683bc70a Mon Sep 17 00:00:00 2001 From: kwoyke Date: Sat, 22 May 2021 10:46:02 +0200 Subject: [PATCH 65/72] BAEL-4970: Close the original response body (#10782) Co-authored-by: Krzysztof Woyke --- .../okhttp/interceptors/ErrorResponseInterceptor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries-http-2/src/main/java/com/baeldung/okhttp/interceptors/ErrorResponseInterceptor.java b/libraries-http-2/src/main/java/com/baeldung/okhttp/interceptors/ErrorResponseInterceptor.java index f6c6673705..02f45e1282 100644 --- a/libraries-http-2/src/main/java/com/baeldung/okhttp/interceptors/ErrorResponseInterceptor.java +++ b/libraries-http-2/src/main/java/com/baeldung/okhttp/interceptors/ErrorResponseInterceptor.java @@ -21,7 +21,12 @@ public class ErrorResponseInterceptor implements Interceptor { Gson gson = new Gson(); String body = gson.toJson(new ErrorMessage(response.code(), "The response from the server was not OK")); ResponseBody responseBody = ResponseBody.create(body, APPLICATION_JSON); - + + ResponseBody originalBody = response.body(); + if (originalBody != null) { + originalBody.close(); + } + return response.newBuilder() .body(responseBody) .build(); From bef579431423ab9678107d8f9bdfdc1b7df39f40 Mon Sep 17 00:00:00 2001 From: Bhabani Prasad Patel Date: Sat, 22 May 2021 14:47:58 +0530 Subject: [PATCH 66/72] Code commit for BAEL-4489 (#10790) * Code commit for "Converting String to BigDecimal in Java" - Article * modified the assert param for comparing actual and expected values * removed the conflict change * Code commit for Secret Key to String and vice versa in java * renaming the junit class name to match coding standard --- .../ConversionClassUtil.java | 53 +++++++++++++++++++ .../ConversionClassUtilUnitTest.java | 44 +++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 core-java-modules/core-java-security-2/src/main/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtil.java create mode 100644 core-java-modules/core-java-security-2/src/test/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtilUnitTest.java diff --git a/core-java-modules/core-java-security-2/src/main/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtil.java b/core-java-modules/core-java-security-2/src/main/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtil.java new file mode 100644 index 0000000000..5ff1b7cb9d --- /dev/null +++ b/core-java-modules/core-java-security-2/src/main/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtil.java @@ -0,0 +1,53 @@ +package com.baeldung.secretkeyandstringconversion; + +import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.KeySpec; +import java.util.Base64; + +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.PBEKeySpec; +import javax.crypto.spec.SecretKeySpec; + +public class ConversionClassUtil { + + /* Generating Secret key */ + + // Generating Secret Key using KeyGenerator class with 256 + public static SecretKey generateKey(int n) throws NoSuchAlgorithmException { + KeyGenerator keyGenerator = KeyGenerator.getInstance("AES"); + keyGenerator.init(n); + SecretKey originalKey = keyGenerator.generateKey(); + return originalKey; + } + + // Generating Secret Key using password and salt + public static SecretKey getKeyFromPassword(String password, String salt) + throws NoSuchAlgorithmException, InvalidKeySpecException { + SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256"); + KeySpec spec = new PBEKeySpec(password.toCharArray(), salt.getBytes(), 65536, 256); + SecretKey originalKey = new SecretKeySpec(factory.generateSecret(spec).getEncoded(), "AES"); + return originalKey; + } + + /* Converting Secret key into String */ + public static String convertSecretKeyToString(SecretKey secretKey) throws NoSuchAlgorithmException { + // Converting the Secret Key into byte array + byte[] rawData = secretKey.getEncoded(); + // Getting String - Base64 encoded version of the Secret Key + String encodedKey = Base64.getEncoder().encodeToString(rawData); + return encodedKey; + } + + /* Converting String into Secret key into */ + public static SecretKey convertStringToSecretKeyto(String encodedKey) { + // Decoding the Base64 encoded string into byte array + byte[] decodedKey = Base64.getDecoder().decode(encodedKey); + // Rebuilding the Secret Key using SecretKeySpec Class + SecretKey originalKey = new SecretKeySpec(decodedKey, 0, decodedKey.length, "AES"); + return originalKey; + } + +} diff --git a/core-java-modules/core-java-security-2/src/test/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtilUnitTest.java b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtilUnitTest.java new file mode 100644 index 0000000000..29c8ba9fd0 --- /dev/null +++ b/core-java-modules/core-java-security-2/src/test/java/com/baeldung/secretkeyandstringconversion/ConversionClassUtilUnitTest.java @@ -0,0 +1,44 @@ +package com.baeldung.secretkeyandstringconversion; + +import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; + +import javax.crypto.SecretKey; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class ConversionClassUtilUnitTest { + + @Test + void givenPasswordAndSalt_whenCreateSecreKeyCheckConversion_thenSuccess() + throws NoSuchAlgorithmException, InvalidKeySpecException { + // given + String password = "Baeldung@2021"; + String salt = "@$#baelDunG@#^$*"; + + // when + SecretKey encodedKey = ConversionClassUtil.getKeyFromPassword(password, salt); + String encodedString = ConversionClassUtil.convertSecretKeyToString(encodedKey); + SecretKey decodeKey = ConversionClassUtil.convertStringToSecretKeyto(encodedString); + + // then + Assertions.assertEquals(encodedKey, decodeKey); + } + + @Test + void givenSize_whenCreateSecreKeyCheckConversion_thenSuccess() + throws NoSuchAlgorithmException, InvalidKeySpecException { + // given + int size = 256; + + // when + SecretKey encodedKey = ConversionClassUtil.generateKey(size); + String encodedString = ConversionClassUtil.convertSecretKeyToString(encodedKey); + SecretKey decodeKey = ConversionClassUtil.convertStringToSecretKeyto(encodedString); + + // then + Assertions.assertEquals(encodedKey, decodeKey); + } + +} From 5e68c55f060b9e32491fc34b19ee43123e75e005 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sat, 22 May 2021 11:23:11 -0500 Subject: [PATCH 67/72] BAEL-4796: add link back to article (#10791) --- maven-modules/maven-printing-plugins/README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 maven-modules/maven-printing-plugins/README.md diff --git a/maven-modules/maven-printing-plugins/README.md b/maven-modules/maven-printing-plugins/README.md new file mode 100644 index 0000000000..862c4bcdd1 --- /dev/null +++ b/maven-modules/maven-printing-plugins/README.md @@ -0,0 +1,7 @@ +## Maven Printing Plugins + +This module contains articles about printing from Maven plugins. + +### Relevant Articles + +- [How to Display a Message in Maven](https://www.baeldung.com/maven-print-message-during-execution) From 960642482e9707e441a74c33d956708345aed9d2 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Sun, 23 May 2021 21:05:12 +0530 Subject: [PATCH 68/72] JAVA-5392: Upgrade spring-boot-admin module --- .../spring-boot-admin/spring-boot-admin-client/pom.xml | 2 +- .../spring-boot-admin/spring-boot-admin-server/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml index a565b94c79..eca92ff3a5 100644 --- a/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml +++ b/spring-boot-modules/spring-boot-admin/spring-boot-admin-client/pom.xml @@ -60,7 +60,7 @@ - 2.4.0 + 2.4.1 2.0.4.RELEASE diff --git a/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml index b53394cdef..63bc286b45 100644 --- a/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml +++ b/spring-boot-modules/spring-boot-admin/spring-boot-admin-server/pom.xml @@ -76,8 +76,8 @@ - 2.4.0 - 2.4.0 + 2.4.1 + 2.4.1 1.5.7 2.0.4.RELEASE From 26f3376b1bed8a305bc6bb2415c4fedf7f63784d Mon Sep 17 00:00:00 2001 From: freelansam <79205526+freelansam@users.noreply.github.com> Date: Sun, 23 May 2021 21:44:50 +0530 Subject: [PATCH 69/72] BAEL-4791: Spring AliasFor Annotation (#10794) --- spring-core-5/pom.xml | 5 ++ .../java/com/baeldung/aliasfor/MyMapping.java | 29 ++++++++ .../aliasfor/MyMappingController.java | 13 ++++ .../baeldung/aliasfor/AliasForUnitTest.java | 66 +++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 spring-core-5/src/main/java/com/baeldung/aliasfor/MyMapping.java create mode 100644 spring-core-5/src/main/java/com/baeldung/aliasfor/MyMappingController.java create mode 100644 spring-core-5/src/test/java/com/baeldung/aliasfor/AliasForUnitTest.java diff --git a/spring-core-5/pom.xml b/spring-core-5/pom.xml index 68229b80b8..1c2e80be44 100644 --- a/spring-core-5/pom.xml +++ b/spring-core-5/pom.xml @@ -19,6 +19,11 @@ spring-boot-starter ${spring-boot-starter.version} + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-starter.version} + org.springframework.boot spring-boot-starter-test diff --git a/spring-core-5/src/main/java/com/baeldung/aliasfor/MyMapping.java b/spring-core-5/src/main/java/com/baeldung/aliasfor/MyMapping.java new file mode 100644 index 0000000000..05263297b5 --- /dev/null +++ b/spring-core-5/src/main/java/com/baeldung/aliasfor/MyMapping.java @@ -0,0 +1,29 @@ +package com.baeldung.aliasfor; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.core.annotation.AliasFor; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +@RequestMapping +public @interface MyMapping { + + @AliasFor(annotation = RequestMapping.class, attribute = "method") + RequestMethod[] action() default {}; + + @AliasFor(annotation = RequestMapping.class, attribute = "path") + String[] value() default {}; + + @AliasFor(annotation = RequestMapping.class, attribute = "path") + String[] mapping() default {}; + + @AliasFor(annotation = RequestMapping.class, attribute = "path") + String[] route() default {}; + +} diff --git a/spring-core-5/src/main/java/com/baeldung/aliasfor/MyMappingController.java b/spring-core-5/src/main/java/com/baeldung/aliasfor/MyMappingController.java new file mode 100644 index 0000000000..c3dc2784f8 --- /dev/null +++ b/spring-core-5/src/main/java/com/baeldung/aliasfor/MyMappingController.java @@ -0,0 +1,13 @@ +package com.baeldung.aliasfor; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +public class MyMappingController { + + @MyMapping(action = RequestMethod.PATCH, route = "/test") + public void mappingMethod() { + } + +} diff --git a/spring-core-5/src/test/java/com/baeldung/aliasfor/AliasForUnitTest.java b/spring-core-5/src/test/java/com/baeldung/aliasfor/AliasForUnitTest.java new file mode 100644 index 0000000000..449a55a6f8 --- /dev/null +++ b/spring-core-5/src/test/java/com/baeldung/aliasfor/AliasForUnitTest.java @@ -0,0 +1,66 @@ +package com.baeldung.aliasfor; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl; + +import java.lang.reflect.Method; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.annotation.AnnotatedElementUtils; +import org.springframework.core.annotation.AnnotationAttributes; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = MyMappingController.class) +public class AliasForUnitTest { + + @Autowired + private ConfigurableApplicationContext context; + + Class controllerClass; + + @Before + public void setControllerBean() { + MyMappingController controllerBean = context.getBean(MyMappingController.class); + controllerClass = controllerBean.getClass(); + } + + @Test + public void givenComposedAnnotation_whenExplicitAlias_thenMetaAnnotationAttributeOverridden() { + + for (Method method : controllerClass.getMethods()) { + if (method.isAnnotationPresent(MyMapping.class)) { + MyMapping annotation = AnnotationUtils.findAnnotation(method, MyMapping.class); + RequestMapping metaAnnotation = AnnotationUtils.findAnnotation(method, RequestMapping.class); + + assertEquals(RequestMethod.PATCH, annotation.action()[0]); + + assertEquals(0, metaAnnotation.method().length); + } + } + } + + @Test + public void givenComposedAnnotation_whenImplictAlias_thenAttributesEqual() { + for (Method method : controllerClass.getMethods()) { + if (method.isAnnotationPresent(MyMapping.class)) { + MyMapping annotationOnBean = AnnotationUtils.findAnnotation(method, MyMapping.class); + + assertTrue(annotationOnBean.mapping()[0].equals(annotationOnBean.route()[0])); + assertTrue(annotationOnBean.value()[0].equals(annotationOnBean.route()[0])); + } + } + } + +} From d8c91ee26aefb12380e03b8ea286cf37461059bb Mon Sep 17 00:00:00 2001 From: mikr Date: Mon, 24 May 2021 13:47:38 +0200 Subject: [PATCH 70/72] JAVA-3589 Update Lombok version --- lombok-custom/pom.xml | 1 - lombok/pom.xml | 2 -- pom.xml | 2 +- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lombok-custom/pom.xml b/lombok-custom/pom.xml index 220367bfe9..68ce4d1346 100644 --- a/lombok-custom/pom.xml +++ b/lombok-custom/pom.xml @@ -57,7 +57,6 @@ - 1.14.8 1.8 3.3.0-v_771 diff --git a/lombok/pom.xml b/lombok/pom.xml index 334d1defc9..c5758ea8df 100644 --- a/lombok/pom.xml +++ b/lombok/pom.xml @@ -73,8 +73,6 @@ - - 1.18.10 1.0.0.Final diff --git a/pom.xml b/pom.xml index f4606ec368..e805431b18 100644 --- a/pom.xml +++ b/pom.xml @@ -1404,7 +1404,7 @@ 3.0.0 3.13.0 - 1.16.12 + 1.18.20 1.4.197 From a8b32feea86346e880691647aa4af4de539ed570 Mon Sep 17 00:00:00 2001 From: mikr Date: Mon, 24 May 2021 16:15:51 +0200 Subject: [PATCH 71/72] JAVA-3589 Update Lombok version --- lombok-custom/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/lombok-custom/pom.xml b/lombok-custom/pom.xml index 68ce4d1346..220367bfe9 100644 --- a/lombok-custom/pom.xml +++ b/lombok-custom/pom.xml @@ -57,6 +57,7 @@ + 1.14.8 1.8 3.3.0-v_771 From fa55f989d68e9f38fc0e19ccd9061c9ddf5d3122 Mon Sep 17 00:00:00 2001 From: anmoldeep0123 Date: Tue, 25 May 2021 00:27:21 +0530 Subject: [PATCH 72/72] BAEL-4220 | A Guide to IllegalAccessError and when it happens (#10798) * BAEL-4220 | A Guide to IllegalAccessError and when it happens * BAEL-4220 | A Guide to IllegalAccessError and when it happens | fix tests * BAEL-4220 | A Guide to IllegalAccessError and when it happens | fix tests * BAEL-4220 | A Guide to IllegalAccessError and when it happens | BDD test names --- .../exceptions/illegalaccesserror/Class1.java | 8 +++++++ .../exceptions/illegalaccesserror/Class2.java | 10 +++++++++ .../IllegalAccessErrorExample.java | 20 ++++++++++++++++++ .../IllegalAccessErrorSolved.java | 20 ++++++++++++++++++ .../IllegalAccessErrorExampleUnitTest.java | 21 +++++++++++++++++++ .../IllegalAccessErrorSolvedUnitTest.java | 14 +++++++++++++ 6 files changed, 93 insertions(+) create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class1.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class2.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExample.java create mode 100644 core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolved.java create mode 100644 core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExampleUnitTest.java create mode 100644 core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolvedUnitTest.java diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class1.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class1.java new file mode 100644 index 0000000000..d50d2bc5f5 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class1.java @@ -0,0 +1,8 @@ +package com.baeldung.exceptions.illegalaccesserror; + +public class Class1 { + + public void bar() { + System.out.println("SUCCESS"); + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class2.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class2.java new file mode 100644 index 0000000000..766ceccb6b --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/Class2.java @@ -0,0 +1,10 @@ +package com.baeldung.exceptions.illegalaccesserror; + +public class Class2 { + + public void foo() { + Class1 c1 = new Class1(); + c1.bar(); + } +} + \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExample.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExample.java new file mode 100644 index 0000000000..2cc1abbb1d --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExample.java @@ -0,0 +1,20 @@ +package com.baeldung.exceptions.illegalaccesserror; + +public class IllegalAccessErrorExample { + + interface Baeldung { + public default void foobar() { + System.out.println("This is a default method."); + } + } + + class Super { + private void foobar() { + System.out.println("SuperClass method foobar"); + } + } + + class MySubClass extends Super implements Baeldung { + + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolved.java b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolved.java new file mode 100644 index 0000000000..8f6a4c14a4 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/main/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolved.java @@ -0,0 +1,20 @@ +package com.baeldung.exceptions.illegalaccesserror; + +public class IllegalAccessErrorSolved { + + interface BaeldungSolved { + public default void foobar() { + System.out.println("This is a default method."); + } + } + + class SuperSolved { + public void foobar() { + System.out.println("SuperClass method foobar"); + } + } + + class MySubClassSolved extends SuperSolved implements BaeldungSolved { + + } +} \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExampleUnitTest.java b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExampleUnitTest.java new file mode 100644 index 0000000000..201e782229 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorExampleUnitTest.java @@ -0,0 +1,21 @@ +package com.baeldung.exceptions.illegalaccesserror; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class IllegalAccessErrorExampleUnitTest { + + @Test() + public void givenInterfaceDefaultMethOverriddenPrivateAccess_whenInvoked_thenIllegalAccessError() { + Assertions.assertThrows(IllegalAccessError.class, () -> { + new IllegalAccessErrorExample().new MySubClass().foobar(); + }); + } + + @Test() + public void givenClass1Class2_whenSameClassDefintion_thenNoIllegalAccessError() { + Assertions.assertDoesNotThrow(() -> { + new Class2().foo(); + }); + } +} diff --git a/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolvedUnitTest.java b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolvedUnitTest.java new file mode 100644 index 0000000000..ad150334d4 --- /dev/null +++ b/core-java-modules/core-java-exceptions-3/src/test/java/com/baeldung/exceptions/illegalaccesserror/IllegalAccessErrorSolvedUnitTest.java @@ -0,0 +1,14 @@ +package com.baeldung.exceptions.illegalaccesserror; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class IllegalAccessErrorSolvedUnitTest { + + @Test() + public void givenInterfaceDefaultMethOverriddenNonPrivateAccess_whenInvoked_thenNoIllegalAccessError() { + Assertions.assertDoesNotThrow(() -> { + new IllegalAccessErrorSolved().new MySubClassSolved().foobar(); + }); + } +}