diff --git a/akka-http/pom.xml b/akka-http/pom.xml index c146e58b60..4b73fbc960 100644 --- a/akka-http/pom.xml +++ b/akka-http/pom.xml @@ -1,8 +1,7 @@ - + 4.0.0 akka-http akka-http diff --git a/akka-streams/pom.xml b/akka-streams/pom.xml index f87f9dd667..f92b37fcb4 100644 --- a/akka-streams/pom.xml +++ b/akka-streams/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-genetic/pom.xml b/algorithms-genetic/pom.xml index 4d15464138..1c9224aff2 100644 --- a/algorithms-genetic/pom.xml +++ b/algorithms-genetic/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-miscellaneous-1/pom.xml b/algorithms-miscellaneous-1/pom.xml index 00cb4eeda9..dd3742d4b0 100644 --- a/algorithms-miscellaneous-1/pom.xml +++ b/algorithms-miscellaneous-1/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-miscellaneous-2/pom.xml b/algorithms-miscellaneous-2/pom.xml index 89d5b3657a..fcefc3ccba 100644 --- a/algorithms-miscellaneous-2/pom.xml +++ b/algorithms-miscellaneous-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-miscellaneous-3/pom.xml b/algorithms-miscellaneous-3/pom.xml index 166a7be623..d5416e543d 100644 --- a/algorithms-miscellaneous-3/pom.xml +++ b/algorithms-miscellaneous-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-miscellaneous-4/pom.xml b/algorithms-miscellaneous-4/pom.xml index 31a6db5354..1eae038bc0 100644 --- a/algorithms-miscellaneous-4/pom.xml +++ b/algorithms-miscellaneous-4/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-miscellaneous-5/pom.xml b/algorithms-miscellaneous-5/pom.xml index 71a5a3d410..8b7cfc7b25 100644 --- a/algorithms-miscellaneous-5/pom.xml +++ b/algorithms-miscellaneous-5/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-miscellaneous-6/pom.xml b/algorithms-miscellaneous-6/pom.xml index 0a0edcbb3f..c9479d160e 100644 --- a/algorithms-miscellaneous-6/pom.xml +++ b/algorithms-miscellaneous-6/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 algorithms-miscellaneous-6 0.0.1-SNAPSHOT @@ -11,9 +12,9 @@ parent-modules 1.0.0-SNAPSHOT - + - + com.google.guava guava ${guava.version} @@ -41,7 +42,7 @@ ${commons-math3.version} - + 28.1-jre 3.9.0 @@ -49,4 +50,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/algorithms-searching/pom.xml b/algorithms-searching/pom.xml index 80443155ff..a67c062403 100644 --- a/algorithms-searching/pom.xml +++ b/algorithms-searching/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/algorithms-sorting-2/pom.xml b/algorithms-sorting-2/pom.xml index 5ef90b9825..f2a31d957d 100644 --- a/algorithms-sorting-2/pom.xml +++ b/algorithms-sorting-2/pom.xml @@ -1,5 +1,4 @@ - 4.0.0 diff --git a/algorithms-sorting/pom.xml b/algorithms-sorting/pom.xml index 1d0b7718ac..cae5eb6efc 100644 --- a/algorithms-sorting/pom.xml +++ b/algorithms-sorting/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/animal-sniffer-mvn-plugin/pom.xml b/animal-sniffer-mvn-plugin/pom.xml index 82726aa7bc..9e4f25c791 100644 --- a/animal-sniffer-mvn-plugin/pom.xml +++ b/animal-sniffer-mvn-plugin/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/annotations/annotation-processing/pom.xml b/annotations/annotation-processing/pom.xml index f94cee04f0..59dffb963d 100644 --- a/annotations/annotation-processing/pom.xml +++ b/annotations/annotation-processing/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/annotations/annotation-user/pom.xml b/annotations/annotation-user/pom.xml index f38e93528d..4743f22e95 100644 --- a/annotations/annotation-user/pom.xml +++ b/annotations/annotation-user/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/annotations/pom.xml b/annotations/pom.xml index c3c23cf5ab..b3fabb8637 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/antlr/pom.xml b/antlr/pom.xml index c8e48706fb..f9d6fb1a08 100644 --- a/antlr/pom.xml +++ b/antlr/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-cxf/cxf-aegis/pom.xml b/apache-cxf/cxf-aegis/pom.xml index c10f019f82..43a6750475 100644 --- a/apache-cxf/cxf-aegis/pom.xml +++ b/apache-cxf/cxf-aegis/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-cxf/cxf-introduction/pom.xml b/apache-cxf/cxf-introduction/pom.xml index be604fa401..d56c7ecd81 100644 --- a/apache-cxf/cxf-introduction/pom.xml +++ b/apache-cxf/cxf-introduction/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-cxf/cxf-jaxrs-implementation/pom.xml b/apache-cxf/cxf-jaxrs-implementation/pom.xml index 7b77969075..04c94455e4 100644 --- a/apache-cxf/cxf-jaxrs-implementation/pom.xml +++ b/apache-cxf/cxf-jaxrs-implementation/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-cxf/cxf-spring/pom.xml b/apache-cxf/cxf-spring/pom.xml index f9581515b2..340b3d486a 100644 --- a/apache-cxf/cxf-spring/pom.xml +++ b/apache-cxf/cxf-spring/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-cxf/pom.xml b/apache-cxf/pom.xml index 0975996c06..3f08c11db0 100644 --- a/apache-cxf/pom.xml +++ b/apache-cxf/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-cxf/sse-jaxrs/pom.xml b/apache-cxf/sse-jaxrs/pom.xml index 5c46547b9a..737fc43dc2 100644 --- a/apache-cxf/sse-jaxrs/pom.xml +++ b/apache-cxf/sse-jaxrs/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml index 92a6165f04..26c8a87c2b 100644 --- a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml +++ b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -59,4 +58,4 @@ 3.2.0 - + \ No newline at end of file diff --git a/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml b/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml index efebb328a2..187f03a431 100644 --- a/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml +++ b/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-libraries/pom.xml b/apache-libraries/pom.xml index 15404676cc..856b01daa0 100644 --- a/apache-libraries/pom.xml +++ b/apache-libraries/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 apache-libraries @@ -29,7 +30,6 @@ avro-maven-plugin ${avro.version} - org.apache.beam @@ -43,7 +43,6 @@ ${beam.version} runtime - org.apache.bval @@ -60,7 +59,6 @@ bval-extras ${bval.version} - org.apache.meecrowave @@ -84,14 +82,12 @@ ${meecrowave-junit.version} test - org.apache.opennlp opennlp-tools ${opennlp.opennlp-tools.version} - org.apache.pulsar @@ -99,14 +95,12 @@ ${pulsar-client.version} compile - org.apache.zookeeper zookeeper ${zookeeper.version} - org.apache.curator @@ -145,21 +139,18 @@ ${avaitility.version} test - org.apache.geode geode-core ${geode.core} - org.apache.solr solr-solrj ${solr.solr-solrj.version} - org.assertj @@ -171,7 +162,7 @@ - + org.apache.avro avro-maven-plugin @@ -192,7 +183,7 @@ - + org.apache.meecrowave diff --git a/apache-olingo/olingo2/pom.xml b/apache-olingo/olingo2/pom.xml index 3456d4f362..c86428d054 100644 --- a/apache-olingo/olingo2/pom.xml +++ b/apache-olingo/olingo2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -40,7 +39,6 @@ spring-boot-starter-test test - org.apache.olingo @@ -85,4 +83,4 @@ 2.0.11 - + \ No newline at end of file diff --git a/apache-poi/pom.xml b/apache-poi/pom.xml index eb72531787..5471c77961 100644 --- a/apache-poi/pom.xml +++ b/apache-poi/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -38,4 +37,4 @@ 1.0.6 - + \ No newline at end of file diff --git a/apache-rocketmq/pom.xml b/apache-rocketmq/pom.xml index ba395ff054..a5f552d6f1 100644 --- a/apache-rocketmq/pom.xml +++ b/apache-rocketmq/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -26,4 +25,4 @@ 1.6.0 2.0.4 - + \ No newline at end of file diff --git a/apache-shiro/pom.xml b/apache-shiro/pom.xml index 59bb91d400..f956883d5f 100644 --- a/apache-shiro/pom.xml +++ b/apache-shiro/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -55,4 +54,4 @@ 1.2.17 - + \ No newline at end of file diff --git a/apache-spark/pom.xml b/apache-spark/pom.xml index e0855155bc..c942795532 100644 --- a/apache-spark/pom.xml +++ b/apache-spark/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -111,4 +110,4 @@ 1.5.2 - + \ No newline at end of file diff --git a/apache-tapestry/pom.xml b/apache-tapestry/pom.xml index 82dc34899f..c7cdc0bf3d 100644 --- a/apache-tapestry/pom.xml +++ b/apache-tapestry/pom.xml @@ -1,8 +1,7 @@ - + 4.0.0 com.baeldung apache-tapestry @@ -12,45 +11,43 @@ + and add a dependency on your JDBC driver. You'll also need to add Hibernate configuration files, such + as hibernate.cfg.xml. --> org.apache.tapestry tapestry-core ${tapestry-release-version} - org.slf4j slf4j-log4j12 ${slf4j-release-version} - org.apache.tapestry tapestry-webresources ${tapestry-release-version} - - + - + org.testng testng ${testng-release-version} test - org.apache.tapestry tapestry-test ${tapestry-release-version} test - javax.servlet @@ -58,7 +55,6 @@ ${servlet-api-release-version} provided - org.apache.tapestry @@ -101,7 +97,8 @@ - + true @@ -123,7 +120,8 @@ http://repository.jboss.org/nexus/content/groups/public/ - + apache-staging https://repository.apache.org/content/groups/staging/ @@ -142,4 +140,4 @@ 1.7.19 - + \ No newline at end of file diff --git a/apache-thrift/pom.xml b/apache-thrift/pom.xml index 6d079c8c28..9562ae7dfe 100644 --- a/apache-thrift/pom.xml +++ b/apache-thrift/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -27,7 +26,6 @@ - org.slf4j slf4j-simple @@ -67,4 +65,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/apache-tika/pom.xml b/apache-tika/pom.xml index a2c3a32820..896b88ec4b 100644 --- a/apache-tika/pom.xml +++ b/apache-tika/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/apache-velocity/pom.xml b/apache-velocity/pom.xml index 806b36237d..f4b6de8872 100644 --- a/apache-velocity/pom.xml +++ b/apache-velocity/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/asciidoctor/pom.xml b/asciidoctor/pom.xml index 5b34f19bbb..ec998a67b8 100644 --- a/asciidoctor/pom.xml +++ b/asciidoctor/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/asm/pom.xml b/asm/pom.xml index f4689de8e0..f1e60d2560 100644 --- a/asm/pom.xml +++ b/asm/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/atomikos/pom.xml b/atomikos/pom.xml index 8918de7b77..405231fea7 100644 --- a/atomikos/pom.xml +++ b/atomikos/pom.xml @@ -1,128 +1,128 @@ - 4.0.0 - atomikos - atomikos + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + atomikos + atomikos - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - com.atomikos - transactions-jdbc - ${atomikos-version} - - - com.atomikos - transactions-jms - ${atomikos-version} - - - com.atomikos - transactions-hibernate4 - ${atomikos-version} - - - org.springframework - spring-context - ${spring-version} - - - org.springframework - spring-tx - ${spring-version} - - - org.springframework.data - spring-data-jpa - ${spring-data-jpa.version} - - - org.springframework - spring-test - ${spring-version} - test - - - org.hibernate - hibernate-core - ${hibernate.version} - provided - - - javax.transaction - jta - - - - - org.apache.activemq - activemq-core - ${activemq-core.version} - - - org.apache.derby - derby - ${derby.version} - - - junit - junit - ${junit.version} - test - - - - javax.transaction - jta - ${jta.version} - - - org.apache.geronimo.specs - geronimo-jta_1.0.1B_spec - ${geronimo.version} - - - javax.validation - validation-api - ${validation-api.version} - - - org.hibernate.validator - hibernate-validator - ${hibernate-validator.version} - - - javax.el - javax.el-api - ${javax.el-api.version} - - - org.glassfish.web - javax.el - ${javax.el.version} - - + + + com.atomikos + transactions-jdbc + ${atomikos-version} + + + com.atomikos + transactions-jms + ${atomikos-version} + + + com.atomikos + transactions-hibernate4 + ${atomikos-version} + + + org.springframework + spring-context + ${spring-version} + + + org.springframework + spring-tx + ${spring-version} + + + org.springframework.data + spring-data-jpa + ${spring-data-jpa.version} + + + org.springframework + spring-test + ${spring-version} + test + + + org.hibernate + hibernate-core + ${hibernate.version} + provided + + + javax.transaction + jta + + + + + org.apache.activemq + activemq-core + ${activemq-core.version} + + + org.apache.derby + derby + ${derby.version} + + + junit + junit + ${junit.version} + test + + + + javax.transaction + jta + ${jta.version} + + + org.apache.geronimo.specs + geronimo-jta_1.0.1B_spec + ${geronimo.version} + + + javax.validation + validation-api + ${validation-api.version} + + + org.hibernate.validator + hibernate-validator + ${hibernate-validator.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + + + org.glassfish.web + javax.el + ${javax.el.version} + + - - 5.0.6 - 5.1.6.RELEASE - 5.4.3.Final - 1.11.23.RELEASE - 5.7.0 - 10.8.1.2 - 1.1 - 1.0 - 2.0.1.Final - 6.1.2.Final - 3.0.0 - 2.2.4 - + + 5.0.6 + 5.1.6.RELEASE + 5.4.3.Final + 1.11.23.RELEASE + 5.7.0 + 10.8.1.2 + 1.1 + 1.0 + 2.0.1.Final + 6.1.2.Final + 3.0.0 + 2.2.4 + \ No newline at end of file diff --git a/atomix/pom.xml b/atomix/pom.xml index 53c7a6c0ba..2b9fc9be37 100644 --- a/atomix/pom.xml +++ b/atomix/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/aws-app-sync/pom.xml b/aws-app-sync/pom.xml index 5ef150de01..b759de4a72 100644 --- a/aws-app-sync/pom.xml +++ b/aws-app-sync/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 aws-app-sync aws-app-sync Spring Boot using AWS App Sync - + com.baeldung parent-boot-2 @@ -14,12 +15,10 @@ - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -46,4 +45,4 @@ - + \ No newline at end of file diff --git a/aws-lambda/lambda/pom.xml b/aws-lambda/lambda/pom.xml index 463d106c77..b6074f16d3 100644 --- a/aws-lambda/lambda/pom.xml +++ b/aws-lambda/lambda/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -96,4 +95,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/aws-lambda/pom.xml b/aws-lambda/pom.xml index 116fc801aa..5dc275141d 100644 --- a/aws-lambda/pom.xml +++ b/aws-lambda/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/aws-lambda/shipping-tracker/ShippingFunction/pom.xml b/aws-lambda/shipping-tracker/ShippingFunction/pom.xml index 2c8224e6d5..99f9c1d051 100644 --- a/aws-lambda/shipping-tracker/ShippingFunction/pom.xml +++ b/aws-lambda/shipping-tracker/ShippingFunction/pom.xml @@ -1,4 +1,5 @@ - 4.0.0 com.baeldung @@ -6,11 +7,6 @@ 1.0 jar ShippingFunction - - 1.8 - 1.8 - 5.4.21.Final - @@ -19,9 +15,9 @@ 1.2.0 - com.amazonaws - aws-lambda-java-events - 3.1.0 + com.amazonaws + aws-lambda-java-events + 3.1.0 com.fasterxml.jackson.core @@ -29,10 +25,10 @@ 2.11.2 - junit - junit - 4.12 - test + junit + junit + 4.12 + test org.hibernate @@ -52,22 +48,29 @@ - - - org.apache.maven.plugins - maven-shade-plugin - 3.1.1 - - - - - package - - shade - - - - - + + + org.apache.maven.plugins + maven-shade-plugin + 3.1.1 + + + + + package + + shade + + + + + - + + + 1.8 + 1.8 + 5.4.21.Final + + + \ No newline at end of file diff --git a/aws-reactive/pom.xml b/aws-reactive/pom.xml index 6224ccbb99..9f0144b15c 100644 --- a/aws-reactive/pom.xml +++ b/aws-reactive/pom.xml @@ -1,9 +1,12 @@ - 4.0.0 + aws-reactive + 0.0.1-SNAPSHOT + aws-reactive + AWS Reactive Sample com.baeldung @@ -11,14 +14,8 @@ 1.0.0-SNAPSHOT - aws-reactive - 0.0.1-SNAPSHOT - aws-reactive - AWS Reactive Sample - - org.springframework.boot @@ -27,7 +24,6 @@ pom import - software.amazon.awssdk bom @@ -43,20 +39,16 @@ org.springframework.boot spring-boot-starter-webflux - software.amazon.awssdk s3 compile - netty-nio-client software.amazon.awssdk compile - - org.springframework.boot spring-boot-starter-test @@ -68,8 +60,6 @@ - - io.projectreactor reactor-test @@ -103,4 +93,4 @@ 2.2.1.RELEASE 2.10.27 - + \ No newline at end of file diff --git a/aws/pom.xml b/aws/pom.xml index be0cdfdd43..1663266612 100644 --- a/aws/pom.xml +++ b/aws/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/axon/README.md b/axon/README.md index 069102fc3a..3b2fd0b5ff 100644 --- a/axon/README.md +++ b/axon/README.md @@ -5,3 +5,4 @@ This module contains articles about Axon ### Relevant articles - [A Guide to the Axon Framework](https://www.baeldung.com/axon-cqrs-event-sourcing) +- [Multi-Entity Aggregates in Axon](https://www.baeldung.com/java-axon-multi-entity-aggregates) diff --git a/axon/pom.xml b/axon/pom.xml index f2cdc34fd1..426c340bfc 100644 --- a/axon/pom.xml +++ b/axon/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -15,36 +14,41 @@ ../parent-boot-2 + + + + org.axonframework + axon-bom + 4.5.0 + pom + import + + + + org.axonframework axon-spring-boot-starter - ${axon.version} - org.axonframework axon-test - ${axon.version} test - org.springframework.boot spring-boot-autoconfigure compile - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa - com.h2database h2 @@ -52,8 +56,4 @@ - - 4.4.7 - - \ No newline at end of file diff --git a/azure/pom.xml b/azure/pom.xml index dc58ffa595..ae20ae7785 100644 --- a/azure/pom.xml +++ b/azure/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -22,24 +21,20 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-tomcat provided - org.springframework.boot spring-boot-starter-data-jpa - com.h2database h2 runtime - mysql mysql-connector-java @@ -129,4 +124,4 @@ 1.1.0 - + \ No newline at end of file diff --git a/bazel/bazelapp/pom.xml b/bazel/bazelapp/pom.xml index 54519afff8..ba150aacae 100644 --- a/bazel/bazelapp/pom.xml +++ b/bazel/bazelapp/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/bazel/bazelgreeting/pom.xml b/bazel/bazelgreeting/pom.xml index 7742f92206..819761bbda 100644 --- a/bazel/bazelgreeting/pom.xml +++ b/bazel/bazelgreeting/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/bazel/pom.xml b/bazel/pom.xml index 6673e09dbc..52c59d3d1d 100644 --- a/bazel/pom.xml +++ b/bazel/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/blade/pom.xml b/blade/pom.xml index 458ec40051..b763f69c85 100644 --- a/blade/pom.xml +++ b/blade/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -19,19 +18,16 @@ blade-mvc ${blade-mvc.version} - org.webjars bootstrap ${bootstrap.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.projectlombok @@ -39,7 +35,6 @@ ${lombok.version} provided - org.assertj @@ -111,7 +106,6 @@ - stop-all @@ -122,7 +116,6 @@ - maven-assembly-plugin ${assembly.plugin.version} @@ -164,4 +157,4 @@ 3.1.0 - + \ No newline at end of file diff --git a/bootique/pom.xml b/bootique/pom.xml index 2cbcd671bb..5710259632 100644 --- a/bootique/pom.xml +++ b/bootique/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/cdi/pom.xml b/cdi/pom.xml index 226ca529e1..5eb566dcfb 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -1,8 +1,7 @@ - + 4.0.0 cdi 1.0-SNAPSHOT @@ -57,4 +56,4 @@ 3.10.0 - + \ No newline at end of file diff --git a/checker-plugin/pom.xml b/checker-plugin/pom.xml index 9820d8b602..28958db89d 100644 --- a/checker-plugin/pom.xml +++ b/checker-plugin/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -69,7 +68,6 @@ -Xbootclasspath/p:${annotatedJdk} - @@ -91,4 +89,4 @@ 2.3.1 - + \ No newline at end of file diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml index 4d64307558..74603bf0fb 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml +++ b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -36,4 +35,4 @@ - + \ No newline at end of file diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml index 6bac4fe59a..276c8bbaa6 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml +++ b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -36,4 +35,4 @@ - + \ No newline at end of file diff --git a/code-generation/pom.xml b/code-generation/pom.xml index c5feef2426..ed8890e1dd 100644 --- a/code-generation/pom.xml +++ b/code-generation/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -43,7 +42,6 @@ ${auto-service.version} true - com.google.inject guice @@ -58,4 +56,4 @@ 4.2.0 - + \ No newline at end of file diff --git a/core-groovy-2/pom.xml b/core-groovy-2/pom.xml index 207c090615..37f8629ae8 100644 --- a/core-groovy-2/pom.xml +++ b/core-groovy-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -189,5 +188,4 @@ 3.3.0-01 - - + \ No newline at end of file diff --git a/core-groovy-collections/pom.xml b/core-groovy-collections/pom.xml index 770bcc57d6..c4e02cfed8 100644 --- a/core-groovy-collections/pom.xml +++ b/core-groovy-collections/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -129,5 +128,4 @@ 1.6 - - + \ No newline at end of file diff --git a/core-groovy-strings/pom.xml b/core-groovy-strings/pom.xml index 1144d748ee..76d1754b98 100644 --- a/core-groovy-strings/pom.xml +++ b/core-groovy-strings/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-groovy/pom.xml b/core-groovy/pom.xml index 82a68f0ff8..3e1913dd7b 100644 --- a/core-groovy/pom.xml +++ b/core-groovy/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -119,5 +118,4 @@ 1.6 - - + \ No newline at end of file diff --git a/core-java-modules/core-java-10/pom.xml b/core-java-modules/core-java-10/pom.xml index b293eb6c2f..b293110546 100644 --- a/core-java-modules/core-java-10/pom.xml +++ b/core-java-modules/core-java-10/pom.xml @@ -1,8 +1,7 @@ - + 4.0.0 core-java-10 0.1.0-SNAPSHOT @@ -44,4 +43,4 @@ 4.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-11-2/pom.xml b/core-java-modules/core-java-11-2/pom.xml index b92963a5c8..5f76c0bf3b 100644 --- a/core-java-modules/core-java-11-2/pom.xml +++ b/core-java-modules/core-java-11-2/pom.xml @@ -1,8 +1,7 @@ - + 4.0.0 core-java-11-2 0.1.0-SNAPSHOT @@ -51,6 +50,11 @@ ${junit.jupiter.version} test + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + @@ -74,6 +78,7 @@ 5.7.0 3.17.2 5.11.1 + 3.12.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-11-2/src/test/java/com/baeldung/version/VersionUnitTest.java b/core-java-modules/core-java-11-2/src/test/java/com/baeldung/version/VersionUnitTest.java new file mode 100644 index 0000000000..fb7d5647a5 --- /dev/null +++ b/core-java-modules/core-java-11-2/src/test/java/com/baeldung/version/VersionUnitTest.java @@ -0,0 +1,48 @@ +package com.baeldung.version; + +import org.apache.commons.lang3.SystemUtils; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +public class VersionUnitTest { + + @Test + public void givenJava_whenUsingRuntime_thenGetVersion() { + String expectedVersion = "11"; + Runtime.Version runtimeVersion = Runtime.version(); + String version = String.valueOf(runtimeVersion.version().get(0)); + Assertions.assertThat(version).isEqualTo(expectedVersion); + } + + @Test + @Disabled("Only valid for Java 8 and lower") + public void givenJava_whenUsingCommonsLang_thenGetVersion() { + int expectedVersion = 8; + String[] versionElements = SystemUtils.JAVA_SPECIFICATION_VERSION.split("\\."); + int discard = Integer.parseInt(versionElements[0]); + int version; + if (discard == 1) { + version = Integer.parseInt(versionElements[1]); + } else { + version = discard; + } + Assertions.assertThat(version).isEqualTo(expectedVersion); + } + + @Test + @Disabled("Only valid for Java 8 and lower") + public void givenJava_whenUsingSystemProp_thenGetVersion() { + int expectedVersion = 8; + String[] versionElements = System.getProperty("java.version").split("\\."); + int discard = Integer.parseInt(versionElements[0]); + int version; + if (discard == 1) { + version = Integer.parseInt(versionElements[1]); + } else { + version = discard; + } + Assertions.assertThat(version).isEqualTo(expectedVersion); + } +} + diff --git a/core-java-modules/core-java-11/pom.xml b/core-java-modules/core-java-11/pom.xml index cdb3aab2c7..def7ab43f7 100644 --- a/core-java-modules/core-java-11/pom.xml +++ b/core-java-modules/core-java-11/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -76,10 +75,12 @@ ${uberjar.name} - + org.openjdk.jmh.Main - + @@ -109,4 +110,4 @@ 3.2.4 - + \ No newline at end of file diff --git a/core-java-modules/core-java-12/pom.xml b/core-java-modules/core-java-12/pom.xml index 373f23488e..8f6abdda5b 100644 --- a/core-java-modules/core-java-12/pom.xml +++ b/core-java-modules/core-java-12/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-13/pom.xml b/core-java-modules/core-java-13/pom.xml index 4537067567..6369976580 100644 --- a/core-java-modules/core-java-13/pom.xml +++ b/core-java-modules/core-java-13/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-14/pom.xml b/core-java-modules/core-java-14/pom.xml index e977f39e9d..f3382f6577 100644 --- a/core-java-modules/core-java-14/pom.xml +++ b/core-java-modules/core-java-14/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -15,6 +14,7 @@ 1.0.0-SNAPSHOT ../../ + org.assertj @@ -35,6 +35,7 @@ test + diff --git a/core-java-modules/core-java-15/pom.xml b/core-java-modules/core-java-15/pom.xml index 3b0d324d10..091f0568a7 100644 --- a/core-java-modules/core-java-15/pom.xml +++ b/core-java-modules/core-java-15/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-8-2/pom.xml b/core-java-modules/core-java-8-2/pom.xml index 48474a5eef..e1a861a63c 100644 --- a/core-java-modules/core-java-8-2/pom.xml +++ b/core-java-modules/core-java-8-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-8-2 jar + com.baeldung.core-java-modules core-java-modules @@ -34,4 +34,4 @@ 3.12.2 - + \ No newline at end of file diff --git a/core-java-modules/core-java-8-datetime-2/pom.xml b/core-java-modules/core-java-8-datetime-2/pom.xml index 0e60941cc7..9972122544 100644 --- a/core-java-modules/core-java-8-datetime-2/pom.xml +++ b/core-java-modules/core-java-8-datetime-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ ${project.parent.version} core-java-8-datetime-2 jar + com.baeldung.core-java-modules core-java-modules @@ -47,7 +47,6 @@ true - org.apache.maven.plugins @@ -69,4 +68,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-8-datetime/pom.xml b/core-java-modules/core-java-8-datetime/pom.xml index 629ce5234d..48b2d062b0 100644 --- a/core-java-modules/core-java-8-datetime/pom.xml +++ b/core-java-modules/core-java-8-datetime/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ ${project.parent.version} core-java-8-datetime jar + com.baeldung.core-java-modules core-java-modules @@ -41,14 +41,13 @@ - core-java-datetime-java8 + core-java-8-datetime src/main/resources true - org.apache.maven.plugins @@ -70,4 +69,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml index 557f9e0dce..13b2fbcf89 100644 --- a/core-java-modules/core-java-8/pom.xml +++ b/core-java-modules/core-java-8/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-8 jar + com.baeldung.core-java-modules core-java-modules @@ -58,4 +58,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-9-improvements/pom.xml b/core-java-modules/core-java-9-improvements/pom.xml index bf68cfbd47..b047e15969 100644 --- a/core-java-modules/core-java-9-improvements/pom.xml +++ b/core-java-modules/core-java-9-improvements/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -78,4 +77,4 @@ 25.1-jre - + \ No newline at end of file diff --git a/core-java-modules/core-java-9-jigsaw/pom.xml b/core-java-modules/core-java-9-jigsaw/pom.xml index 6ad4c3d510..0797003174 100644 --- a/core-java-modules/core-java-9-jigsaw/pom.xml +++ b/core-java-modules/core-java-9-jigsaw/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-9-new-features/pom.xml b/core-java-modules/core-java-9-new-features/pom.xml index 2f07a665a4..2f174002bb 100644 --- a/core-java-modules/core-java-9-new-features/pom.xml +++ b/core-java-modules/core-java-9-new-features/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -40,6 +39,7 @@ test + incubator-features @@ -131,6 +131,7 @@ + core-java-9-new-features @@ -164,4 +165,4 @@ 3.2.0 - + \ 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 8c1af89b24..e59cc347c7 100644 --- a/core-java-modules/core-java-9-streams/pom.xml +++ b/core-java-modules/core-java-9-streams/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-9-streams jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-9/pom.xml b/core-java-modules/core-java-9/pom.xml index 001faf88cb..543c3891ee 100644 --- a/core-java-modules/core-java-9/pom.xml +++ b/core-java-modules/core-java-9/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -90,4 +89,4 @@ 3.2.2 - + \ No newline at end of file diff --git a/core-java-modules/core-java-annotations/pom.xml b/core-java-modules/core-java-annotations/pom.xml index 92ba4991bb..6c35aea668 100644 --- a/core-java-modules/core-java-annotations/pom.xml +++ b/core-java-modules/core-java-annotations/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java b/core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/ObjectToJsonConverterUnitTest.java similarity index 95% rename from core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java rename to core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/ObjectToJsonConverterUnitTest.java index fd8f8ba8b3..6c22b1bb73 100644 --- a/core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/JsonSerializerUnitTest.java +++ b/core-java-modules/core-java-annotations/src/test/java/com/baeldung/customannotations/ObjectToJsonConverterUnitTest.java @@ -5,7 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; -public class JsonSerializerUnitTest { +public class ObjectToJsonConverterUnitTest { @Test public void givenObjectNotSerializedThenExceptionThrown() throws JsonSerializationException { diff --git a/core-java-modules/core-java-arrays-convert/pom.xml b/core-java-modules/core-java-arrays-convert/pom.xml index 67dc645936..4cb2946ac9 100644 --- a/core-java-modules/core-java-arrays-convert/pom.xml +++ b/core-java-modules/core-java-arrays-convert/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 + core-java-arrays-convert + core-java-arrays-convert + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-arrays-convert - core-java-arrays-convert - jar @@ -24,4 +24,5 @@ 28.2-jre + \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-guides/pom.xml b/core-java-modules/core-java-arrays-guides/pom.xml index a7c996cf7e..3dba2dc05f 100644 --- a/core-java-modules/core-java-arrays-guides/pom.xml +++ b/core-java-modules/core-java-arrays-guides/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 + core-java-arrays-guides + core-java-arrays-guides + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-arrays-guides - core-java-arrays-guides - jar @@ -31,4 +31,5 @@ test + \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-multidimensional/pom.xml b/core-java-modules/core-java-arrays-multidimensional/pom.xml index d90853678c..d314b07d85 100644 --- a/core-java-modules/core-java-arrays-multidimensional/pom.xml +++ b/core-java-modules/core-java-arrays-multidimensional/pom.xml @@ -1,15 +1,16 @@ + 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 + core-java-arrays-multidimensional + core-java-arrays-multidimensional + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - core-java-arrays-multidimensional - core-java-arrays-multidimensional - jar \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-operations-advanced/README.md b/core-java-modules/core-java-arrays-operations-advanced/README.md index c8ec3e74bc..0e003b5cd9 100644 --- a/core-java-modules/core-java-arrays-operations-advanced/README.md +++ b/core-java-modules/core-java-arrays-operations-advanced/README.md @@ -9,3 +9,4 @@ This module contains articles about advanced operations on arrays in Java. They - [Find Sum and Average in a Java Array](https://www.baeldung.com/java-array-sum-average) - [Intersection Between two Integer Arrays](https://www.baeldung.com/java-array-intersection) - [Comparing Arrays in Java](https://www.baeldung.com/java-comparing-arrays) +- [Concatenate Two Arrays in Java](https://www.baeldung.com/java-concatenate-arrays) diff --git a/core-java-modules/core-java-arrays-operations-advanced/pom.xml b/core-java-modules/core-java-arrays-operations-advanced/pom.xml index c7ea09c616..5663a7d1ca 100644 --- a/core-java-modules/core-java-arrays-operations-advanced/pom.xml +++ b/core-java-modules/core-java-arrays-operations-advanced/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 + core-java-arrays-operations-advanced + core-java-arrays-operations-advanced + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-arrays-operations-advanced - core-java-arrays-operations-advanced - jar @@ -31,4 +31,5 @@ 3.10.0 + \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-operations-advanced/src/main/java/com/baeldung/arrayconcat/ArrayConcatUtil.java b/core-java-modules/core-java-arrays-operations-advanced/src/main/java/com/baeldung/arrayconcat/ArrayConcatUtil.java new file mode 100644 index 0000000000..15ac48ea7d --- /dev/null +++ b/core-java-modules/core-java-arrays-operations-advanced/src/main/java/com/baeldung/arrayconcat/ArrayConcatUtil.java @@ -0,0 +1,65 @@ +package com.baeldung.arrayconcat; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +public class ArrayConcatUtil { + private ArrayConcatUtil() {} + + static T[] concatWithCollection(T[] array1, T[] array2) { + List resultList = new ArrayList<>(array1.length + array2.length); + Collections.addAll(resultList, array1); + Collections.addAll(resultList, array2); + + @SuppressWarnings("unchecked") + //the type cast is safe as the array1 has the type T[] + T[] resultArray = (T[]) Array.newInstance(array1.getClass().getComponentType(), 0); + return resultList.toArray(resultArray); + } + + static T[] concatWithArrayCopy(T[] array1, T[] array2) { + T[] result = Arrays.copyOf(array1, array1.length + array2.length); + System.arraycopy(array2, 0, result, array1.length, array2.length); + return result; + } + + static T concatWithCopy2(T array1, T array2) { + if (!array1.getClass().isArray() || !array2.getClass().isArray()) { + throw new IllegalArgumentException("Only arrays are accepted."); + } + + Class compType1 = array1.getClass().getComponentType(); + Class compType2 = array2.getClass().getComponentType(); + + if (!compType1.equals(compType2)) { + throw new IllegalArgumentException("Two arrays have different types."); + } + + int len1 = Array.getLength(array1); + int len2 = Array.getLength(array2); + + @SuppressWarnings("unchecked") + //the cast is safe due to the previous checks + T result = (T) Array.newInstance(compType1, len1 + len2); + + System.arraycopy(array1, 0, result, 0, len1); + System.arraycopy(array2, 0, result, len1, len2); + + return result; + } + + @SuppressWarnings("unchecked") + static T[] concatWithStream(T[] array1, T[] array2) { + return Stream.concat(Arrays.stream(array1), Arrays.stream(array2)) + .toArray(size -> (T[]) Array.newInstance(array1.getClass().getComponentType(), size)); + } + + static int[] concatIntArraysWithIntStream(int[] array1, int[] array2) { + return IntStream.concat(Arrays.stream(array1), Arrays.stream(array2)).toArray(); + } +} diff --git a/core-java-modules/core-java-arrays-operations-advanced/src/test/java/com/baeldung/arrayconcat/ArrayConcatUtilUnitTest.java b/core-java-modules/core-java-arrays-operations-advanced/src/test/java/com/baeldung/arrayconcat/ArrayConcatUtilUnitTest.java new file mode 100644 index 0000000000..77c368d763 --- /dev/null +++ b/core-java-modules/core-java-arrays-operations-advanced/src/test/java/com/baeldung/arrayconcat/ArrayConcatUtilUnitTest.java @@ -0,0 +1,99 @@ +package com.baeldung.arrayconcat; + + +import com.google.common.collect.ObjectArrays; +import com.google.common.primitives.Ints; +import org.apache.commons.lang3.ArrayUtils; +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +public class ArrayConcatUtilUnitTest { + private final String[] strArray1 = { "element 1", "element 2", "element 3" }; + private final String[] strArray2 = { "element 4", "element 5" }; + private final String[] expectedStringArray = { "element 1", "element 2", "element 3", "element 4", "element 5" }; + + private final int[] intArray1 = { 0, 1, 2, 3 }; + private final int[] intArray2 = { 4, 5, 6, 7 }; + private final int[] expectedIntArray = { 0, 1, 2, 3, 4, 5, 6, 7 }; + + @Test + public void givenTwoStringArrays_whenConcatWithList_thenGetExpectedResult() { + String[] result = ArrayConcatUtil.concatWithCollection(strArray1, strArray2); + assertThat(result).isEqualTo(expectedStringArray); + } + + @Test + public void givenTwoStringArrays_whenConcatWithCopy_thenGetExpectedResult() { + String[] result = ArrayConcatUtil.concatWithArrayCopy(strArray1, strArray2); + assertThat(result).isEqualTo(expectedStringArray); + } + + @Test + public void givenTwoStrings_whenConcatWithCopy2_thenGetException() { + String exMsg = "Only arrays are accepted."; + try { + ArrayConcatUtil.concatWithCopy2("String Nr. 1", "String Nr. 2"); + fail(String.format("IllegalArgumentException with message:'%s' should be thrown. But it didn't", exMsg)); + } catch (IllegalArgumentException e) { + assertThat(e).hasMessage(exMsg); + } + } + + @Test + public void givenTwoArraysInDifferentTypes_whenConcatWithCopy2_thenGetException() { + String[] strArray = new String[] { "test 1", "test 2" }; + Integer[] integerArray = new Integer[] { 7, 11 }; + String exMsg = "Two arrays have different types."; + + try { + ArrayConcatUtil.concatWithCopy2(strArray, integerArray); + fail(String.format("IllegalArgumentException with message:'%s' should be thrown. But it didn't", exMsg)); + } catch (IllegalArgumentException e) { + assertThat(e).hasMessage(exMsg); + } + } + + @Test + public void givenTwoArrays_whenConcatWithCopy2_thenGetExpectedResult() { + String[] result = ArrayConcatUtil.concatWithCopy2(strArray1, strArray2); + assertThat(result).isEqualTo(expectedStringArray); + + int[] intResult = ArrayConcatUtil.concatWithCopy2(intArray1, intArray2); + assertThat(intResult).isEqualTo(expectedIntArray); + } + + @Test + public void givenTwoStringArrays_whenConcatWithStream_thenGetExpectedResult() { + String[] result = ArrayConcatUtil.concatWithStream(strArray1, strArray2); + assertThat(result).isEqualTo(expectedStringArray); + } + + @Test + public void givenTwoIntArrays_whenConcatWithIntStream_thenGetExpectedResult() { + int[] intResult = ArrayConcatUtil.concatIntArraysWithIntStream(intArray1, intArray2); + assertThat(intResult).isEqualTo(expectedIntArray); + } + + @Test + public void givenTwoArrays_whenConcatWithCommonsLang_thenGetExpectedResult() { + String[] result = ArrayUtils.addAll(strArray1, strArray2); + assertThat(result).isEqualTo(expectedStringArray); + + int[] intResult = ArrayUtils.addAll(intArray1, intArray2); + assertThat(intResult).isEqualTo(expectedIntArray); + } + + @Test + public void givenTwoStringArrays_whenConcatWithGuava_thenGetExpectedResult() { + String[] result = ObjectArrays.concat(strArray1, strArray2, String.class); + assertThat(result).isEqualTo(expectedStringArray); + } + + @Test + public void givenTwoIntArrays_whenConcatWithGuava_thenGetExpectedResult() { + int[] intResult = Ints.concat(intArray1, intArray2); + assertThat(intResult).isEqualTo(expectedIntArray); + } +} diff --git a/core-java-modules/core-java-arrays-operations-basic/pom.xml b/core-java-modules/core-java-arrays-operations-basic/pom.xml index 9157d9deb9..382cee102d 100644 --- a/core-java-modules/core-java-arrays-operations-basic/pom.xml +++ b/core-java-modules/core-java-arrays-operations-basic/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 + core-java-arrays-operations-basic + core-java-arrays-operations-basic + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-arrays-operations-basic - core-java-arrays-operations-basic - jar @@ -19,7 +19,6 @@ commons-lang3 ${commons-lang3.version} - org.openjdk.jmh @@ -31,7 +30,6 @@ jmh-generator-annprocess ${jmh-generator.version} - org.assertj assertj-core @@ -55,7 +53,8 @@ benchmarks - + org.openjdk.jmh.Main @@ -70,4 +69,5 @@ 3.2.0 3.10.0 + \ No newline at end of file diff --git a/core-java-modules/core-java-arrays-sorting/pom.xml b/core-java-modules/core-java-arrays-sorting/pom.xml index 610582260b..d30e2bfabc 100644 --- a/core-java-modules/core-java-arrays-sorting/pom.xml +++ b/core-java-modules/core-java-arrays-sorting/pom.xml @@ -1,18 +1,18 @@ + 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 + core-java-arrays-sorting + core-java-arrays-sorting + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT ../ - 4.0.0 - - core-java-arrays-sorting - core-java-arrays-sorting - jar @@ -26,7 +26,6 @@ guava ${guava.version} - org.openjdk.jmh @@ -38,7 +37,6 @@ jmh-generator-annprocess ${jmh-generator.version} - org.assertj @@ -63,7 +61,8 @@ benchmarks - + org.openjdk.jmh.Main diff --git a/core-java-modules/core-java-char/pom.xml b/core-java-modules/core-java-char/pom.xml index 078a829e00..ef356d9542 100644 --- a/core-java-modules/core-java-char/pom.xml +++ b/core-java-modules/core-java-char/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 core-java-char 0.1.0-SNAPSHOT core-java-char jar + com.baeldung.core-java-modules core-java-modules @@ -38,4 +38,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-2/pom.xml b/core-java-modules/core-java-collections-2/pom.xml index d163aabdbc..421ba9abac 100644 --- a/core-java-modules/core-java-collections-2/pom.xml +++ b/core-java-modules/core-java-collections-2/pom.xml @@ -1,12 +1,12 @@ - 4.0.0 core-java-collections-2 core-java-collections-2 jar + com.baeldung.core-java-modules core-java-modules @@ -57,4 +57,4 @@ 1.3 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-3/pom.xml b/core-java-modules/core-java-collections-3/pom.xml index aa04d1cb24..c7b1284d5c 100644 --- a/core-java-modules/core-java-collections-3/pom.xml +++ b/core-java-modules/core-java-collections-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections-3 jar + com.baeldung.core-java-modules core-java-modules @@ -44,4 +44,4 @@ 0.10 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-4/pom.xml b/core-java-modules/core-java-collections-4/pom.xml index b4f8aa6320..daf2588ece 100644 --- a/core-java-modules/core-java-collections-4/pom.xml +++ b/core-java-modules/core-java-collections-4/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections-4 jar + com.baeldung.core-java-modules core-java-modules @@ -28,4 +28,4 @@ 3.19.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-array-list/pom.xml b/core-java-modules/core-java-collections-array-list/pom.xml index 81ee4eff55..2e4ab30b8a 100644 --- a/core-java-modules/core-java-collections-array-list/pom.xml +++ b/core-java-modules/core-java-collections-array-list/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections-array-list jar + com.baeldung.core-java-modules core-java-modules @@ -34,4 +34,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-list-2/pom.xml b/core-java-modules/core-java-collections-list-2/pom.xml index 230787d14d..abddeb9014 100644 --- a/core-java-modules/core-java-collections-list-2/pom.xml +++ b/core-java-modules/core-java-collections-list-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections-list-2 jar + com.baeldung.core-java-modules core-java-modules @@ -40,4 +40,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-list-3/pom.xml b/core-java-modules/core-java-collections-list-3/pom.xml index d1d199ec3f..b05fc46928 100644 --- a/core-java-modules/core-java-collections-list-3/pom.xml +++ b/core-java-modules/core-java-collections-list-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections-list-3 jar + com.baeldung.core-java-modules core-java-modules @@ -33,7 +33,6 @@ ${assertj.version} test - net.sf.trove4j trove4j @@ -49,7 +48,6 @@ colt ${colt.version} - org.openjdk.jmh jmh-core @@ -70,4 +68,4 @@ 1.2.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-list/pom.xml b/core-java-modules/core-java-collections-list/pom.xml index 76ca66fe70..f1b6bc3965 100644 --- a/core-java-modules/core-java-collections-list/pom.xml +++ b/core-java-modules/core-java-collections-list/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections-list jar + com.baeldung.core-java-modules core-java-modules @@ -39,4 +39,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java index 96813df862..5ef08a9337 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java +++ b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/collections/JavaCollectionCleanupUnitTest.java @@ -1,11 +1,14 @@ package com.baeldung.collections; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.hamcrest.Matchers.containsInRelativeOrder; import static org.hamcrest.Matchers.hasSize; import static org.junit.Assert.assertThat; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import org.apache.commons.collections4.CollectionUtils; @@ -22,7 +25,7 @@ public class JavaCollectionCleanupUnitTest { // tests - removing nulls @Test - public final void givenListContainsNulls_whenRemovingNullsWithPlainJava_thenCorrect() { + public void givenListContainsNulls_whenRemovingNullsWithPlainJava_thenCorrect() { final List list = Lists.newArrayList(null, 1, null); while (list.remove(null)) ; @@ -31,7 +34,7 @@ public class JavaCollectionCleanupUnitTest { } @Test - public final void givenListContainsNulls_whenRemovingNullsWithPlainJavaAlternative_thenCorrect() { + public void givenListContainsNulls_whenRemovingNullsWithPlainJavaAlternative_thenCorrect() { final List list = Lists.newArrayList(null, 1, null); list.removeAll(Collections.singleton(null)); @@ -39,7 +42,7 @@ public class JavaCollectionCleanupUnitTest { } @Test - public final void givenListContainsNulls_whenRemovingNullsWithGuavaV1_thenCorrect() { + public void givenListContainsNulls_whenRemovingNullsWithGuavaV1_thenCorrect() { final List list = Lists.newArrayList(null, 1, null); Iterables.removeIf(list, Predicates.isNull()); @@ -47,7 +50,7 @@ public class JavaCollectionCleanupUnitTest { } @Test - public final void givenListContainsNulls_whenRemovingNullsWithGuavaV2_thenCorrect() { + public void givenListContainsNulls_whenRemovingNullsWithGuavaV2_thenCorrect() { final List list = Lists.newArrayList(null, 1, null, 2, 3); final List listWithoutNulls = Lists.newArrayList(Iterables.filter(list, Predicates.notNull())); @@ -55,7 +58,7 @@ public class JavaCollectionCleanupUnitTest { } @Test - public final void givenListContainsNulls_whenRemovingNullsWithCommonsCollections_thenCorrect() { + public void givenListContainsNulls_whenRemovingNullsWithCommonsCollections_thenCorrect() { final List list = Lists.newArrayList(null, 1, 2, null, 3, null); CollectionUtils.filter(list, PredicateUtils.notNullPredicate()); @@ -65,19 +68,38 @@ public class JavaCollectionCleanupUnitTest { // tests - remove duplicates @Test - public final void givenListContainsDuplicates_whenRemovingDuplicatesWithPlainJava_thenCorrect() { - final List listWithDuplicates = Lists.newArrayList(0, 1, 2, 3, 0, 0); + public void givenListContainsDuplicates_whenRemovingDuplicatesWithPlainJava_thenCorrect() { + final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0); final List listWithoutDuplicates = new ArrayList<>(new HashSet<>(listWithDuplicates)); - assertThat(listWithoutDuplicates, hasSize(4)); + assertThat(listWithoutDuplicates, hasSize(5)); + assertThat(listWithoutDuplicates, containsInAnyOrder(5, 0, 3, 1, 2)); } @Test - public final void givenListContainsDuplicates_whenRemovingDuplicatesWithGuava_thenCorrect() { - final List listWithDuplicates = Lists.newArrayList(0, 1, 2, 3, 0, 0); - final List listWithoutDuplicates = Lists.newArrayList(Sets.newHashSet(listWithDuplicates)); + public void givenListContainsDuplicates_whenRemovingDuplicatesPreservingOrderWithPlainJava_thenCorrect() { + final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0); + final List listWithoutDuplicates = new ArrayList<>(new LinkedHashSet<>(listWithDuplicates)); - assertThat(listWithoutDuplicates, hasSize(4)); + assertThat(listWithoutDuplicates, hasSize(5)); + assertThat(listWithoutDuplicates, containsInRelativeOrder(5, 0, 3, 1, 2)); } + @Test + public void givenListContainsDuplicates_whenRemovingDuplicatesWithGuava_thenCorrect() { + final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0); + final List listWithoutDuplicates = Lists.newArrayList(Sets.newHashSet(listWithDuplicates)); + + assertThat(listWithoutDuplicates, hasSize(5)); + assertThat(listWithoutDuplicates, containsInAnyOrder(5, 0, 3, 1, 2)); + } + + @Test + public void givenListContainsDuplicates_whenRemovingDuplicatesPreservingOrderWithGuava_thenCorrect() { + final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0); + final List listWithoutDuplicates = Lists.newArrayList(Sets.newLinkedHashSet(listWithDuplicates)); + + assertThat(listWithoutDuplicates, hasSize(5)); + assertThat(listWithoutDuplicates, containsInRelativeOrder(5, 0, 3, 1, 2)); + } } diff --git a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/java8/Java8CollectionCleanupUnitTest.java b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/java8/Java8CollectionCleanupUnitTest.java index ef7b642f89..5eb75f5cad 100644 --- a/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/java8/Java8CollectionCleanupUnitTest.java +++ b/core-java-modules/core-java-collections-list/src/test/java/com/baeldung/java8/Java8CollectionCleanupUnitTest.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Objects; import java.util.stream.Collectors; +import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.hasSize; import static org.junit.Assert.assertThat; @@ -40,10 +41,11 @@ public class Java8CollectionCleanupUnitTest { @Test public void givenListContainsDuplicates_whenRemovingDuplicatesWithJava8_thenCorrect() { - final List listWithDuplicates = Lists.newArrayList(1, 1, 2, 2, 3, 3); - final List listWithoutDuplicates = listWithDuplicates.parallelStream().distinct().collect(Collectors.toList()); + final List listWithDuplicates = Lists.newArrayList(5, 0, 3, 1, 2, 3, 0, 0); + final List listWithoutDuplicates = listWithDuplicates.stream().distinct().collect(Collectors.toList()); - assertThat(listWithoutDuplicates, hasSize(3)); + assertThat(listWithoutDuplicates, hasSize(5)); + assertThat(listWithoutDuplicates, containsInAnyOrder(5, 0, 3, 1, 2)); } } diff --git a/core-java-modules/core-java-collections-maps-2/pom.xml b/core-java-modules/core-java-collections-maps-2/pom.xml index 7c4ab19945..3ae1437054 100644 --- a/core-java-modules/core-java-collections-maps-2/pom.xml +++ b/core-java-modules/core-java-collections-maps-2/pom.xml @@ -1,12 +1,13 @@ + 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 core-java-collections-maps-2 0.1.0-SNAPSHOT core-java-collections-maps-2 jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-collections-maps-3/pom.xml b/core-java-modules/core-java-collections-maps-3/pom.xml index c9fda26fc3..892d0443c5 100644 --- a/core-java-modules/core-java-collections-maps-3/pom.xml +++ b/core-java-modules/core-java-collections-maps-3/pom.xml @@ -1,12 +1,13 @@ + 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 core-java-collections-maps-3 0.1.0-SNAPSHOT core-java-collections-maps-3 jar + com.baeldung.core-java-modules core-java-modules @@ -27,8 +28,4 @@ - - - - \ No newline at end of file diff --git a/core-java-modules/core-java-collections-maps/pom.xml b/core-java-modules/core-java-collections-maps/pom.xml index 742e264504..68e5c736cd 100644 --- a/core-java-modules/core-java-collections-maps/pom.xml +++ b/core-java-modules/core-java-collections-maps/pom.xml @@ -1,11 +1,13 @@ - + 4.0.0 core-java-collections-maps 0.1.0-SNAPSHOT core-java-collections-maps jar + com.baeldung.core-java-modules core-java-modules @@ -31,4 +33,5 @@ 4.1 3.6.1 + diff --git a/core-java-modules/core-java-collections-set/pom.xml b/core-java-modules/core-java-collections-set/pom.xml index 7c55f2ff2a..b8940f4a68 100644 --- a/core-java-modules/core-java-collections-set/pom.xml +++ b/core-java-modules/core-java-collections-set/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections-set jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-collections/pom.xml b/core-java-modules/core-java-collections/pom.xml index fe9cf57bfb..81bcdc74aa 100644 --- a/core-java-modules/core-java-collections/pom.xml +++ b/core-java-modules/core-java-collections/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-collections jar + com.baeldung.core-java-modules core-java-modules @@ -38,4 +38,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-2/pom.xml b/core-java-modules/core-java-concurrency-2/pom.xml index 253537bc2b..3a29101d0f 100644 --- a/core-java-modules/core-java-concurrency-2/pom.xml +++ b/core-java-modules/core-java-concurrency-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,14 +7,15 @@ 0.1.0-SNAPSHOT core-java-concurrency-2 jar + com.baeldung.core-java-modules core-java-modules 0.0.1-SNAPSHOT ../ - - + + junit junit @@ -55,8 +55,7 @@ true - - + org.apache.maven.plugins maven-compiler-plugin @@ -67,7 +66,6 @@ ${java.version} - org.apache.maven.plugins maven-shade-plugin @@ -97,7 +95,7 @@ - + 4.13 0.2 @@ -106,4 +104,4 @@ 0.5 - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-advanced-2/pom.xml b/core-java-modules/core-java-concurrency-advanced-2/pom.xml index 98f159a85f..0571598684 100644 --- a/core-java-modules/core-java-concurrency-advanced-2/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-concurrency-advanced-2 jar + com.baeldung.core-java-modules core-java-modules @@ -54,4 +54,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-advanced-3/pom.xml b/core-java-modules/core-java-concurrency-advanced-3/pom.xml index 32267fb800..7a85672779 100644 --- a/core-java-modules/core-java-concurrency-advanced-3/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced-3/pom.xml @@ -1,14 +1,13 @@ - - 4.0.0 core-java-concurrency-advanced-3 0.1.0-SNAPSHOT core-java-concurrency-advanced-3 jar + com.baeldung.core-java-modules core-java-modules @@ -23,32 +22,27 @@ ${assertj.version} test - com.jcabi jcabi-aspects ${jcabi-aspects.version} - org.aspectj aspectjrt ${aspectjrt.version} runtime - com.google.guava guava ${guava.version} - org.cactoos cactoos ${cactoos.version} - com.ea.async ea-async @@ -114,4 +108,4 @@ 1.9.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-advanced-4/pom.xml b/core-java-modules/core-java-concurrency-advanced-4/pom.xml index eb9ed3adc1..7f4a573664 100644 --- a/core-java-modules/core-java-concurrency-advanced-4/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced-4/pom.xml @@ -1,14 +1,13 @@ - - 4.0.0 core-java-concurrency-advanced-4 0.1.0-SNAPSHOT core-java-concurrency-advanced-4 jar + com.baeldung.core-java-modules core-java-modules @@ -44,4 +43,4 @@ 1.8 - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-advanced/pom.xml b/core-java-modules/core-java-concurrency-advanced/pom.xml index 67db486121..7dae0b17aa 100644 --- a/core-java-modules/core-java-concurrency-advanced/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-concurrency-advanced jar + com.baeldung.core-java-modules core-java-modules @@ -71,4 +71,4 @@ 1.7.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-basic-2/README.md b/core-java-modules/core-java-concurrency-basic-2/README.md index bf973f7036..c4a6105c56 100644 --- a/core-java-modules/core-java-concurrency-basic-2/README.md +++ b/core-java-modules/core-java-concurrency-basic-2/README.md @@ -12,4 +12,5 @@ This module contains articles about basic Java concurrency - [Guide to AtomicMarkableReference](https://www.baeldung.com/java-atomicmarkablereference) - [Why are Local Variables Thread-Safe in Java](https://www.baeldung.com/java-local-variables-thread-safe) - [How to Stop Execution After a Certain Time in Java](https://www.baeldung.com/java-stop-execution-after-certain-time) +- [How to Handle InterruptedException in Java](https://www.baeldung.com/java-interrupted-exception) - [[<-- Prev]](/core-java-modules/core-java-concurrency-basic) diff --git a/core-java-modules/core-java-concurrency-basic-2/pom.xml b/core-java-modules/core-java-concurrency-basic-2/pom.xml index adc4fd33e3..38c9c26c80 100644 --- a/core-java-modules/core-java-concurrency-basic-2/pom.xml +++ b/core-java-modules/core-java-concurrency-basic-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-concurrency-basic-2 jar + com.baeldung.core-java-modules core-java-modules @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-basic/pom.xml b/core-java-modules/core-java-concurrency-basic/pom.xml index 29d393805b..3f69d1a73b 100644 --- a/core-java-modules/core-java-concurrency-basic/pom.xml +++ b/core-java-modules/core-java-concurrency-basic/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-concurrency-basic jar + com.baeldung.core-java-modules core-java-modules @@ -51,4 +51,4 @@ 1.7.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-collections-2/pom.xml b/core-java-modules/core-java-concurrency-collections-2/pom.xml index 19d43aa7dd..020586e892 100644 --- a/core-java-modules/core-java-concurrency-collections-2/pom.xml +++ b/core-java-modules/core-java-concurrency-collections-2/pom.xml @@ -1,5 +1,4 @@ - 4.0.0 @@ -7,6 +6,7 @@ 0.1.0-SNAPSHOT core-java-concurrency-collections-2 jar + com.baeldung.core-java-modules core-java-modules @@ -30,7 +30,7 @@ jmh-generator-annprocess ${jmh-generator.version} - + org.assertj assertj-core ${assertj.version} @@ -40,7 +40,7 @@ 28.2-jre - + 3.6.1 diff --git a/core-java-modules/core-java-concurrency-collections/pom.xml b/core-java-modules/core-java-concurrency-collections/pom.xml index 31f5a0fca8..8a7fc58bfd 100644 --- a/core-java-modules/core-java-concurrency-collections/pom.xml +++ b/core-java-modules/core-java-concurrency-collections/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-concurrency-collections jar + com.baeldung.core-java-modules core-java-modules @@ -39,4 +39,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-console/pom.xml b/core-java-modules/core-java-console/pom.xml index fc4f1875ca..6f9288f1a5 100644 --- a/core-java-modules/core-java-console/pom.xml +++ b/core-java-modules/core-java-console/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-console jar + com.baeldung.core-java-modules core-java-modules @@ -23,7 +23,6 @@ true - org.apache.maven.plugins @@ -41,7 +40,6 @@ - org.codehaus.mojo exec-maven-plugin @@ -57,7 +55,6 @@ - org.apache.maven.plugins maven-javadoc-plugin @@ -136,4 +133,4 @@ 1.8 - + \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations-1/pom.xml b/core-java-modules/core-java-date-operations-1/pom.xml index e12e4aa4ee..ded6f062cf 100644 --- a/core-java-modules/core-java-date-operations-1/pom.xml +++ b/core-java-modules/core-java-date-operations-1/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ ${project.parent.version} core-java-date-operations-1 jar + com.baeldung.core-java-modules core-java-modules @@ -71,4 +71,4 @@ 1.9 - + \ No newline at end of file diff --git a/core-java-modules/core-java-date-operations-2/pom.xml b/core-java-modules/core-java-date-operations-2/pom.xml index 5861a9ab98..5766f39739 100644 --- a/core-java-modules/core-java-date-operations-2/pom.xml +++ b/core-java-modules/core-java-date-operations-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ ${project.parent.version} core-java-date-operations-2 jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-datetime-conversion/pom.xml b/core-java-modules/core-java-datetime-conversion/pom.xml index 79d1394576..b494b307d0 100644 --- a/core-java-modules/core-java-datetime-conversion/pom.xml +++ b/core-java-modules/core-java-datetime-conversion/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ ${project.parent.version} core-java-datetime-conversion jar + com.baeldung.core-java-modules core-java-modules @@ -70,4 +70,4 @@ 1.9 - + \ No newline at end of file diff --git a/core-java-modules/core-java-datetime-string/pom.xml b/core-java-modules/core-java-datetime-string/pom.xml index c1181f670a..dc0c5fd8b1 100644 --- a/core-java-modules/core-java-datetime-string/pom.xml +++ b/core-java-modules/core-java-datetime-string/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ ${project.parent.version} core-java-datetime-string jar + com.baeldung.core-java-modules core-java-modules @@ -60,7 +60,6 @@ true - org.apache.maven.plugins @@ -83,4 +82,4 @@ 1.9 - + \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions-2/pom.xml b/core-java-modules/core-java-exceptions-2/pom.xml index 4497874640..ce95553021 100644 --- a/core-java-modules/core-java-exceptions-2/pom.xml +++ b/core-java-modules/core-java-exceptions-2/pom.xml @@ -1,12 +1,13 @@ - 4.0.0 - core-java-exceptions-2 core-java-exceptions-2 jar + + http://maven.apache.org + com.baeldung.core-java-modules core-java-modules @@ -29,13 +30,10 @@ - - http://maven.apache.org - 3.10 3.10.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions-3/pom.xml b/core-java-modules/core-java-exceptions-3/pom.xml index 8c36fd0af1..6e35845c6a 100644 --- a/core-java-modules/core-java-exceptions-3/pom.xml +++ b/core-java-modules/core-java-exceptions-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -9,6 +8,7 @@ 0.1.0-SNAPSHOT core-java-exceptions-3 jar + com.baeldung.core-java-modules core-java-modules @@ -17,14 +17,12 @@ - com.h2database h2 1.4.191 test - org.assertj @@ -38,4 +36,4 @@ 3.10.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/pom.xml b/core-java-modules/core-java-exceptions/pom.xml index b708aff6b9..f2c6d001be 100644 --- a/core-java-modules/core-java-exceptions/pom.xml +++ b/core-java-modules/core-java-exceptions/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -9,6 +8,7 @@ 0.1.0-SNAPSHOT core-java-exceptions jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-function/pom.xml b/core-java-modules/core-java-function/pom.xml index 0eb34bed7b..5db73d8796 100644 --- a/core-java-modules/core-java-function/pom.xml +++ b/core-java-modules/core-java-function/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-function jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-functional/pom.xml b/core-java-modules/core-java-functional/pom.xml index f00600c794..87a08e1e3f 100644 --- a/core-java-modules/core-java-functional/pom.xml +++ b/core-java-modules/core-java-functional/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-functional jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-io-2/pom.xml b/core-java-modules/core-java-io-2/pom.xml index c0aae2b1ce..a4168a8f1f 100644 --- a/core-java-modules/core-java-io-2/pom.xml +++ b/core-java-modules/core-java-io-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-io-2 jar + com.baeldung.core-java-modules core-java-modules @@ -53,7 +53,6 @@ ${wiremock.version} test - diff --git a/core-java-modules/core-java-io-3/pom.xml b/core-java-modules/core-java-io-3/pom.xml index cc4dca5fa5..f1b6412249 100644 --- a/core-java-modules/core-java-io-3/pom.xml +++ b/core-java-modules/core-java-io-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-io-3 jar + com.baeldung.core-java-modules core-java-modules @@ -46,12 +46,8 @@ ${assertj.version} test - - - - 3.6.1 diff --git a/core-java-modules/core-java-io-4/pom.xml b/core-java-modules/core-java-io-4/pom.xml index ee31b35ba9..8327764c9f 100644 --- a/core-java-modules/core-java-io-4/pom.xml +++ b/core-java-modules/core-java-io-4/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-io-4 jar + com.baeldung.core-java-modules core-java-modules @@ -42,9 +42,6 @@ - - - 3.6.1 diff --git a/core-java-modules/core-java-io-apis/pom.xml b/core-java-modules/core-java-io-apis/pom.xml index 9350e4b527..0984296ea1 100644 --- a/core-java-modules/core-java-io-apis/pom.xml +++ b/core-java-modules/core-java-io-apis/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-io-apis jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-io-conversions-2/pom.xml b/core-java-modules/core-java-io-conversions-2/pom.xml index b8b5074c7c..e594666b55 100644 --- a/core-java-modules/core-java-io-conversions-2/pom.xml +++ b/core-java-modules/core-java-io-conversions-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-io-conversions-2 jar + com.baeldung.core-java-modules core-java-modules @@ -35,7 +35,7 @@ - core-java-io-conversions + core-java-io-conversions-2 src/main/resources diff --git a/core-java-modules/core-java-io-conversions/pom.xml b/core-java-modules/core-java-io-conversions/pom.xml index 0012b02d7e..14320f46b9 100644 --- a/core-java-modules/core-java-io-conversions/pom.xml +++ b/core-java-modules/core-java-io-conversions/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-io/pom.xml b/core-java-modules/core-java-io/pom.xml index 02b5adae7c..67495f84f9 100644 --- a/core-java-modules/core-java-io/pom.xml +++ b/core-java-modules/core-java-io/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-io jar + com.baeldung.core-java-modules core-java-modules @@ -81,7 +81,6 @@ ${maven.compiler.target} - org.apache.maven.plugins @@ -98,7 +97,6 @@ - integration diff --git a/core-java-modules/core-java-jar/pom.xml b/core-java-modules/core-java-jar/pom.xml index 45500de739..4e4a7ee465 100644 --- a/core-java-modules/core-java-jar/pom.xml +++ b/core-java-modules/core-java-jar/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -72,7 +71,6 @@ true - org.apache.maven.plugins @@ -90,7 +88,6 @@ - org.apache.maven.plugins maven-jar-plugin @@ -105,7 +102,6 @@ - org.apache.maven.plugins maven-assembly-plugin @@ -129,7 +125,6 @@ - org.apache.maven.plugins maven-shade-plugin @@ -142,7 +137,8 @@ true - + com.baeldung.executable.ExecutableMavenJar @@ -150,7 +146,6 @@ - com.jolira onejar-maven-plugin @@ -168,7 +163,6 @@ - org.springframework.boot spring-boot-maven-plugin @@ -185,7 +179,6 @@ - org.codehaus.mojo exec-maven-plugin @@ -201,7 +194,6 @@ - org.apache.maven.plugins maven-javadoc-plugin @@ -272,7 +264,6 @@ - buildAgentLoader @@ -383,13 +374,10 @@ 0.4 1.8.7 - 3.10.0 - 1.1 - 3.0.0-M1 3.0.2 1.4.4 @@ -399,4 +387,4 @@ 1.8 - + \ No newline at end of file diff --git a/core-java-modules/core-java-jndi/pom.xml b/core-java-modules/core-java-jndi/pom.xml index 030a5f5d50..dae0e9bb35 100644 --- a/core-java-modules/core-java-jndi/pom.xml +++ b/core-java-modules/core-java-jndi/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -82,4 +81,4 @@ 1.8 - + \ No newline at end of file diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule1/pom.xml similarity index 90% rename from core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/pom.xml rename to core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule1/pom.xml index fb6d2b1065..d0dce32c33 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule1/pom.xml @@ -1,10 +1,9 @@ - 4.0.0 - consumermodule + consumermodule1 1.0 jar @@ -35,4 +34,4 @@ 1.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/src/main/java/com/baeldung/consumermodule/Application.java b/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule1/src/main/java/com/baeldung/consumermodule/Application.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/src/main/java/com/baeldung/consumermodule/Application.java rename to core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule1/src/main/java/com/baeldung/consumermodule/Application.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/src/main/java/module-info.java b/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule1/src/main/java/module-info.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/src/main/java/module-info.java rename to core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule1/src/main/java/module-info.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml index f80d7d4815..2121b46b82 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -16,8 +15,8 @@ - servicemodule - consumermodule + servicemodule1 + consumermodule1 diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/pom.xml similarity index 93% rename from core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/pom.xml rename to core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/pom.xml index 4c811ea866..8e30fa9182 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/external/TextService.java b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/external/TextService.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/external/TextService.java rename to core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/external/TextService.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/external/TextServiceFactory.java b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/external/TextServiceFactory.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/external/TextServiceFactory.java rename to core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/external/TextServiceFactory.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/internal/LowercaseTextService.java b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/internal/LowercaseTextService.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/internal/LowercaseTextService.java rename to core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/internal/LowercaseTextService.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/internal/UppercaseTextService.java b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/internal/UppercaseTextService.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/com/baeldung/servicemodule/internal/UppercaseTextService.java rename to core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/com/baeldung/servicemodule/internal/UppercaseTextService.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/module-info.java b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/module-info.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/src/main/java/module-info.java rename to core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule1/src/main/java/module-info.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule2/pom.xml similarity index 93% rename from core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml rename to core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule2/pom.xml index c7bff60a8b..13d0b2d201 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule2/pom.xml @@ -1,11 +1,10 @@ - 4.0.0 com.baeldung.consumermodule - consumermodule + consumermodule2 1.0 @@ -46,4 +45,4 @@ 1.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/src/main/java/com/baeldung/consumermodule/Application.java b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule2/src/main/java/com/baeldung/consumermodule/Application.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/src/main/java/com/baeldung/consumermodule/Application.java rename to core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule2/src/main/java/com/baeldung/consumermodule/Application.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/src/main/java/module-info.java b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule2/src/main/java/module-info.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/src/main/java/module-info.java rename to core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule2/src/main/java/module-info.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/pom.xml index 91b92b9df5..5b2e4cfc82 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -16,9 +15,9 @@ - servicemodule + servicemodule2 providermodule - consumermodule + consumermodule2 diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml index 6c0f1956b9..ddb8aeccd1 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -17,7 +16,7 @@ com.baeldung.servicemodule - servicemodule + servicemodule2 ${servicemodule.version} @@ -40,5 +39,4 @@ 1.0 - \ No newline at end of file diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule2/pom.xml similarity index 94% rename from core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml rename to core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule2/pom.xml index 50201911a6..06ef900092 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/src/main/java/com/baeldung/servicemodule/TextService.java b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule2/src/main/java/com/baeldung/servicemodule/TextService.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/src/main/java/com/baeldung/servicemodule/TextService.java rename to core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule2/src/main/java/com/baeldung/servicemodule/TextService.java diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/src/main/java/module-info.java b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule2/src/main/java/module-info.java similarity index 100% rename from core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/src/main/java/module-info.java rename to core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule2/src/main/java/module-info.java diff --git a/core-java-modules/core-java-jpms/pom.xml b/core-java-modules/core-java-jpms/pom.xml index ee7eb02f10..65f5afad47 100644 --- a/core-java-modules/core-java-jpms/pom.xml +++ b/core-java-modules/core-java-jpms/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -42,4 +41,4 @@ 11 - + \ No newline at end of file diff --git a/core-java-modules/core-java-jvm-2/pom.xml b/core-java-modules/core-java-jvm-2/pom.xml index 71dca18094..f1d0a292c6 100644 --- a/core-java-modules/core-java-jvm-2/pom.xml +++ b/core-java-modules/core-java-jvm-2/pom.xml @@ -40,4 +40,4 @@ 0.10 - + \ No newline at end of file diff --git a/core-java-modules/core-java-jvm/pom.xml b/core-java-modules/core-java-jvm/pom.xml index 17ff2f658f..58934065a3 100644 --- a/core-java-modules/core-java-jvm/pom.xml +++ b/core-java-modules/core-java-jvm/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -83,4 +82,4 @@ 6.5.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-lambdas/pom.xml b/core-java-modules/core-java-lambdas/pom.xml index 318b04fcf5..87b315490a 100644 --- a/core-java-modules/core-java-lambdas/pom.xml +++ b/core-java-modules/core-java-lambdas/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-lambdas jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-lang-2/pom.xml b/core-java-modules/core-java-lang-2/pom.xml index 9da76fa168..d32f382506 100644 --- a/core-java-modules/core-java-lang-2/pom.xml +++ b/core-java-modules/core-java-lang-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-lang-2 jar + com.baeldung.core-java-modules core-java-modules @@ -70,4 +70,4 @@ 29.0-jre - + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-3/pom.xml b/core-java-modules/core-java-lang-3/pom.xml index f98074ad1b..c9005e51ae 100644 --- a/core-java-modules/core-java-lang-3/pom.xml +++ b/core-java-modules/core-java-lang-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -50,5 +49,5 @@ 3.12.2 - + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-4/README.md b/core-java-modules/core-java-lang-4/README.md index 8e8d6185b0..8b8dff4bd1 100644 --- a/core-java-modules/core-java-lang-4/README.md +++ b/core-java-modules/core-java-lang-4/README.md @@ -4,3 +4,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) diff --git a/core-java-modules/core-java-lang-4/pom.xml b/core-java-modules/core-java-lang-4/pom.xml index f00a9318f7..4e692ffa55 100644 --- a/core-java-modules/core-java-lang-4/pom.xml +++ b/core-java-modules/core-java-lang-4/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -39,5 +38,4 @@ - \ No newline at end of file diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/Annotations.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/Annotations.java new file mode 100644 index 0000000000..c46c511ea8 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/Annotations.java @@ -0,0 +1,11 @@ +package com.baeldung.compiletimeconstants; + +public class Annotations { + + private final String deprecatedDate = "20-02-14"; + private final String deprecatedTime = "22:00"; + + //@Deprecated(since = deprecatedDate + " " + deprecatedTime) //TODO: Required JDK 9+ + public void deprecatedMethod() {} + +} diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/ClassConstants.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/ClassConstants.java new file mode 100644 index 0000000000..6c5995a4ea --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/ClassConstants.java @@ -0,0 +1,19 @@ +package com.baeldung.compiletimeconstants; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.List; + +public class ClassConstants { + + public static final int MAXIMUM_NUMBER_OF_USERS = 10; + public static final String DEFAULT_USERNAME = "unknown"; + + public static final Logger log = LoggerFactory.getLogger(ClassConstants.class); + public static final List contributorGroups = Arrays.asList("contributor", "author"); + + public static final int MAXIMUM_NUMBER_OF_GUESTS = MAXIMUM_NUMBER_OF_USERS * 10; + +} \ No newline at end of file diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/CompileTimeVariables.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/CompileTimeVariables.java new file mode 100644 index 0000000000..c783a1368b --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/CompileTimeVariables.java @@ -0,0 +1,21 @@ +package com.baeldung.compiletimeconstants; + +import java.io.PrintWriter; + +public class CompileTimeVariables { + + public final String errorMessage = ClassConstants.DEFAULT_USERNAME + " not allowed here."; + public final int maximumLoginAttempts = 5; + + public static void main(String[] args) { + PrintWriter printWriter = System.console().writer(); + printWriter.println(ClassConstants.DEFAULT_USERNAME); + + CompileTimeVariables instance = new CompileTimeVariables(); + printWriter.println(instance.maximumLoginAttempts); + + final String username = "baeldung" + "-" + "user"; + printWriter.println(username); + } + +} diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/RuntimeVariables.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/RuntimeVariables.java new file mode 100644 index 0000000000..53e567fe54 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/RuntimeVariables.java @@ -0,0 +1,16 @@ +package com.baeldung.compiletimeconstants; + +import java.io.Console; +public class RuntimeVariables { + + public static void main(String[] args) { + Console console = System.console(); + + final String input = console.readLine(); + console.writer().println(input); + + final double random = Math.random(); + console.writer().println("Number: " + random); + } + +} diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/SwitchStatement.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/SwitchStatement.java new file mode 100644 index 0000000000..4242dc8d36 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/compiletimeconstants/SwitchStatement.java @@ -0,0 +1,17 @@ +package com.baeldung.compiletimeconstants; + +public class SwitchStatement { + + private static final String VALUE_ONE = "value-one"; + + public static void main(String[] args) { + final String valueTwo = "value" + "-" + "two"; + switch (args[0]) { + case VALUE_ONE: + break; + case valueTwo: + break; + } + } + +} diff --git a/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/hash/Player.java b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/hash/Player.java new file mode 100644 index 0000000000..79d2396816 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/main/java/com/baeldung/hash/Player.java @@ -0,0 +1,91 @@ +package com.baeldung.hash; + +import java.util.Objects; + +public class Player { + private String firstName; + private String lastName; + private String position; + + public Player() { + + } + + public Player(String firstName, String lastName, String position) { + this.firstName = firstName; + this.lastName = lastName; + this.position = position; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, position); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + + if (obj == null) { + return false; + } + + if (getClass() != obj.getClass()) { + return false; + } + + Player other = (Player) obj; + + if (firstName == null) { + if (other.firstName != null) { + return false; + } + } else if (!firstName.equals(other.firstName)) { + return false; + } + + if (lastName == null) { + if (other.lastName != null) { + return false; + } + } else if (!lastName.equals(other.lastName)) { + return false; + } + + if (position == null) { + if (other.position != null) { + return false; + } + } else if (!position.equals(other.position)) { + return false; + } + return true; + } + +} diff --git a/core-java-modules/core-java-lang-4/src/test/java/com/baeldung/hash/HashCodeUnitTest.java b/core-java-modules/core-java-lang-4/src/test/java/com/baeldung/hash/HashCodeUnitTest.java new file mode 100644 index 0000000000..d1a9e06611 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/test/java/com/baeldung/hash/HashCodeUnitTest.java @@ -0,0 +1,67 @@ +package com.baeldung.hash; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; + +import java.util.Objects; + +import org.junit.Test; + +public class HashCodeUnitTest { + + @Test + public void whenCallingObjectsHashCodeOnIndenticalObjects_thenSameHashCodeReturned() { + String stringOne = "test"; + String stringTwo = "test"; + int hashCode1 = Objects.hashCode(stringOne); + int hashCode2 = Objects.hashCode(stringTwo); + + assertEquals(hashCode1, hashCode2); + } + + @Test + public void whenCallingObjectsHashCodeOnNullObject_thenZeroReturned() { + String nullString = null; + int hashCode = Objects.hashCode(nullString); + assertEquals(0, hashCode); + } + + @Test + public void whenCallingObjectHashCodeOnIndenticalObjects_thenSameHashCodeReturned() { + Double valueOne = Double.valueOf(1.0012); + Double valueTwo = Double.valueOf(1.0012); + + int hashCode1 = valueOne.hashCode(); + int hashCode2 = valueTwo.hashCode(); + + assertEquals(hashCode1, hashCode2); + } + + @Test(expected = NullPointerException.class) + public void whenCallingObjectHashCodeOnNullObject_theNullPointerExceptionThrown() { + Double value = null; + value.hashCode(); + } + + @Test + public void whenCallingObjectsHashOnStrings_thenSameHashCodeReturned() { + String strOne = "one"; + String strTwo = "two"; + String strOne2 = "one"; + String strTwo2 = "two"; + + int hashCode1 = Objects.hash(strOne, strTwo); + int hashCode2 = Objects.hash(strOne2, strTwo2); + + assertEquals(hashCode1, hashCode2); + } + + @Test + public void whenCallingObjectsHashOnSingleString_thenDifferentHashcodeFromObjectsHashCodeCallReturned() { + String testString = "test string"; + int hashCode1 = Objects.hash(testString); + int hashCode2 = Objects.hashCode(testString); + + assertNotEquals(hashCode1, hashCode2); + } +} diff --git a/core-java-modules/core-java-lang-4/src/test/java/com/baeldung/hash/PlayerUnitTest.java b/core-java-modules/core-java-lang-4/src/test/java/com/baeldung/hash/PlayerUnitTest.java new file mode 100644 index 0000000000..fe0ef8a727 --- /dev/null +++ b/core-java-modules/core-java-lang-4/src/test/java/com/baeldung/hash/PlayerUnitTest.java @@ -0,0 +1,33 @@ +package com.baeldung.hash; + +import static org.junit.Assert.assertEquals; + +import java.util.Arrays; + +import org.junit.Test; + +public class PlayerUnitTest { + + @Test + public void whenCallingHashCodeOnIdenticalValue_thenSameHashCodeReturned() { + Player player = new Player("Eduardo", "Rodriguez", "Pitcher"); + Player indenticalPlayer = new Player("Eduardo", "Rodriguez", "Pitcher"); + + int hashCode1 = player.hashCode(); + int hashCode2 = player.hashCode(); + int hashCode3 = indenticalPlayer.hashCode(); + + assertEquals(hashCode1, hashCode2); + assertEquals(hashCode1, hashCode3); + } + + @Test + public void whenCallingHashCodeAndArraysHashCode_thenSameHashCodeReturned() { + Player player = new Player("Bobby", "Dalbec", "First Base"); + int hashcode1 = player.hashCode(); + String[] playerInfo = { "Bobby", "Dalbec", "First Base" }; + int hashcode2 = Arrays.hashCode(playerInfo); + + assertEquals(hashcode1, hashcode2); + } +} diff --git a/core-java-modules/core-java-lang-math-2/pom.xml b/core-java-modules/core-java-lang-math-2/pom.xml index 56e18158b3..098d77b59a 100644 --- a/core-java-modules/core-java-lang-math-2/pom.xml +++ b/core-java-modules/core-java-lang-math-2/pom.xml @@ -1,10 +1,12 @@ - + 4.0.0 core-java-lang-math-2 0.0.1-SNAPSHOT core-java-lang-math-2 + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-lang-math-3/pom.xml b/core-java-modules/core-java-lang-math-3/pom.xml index 27c2372ab6..6779d0ecc6 100644 --- a/core-java-modules/core-java-lang-math-3/pom.xml +++ b/core-java-modules/core-java-lang-math-3/pom.xml @@ -6,6 +6,7 @@ core-java-lang-math-3 0.0.1-SNAPSHOT core-java-lang-math-3 + com.baeldung.core-java-modules core-java-modules @@ -19,7 +20,6 @@ exp4j 0.4.8 - com.fathzer javaluator @@ -27,9 +27,4 @@ - - - - - diff --git a/core-java-modules/core-java-lang-math/pom.xml b/core-java-modules/core-java-lang-math/pom.xml index 81ff0d43ea..0facdf2d8b 100644 --- a/core-java-modules/core-java-lang-math/pom.xml +++ b/core-java-modules/core-java-lang-math/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-lang-math jar + com.baeldung.core-java-modules core-java-modules @@ -40,4 +40,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-constructors/pom.xml b/core-java-modules/core-java-lang-oop-constructors/pom.xml index e54286a822..5635059fa9 100644 --- a/core-java-modules/core-java-lang-oop-constructors/pom.xml +++ b/core-java-modules/core-java-lang-oop-constructors/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 + core-java-lang-oop-constructors + core-java-lang-oop-constructors + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-constructors - core-java-lang-oop-constructors - jar @@ -25,4 +25,5 @@ 3.10.0 + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-generics/pom.xml b/core-java-modules/core-java-lang-oop-generics/pom.xml index 1a538edac9..b13683d1cd 100644 --- a/core-java-modules/core-java-lang-oop-generics/pom.xml +++ b/core-java-modules/core-java-lang-oop-generics/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 + core-java-lang-oop-generics + core-java-lang-oop-generics + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-generics - core-java-lang-oop-generics - jar @@ -20,7 +20,6 @@ true - org.apache.maven.plugins @@ -30,12 +29,13 @@ ${maven.compiler.source} ${maven.compiler.target} - + + 1.8 1.8 diff --git a/core-java-modules/core-java-lang-oop-inheritance/pom.xml b/core-java-modules/core-java-lang-oop-inheritance/pom.xml index ca828279db..e0272fb94e 100644 --- a/core-java-modules/core-java-lang-oop-inheritance/pom.xml +++ b/core-java-modules/core-java-lang-oop-inheritance/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 + core-java-lang-oop-inheritance + core-java-lang-oop-inheritance + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-inheritance - core-java-lang-oop-inheritance - jar @@ -25,4 +25,5 @@ 3.10.0 + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-methods/pom.xml b/core-java-modules/core-java-lang-oop-methods/pom.xml index bcf561a6c2..e493f716ec 100644 --- a/core-java-modules/core-java-lang-oop-methods/pom.xml +++ b/core-java-modules/core-java-lang-oop-methods/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 + core-java-lang-oop-methods + core-java-lang-oop-methods + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-methods - core-java-lang-oop-methods - jar @@ -24,7 +24,6 @@ commons-lang ${commons-lang.version} - org.assertj assertj-core @@ -42,8 +41,8 @@ 1.18.12 2.6 - 3.10.0 3.0.3 + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-modifiers/pom.xml b/core-java-modules/core-java-lang-oop-modifiers/pom.xml index 5f0be4545f..70c70608eb 100644 --- a/core-java-modules/core-java-lang-oop-modifiers/pom.xml +++ b/core-java-modules/core-java-lang-oop-modifiers/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 + core-java-lang-oop-modifiers + core-java-lang-oop-modifiers + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-modifiers - core-java-lang-oop-modifiers - jar @@ -31,4 +31,5 @@ 3.10.0 + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-others/pom.xml b/core-java-modules/core-java-lang-oop-others/pom.xml index ad5699d592..d9d147f34a 100644 --- a/core-java-modules/core-java-lang-oop-others/pom.xml +++ b/core-java-modules/core-java-lang-oop-others/pom.xml @@ -1,16 +1,16 @@ + 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 + core-java-lang-oop-others + core-java-lang-oop-others + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-others - core-java-lang-oop-others - jar \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-patterns/pom.xml b/core-java-modules/core-java-lang-oop-patterns/pom.xml index 0829295250..8b8b4a7b46 100644 --- a/core-java-modules/core-java-lang-oop-patterns/pom.xml +++ b/core-java-modules/core-java-lang-oop-patterns/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 + core-java-lang-oop-patterns + core-java-lang-oop-patterns + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-patterns - core-java-lang-oop-patterns - jar @@ -29,7 +29,6 @@ gson ${gson.version} - org.assertj assertj-core @@ -42,4 +41,5 @@ 2.8.2 3.10.0 + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Car.java b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Car.java new file mode 100644 index 0000000000..6f17ecc536 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Car.java @@ -0,0 +1,42 @@ +package com.baeldung.interfacevsabstractclass; + +public class Car extends Vehicle { + + public Car(String vechicleName) { + super(vechicleName); + } + + public Car(String vechicleName, String vehicleModel) { + super(vechicleName, vehicleModel); + } + + public Car(String vechicleName, String vehicleModel, Long makeYear) { + super(vechicleName, vehicleModel, makeYear); + } + + @Override + protected void start() { + // code implementation details on starting a car. + } + + @Override + protected void stop() { + // code implementation details on stopping a car. + } + + @Override + protected void drive() { + // code implementation details on start driving a car. + } + + @Override + protected void changeGear() { + // code implementation details on changing the car gear. + } + + @Override + protected void reverse() { + // code implementation details on reverse driving a car. + } + +} diff --git a/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/ImageSender.java b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/ImageSender.java new file mode 100644 index 0000000000..1948cc6583 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/ImageSender.java @@ -0,0 +1,12 @@ +package com.baeldung.interfacevsabstractclass; + +import java.io.File; + +public class ImageSender implements Sender { + + @Override + public void send(File fileToBeSent) { + // image sending implementation code. + } + +} \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Sender.java b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Sender.java new file mode 100644 index 0000000000..fde6527ef6 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Sender.java @@ -0,0 +1,8 @@ +package com.baeldung.interfacevsabstractclass; + +import java.io.File; + +public interface Sender { + + void send(File fileToBeSent); +} diff --git a/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Vehicle.java b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Vehicle.java new file mode 100644 index 0000000000..d98b8ca93b --- /dev/null +++ b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/Vehicle.java @@ -0,0 +1,57 @@ +package com.baeldung.interfacevsabstractclass; + +public abstract class Vehicle { + + private String vehicleName; + private String vehicleModel; + private Long makeYear; + + public Vehicle(String vehicleName) { + this.vehicleName = vehicleName; + } + + public Vehicle(String vehicleName, String vehicleModel) { + this(vehicleName); + this.vehicleModel = vehicleModel; + } + + public Vehicle(String vechicleName, String vehicleModel, Long makeYear) { + this(vechicleName, vehicleModel); + this.makeYear = makeYear; + } + + public String getVehicleName() { + return vehicleName; + } + + public void setVehicleName(String vehicleName) { + this.vehicleName = vehicleName; + } + + public String getVehicleModel() { + return vehicleModel; + } + + public void setVehicleModel(String vehicleModel) { + this.vehicleModel = vehicleModel; + } + + public Long getMakeYear() { + return makeYear; + } + + public void setMakeYear(Long makeYear) { + this.makeYear = makeYear; + } + + protected abstract void start(); + + protected abstract void stop(); + + protected abstract void drive(); + + protected abstract void changeGear(); + + protected abstract void reverse(); + +} diff --git a/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/VideoSender.java b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/VideoSender.java new file mode 100644 index 0000000000..71f8050590 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-patterns/src/main/java/com/baeldung/interfacevsabstractclass/VideoSender.java @@ -0,0 +1,12 @@ +package com.baeldung.interfacevsabstractclass; + +import java.io.File; + +public class VideoSender implements Sender { + + @Override + public void send(File fileToBeSent) { + // video sending implementation code + } + +} \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/interfacevsabstractclass/SenderUnitTest.java b/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/interfacevsabstractclass/SenderUnitTest.java new file mode 100644 index 0000000000..6419721b3a --- /dev/null +++ b/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/interfacevsabstractclass/SenderUnitTest.java @@ -0,0 +1,23 @@ +package com.baeldung.interfacevsabstractclass; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + +import com.baeldung.interfacevsabstractclass.ImageSender; +import com.baeldung.interfacevsabstractclass.Sender; + +import java.io.File; + +class SenderUnitTest { + + public final static String IMAGE_FILE_PATH = "/sample_image_file_path/photo.jpg"; + + @Test + void givenImageUploaded_whenButtonClicked_thenSendImage() { + File imageFile = new File(IMAGE_FILE_PATH); + + Sender sender = new ImageSender(); + sender.send(imageFile); + } + +} diff --git a/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/interfacevsabstractclass/VehicleUnitTest.java b/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/interfacevsabstractclass/VehicleUnitTest.java new file mode 100644 index 0000000000..1650ab9257 --- /dev/null +++ b/core-java-modules/core-java-lang-oop-patterns/src/test/java/com/baeldung/interfacevsabstractclass/VehicleUnitTest.java @@ -0,0 +1,22 @@ +package com.baeldung.interfacevsabstractclass; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import com.baeldung.interfacevsabstractclass.Car; +import com.baeldung.interfacevsabstractclass.Vehicle; + +class VehicleUnitTest { + + @Test + void givenVehicle_whenNeedToDrive_thenStart() { + Vehicle car = new Car("BMW"); + + car.start(); + car.drive(); + car.changeGear(); + car.stop(); + } + +} diff --git a/core-java-modules/core-java-lang-oop-types-2/README.md b/core-java-modules/core-java-lang-oop-types-2/README.md index 70a0273bc4..a4e7b101c3 100644 --- a/core-java-modules/core-java-lang-oop-types-2/README.md +++ b/core-java-modules/core-java-lang-oop-types-2/README.md @@ -4,4 +4,4 @@ This module contains articles about types in Java ### Relevant Articles: -- \ No newline at end of file +- [Convert an Array of Primitives to an Array of Objects](https://www.baeldung.com/java-primitive-array-to-object-array) diff --git a/core-java-modules/core-java-lang-oop-types-2/pom.xml b/core-java-modules/core-java-lang-oop-types-2/pom.xml index 94a04fe47b..d95123b39e 100644 --- a/core-java-modules/core-java-lang-oop-types-2/pom.xml +++ b/core-java-modules/core-java-lang-oop-types-2/pom.xml @@ -1,16 +1,16 @@ + 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 + core-java-lang-oop-types-2 + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-types-2 - jar @@ -19,4 +19,5 @@ ${commons-lang3.version} + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-oop-types/pom.xml b/core-java-modules/core-java-lang-oop-types/pom.xml index c4efd9b8d2..b770caf970 100644 --- a/core-java-modules/core-java-lang-oop-types/pom.xml +++ b/core-java-modules/core-java-lang-oop-types/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 + core-java-lang-oop-types + core-java-lang-oop-types + jar + core-java-modules com.baeldung.core-java-modules 0.0.1-SNAPSHOT - 4.0.0 - - core-java-lang-oop-types - core-java-lang-oop-types - jar @@ -28,4 +28,5 @@ 1.15 + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-operators/pom.xml b/core-java-modules/core-java-lang-operators/pom.xml index 5b4c2fecaa..2d669bfa55 100644 --- a/core-java-modules/core-java-lang-operators/pom.xml +++ b/core-java-modules/core-java-lang-operators/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-lang-operators jar + com.baeldung.core-java-modules core-java-modules @@ -46,4 +46,4 @@ 3.10.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-lang-syntax-2/pom.xml b/core-java-modules/core-java-lang-syntax-2/pom.xml index b88c86b047..b725089351 100644 --- a/core-java-modules/core-java-lang-syntax-2/pom.xml +++ b/core-java-modules/core-java-lang-syntax-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-lang-syntax-2 jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-lang-syntax/pom.xml b/core-java-modules/core-java-lang-syntax/pom.xml index c8f6524e0b..70b0600580 100644 --- a/core-java-modules/core-java-lang-syntax/pom.xml +++ b/core-java-modules/core-java-lang-syntax/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-lang-syntax jar + com.baeldung.core-java-modules core-java-modules @@ -51,4 +51,4 @@ 3.10.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-lang/pom.xml b/core-java-modules/core-java-lang/pom.xml index 807d5f34d4..2a1a7a05b8 100644 --- a/core-java-modules/core-java-lang/pom.xml +++ b/core-java-modules/core-java-lang/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-lang jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-networking-2/pom.xml b/core-java-modules/core-java-networking-2/pom.xml index 89a98bbf8b..893db2d85c 100644 --- a/core-java-modules/core-java-networking-2/pom.xml +++ b/core-java-modules/core-java-networking-2/pom.xml @@ -1,12 +1,12 @@ - 4.0.0 core-java-networking-2 core-java-networking-2 jar + com.baeldung.core-java-modules core-java-modules @@ -53,4 +53,4 @@ 2.4.5 - + \ No newline at end of file diff --git a/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java index 16017ee482..987a69582f 100644 --- a/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java +++ b/core-java-modules/core-java-networking-2/src/test/java/com/baeldung/download/FileDownloadIntegrationTest.java @@ -17,9 +17,9 @@ import static org.junit.Assert.assertTrue; public class FileDownloadIntegrationTest { - static String FILE_URL = "http://ovh.net/files/1Mio.dat"; + static String FILE_URL = "https://s3.amazonaws.com/baeldung.com/Do+JSON+with+Jackson+by+Baeldung.pdf"; static String FILE_NAME = "file.dat"; - static String FILE_MD5_HASH = "6cb91af4ed4c60c11613b75cd1fc6116"; + static String FILE_MD5_HASH = "c959feb066b37f5c4f0e0f45bbbb4f86"; @Test public void givenJavaIO_whenDownloadingFile_thenDownloadShouldBeCorrect() throws NoSuchAlgorithmException, IOException { diff --git a/core-java-modules/core-java-networking-3/pom.xml b/core-java-modules/core-java-networking-3/pom.xml index d72981f862..35e88b3b92 100644 --- a/core-java-modules/core-java-networking-3/pom.xml +++ b/core-java-modules/core-java-networking-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -56,4 +55,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-networking/pom.xml b/core-java-modules/core-java-networking/pom.xml index b81be2751a..3e69e03dcb 100644 --- a/core-java-modules/core-java-networking/pom.xml +++ b/core-java-modules/core-java-networking/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-networking jar + com.baeldung.core-java-modules core-java-modules @@ -31,4 +31,4 @@ 4.3.4.RELEASE - + \ No newline at end of file diff --git a/core-java-modules/core-java-nio-2/pom.xml b/core-java-modules/core-java-nio-2/pom.xml index 7c4583476d..0f4107d536 100644 --- a/core-java-modules/core-java-nio-2/pom.xml +++ b/core-java-modules/core-java-nio-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,12 +7,14 @@ 0.1.0-SNAPSHOT core-java-nio-2 jar + com.baeldung.core-java-modules core-java-modules 0.0.1-SNAPSHOT ../ + org.assertj @@ -22,4 +23,5 @@ test + \ No newline at end of file diff --git a/core-java-modules/core-java-nio/pom.xml b/core-java-modules/core-java-nio/pom.xml index 5b8baf6a70..1d267245a9 100644 --- a/core-java-modules/core-java-nio/pom.xml +++ b/core-java-modules/core-java-nio/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-nio jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-optional/pom.xml b/core-java-modules/core-java-optional/pom.xml index a6127f5fdd..dd5217df74 100644 --- a/core-java-modules/core-java-optional/pom.xml +++ b/core-java-modules/core-java-optional/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/core-java-os/pom.xml b/core-java-modules/core-java-os/pom.xml index e17ddf9b37..5f00b709e3 100644 --- a/core-java-modules/core-java-os/pom.xml +++ b/core-java-modules/core-java-os/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-os jar + com.baeldung.core-java-modules core-java-modules @@ -63,7 +63,6 @@ true - org.apache.maven.plugins @@ -81,7 +80,6 @@ 4.1 4.01 - 3.6.1 1.8.9 @@ -92,4 +90,4 @@ 1.8.7 - + \ No newline at end of file diff --git a/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessAPIEnhancementsUnitTest.java b/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessAPIEnhancementsUnitTest.java index a7a23fb6fc..c81f060150 100644 --- a/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessAPIEnhancementsUnitTest.java +++ b/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessAPIEnhancementsUnitTest.java @@ -20,7 +20,8 @@ public class ProcessAPIEnhancementsUnitTest { Logger log = LoggerFactory.getLogger(ProcessAPIEnhancementsUnitTest.class); - @Test + // @Test + // OS / Java version dependent public void givenCurrentProcess_whenInvokeGetInfo_thenSuccess() throws IOException { ProcessHandle processHandle = ProcessHandle.current(); ProcessHandle.Info processInfo = processHandle.info(); @@ -41,7 +42,8 @@ public class ProcessAPIEnhancementsUnitTest { .isPresent()); } - @Test + // @Test + // OS / Java version dependent public void givenSpawnProcess_whenInvokeGetInfo_thenSuccess() throws IOException { String javaCmd = ProcessUtils.getJavaCmd() @@ -67,7 +69,8 @@ public class ProcessAPIEnhancementsUnitTest { .isPresent()); } - @Test + // @Test + // OS / Java version dependent public void givenLiveProcesses_whenInvokeGetInfo_thenSuccess() { Stream liveProcesses = ProcessHandle.allProcesses(); liveProcesses.filter(ProcessHandle::isAlive) @@ -82,7 +85,8 @@ public class ProcessAPIEnhancementsUnitTest { }); } - @Test + // @Test + // OS / Java version dependent public void givenProcess_whenGetChildProcess_thenSuccess() throws IOException { int childProcessCount = 5; for (int i = 0; i < childProcessCount; i++) { @@ -105,7 +109,8 @@ public class ProcessAPIEnhancementsUnitTest { .command())); } - @Test + // @Test + // OS / Java version dependent public void givenProcess_whenAddExitCallback_thenSuccess() throws Exception { String javaCmd = ProcessUtils.getJavaCmd() .getAbsolutePath(); diff --git a/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessUnderstandingUnitTest.java b/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessUnderstandingUnitTest.java index cb5a20f184..b3b9ca8bc6 100644 --- a/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessUnderstandingUnitTest.java +++ b/core-java-modules/core-java-os/src/test/java/com/baeldung/java9/process/ProcessUnderstandingUnitTest.java @@ -90,16 +90,19 @@ class ProcessUnderstandingUnitTest { } @Test - public void givenSourceProgram_whenReadingInputStream_thenFirstLineEquals3() throws IOException { + public void givenSourceProgram_whenReadingInputStream_thenFirstLineEquals3() throws IOException, InterruptedException { Runtime.getRuntime() .exec("javac -cp src src/main/java/com/baeldung/java9/process/OutputStreamExample.java" - .replace("/", File.separator)); + .replace("/", File.separator)) + .waitFor(5, TimeUnit.SECONDS); Process process = Runtime.getRuntime() .exec("java -cp src/main/java com.baeldung.java9.process.OutputStreamExample" .replace("/", File.separator)); + process.waitFor(5, TimeUnit.SECONDS); + BufferedReader output = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = output.readLine(); int value = Integer.parseInt(line); diff --git a/core-java-modules/core-java-perf/pom.xml b/core-java-modules/core-java-perf/pom.xml index 3956c7e9fb..bc82e92e34 100644 --- a/core-java-modules/core-java-perf/pom.xml +++ b/core-java-modules/core-java-perf/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-perf jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-reflection-2/pom.xml b/core-java-modules/core-java-reflection-2/pom.xml index 02a806f87c..74a7328c16 100644 --- a/core-java-modules/core-java-reflection-2/pom.xml +++ b/core-java-modules/core-java-reflection-2/pom.xml @@ -7,13 +7,14 @@ 0.1.0-SNAPSHOT core-java-reflection-2 jar + com.baeldung.core-java-modules core-java-modules 0.0.1-SNAPSHOT ../ - + org.springframework @@ -22,7 +23,7 @@ test - + core-java-reflection-2 diff --git a/core-java-modules/core-java-reflection/pom.xml b/core-java-modules/core-java-reflection/pom.xml index 4ae7b26745..67922eec5b 100644 --- a/core-java-modules/core-java-reflection/pom.xml +++ b/core-java-modules/core-java-reflection/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-reflection jar + com.baeldung.core-java-modules core-java-modules @@ -51,4 +51,5 @@ 1.8 1.8 + \ No newline at end of file diff --git a/core-java-modules/core-java-regex/pom.xml b/core-java-modules/core-java-regex/pom.xml index f26218877c..fc8c1a8385 100644 --- a/core-java-modules/core-java-regex/pom.xml +++ b/core-java-modules/core-java-regex/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-regex jar + com.baeldung.core-java-modules core-java-modules @@ -48,4 +48,4 @@ 3.15.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-security-2/pom.xml b/core-java-modules/core-java-security-2/pom.xml index 895509410d..2520cee7f8 100644 --- a/core-java-modules/core-java-security-2/pom.xml +++ b/core-java-modules/core-java-security-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-security-2 jar + com.baeldung.core-java-modules core-java-modules @@ -16,45 +16,38 @@ - commons-codec commons-codec ${commons-codec.version} - org.bouncycastle bcprov-jdk15on ${bouncycastle.version} - - + org.assertj assertj-core ${assertj-core.version} test - javax.xml.bind jaxb-api ${jaxb-api.version} - - - + 1.60 1.11 - 3.18.0 2.3.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-security/pom.xml b/core-java-modules/core-java-security/pom.xml index 8ad120c8fc..7b49d08a37 100644 --- a/core-java-modules/core-java-security/pom.xml +++ b/core-java-modules/core-java-security/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-security jar + com.baeldung.core-java-modules core-java-modules @@ -30,4 +30,4 @@ 3.10.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-streams-2/pom.xml b/core-java-modules/core-java-streams-2/pom.xml index 323e01261f..f875e910db 100644 --- a/core-java-modules/core-java-streams-2/pom.xml +++ b/core-java-modules/core-java-streams-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 1.0 core-java-streams-2 jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-streams-3/pom.xml b/core-java-modules/core-java-streams-3/pom.xml index 6597c999d8..659f1937f2 100644 --- a/core-java-modules/core-java-streams-3/pom.xml +++ b/core-java-modules/core-java-streams-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-streams-3 jar + com.baeldung.core-java-modules core-java-modules @@ -51,4 +51,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-streams/pom.xml b/core-java-modules/core-java-streams/pom.xml index f713fe7499..f02ba1c69a 100644 --- a/core-java-modules/core-java-streams/pom.xml +++ b/core-java-modules/core-java-streams/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-streams jar + com.baeldung.core-java-modules core-java-modules @@ -121,4 +121,4 @@ 1.8 - + \ No newline at end of file diff --git a/core-java-modules/core-java-string-algorithms-2/pom.xml b/core-java-modules/core-java-string-algorithms-2/pom.xml index ae2685e742..e263c1c79c 100644 --- a/core-java-modules/core-java-string-algorithms-2/pom.xml +++ b/core-java-modules/core-java-string-algorithms-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-algorithms-2 jar + com.baeldung.core-java-modules core-java-modules @@ -65,4 +65,4 @@ 1.2 - + \ No newline at end of file diff --git a/core-java-modules/core-java-string-algorithms-3/pom.xml b/core-java-modules/core-java-string-algorithms-3/pom.xml index 610956588e..1048b796bc 100644 --- a/core-java-modules/core-java-string-algorithms-3/pom.xml +++ b/core-java-modules/core-java-string-algorithms-3/pom.xml @@ -1,5 +1,4 @@ - 4.0.0 @@ -7,6 +6,7 @@ 0.1.0-SNAPSHOT jar core-java-string-algorithms-3 + com.baeldung.core-java-modules core-java-modules @@ -43,7 +43,6 @@ true - org.apache.maven.plugins @@ -63,4 +62,4 @@ 28.1-jre - + \ No newline at end of file diff --git a/core-java-modules/core-java-string-algorithms/pom.xml b/core-java-modules/core-java-string-algorithms/pom.xml index abafd10f2b..0ad9ec4c66 100644 --- a/core-java-modules/core-java-string-algorithms/pom.xml +++ b/core-java-modules/core-java-string-algorithms/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-algorithms jar + com.baeldung.core-java-modules core-java-modules @@ -71,4 +71,4 @@ 4.0.0 - + \ No newline at end of file diff --git a/core-java-modules/core-java-string-apis/pom.xml b/core-java-modules/core-java-string-apis/pom.xml index 449092bacb..b09d59fc10 100644 --- a/core-java-modules/core-java-string-apis/pom.xml +++ b/core-java-modules/core-java-string-apis/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-apis jar + com.baeldung.core-java-modules core-java-modules @@ -54,4 +54,4 @@ 1.4 - + \ No newline at end of file diff --git a/core-java-modules/core-java-string-conversions-2/pom.xml b/core-java-modules/core-java-string-conversions-2/pom.xml index cd7381d822..8a222a6b5d 100644 --- a/core-java-modules/core-java-string-conversions-2/pom.xml +++ b/core-java-modules/core-java-string-conversions-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-conversions-2 jar + com.baeldung.core-java-modules core-java-modules @@ -45,4 +45,4 @@ - + \ No newline at end of file diff --git a/core-java-modules/core-java-string-conversions/pom.xml b/core-java-modules/core-java-string-conversions/pom.xml index 7d8977d2a5..ccbeb69768 100644 --- a/core-java-modules/core-java-string-conversions/pom.xml +++ b/core-java-modules/core-java-string-conversions/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-conversions jar + com.baeldung.core-java-modules core-java-modules @@ -66,4 +66,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-string-operations-2/pom.xml b/core-java-modules/core-java-string-operations-2/pom.xml index 5865d9a776..b7187d2fdf 100644 --- a/core-java-modules/core-java-string-operations-2/pom.xml +++ b/core-java-modules/core-java-string-operations-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-operations-2 jar + com.baeldung.core-java-modules core-java-modules @@ -57,7 +57,6 @@ jmh-core ${jmh-core.version} - org.openjdk.jmh jmh-generator-annprocess @@ -68,7 +67,6 @@ commons-codec ${commons-codec.version} - org.assertj assertj-core @@ -92,7 +90,8 @@ - + org.openjdk.jmh.Main @@ -119,4 +118,4 @@ 1.14 - + \ No newline at end of file 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 7f391ee056..bc4af852ed 100644 --- a/core-java-modules/core-java-string-operations-3/README.md +++ b/core-java-modules/core-java-string-operations-3/README.md @@ -2,3 +2,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) diff --git a/core-java-modules/core-java-string-operations-3/pom.xml b/core-java-modules/core-java-string-operations-3/pom.xml index 5edff0e090..aa9fe38cca 100644 --- a/core-java-modules/core-java-string-operations-3/pom.xml +++ b/core-java-modules/core-java-string-operations-3/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-operations-3 jar + com.baeldung.core-java-modules core-java-modules @@ -52,10 +52,10 @@ 3.1.0 - - - gradle-repo - https://repo.gradle.org/gradle/libs-releases-local/ - - - + + + gradle-repo + https://repo.gradle.org/gradle/libs-releases-local/ + + + \ No newline at end of file diff --git a/core-java-modules/core-java-string-operations/pom.xml b/core-java-modules/core-java-string-operations/pom.xml index 9632988392..a7f75f37e2 100644 --- a/core-java-modules/core-java-string-operations/pom.xml +++ b/core-java-modules/core-java-string-operations/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-string-operations jar + com.baeldung.core-java-modules core-java-modules @@ -64,4 +64,4 @@ 1.10 - + \ No newline at end of file diff --git a/core-java-modules/core-java-strings/pom.xml b/core-java-modules/core-java-strings/pom.xml index b09dc3f8a4..137499de6b 100644 --- a/core-java-modules/core-java-strings/pom.xml +++ b/core-java-modules/core-java-strings/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-strings jar + com.baeldung.core-java-modules core-java-modules @@ -59,4 +59,4 @@ 61.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java-sun/pom.xml b/core-java-modules/core-java-sun/pom.xml index 541af2445f..347020a736 100644 --- a/core-java-modules/core-java-sun/pom.xml +++ b/core-java-modules/core-java-sun/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java-sun jar + com.baeldung.core-java-modules core-java-modules @@ -97,7 +97,6 @@ 3.6.1 1.7.0 - 1.8.0 diff --git a/core-java-modules/core-java-time-measurements/pom.xml b/core-java-modules/core-java-time-measurements/pom.xml index 3197b1ae6a..663cf6708b 100644 --- a/core-java-modules/core-java-time-measurements/pom.xml +++ b/core-java-modules/core-java-time-measurements/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -9,6 +8,7 @@ 0.0.1-SNAPSHOT core-java-time-measurements jar + com.baeldung.core-java-modules core-java-modules @@ -73,7 +73,6 @@ true - maven-surefire-plugin @@ -102,4 +101,4 @@ 2.22.1 - + \ No newline at end of file diff --git a/core-java-modules/core-java/pom.xml b/core-java-modules/core-java/pom.xml index 9b595288e6..504ec321f2 100644 --- a/core-java-modules/core-java/pom.xml +++ b/core-java-modules/core-java/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -8,6 +7,7 @@ 0.1.0-SNAPSHOT core-java jar + com.baeldung.core-java-modules core-java-modules @@ -90,7 +90,6 @@ - org.codehaus.mojo exec-maven-plugin @@ -106,7 +105,6 @@ - org.apache.maven.plugins maven-javadoc-plugin @@ -183,16 +181,13 @@ 0.4 1.8.7 - 3.10.0 - 1.1 - 3.0.0-M1 1.8 1.8 - + \ No newline at end of file diff --git a/core-java-modules/multimodulemavenproject/daomodule/pom.xml b/core-java-modules/multimodulemavenproject/daomodule/pom.xml index 56c2d70d24..626a6f707a 100644 --- a/core-java-modules/multimodulemavenproject/daomodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/daomodule/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/multimodulemavenproject/entitymodule/pom.xml b/core-java-modules/multimodulemavenproject/entitymodule/pom.xml index 00ad56b3ab..e2a453b9c2 100644 --- a/core-java-modules/multimodulemavenproject/entitymodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/entitymodule/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml b/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml index a9fe04b108..c376a2b04e 100644 --- a/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/multimodulemavenproject/pom.xml b/core-java-modules/multimodulemavenproject/pom.xml index 25f268f8b3..f45774ae00 100644 --- a/core-java-modules/multimodulemavenproject/pom.xml +++ b/core-java-modules/multimodulemavenproject/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.multimodulemavenproject multimodulemavenproject @@ -62,4 +63,4 @@ 3.12.2 - + \ No newline at end of file diff --git a/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml b/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml index 150c10b68f..4df29457c5 100644 --- a/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml index 1c36ed73c8..b4aae7949f 100644 --- a/core-java-modules/pom.xml +++ b/core-java-modules/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -20,16 +19,13 @@ core-java core-java-8 core-java-8-2 - core-java-annotations - core-java-arrays-sorting core-java-arrays-guides core-java-arrays-multidimensional core-java-arrays-convert core-java-arrays-operations-basic core-java-arrays-operations-advanced - core-java-char core-java-collections core-java-collections-2 @@ -42,7 +38,6 @@ core-java-collections-maps core-java-collections-maps-2 core-java-collections-maps-3 - core-java-concurrency-2 core-java-concurrency-advanced core-java-concurrency-advanced-2 @@ -53,31 +48,26 @@ core-java-concurrency-collections core-java-concurrency-collections-2 core-java-console - - + core-java-8-datetime-2 core-java-date-operations-2 core-java-8-datetime - core-java-exceptions core-java-exceptions-2 core-java-exceptions-3 core-java-function - core-java-functional - + core-java-functional core-java-io core-java-io-2 core-java-io-3 - core-java-io-4 + core-java-io-4 core-java-io-apis core-java-io-conversions core-java-io-conversions-2 - core-java-jar core-java-jndi core-java-jvm core-java-jvm-2 - core-java-lambdas core-java-lang core-java-lang-2 @@ -98,20 +88,15 @@ core-java-lang-operators core-java-lang-syntax core-java-lang-syntax-2 - core-java-networking core-java-networking-2 core-java-networking-3 core-java-nio core-java-nio-2 - core-java-optional - core-java-perf - core-java-reflection core-java-reflection-2 - core-java-security core-java-security-2 core-java-streams @@ -128,7 +113,6 @@ core-java-string-operations-3 core-java-strings core-java-sun - core-java-regex pre-jpms @@ -154,4 +138,4 @@ 2.22.2 5.6.2 - + \ No newline at end of file diff --git a/core-java-modules/pre-jpms/pom.xml b/core-java-modules/pre-jpms/pom.xml index 9032c9475b..60e425b936 100644 --- a/core-java-modules/pre-jpms/pom.xml +++ b/core-java-modules/pre-jpms/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -78,4 +77,4 @@ 1.8 - + \ No newline at end of file diff --git a/couchbase/pom.xml b/couchbase/pom.xml index 34e2832e55..e87975a53c 100644 --- a/couchbase/pom.xml +++ b/couchbase/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -72,4 +71,4 @@ 4.3.5.RELEASE - + \ No newline at end of file diff --git a/custom-pmd/pom.xml b/custom-pmd/pom.xml index 50bd16e2d5..550f96de33 100644 --- a/custom-pmd/pom.xml +++ b/custom-pmd/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -51,4 +50,4 @@ 1.8 - + \ No newline at end of file diff --git a/dagger/pom.xml b/dagger/pom.xml index e9410ceb63..304b0e428e 100644 --- a/dagger/pom.xml +++ b/dagger/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -46,4 +45,4 @@ 2.16 - + \ No newline at end of file diff --git a/data-structures/pom.xml b/data-structures/pom.xml index 7bf34b1c63..cba602878f 100644 --- a/data-structures/pom.xml +++ b/data-structures/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -44,4 +43,4 @@ 0.7.0 - + \ No newline at end of file diff --git a/ddd/pom.xml b/ddd/pom.xml index 41fccc7d5f..77cf1f5341 100644 --- a/ddd/pom.xml +++ b/ddd/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -101,6 +100,5 @@ 1.0.1 - - + \ No newline at end of file diff --git a/deeplearning4j/pom.xml b/deeplearning4j/pom.xml index af65aa7e03..f1f9b9fa7b 100644 --- a/deeplearning4j/pom.xml +++ b/deeplearning4j/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -66,4 +65,4 @@ 1.7.5 - + \ No newline at end of file diff --git a/discord4j/pom.xml b/discord4j/pom.xml index 07fa3fa72e..1e73e5109b 100644 --- a/discord4j/pom.xml +++ b/discord4j/pom.xml @@ -1,12 +1,13 @@ - - 4.0.0 - com.baeldung - discord4j - 0.0.1-SNAPSHOT - discord4j - Demo Discord bot using Discord4J + Spring Boot + + 4.0.0 + com.baeldung + discord4j + 0.0.1-SNAPSHOT + discord4j + Demo Discord bot using Discord4J + Spring Boot com.baeldung @@ -15,58 +16,56 @@ ../parent-boot-2 - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-webflux - - - org.springframework.boot - spring-boot-starter-actuator - + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + com.discord4j + discord4j-core + 3.1.1 + + - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + - - com.discord4j - discord4j-core - 3.1.1 - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - - 1.8 - + \ No newline at end of file diff --git a/disruptor/pom.xml b/disruptor/pom.xml index 31fc28986b..c2f9cf34b0 100644 --- a/disruptor/pom.xml +++ b/disruptor/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -87,7 +86,8 @@ true - + org.baeldung.executable.ExecutableMavenJar diff --git a/dozer/pom.xml b/dozer/pom.xml index 0fdf7f6fba..840763445c 100644 --- a/dozer/pom.xml +++ b/dozer/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -31,4 +30,4 @@ 5.5.1 - + \ No newline at end of file diff --git a/drools/pom.xml b/drools/pom.xml index e0a7b52938..cc96d9d032 100644 --- a/drools/pom.xml +++ b/drools/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -65,4 +64,4 @@ 7.10.0.Final - + \ No newline at end of file diff --git a/dropwizard/pom.xml b/dropwizard/pom.xml index c3e1a4e841..36f2ec43f0 100644 --- a/dropwizard/pom.xml +++ b/dropwizard/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -49,8 +48,10 @@ - - + + com.baeldung.dropwizard.introduction.IntroductionApplication diff --git a/dubbo/pom.xml b/dubbo/pom.xml index cca1b3a3d1..76e09c4375 100644 --- a/dubbo/pom.xml +++ b/dubbo/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -37,4 +36,4 @@ 0.10 - + \ No newline at end of file diff --git a/ethereum/pom.xml b/ethereum/pom.xml index 5953195123..4283714b98 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -16,14 +15,12 @@ - org.springframework.boot spring-boot-starter ${spring.boot.version} - org.springframework.boot spring-boot-starter-web @@ -34,7 +31,6 @@ spring-boot-starter-tomcat ${spring.boot.version} - org.springframework @@ -51,7 +47,6 @@ spring-webmvc ${spring.version} - org.ethereum @@ -63,7 +58,6 @@ core ${web3j.core.version} - com.fasterxml.jackson.core @@ -80,7 +74,6 @@ jackson-annotations ${jackson.version} - javax.servlet @@ -102,7 +95,6 @@ javax.servlet.jsp-api ${javax.servlet.jsp-api.version} - org.slf4j @@ -114,7 +106,6 @@ logback-classic ${logback.version} - org.springframework.boot @@ -133,7 +124,6 @@ ${spring.version} test - org.mockito @@ -219,4 +209,4 @@ 2.0.4.RELEASE 3.1 - + \ No newline at end of file diff --git a/feign/pom.xml b/feign/pom.xml index da3cbcb0fd..56059d2a77 100644 --- a/feign/pom.xml +++ b/feign/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -43,4 +42,4 @@ 10.11 - + \ No newline at end of file diff --git a/flyway-cdi-extension/pom.xml b/flyway-cdi-extension/pom.xml index 566eed95d8..757d1e0a7f 100644 --- a/flyway-cdi-extension/pom.xml +++ b/flyway-cdi-extension/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -57,4 +56,4 @@ 8.5.33 1.3.2 - + \ No newline at end of file diff --git a/google-cloud/pom.xml b/google-cloud/pom.xml index 1e474b5dd0..72b9647bc8 100644 --- a/google-cloud/pom.xml +++ b/google-cloud/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -35,4 +34,4 @@ 1.16.0 - + \ No newline at end of file diff --git a/google-web-toolkit/pom.xml b/google-web-toolkit/pom.xml index 1ff5081343..6b93ccbc71 100644 --- a/google-web-toolkit/pom.xml +++ b/google-web-toolkit/pom.xml @@ -1,6 +1,5 @@ - @@ -54,11 +53,10 @@ - + ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - - net.ltgt.gwt.maven @@ -76,7 +74,8 @@ com.baeldung.Google_web_toolkit Google_web_toolkit true - + ${maven.compiler.source} @@ -93,7 +92,6 @@ - maven-surefire-plugin @@ -101,19 +99,16 @@ true - - - + 1.8 1.8 - 2.8.2 1.0-rc-8 - + \ No newline at end of file diff --git a/graphql/graphql-java/pom.xml b/graphql/graphql-java/pom.xml index 30bfbf555a..eae30aa8fa 100644 --- a/graphql/graphql-java/pom.xml +++ b/graphql/graphql-java/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/grpc/pom.xml b/grpc/pom.xml index 5e1c0bb28b..c3e4996c29 100644 --- a/grpc/pom.xml +++ b/grpc/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -78,4 +77,4 @@ 1.6.1 0.6.1 - + \ No newline at end of file diff --git a/gson/pom.xml b/gson/pom.xml index 0de9a6a533..a928d87b61 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/guava-modules/guava-18/pom.xml b/guava-modules/guava-18/pom.xml index d65fab1e57..ed295db2f4 100644 --- a/guava-modules/guava-18/pom.xml +++ b/guava-modules/guava-18/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 guava-18 0.1.0-SNAPSHOT diff --git a/guava-modules/guava-19/pom.xml b/guava-modules/guava-19/pom.xml index 20a405cff4..3c29a2a59c 100644 --- a/guava-modules/guava-19/pom.xml +++ b/guava-modules/guava-19/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 guava-19 0.1.0-SNAPSHOT diff --git a/guava-modules/guava-21/pom.xml b/guava-modules/guava-21/pom.xml index b793f11a7f..8b7c3cdcfd 100644 --- a/guava-modules/guava-21/pom.xml +++ b/guava-modules/guava-21/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 guava-21 1.0-SNAPSHOT diff --git a/guava-modules/guava-collections-list/pom.xml b/guava-modules/guava-collections-list/pom.xml index 78a4aeb8ea..d281be2235 100644 --- a/guava-modules/guava-collections-list/pom.xml +++ b/guava-modules/guava-collections-list/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -27,7 +26,6 @@ commons-lang3 ${commons-lang3.version} - org.junit.jupiter @@ -47,7 +45,6 @@ ${assertj.version} test - org.hamcrest @@ -58,8 +55,7 @@ - guava-collections - + guava-collections-list src/main/resources @@ -71,7 +67,6 @@ 4.1 - 3.6.1 2.0.0.0 diff --git a/guava-modules/guava-collections-map/pom.xml b/guava-modules/guava-collections-map/pom.xml index f3f829f25f..a03a779b3e 100644 --- a/guava-modules/guava-collections-map/pom.xml +++ b/guava-modules/guava-collections-map/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.guava guava-collections-map @@ -31,7 +32,6 @@ guava-collections-map - src/main/resources diff --git a/guava-modules/guava-collections-set/pom.xml b/guava-modules/guava-collections-set/pom.xml index 0e53527aef..b989966a54 100644 --- a/guava-modules/guava-collections-set/pom.xml +++ b/guava-modules/guava-collections-set/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 guava-collections-set 0.1.0-SNAPSHOT @@ -45,4 +46,4 @@ 5.6.2 - + \ No newline at end of file diff --git a/guava-modules/guava-collections/pom.xml b/guava-modules/guava-collections/pom.xml index 90ed99bab7..021c4c6037 100644 --- a/guava-modules/guava-collections/pom.xml +++ b/guava-modules/guava-collections/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -32,7 +31,6 @@ jool ${jool.version} - org.junit.jupiter @@ -52,7 +50,6 @@ ${assertj.version} test - org.hamcrest @@ -64,7 +61,6 @@ guava-collections - src/main/resources @@ -77,7 +73,6 @@ 4.1 0.9.12 - 3.6.1 2.0.0.0 diff --git a/guava-modules/guava-core/pom.xml b/guava-modules/guava-core/pom.xml index 5224148cb8..a15dfb5178 100644 --- a/guava-modules/guava-core/pom.xml +++ b/guava-modules/guava-core/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -31,7 +30,7 @@ - guava + guava-core src/main/resources @@ -45,4 +44,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/guava-modules/guava-io/pom.xml b/guava-modules/guava-io/pom.xml index b77bad575d..f6ebac8ba4 100644 --- a/guava-modules/guava-io/pom.xml +++ b/guava-modules/guava-io/pom.xml @@ -1,12 +1,10 @@ - + 4.0.0 guava-io 0.1.0-SNAPSHOT - - 5.6.2 - guava-io @@ -33,7 +31,6 @@ guava-io - src/main/resources @@ -42,4 +39,8 @@ + + 5.6.2 + + \ No newline at end of file diff --git a/guava-modules/guava-utilities/pom.xml b/guava-modules/guava-utilities/pom.xml index fd9523c224..a9aca0ee08 100644 --- a/guava-modules/guava-utilities/pom.xml +++ b/guava-modules/guava-utilities/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -21,7 +20,6 @@ commons-lang3 ${commons-lang3.version} - org.junit.jupiter @@ -44,8 +42,7 @@ - guava - + guava-utilities src/main/resources diff --git a/guava-modules/pom.xml b/guava-modules/pom.xml index 4b84f616f3..957b8ad166 100644 --- a/guava-modules/pom.xml +++ b/guava-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 guava-modules guava-modules @@ -52,4 +53,4 @@ 29.0-jre - + \ No newline at end of file diff --git a/guice/pom.xml b/guice/pom.xml index 6bbad6dddc..2d968cdfc7 100644 --- a/guice/pom.xml +++ b/guice/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/hazelcast/pom.xml b/hazelcast/pom.xml index 69444308a3..694563790f 100644 --- a/hazelcast/pom.xml +++ b/hazelcast/pom.xml @@ -1,8 +1,7 @@ - + 4.0.0 hazelcast 0.0.1-SNAPSHOT diff --git a/helidon/helidon-mp/pom.xml b/helidon/helidon-mp/pom.xml index 38187a5cb8..3e61d05f61 100644 --- a/helidon/helidon-mp/pom.xml +++ b/helidon/helidon-mp/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 helidon-mp helidon-mp @@ -29,4 +30,4 @@ 2.26 - + \ No newline at end of file diff --git a/helidon/helidon-se/pom.xml b/helidon/helidon-se/pom.xml index d5592dfb7b..e26390a99d 100644 --- a/helidon/helidon-se/pom.xml +++ b/helidon/helidon-se/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 helidon-se helidon-se @@ -13,14 +13,13 @@ - + io.helidon.config helidon-config-yaml ${helidon.version} - - + io.helidon.webserver helidon-webserver @@ -37,8 +36,7 @@ helidon-webserver-json ${helidon.version} - - + io.helidon.security helidon-security diff --git a/helidon/pom.xml b/helidon/pom.xml index 85bab4db42..36466203a8 100644 --- a/helidon/pom.xml +++ b/helidon/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.helidon helidon @@ -18,4 +19,4 @@ helidon-mp - + \ No newline at end of file diff --git a/httpclient-2/pom.xml b/httpclient-2/pom.xml index 7638c692dc..881b0407c3 100644 --- a/httpclient-2/pom.xml +++ b/httpclient-2/pom.xml @@ -26,7 +26,6 @@ - org.springframework.boot diff --git a/httpclient-simple/pom.xml b/httpclient-simple/pom.xml index 019f1af856..84b41cdd6c 100644 --- a/httpclient-simple/pom.xml +++ b/httpclient-simple/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 httpclient-simple 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,21 +79,17 @@ spring-webmvc ${spring.version} - org.springframework spring-oxm ${spring.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - org.apache.httpcomponents httpcore @@ -109,7 +101,6 @@ - org.apache.commons @@ -166,33 +157,26 @@ ${wiremock.version} test - - 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 @@ -209,7 +193,6 @@ true - org.apache.maven.plugins @@ -264,7 +247,6 @@ - org.apache.maven.plugins maven-surefire-plugin @@ -288,7 +270,6 @@ - @@ -302,7 +283,7 @@ 2.5.1 4.4.11 - 4.5.8 + 4.5.8 1.6.1 diff --git a/httpclient/pom.xml b/httpclient/pom.xml index 606e9ed793..a1627cb6fa 100644 --- a/httpclient/pom.xml +++ b/httpclient/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 httpclient 0.1-SNAPSHOT diff --git a/hystrix/pom.xml b/hystrix/pom.xml index 1cf8713b91..639d4eba02 100644 --- a/hystrix/pom.xml +++ b/hystrix/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 hystrix 1.0 @@ -57,4 +58,4 @@ 1.5.8 - + \ No newline at end of file diff --git a/image-processing/pom.xml b/image-processing/pom.xml index f2551598d5..ea218356ce 100644 --- a/image-processing/pom.xml +++ b/image-processing/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 image-processing 1.0-SNAPSHOT @@ -75,14 +76,14 @@ marvin ${marvin-version} pom - + com.github.downgoon MarvinPlugins ${marvin-version} - + 1.3.5 1.51h diff --git a/immutables/pom.xml b/immutables/pom.xml index af4a62ea6b..648166fd74 100644 --- a/immutables/pom.xml +++ b/immutables/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 immutables immutables diff --git a/jackson-modules/jackson-annotations/pom.xml b/jackson-modules/jackson-annotations/pom.xml index e4a41a5825..bdc131c867 100644 --- a/jackson-modules/jackson-annotations/pom.xml +++ b/jackson-modules/jackson-annotations/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson-annotations 0.0.1-SNAPSHOT @@ -47,4 +48,4 @@ 3.1.1 - + \ No newline at end of file diff --git a/jackson-modules/jackson-conversions-2/pom.xml b/jackson-modules/jackson-conversions-2/pom.xml index 992cff30b2..799fcb106a 100644 --- a/jackson-modules/jackson-conversions-2/pom.xml +++ b/jackson-modules/jackson-conversions-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson-conversions-2 0.0.1-SNAPSHOT @@ -54,4 +55,4 @@ 2.9.8 - + \ No newline at end of file diff --git a/jackson-modules/jackson-conversions/pom.xml b/jackson-modules/jackson-conversions/pom.xml index fafb731cc9..9218f209ac 100644 --- a/jackson-modules/jackson-conversions/pom.xml +++ b/jackson-modules/jackson-conversions/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson-conversions 0.0.1-SNAPSHOT @@ -35,4 +36,4 @@ - + \ No newline at end of file diff --git a/jackson-modules/jackson-custom-conversions/pom.xml b/jackson-modules/jackson-custom-conversions/pom.xml index f58b25781c..79af962eec 100644 --- a/jackson-modules/jackson-custom-conversions/pom.xml +++ b/jackson-modules/jackson-custom-conversions/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson-custom-conversions 0.0.1-SNAPSHOT @@ -28,8 +29,6 @@ jackson-core ${jackson.version} - - @@ -42,4 +41,4 @@ - + \ No newline at end of file diff --git a/jackson-modules/jackson-exceptions/pom.xml b/jackson-modules/jackson-exceptions/pom.xml index 1a52892523..a24a0ab4b7 100644 --- a/jackson-modules/jackson-exceptions/pom.xml +++ b/jackson-modules/jackson-exceptions/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson-exceptions 0.0.1-SNAPSHOT @@ -22,4 +23,4 @@ - + \ No newline at end of file diff --git a/jackson-modules/jackson/pom.xml b/jackson-modules/jackson/pom.xml index 615076fc93..a4aecfa3de 100644 --- a/jackson-modules/jackson/pom.xml +++ b/jackson-modules/jackson/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson 0.0.1-SNAPSHOT @@ -19,41 +20,34 @@ jackson-datatype-jsr310 ${jackson.version} - com.fasterxml.jackson.datatype jackson-datatype-joda ${jackson.version} - com.fasterxml.jackson.module jackson-module-jsonSchema ${jackson.version} - com.fasterxml.jackson.datatype jackson-datatype-jdk8 ${jackson.version} - - io.rest-assured json-schema-validator ${rest-assured.version} test - io.rest-assured json-path ${rest-assured.version} test - org.assertj assertj-core @@ -78,4 +72,4 @@ 3.11.0 - + \ No newline at end of file diff --git a/jackson-modules/pom.xml b/jackson-modules/pom.xml index 819f11c110..3d9d83553e 100644 --- a/jackson-modules/pom.xml +++ b/jackson-modules/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 jackson-modules jackson-modules @@ -35,7 +35,6 @@ jackson-dataformat-xml ${jackson.version} - org.junit.jupiter junit-jupiter @@ -53,4 +52,5 @@ 5.6.2 + \ No newline at end of file diff --git a/jackson-simple/pom.xml b/jackson-simple/pom.xml index 8dfd949166..204954ce60 100644 --- a/jackson-simple/pom.xml +++ b/jackson-simple/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jackson-simple 0.0.1-SNAPSHOT @@ -20,7 +21,6 @@ jackson-dataformat-xml ${jackson.version} - org.junit.jupiter @@ -44,7 +44,6 @@ jackson-simple - src/main/resources @@ -59,4 +58,4 @@ 3.11.0 - + \ No newline at end of file diff --git a/java-blockchain/pom.xml b/java-blockchain/pom.xml index 3100fed7b9..6d3910df80 100644 --- a/java-blockchain/pom.xml +++ b/java-blockchain/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.blockchain java-blockchain diff --git a/java-collections-conversions-2/pom.xml b/java-collections-conversions-2/pom.xml index 23f20276a3..7845e0d934 100644 --- a/java-collections-conversions-2/pom.xml +++ b/java-collections-conversions-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-collections-conversions-2 0.1.0-SNAPSHOT @@ -55,4 +56,4 @@ - + \ No newline at end of file diff --git a/java-collections-conversions/pom.xml b/java-collections-conversions/pom.xml index 2073640372..92fc66b480 100644 --- a/java-collections-conversions/pom.xml +++ b/java-collections-conversions/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-collections-conversions 0.1.0-SNAPSHOT @@ -40,4 +41,5 @@ 4.1 - + + \ No newline at end of file diff --git a/java-collections-maps-3/pom.xml b/java-collections-maps-3/pom.xml index 3888623a7f..37a0f617d0 100644 --- a/java-collections-maps-3/pom.xml +++ b/java-collections-maps-3/pom.xml @@ -1,7 +1,13 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + java-collections-maps-3 + 0.1.0-SNAPSHOT + java-collections-maps-3 + jar + com.baeldung parent-java @@ -9,12 +15,6 @@ ../parent-java - 4.0.0 - java-collections-maps-3 - 0.1.0-SNAPSHOT - java-collections-maps-3 - jar - org.springframework @@ -28,11 +28,11 @@ ${assertj.version} test - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + @@ -40,4 +40,4 @@ 3.6.1 5.2.5.RELEASE - + \ No newline at end of file diff --git a/java-ee-8-security-api/app-auth-basic-store-db/pom.xml b/java-ee-8-security-api/app-auth-basic-store-db/pom.xml index 02e3b04a40..7307f144a7 100644 --- a/java-ee-8-security-api/app-auth-basic-store-db/pom.xml +++ b/java-ee-8-security-api/app-auth-basic-store-db/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 app-auth-basic-store-db app-auth-basic-store-db @@ -65,4 +66,4 @@ - + \ No newline at end of file diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml b/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml index 9354782999..729b426049 100644 --- a/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml +++ b/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 app-auth-custom-form-store-custom app-auth-custom-form-store-custom @@ -39,4 +40,4 @@ - + \ No newline at end of file diff --git a/java-ee-8-security-api/app-auth-custom-no-store/pom.xml b/java-ee-8-security-api/app-auth-custom-no-store/pom.xml index fee665e22d..da6ed0a1a5 100644 --- a/java-ee-8-security-api/app-auth-custom-no-store/pom.xml +++ b/java-ee-8-security-api/app-auth-custom-no-store/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 app-auth-custom-no-store app-auth-custom-no-store @@ -65,4 +66,4 @@ - + \ No newline at end of file diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml index f8d19b5750..1dea82992c 100644 --- a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml +++ b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -53,4 +52,4 @@ 4.0.4 - + \ No newline at end of file diff --git a/java-ee-8-security-api/pom.xml b/java-ee-8-security-api/pom.xml index 5eeebcb6f0..c01bedbeee 100644 --- a/java-ee-8-security-api/pom.xml +++ b/java-ee-8-security-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 java-ee-8-security-api 1.0-SNAPSHOT @@ -71,4 +71,4 @@ 18.0.0.1 - + \ No newline at end of file diff --git a/java-native/pom.xml b/java-native/pom.xml index 29fc13b8d8..95cb24bd98 100644 --- a/java-native/pom.xml +++ b/java-native/pom.xml @@ -12,10 +12,6 @@ 1.0.0-SNAPSHOT - - 5.6.0 - - net.java.dev.jna @@ -23,7 +19,7 @@ ${jna.version} - + @@ -36,4 +32,9 @@ + + + 5.6.0 + + \ No newline at end of file diff --git a/java-numbers-2/pom.xml b/java-numbers-2/pom.xml index 5c81b00756..466d040b13 100644 --- a/java-numbers-2/pom.xml +++ b/java-numbers-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 java-numbers-2 0.1.0-SNAPSHOT @@ -42,4 +42,4 @@ 2.6.0 - + \ No newline at end of file diff --git a/java-numbers-3/pom.xml b/java-numbers-3/pom.xml index 62225a898f..e8e080c4c0 100644 --- a/java-numbers-3/pom.xml +++ b/java-numbers-3/pom.xml @@ -54,4 +54,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/java-numbers-4/pom.xml b/java-numbers-4/pom.xml index f4b0e23bd7..dbd6ac456a 100644 --- a/java-numbers-4/pom.xml +++ b/java-numbers-4/pom.xml @@ -48,4 +48,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/java-numbers/pom.xml b/java-numbers/pom.xml index fc904c5747..8bab655f73 100644 --- a/java-numbers/pom.xml +++ b/java-numbers/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 java-numbers 0.1.0-SNAPSHOT @@ -54,4 +54,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/java-rmi/pom.xml b/java-rmi/pom.xml index 5fa3ac8845..fee5107423 100644 --- a/java-rmi/pom.xml +++ b/java-rmi/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.rmi java-rmi @@ -14,4 +15,4 @@ 1.0.0-SNAPSHOT - + \ No newline at end of file diff --git a/java-spi/exchange-rate-api/pom.xml b/java-spi/exchange-rate-api/pom.xml index 1630dbf699..8067175cac 100644 --- a/java-spi/exchange-rate-api/pom.xml +++ b/java-spi/exchange-rate-api/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 exchange-rate-api exchange-rate-api @@ -12,4 +13,4 @@ 1.0.0-SNAPSHOT - + \ No newline at end of file diff --git a/java-spi/exchange-rate-app/pom.xml b/java-spi/exchange-rate-app/pom.xml index fea9ebe8d9..fbf87eb026 100644 --- a/java-spi/exchange-rate-app/pom.xml +++ b/java-spi/exchange-rate-app/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 exchange-rate-app exchange-rate-app @@ -24,4 +25,4 @@ 1.0.0-SNAPSHOT - + \ No newline at end of file diff --git a/java-spi/exchange-rate-impl/pom.xml b/java-spi/exchange-rate-impl/pom.xml index 553a9e3377..254a8bb809 100644 --- a/java-spi/exchange-rate-impl/pom.xml +++ b/java-spi/exchange-rate-impl/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 exchange-rate-impl exchange-rate-impl @@ -71,4 +72,4 @@ 3.1.0 - + \ No newline at end of file diff --git a/java-spi/pom.xml b/java-spi/pom.xml index 6d4874083d..fac6409b9f 100644 --- a/java-spi/pom.xml +++ b/java-spi/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-spi java-spi @@ -18,4 +19,4 @@ exchange-rate-app - + \ No newline at end of file diff --git a/java-vavr-stream/pom.xml b/java-vavr-stream/pom.xml index 94520f299d..8358c29003 100644 --- a/java-vavr-stream/pom.xml +++ b/java-vavr-stream/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.samples java-vavr-stream diff --git a/java-websocket/pom.xml b/java-websocket/pom.xml index ddf10c4457..ffc2b0631e 100644 --- a/java-websocket/pom.xml +++ b/java-websocket/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-websocket 0.0.1-SNAPSHOT @@ -32,4 +33,4 @@ 2.8.0 - + \ No newline at end of file diff --git a/javafx/pom.xml b/javafx/pom.xml index 50b9e7135c..9b0b6002a8 100644 --- a/javafx/pom.xml +++ b/javafx/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 javafx javafx diff --git a/javax-servlets/pom.xml b/javax-servlets/pom.xml index 700b823a6e..f1677050cf 100644 --- a/javax-servlets/pom.xml +++ b/javax-servlets/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.javax-servlets javax-servlets @@ -21,21 +22,18 @@ ${assertj.version} test - commons-fileupload commons-fileupload ${commons-fileupload.version} - javax.servlet javax.servlet-api ${javax.servlet-api.version} - org.apache.httpcomponents httpclient @@ -62,4 +60,4 @@ 4.0.1 - + \ No newline at end of file diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 2655d1fe3e..d684e9dfe2 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 javaxval 0.1-SNAPSHOT @@ -47,4 +48,4 @@ 5.0.2.RELEASE 3.11.1 - + \ No newline at end of file diff --git a/javaxval/src/test/java/com/baeldung/javaxval/bigdecimal/InvoiceUnitTest.java b/javaxval/src/test/java/com/baeldung/javaxval/bigdecimal/InvoiceUnitTest.java index 2df0cf81af..801d7966a5 100644 --- a/javaxval/src/test/java/com/baeldung/javaxval/bigdecimal/InvoiceUnitTest.java +++ b/javaxval/src/test/java/com/baeldung/javaxval/bigdecimal/InvoiceUnitTest.java @@ -1,18 +1,17 @@ package com.baeldung.javaxval.bigdecimal; -import static org.assertj.core.api.Assertions.assertThat; - -import java.math.BigDecimal; -import java.util.Set; - -import javax.validation.ConstraintViolation; -import javax.validation.Validation; -import javax.validation.Validator; - import com.baeldung.javaxval.LocaleAwareUnitTest; import org.junit.BeforeClass; import org.junit.Test; +import javax.validation.ConstraintViolation; +import javax.validation.Validation; +import javax.validation.Validator; +import java.math.BigDecimal; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; + public class InvoiceUnitTest extends LocaleAwareUnitTest { private static Validator validator; @@ -24,41 +23,67 @@ public class InvoiceUnitTest extends LocaleAwareUnitTest { } @Test - public void whenPriceIntegerDigitLessThanThreeWithDecimalValue_thenShouldGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(10.21), "Book purchased"); + public void whenLessThanThreeIntegerDigits_thenShouldNotGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal("10.21"), "Book purchased"); Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> assertThat(action.getMessage()).isEqualTo("numeric value out of bounds (<3 digits>.<2 digits> expected)")); + assertThat(violations).isEmpty(); } @Test - public void whenPriceIntegerDigitLessThanThreeWithIntegerValue_thenShouldNotGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(10), "Book purchased"); + public void whenThreeIntegerDigits_thenShouldNotGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal("102.21"), "Book purchased"); Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(0); + assertThat(violations).isEmpty(); } @Test - public void whenPriceIntegerDigitGreaterThanThree_thenShouldGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(1021.21), "Book purchased"); + public void whenMoreThanThreeIntegerDigits_thenShouldGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal("1021.21"), "Book purchased"); Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> assertThat(action.getMessage()).isEqualTo("numeric value out of bounds (<3 digits>.<2 digits> expected)")); + assertThat(violations).hasSize(1); + assertThat(violations) + .extracting("message") + .containsOnly("numeric value out of bounds (<3 digits>.<2 digits> expected)"); + } + + @Test + public void whenLessThanTwoFractionDigits_thenShouldNotGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal("99.9"), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations).isEmpty(); + } + + @Test + public void whenTwoFractionDigits_thenShouldNotGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal("99.99"), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations).isEmpty(); + } + + @Test + public void whenMoreThanTwoFractionDigits_thenShouldGiveConstraintViolations() { + Invoice invoice = new Invoice(new BigDecimal("99.999"), "Book purchased"); + Set> violations = validator.validate(invoice); + assertThat(violations).hasSize(1); + assertThat(violations) + .extracting("message") + .containsOnly("numeric value out of bounds (<3 digits>.<2 digits> expected)"); } @Test public void whenPriceIsZero_thenShouldGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(000.00), "Book purchased"); + Invoice invoice = new Invoice(new BigDecimal("0.00"), "Book purchased"); Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(1); - violations.forEach(action -> assertThat(action.getMessage()).isEqualTo("must be greater than 0.0")); + assertThat(violations).hasSize(1); + assertThat(violations) + .extracting("message") + .containsOnly("must be greater than 0.0"); } @Test public void whenPriceIsGreaterThanZero_thenShouldNotGiveConstraintViolations() { - Invoice invoice = new Invoice(new BigDecimal(100.50), "Book purchased"); + Invoice invoice = new Invoice(new BigDecimal("100.50"), "Book purchased"); Set> violations = validator.validate(invoice); - assertThat(violations.size()).isEqualTo(0); + assertThat(violations).isEmpty(); } - } diff --git a/jaxb/pom.xml b/jaxb/pom.xml index dc13cf75bc..183f7f13cb 100644 --- a/jaxb/pom.xml +++ b/jaxb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jaxb 0.0.1-SNAPSHOT @@ -34,7 +35,6 @@ true - @@ -55,7 +55,7 @@ - + @@ -64,9 +64,7 @@ - - org.codehaus.mojo diff --git a/jee-7-security/pom.xml b/jee-7-security/pom.xml index e47df7aae9..a8ceee8704 100644 --- a/jee-7-security/pom.xml +++ b/jee-7-security/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jee-7-security 1.0-SNAPSHOT @@ -58,4 +59,4 @@ 1.0-pr - + \ No newline at end of file diff --git a/jee-7/pom.xml b/jee-7/pom.xml index 48814e6d2f..b68c8b9801 100644 --- a/jee-7/pom.xml +++ b/jee-7/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 jee-7 1.0-SNAPSHOT @@ -41,7 +41,6 @@ ${javaee_api.version} provided - org.jboss.arquillian.junit arquillian-junit-container @@ -60,14 +59,12 @@ ${awaitility.version} test - org.jboss.shrinkwrap.resolver shrinkwrap-resolver-impl-maven test jar - org.jboss.shrinkwrap.resolver shrinkwrap-resolver-impl-maven-archive @@ -114,7 +111,6 @@ standard ${taglibs.standard.version} - javax.mvc javax.mvc-api @@ -125,13 +121,11 @@ ozark ${ozark.version} - org.springframework.security spring-security-web ${org.springframework.security.version} - org.springframework.security spring-security-config @@ -143,7 +137,6 @@ ${org.springframework.security.version} - org.jboss.spec.javax.batch jboss-batch-api_1.0_spec @@ -210,8 +203,8 @@ - + org.eclipse.m2e lifecycle-mapping @@ -242,7 +235,7 @@ - + org.codehaus.mojo jaxws-maven-plugin @@ -539,4 +532,4 @@ 2.22.1 - + \ No newline at end of file diff --git a/jersey/pom.xml b/jersey/pom.xml index 065e2230a2..9f57179065 100644 --- a/jersey/pom.xml +++ b/jersey/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jersey 0.0.1-SNAPSHOT @@ -97,4 +98,4 @@ 2.26 - + \ No newline at end of file diff --git a/jgit/pom.xml b/jgit/pom.xml index d960843868..ca58709583 100644 --- a/jgit/pom.xml +++ b/jgit/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jgit 1.0-SNAPSHOT diff --git a/jgroups/pom.xml b/jgroups/pom.xml index 494de2fb4f..370d8a349a 100644 --- a/jgroups/pom.xml +++ b/jgroups/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jgroups 0.1-SNAPSHOT @@ -31,4 +32,4 @@ 4.0.10.Final - + \ No newline at end of file diff --git a/jib/pom.xml b/jib/pom.xml index 15e7e44e7c..8208eebdf7 100644 --- a/jib/pom.xml +++ b/jib/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jib 0.1-SNAPSHOT @@ -42,4 +43,4 @@ 2.5.0 - + \ No newline at end of file diff --git a/jjwt/README.md b/jjwt/README.md index 1798d5193b..ff4b7f547c 100644 --- a/jjwt/README.md +++ b/jjwt/README.md @@ -8,8 +8,7 @@ This tutorial walks you through the various features supported by the [JJWT](htt It's super easy to build and exercise this tutorial. ``` -mvn clean install -java -jar target/*.jar +mvn clean spring-boot:run ``` That's it! diff --git a/jjwt/pom.xml b/jjwt/pom.xml index 9d38d1b0e9..4c194f9285 100644 --- a/jjwt/pom.xml +++ b/jjwt/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 io.jsonwebtoken jjwt @@ -20,28 +21,23 @@ org.springframework.boot spring-boot-devtools - org.springframework.boot spring-boot-starter-thymeleaf - org.springframework.boot spring-boot-starter-security - org.springframework.boot spring-boot-starter-web - io.jsonwebtoken jjwt ${jjwt.version} - org.assertj assertj-core @@ -53,4 +49,4 @@ 0.7.0 - + \ No newline at end of file diff --git a/jmeter/pom.xml b/jmeter/pom.xml index e2830baef5..199d95e0d6 100644 --- a/jmeter/pom.xml +++ b/jmeter/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jmeter jmeter @@ -40,7 +41,6 @@ org.springframework.boot spring-boot-maven-plugin - com.lazerycode.jmeter jmeter-maven-plugin @@ -65,4 +65,4 @@ 2.6.0 - + \ No newline at end of file diff --git a/jmh/pom.xml b/jmh/pom.xml index ecee66f410..61f62efd5a 100644 --- a/jmh/pom.xml +++ b/jmh/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jmh 1.0-SNAPSHOT @@ -47,7 +48,6 @@ - org.apache.maven.plugins maven-assembly-plugin diff --git a/jooby/pom.xml b/jooby/pom.xml index fe26f9a4c6..f972a22e9c 100644 --- a/jooby/pom.xml +++ b/jooby/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.jooby jooby @@ -60,4 +61,4 @@ 2.4.3 - + \ No newline at end of file diff --git a/jsf/pom.xml b/jsf/pom.xml index dc110b9fd5..88099ef9c4 100644 --- a/jsf/pom.xml +++ b/jsf/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jsf 0.1-SNAPSHOT @@ -66,7 +67,6 @@ 4.3.4.RELEASE - 2.2.14 3.0.0 diff --git a/json-2/pom.xml b/json-2/pom.xml index e27d1c83f6..fbae40b6a3 100644 --- a/json-2/pom.xml +++ b/json-2/pom.xml @@ -1,7 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 com.baeldung json-2 0.0.1-SNAPSHOT @@ -11,7 +12,6 @@ com.baeldung 1.0.0-SNAPSHOT - 4.0.0 @@ -19,21 +19,18 @@ jsoniter ${jsoniter.version} - junit junit ${junit.version} test - org.assertj assertj-core ${assertj-core.version} test - com.squareup.moshi moshi @@ -110,46 +107,50 @@ + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-pmd-plugin + + + [3.13.0,) + + + check + + + + + + + + + + + + + + 0.9.23 3.11.1 1.9.2 - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.maven.plugins - - - maven-pmd-plugin - - - [3.13.0,) - - - check - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/json-path/pom.xml b/json-path/pom.xml index 8756ffee7b..b4577ec15f 100644 --- a/json-path/pom.xml +++ b/json-path/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 json-path 0.0.1-SNAPSHOT @@ -25,4 +26,5 @@ 2.4.0 + \ No newline at end of file diff --git a/json/pom.xml b/json/pom.xml index bd901b526e..260b2d1ad9 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.baeldung json @@ -87,4 +88,4 @@ 3.11.1 - + \ No newline at end of file diff --git a/jsoup/pom.xml b/jsoup/pom.xml index d2b59476f3..44f8f996f5 100644 --- a/jsoup/pom.xml +++ b/jsoup/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jsoup jsoup @@ -24,4 +25,4 @@ 1.10.2 - + \ No newline at end of file diff --git a/jta/pom.xml b/jta/pom.xml index 8f90f74d43..b8b5570226 100644 --- a/jta/pom.xml +++ b/jta/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 jta 1.0-SNAPSHOT @@ -35,4 +36,4 @@ - + \ No newline at end of file diff --git a/kubernetes/k8s-intro/README.md b/kubernetes/k8s-intro/README.md index 0055e8a27c..6ac593452c 100644 --- a/kubernetes/k8s-intro/README.md +++ b/kubernetes/k8s-intro/README.md @@ -15,3 +15,5 @@ If you get a valid response, then you're good to go. ### Relevant Articles: - [Paging and Async Calls with the Kubernetes API](https://www.baeldung.com/java-kubernetes-paging-async) +- [Using Watch with the Kubernetes API](https://www.baeldung.com/java-kubernetes-watch) +- [Using Namespaces and Selectors With the Kubernetes Java API](https://www.baeldung.com/java-kubernetes-namespaces-selectors) diff --git a/kubernetes/k8s-intro/pom.xml b/kubernetes/k8s-intro/pom.xml index 5b4867d0df..61722cb2c8 100644 --- a/kubernetes/k8s-intro/pom.xml +++ b/kubernetes/k8s-intro/pom.xml @@ -2,13 +2,14 @@ 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 + k8s-intro + 0.0.1-SNAPSHOT + com.baeldung kubernetes 1.0.0-SNAPSHOT - k8s-intro - 0.0.1-SNAPSHOT @@ -16,7 +17,6 @@ client-java 11.0.0 - ch.qos.logback logback-classic @@ -38,4 +38,5 @@ + \ No newline at end of file diff --git a/kubernetes/k8s-intro/src/k8s/create-http-server.yml b/kubernetes/k8s-intro/src/k8s/create-http-server.yml new file mode 100644 index 0000000000..59ef344de3 --- /dev/null +++ b/kubernetes/k8s-intro/src/k8s/create-http-server.yml @@ -0,0 +1,58 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: ns1 +--- +apiVersion: v1 +kind: Namespace +metadata: + name: ns2 +--- + apiVersion: apps/v1 + kind: Deployment + metadata: + name: httpd + namespace: ns1 + labels: + app: httpd + version: "1" + spec: + replicas: 3 + selector: + matchLabels: + app: httpd + template: + metadata: + labels: + app: httpd + spec: + containers: + - name: main + image: httpd:alpine + ports: + - containerPort: 80 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: httpd + namespace: ns2 + labels: + app: httpd + version: "2" + foo: bar +spec: + replicas: 3 + selector: + matchLabels: + app: httpd + template: + metadata: + labels: + app: httpd + spec: + containers: + - name: main + image: httpd:alpine + ports: + - containerPort: 80 \ No newline at end of file diff --git a/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithFieldSelectors.java b/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithFieldSelectors.java new file mode 100644 index 0000000000..459f61099c --- /dev/null +++ b/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithFieldSelectors.java @@ -0,0 +1,68 @@ +/** + * + */ +package com.baeldung.kubernetes.intro; + + +import java.util.concurrent.TimeUnit; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * @author Philippe + * + */ +public class ListPodsWithFieldSelectors { + + private static final Logger log = LoggerFactory.getLogger(ListPodsWithFieldSelectors.class); + + /** + * @param args + */ + public static void main(String[] args) throws Exception { + + ApiClient client = Config.defaultClient(); + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> log.info(message)); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + OkHttpClient newClient = client.getHttpClient() + .newBuilder() + .addInterceptor(interceptor) + .readTimeout(0, TimeUnit.SECONDS) + .build(); + + client.setHttpClient(newClient); + CoreV1Api api = new CoreV1Api(client); + + String fs = createSelector(args); + V1PodList items = api.listPodForAllNamespaces(null, null, fs, null, null, null, null, null, 10, false); + items.getItems() + .stream() + .map((pod) -> pod.getMetadata().getName() ) + .forEach((name) -> System.out.println("name=" + name)); + + } + + private static String createSelector(String[] args) { + + StringBuilder b = new StringBuilder(); + for( int i = 0 ; i < args.length; i++ ) { + if( b.length() > 0 ) { + b.append(','); + } + + b.append(args[i]); + } + + return b.toString(); + } + +} diff --git a/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithLabelSelectors.java b/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithLabelSelectors.java new file mode 100644 index 0000000000..2e7c8b6a1f --- /dev/null +++ b/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithLabelSelectors.java @@ -0,0 +1,68 @@ +/** + * + */ +package com.baeldung.kubernetes.intro; + + +import java.util.concurrent.TimeUnit; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * @author Philippe + * + */ +public class ListPodsWithLabelSelectors { + + private static final Logger log = LoggerFactory.getLogger(ListPodsWithLabelSelectors.class); + + /** + * @param args + */ + public static void main(String[] args) throws Exception { + + ApiClient client = Config.defaultClient(); + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> log.info(message)); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + OkHttpClient newClient = client.getHttpClient() + .newBuilder() + .addInterceptor(interceptor) + .readTimeout(0, TimeUnit.SECONDS) + .build(); + + client.setHttpClient(newClient); + CoreV1Api api = new CoreV1Api(client); + + String selector = createSelector(args); + V1PodList items = api.listPodForAllNamespaces(null, null, null, selector, null, null, null, null, 10, false); + items.getItems() + .stream() + .map((pod) -> pod.getMetadata().getName() ) + .forEach((name) -> System.out.println("name=" + name)); + + } + + private static String createSelector(String[] args) { + + StringBuilder b = new StringBuilder(); + for( int i = 0 ; i < args.length; i++ ) { + if( b.length() > 0 ) { + b.append(','); + } + + b.append(args[i]); + } + + return b.toString(); + } + +} diff --git a/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithNamespaces.java b/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithNamespaces.java new file mode 100644 index 0000000000..68a951f394 --- /dev/null +++ b/kubernetes/k8s-intro/src/main/java/com/baeldung/kubernetes/intro/ListPodsWithNamespaces.java @@ -0,0 +1,52 @@ +/** + * + */ +package com.baeldung.kubernetes.intro; + + +import java.util.concurrent.TimeUnit; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.kubernetes.client.openapi.ApiClient; +import io.kubernetes.client.openapi.apis.CoreV1Api; +import io.kubernetes.client.openapi.models.V1NodeList; +import io.kubernetes.client.openapi.models.V1PodList; +import io.kubernetes.client.util.Config; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; + +/** + * @author Philippe + * + */ +public class ListPodsWithNamespaces { + + private static final Logger log = LoggerFactory.getLogger(ListPodsWithNamespaces.class); + + /** + * @param args + */ + public static void main(String[] args) throws Exception { + + ApiClient client = Config.defaultClient(); + HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> log.info(message)); + interceptor.setLevel(HttpLoggingInterceptor.Level.BODY); + OkHttpClient newClient = client.getHttpClient() + .newBuilder() + .addInterceptor(interceptor) + .readTimeout(0, TimeUnit.SECONDS) + .build(); + + client.setHttpClient(newClient); + CoreV1Api api = new CoreV1Api(client); + String namespace = "ns1"; + V1PodList items = api.listNamespacedPod(namespace,null, null, null, null, null, null, null, null, 10, false); + items.getItems() + .stream() + .map((pod) -> pod.getMetadata().getName() ) + .forEach((name) -> System.out.println("name=" + name)); + + } +} diff --git a/kubernetes/k8s-intro/src/test/java/com/baeldung/kubernetes/intro/ListPodsWithFieldSelectorsLiveTest.java b/kubernetes/k8s-intro/src/test/java/com/baeldung/kubernetes/intro/ListPodsWithFieldSelectorsLiveTest.java new file mode 100644 index 0000000000..9413fe1460 --- /dev/null +++ b/kubernetes/k8s-intro/src/test/java/com/baeldung/kubernetes/intro/ListPodsWithFieldSelectorsLiveTest.java @@ -0,0 +1,27 @@ +package com.baeldung.kubernetes.intro; + +import org.junit.jupiter.api.Test; + +class ListPodsWithFieldSelectorsLiveTest { + @Test + void givenEqualitySelector_whenListPodsWithFieldSelectors_thenSuccess() throws Exception { + ListPodsWithFieldSelectors.main(new String[] { + "metadata.namespace=ns1" + }); + } + + @Test + void givenInequalitySelector_whenListPodsWithFieldSelectors_thenSuccess() throws Exception { + ListPodsWithFieldSelectors.main(new String[] { + "metadata.namespace!=ns1" + }); + } + + @Test + void givenChainedSelector_whenListPodsWithFieldSelectors_thenSuccess() throws Exception { + ListPodsWithFieldSelectors.main(new String[] { + "metadata.namespace=ns1", + "status.phase=Running" + }); + } +} diff --git a/kubernetes/k8s-intro/src/test/java/com/baeldung/kubernetes/intro/ListPodsWithLabelSelectorsLiveTest.java b/kubernetes/k8s-intro/src/test/java/com/baeldung/kubernetes/intro/ListPodsWithLabelSelectorsLiveTest.java new file mode 100644 index 0000000000..eb64853225 --- /dev/null +++ b/kubernetes/k8s-intro/src/test/java/com/baeldung/kubernetes/intro/ListPodsWithLabelSelectorsLiveTest.java @@ -0,0 +1,55 @@ +package com.baeldung.kubernetes.intro; + +import org.junit.jupiter.api.Test; + +class ListPodsWithLabelSelectorsLiveTest { + @Test + void givenEqualitySelector_whenListPodsWithLabelSelectors_thenSuccess() throws Exception { + ListPodsWithLabelSelectors.main(new String[] { + "app=httpd" + }); + } + + @Test + void givenInqualitySelector_whenListPodsWithLabelSelectors_thenSuccess() throws Exception { + ListPodsWithLabelSelectors.main(new String[] { + "app!=httpd" + }); + } + + @Test + void givenInSetSelector_whenListPodsWithLabelSelectors_thenSuccess() throws Exception { + ListPodsWithLabelSelectors.main(new String[] { + "app in (httpd,test)" + }); + } + + @Test + void givenNotInSetSelector_whenListPodsWithLabelSelectors_thenSuccess() throws Exception { + ListPodsWithLabelSelectors.main(new String[] { + "app notin (httpd)" + }); + } + + @Test + void givenLabelPresentSelector_whenListPodsWithLabelSelectors_thenSuccess() throws Exception { + ListPodsWithLabelSelectors.main(new String[] { + "app" + }); + } + + @Test + void givenLabelNotPresentSelector_whenListPodsWithLabelSelectors_thenSuccess() throws Exception { + ListPodsWithLabelSelectors.main(new String[] { + "!app" + }); + } + + @Test + void givenChainedSelector_whenListPodsWithLabelSelectors_thenSuccess() throws Exception { + ListPodsWithLabelSelectors.main(new String[] { + "app=httpd", + "!foo" + }); + } +} diff --git a/kubernetes/pom.xml b/kubernetes/pom.xml index aea3dea47e..72cb1577a4 100644 --- a/kubernetes/pom.xml +++ b/kubernetes/pom.xml @@ -1,12 +1,16 @@ - + 4.0.0 + kubernetes + pom + com.baeldung parent-modules 1.0.0-SNAPSHOT - kubernetes - pom + k8s-intro diff --git a/language-interop/pom.xml b/language-interop/pom.xml index bdf872a076..f2b0a08969 100644 --- a/language-interop/pom.xml +++ b/language-interop/pom.xml @@ -52,4 +52,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/libraries-2/pom.xml b/libraries-2/pom.xml index 3aa36c3f90..28a7fb62fd 100644 --- a/libraries-2/pom.xml +++ b/libraries-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 libraries-2 libraries-2 @@ -75,7 +75,6 @@ - edu.uci.ics crawler4j @@ -136,4 +135,4 @@ 2.5.0 - + \ No newline at end of file diff --git a/libraries-3/pom.xml b/libraries-3/pom.xml index 3d3b5db890..079628ffaa 100644 --- a/libraries-3/pom.xml +++ b/libraries-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 libraries-3 libraries-3 @@ -70,7 +70,7 @@ velocity-engine-core ${velocity-engine-core.version} - + com.uber.nullaway nullaway ${nullaway.version} @@ -80,8 +80,7 @@ plexus-compiler-javac-errorprone ${plexus-compiler.version} - + com.google.errorprone error_prone_core @@ -123,7 +122,7 @@ - + org.apache.maven.plugins maven-compiler-plugin 3.5 @@ -141,7 +140,8 @@ - + -XepExcludedPaths:(.*)/test/.*|(.*)/jcabi/.* -XepOpt:NullAway:AnnotatedPackages=com.baeldung.nullaway @@ -153,8 +153,8 @@ plexus-compiler-javac-errorprone 2.8 - + com.google.errorprone error_prone_core @@ -170,7 +170,7 @@ - + reload @@ -210,11 +210,10 @@ - + 1.78 1.18.6 - 0.43 2.7.2 1.2.3.Final @@ -223,7 +222,6 @@ 0.14.1 1.9.2 1.9.2 - 1.19 4.4.13 4.5.12 @@ -232,4 +230,4 @@ 2.8 2.1.3 - + \ No newline at end of file diff --git a/libraries-4/pom.xml b/libraries-4/pom.xml index d7f6a44985..decd467de9 100644 --- a/libraries-4/pom.xml +++ b/libraries-4/pom.xml @@ -1,15 +1,15 @@ + 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 + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - libraries-4 diff --git a/libraries-5/pom.xml b/libraries-5/pom.xml index c0de1af822..ff6c208f5f 100644 --- a/libraries-5/pom.xml +++ b/libraries-5/pom.xml @@ -1,16 +1,16 @@ + 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 + parent-modules com.baeldung 1.0.0-SNAPSHOT - libraries-5 - 4.0.0 - org.springframework @@ -33,7 +33,6 @@ ${pact.version} test - com.typesafe.akka @@ -45,7 +44,6 @@ akka-testkit_${scala.version} ${typesafe-akka.version} test - one.util @@ -62,7 +60,6 @@ byte-buddy-agent ${byte-buddy.version} - com.github.docker-java @@ -84,7 +81,6 @@ - com.github.ben-manes.caffeine caffeine diff --git a/libraries-6/pom.xml b/libraries-6/pom.xml index caaebbb922..6db3b1b77b 100644 --- a/libraries-6/pom.xml +++ b/libraries-6/pom.xml @@ -1,15 +1,15 @@ + 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 + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - libraries-6 @@ -164,5 +164,4 @@ 8.12.9 - \ No newline at end of file diff --git a/libraries-apache-commons-collections/pom.xml b/libraries-apache-commons-collections/pom.xml index 2209874c66..e2805552e3 100644 --- a/libraries-apache-commons-collections/pom.xml +++ b/libraries-apache-commons-collections/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libraries-apache-commons-collections libraries-apache-commons-collections @@ -37,4 +38,4 @@ 2.0.0.0 - + \ No newline at end of file diff --git a/libraries-apache-commons-io/pom.xml b/libraries-apache-commons-io/pom.xml index 21f3f16cd3..5d0ed20abf 100644 --- a/libraries-apache-commons-io/pom.xml +++ b/libraries-apache-commons-io/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libraries-apache-commons-io libraries-apache-commons-io @@ -28,4 +29,4 @@ 1.4 - + \ No newline at end of file diff --git a/libraries-apache-commons/pom.xml b/libraries-apache-commons/pom.xml index 08dddac880..8fa55c1b0e 100644 --- a/libraries-apache-commons/pom.xml +++ b/libraries-apache-commons/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libraries-apache-commons libraries-apache-commons @@ -75,4 +76,4 @@ 2.5 - + \ No newline at end of file diff --git a/libraries-concurrency/pom.xml b/libraries-concurrency/pom.xml index 66296d829f..d8f48a1959 100644 --- a/libraries-concurrency/pom.xml +++ b/libraries-concurrency/pom.xml @@ -54,14 +54,11 @@ -Dco.paralleluniverse.fibers.verifyInstrumentation=true - -javaagent:${co.paralleluniverse:quasar-core:jar} - -classpath - com.baeldung.quasar.App @@ -81,4 +78,5 @@ 0.8.0 + \ No newline at end of file diff --git a/libraries-data-2/pom.xml b/libraries-data-2/pom.xml index 0154823cca..1feb3142ee 100644 --- a/libraries-data-2/pom.xml +++ b/libraries-data-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 libraries-data-2 libraries-data-2 @@ -142,7 +142,7 @@ net.bytebuddy byte-buddy ${byte-buddy.version} - test + test org.apache.kafka @@ -168,7 +168,7 @@ 0.1.0 1.0.3 9.1.5.Final - + 4.3.8.RELEASE 4.0.0 1.1.0 diff --git a/libraries-data-db/README.md b/libraries-data-db/README.md index 790a3eb318..98a83d5669 100644 --- a/libraries-data-db/README.md +++ b/libraries-data-db/README.md @@ -3,9 +3,11 @@ This module contains articles about database-related data processing libraries. ### Relevant articles + - [Introduction to Reladomo](https://www.baeldung.com/reladomo) - [Introduction to ORMLite](https://www.baeldung.com/ormlite) - [Guide to Java Data Objects](https://www.baeldung.com/jdo) - [Intro to JDO Queries 2/2](https://www.baeldung.com/jdo-queries) - [Introduction to HikariCP](https://www.baeldung.com/hikaricp) - [Guide to Ebean ORM](https://www.baeldung.com/ebean-orm) +- [Introduction to Debezium](https://www.baeldung.com/debezium-intro) diff --git a/libraries-data-db/pom.xml b/libraries-data-db/pom.xml index 01e078d18d..20119da8a2 100644 --- a/libraries-data-db/pom.xml +++ b/libraries-data-db/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-data-db libraries-data-db @@ -84,7 +84,6 @@ - io.debezium @@ -107,38 +106,32 @@ debezium-connector-mysql ${debezium.version} - org.testcontainers testcontainers ${testcontainers-version} - org.testcontainers mysql ${testcontainers-version} - - + org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa - mysql mysql-connector-java - - + org.projectlombok lombok @@ -161,16 +154,25 @@ - - - + + + - - + + - + @@ -181,7 +183,6 @@ reladomogen ${reladomo.version} - com.goldmansachs.reladomo reladomo-gen-util @@ -223,7 +224,6 @@ - org.datanucleus @@ -283,4 +283,4 @@ 1.15.3 - + \ No newline at end of file diff --git a/libraries-data-io/pom.xml b/libraries-data-io/pom.xml index e15e188d10..58bfde9aa0 100644 --- a/libraries-data-io/pom.xml +++ b/libraries-data-io/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-data-io libraries-data-io diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index 5adb490e96..3c6bedba90 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libraries-data libraries-data @@ -57,8 +58,7 @@ hazelcast ${hazelcast.version} - - + org.apache.crunch crunch-core @@ -70,7 +70,6 @@ ${org.apache.hadoop.hadoop-client} provided - commons-cli commons-cli @@ -179,4 +178,4 @@ 1.6.0.1 - + \ No newline at end of file diff --git a/libraries-http-2/README.md b/libraries-http-2/README.md index f3fdf1becb..4085d98ea5 100644 --- a/libraries-http-2/README.md +++ b/libraries-http-2/README.md @@ -8,5 +8,6 @@ This module contains articles about HTTP libraries. - [Decode an OkHttp JSON Response](https://www.baeldung.com/okhttp-json-response) - [Retrofit 2 – Dynamic URL](https://www.baeldung.com/retrofit-dynamic-url) - [Adding Interceptors in OkHTTP](https://www.baeldung.com/java-okhttp-interceptors) +- [A Guide to Events in OkHTTP](https://www.baeldung.com/java-okhttp-events) - More articles [[<-- prev]](/libraries-http) diff --git a/libraries-http-2/pom.xml b/libraries-http-2/pom.xml index 855008521f..d8479def3c 100644 --- a/libraries-http-2/pom.xml +++ b/libraries-http-2/pom.xml @@ -71,7 +71,6 @@ reactive-streams ${reactive.stream.version} - com.squareup.retrofit2 @@ -98,4 +97,4 @@ 3.2.12.RELEASE - + \ No newline at end of file diff --git a/libraries-http-2/src/main/java/com/baeldung/okhttp/events/EventTimer.java b/libraries-http-2/src/main/java/com/baeldung/okhttp/events/EventTimer.java new file mode 100644 index 0000000000..356dea9fc6 --- /dev/null +++ b/libraries-http-2/src/main/java/com/baeldung/okhttp/events/EventTimer.java @@ -0,0 +1,156 @@ +package com.baeldung.okhttp.events; + +import java.io.IOException; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.util.List; + +import okhttp3.Call; +import okhttp3.Connection; +import okhttp3.EventListener; +import okhttp3.Handshake; +import okhttp3.HttpUrl; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; + +public class EventTimer extends EventListener { + + private long start; + + private void logTimedEvent(String name) { + long now = System.nanoTime(); + if (name.equals("callStart")) { + start = now; + } + long elapsedNanos = now - start; + System.out.printf("%.3f %s%n", elapsedNanos / 1000000000d, name); + } + + @Override + public void callStart(Call call) { + logTimedEvent("callStart"); + } + + @Override + public void proxySelectStart(Call call, HttpUrl url) { + logTimedEvent("proxySelectStart"); + } + + @Override + public void proxySelectEnd(Call call, HttpUrl url, List proxies) { + logTimedEvent("proxySelectEnd"); + } + + @Override + public void dnsStart(Call call, String domainName) { + logTimedEvent("dnsStart"); + } + + @Override + public void dnsEnd(Call call, String domainName, List inetAddressList) { + logTimedEvent("dnsEnd"); + } + + @Override + public void connectStart(Call call, InetSocketAddress inetSocketAddress, Proxy proxy) { + logTimedEvent("connectStart"); + } + + @Override + public void secureConnectStart(Call call) { + logTimedEvent("secureConnectStart"); + } + + @Override + public void secureConnectEnd(Call call, Handshake handshake) { + logTimedEvent("secureConnectEnd"); + } + + @Override + public void connectEnd(Call call, InetSocketAddress inetSocketAddress, Proxy proxy, Protocol protocol) { + logTimedEvent("connectEnd"); + } + + @Override + public void connectFailed(Call call, InetSocketAddress inetSocketAddress, Proxy proxy, Protocol protocol, IOException ioe) { + logTimedEvent("connectFailed"); + } + + @Override + public void connectionAcquired(Call call, Connection connection) { + logTimedEvent("connectionAcquired"); + } + + @Override + public void connectionReleased(Call call, Connection connection) { + logTimedEvent("connectionReleased"); + } + + @Override + public void requestHeadersStart(Call call) { + logTimedEvent("requestHeadersStart"); + } + + @Override + public void requestHeadersEnd(Call call, Request request) { + logTimedEvent("requestHeadersEnd"); + } + + @Override + public void requestBodyStart(Call call) { + logTimedEvent("requestBodyStart"); + } + + @Override + public void requestBodyEnd(Call call, long byteCount) { + logTimedEvent("requestBodyEnd"); + } + + @Override + public void requestFailed(Call call, IOException ioe) { + logTimedEvent("requestFailed"); + } + + @Override + public void responseHeadersStart(Call call) { + logTimedEvent("responseHeadersStart"); + } + + @Override + public void responseHeadersEnd(Call call, Response response) { + logTimedEvent("responseHeadersEnd"); + } + + @Override + public void responseBodyStart(Call call) { + logTimedEvent("responseBodyStart"); + } + + @Override + public void responseBodyEnd(Call call, long byteCount) { + logTimedEvent("responseBodyEnd"); + } + + @Override + public void responseFailed(Call call, IOException ioe) { + logTimedEvent("responseFailed"); + } + + @Override + public void callEnd(Call call) { + logTimedEvent("callEnd"); + } + + @Override + public void callFailed(Call call, IOException ioe) { + logTimedEvent("callFailed"); + } + + @Override + public void canceled(Call call) { + logTimedEvent("canceled"); + } + +} diff --git a/libraries-http-2/src/main/java/com/baeldung/okhttp/events/SimpleLogEventsListener.java b/libraries-http-2/src/main/java/com/baeldung/okhttp/events/SimpleLogEventsListener.java new file mode 100644 index 0000000000..93e3eb6308 --- /dev/null +++ b/libraries-http-2/src/main/java/com/baeldung/okhttp/events/SimpleLogEventsListener.java @@ -0,0 +1,37 @@ +package com.baeldung.okhttp.events; + +import java.time.LocalDateTime; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import okhttp3.Call; +import okhttp3.EventListener; +import okhttp3.Request; +import okhttp3.Response; + +public class SimpleLogEventsListener extends EventListener { + + private static final Logger LOGGER = LoggerFactory.getLogger(SimpleLogEventsListener.class); + + @Override + public void callStart(Call call) { + LOGGER.info("callStart at {}", LocalDateTime.now()); + } + + @Override + public void requestHeadersEnd(Call call, Request request) { + LOGGER.info("requestHeadersEnd at {} with headers {}", LocalDateTime.now(), request.headers()); + } + + @Override + public void responseHeadersEnd(Call call, Response response) { + LOGGER.info("responseHeadersEnd at {} with headers {}", LocalDateTime.now(), response.headers()); + } + + @Override + public void callEnd(Call call) { + LOGGER.info("callEnd at {}", LocalDateTime.now()); + } + +} diff --git a/libraries-http-2/src/test/java/com/baeldung/okhttp/events/EventTimerLiveTest.java b/libraries-http-2/src/test/java/com/baeldung/okhttp/events/EventTimerLiveTest.java new file mode 100644 index 0000000000..ebf4cd1404 --- /dev/null +++ b/libraries-http-2/src/test/java/com/baeldung/okhttp/events/EventTimerLiveTest.java @@ -0,0 +1,31 @@ +package com.baeldung.okhttp.events; + +import static org.junit.Assert.*; + +import java.io.IOException; + +import org.junit.Test; + +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +public class EventTimerLiveTest { + + @Test + public void givenSimpleEventTimer_whenRequestSent_thenCallsLogged() throws IOException { + + OkHttpClient client = new OkHttpClient.Builder() + .eventListener(new EventTimer()) + .build(); + + Request request = new Request.Builder() + .url("https://www.baeldung.com/") + .build(); + + try (Response response = client.newCall(request).execute()) { + assertEquals("Response code should be: ", 200, response.code()); + } + } + +} diff --git a/libraries-http-2/src/test/java/com/baeldung/okhttp/events/LogEventsListenerIntegrationTest.java b/libraries-http-2/src/test/java/com/baeldung/okhttp/events/LogEventsListenerIntegrationTest.java new file mode 100644 index 0000000000..c5884e8a12 --- /dev/null +++ b/libraries-http-2/src/test/java/com/baeldung/okhttp/events/LogEventsListenerIntegrationTest.java @@ -0,0 +1,53 @@ +package com.baeldung.okhttp.events; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.net.SocketTimeoutException; + +import org.junit.Rule; +import org.junit.Test; + +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; + +public class LogEventsListenerIntegrationTest { + + @Rule + public MockWebServer server = new MockWebServer(); + + @Test + public void givenSimpleEventLogger_whenRequestSent_thenCallsLogged() throws IOException { + server.enqueue(new MockResponse().setBody("Hello Baeldung Readers!")); + + OkHttpClient client = new OkHttpClient.Builder() + .eventListener(new SimpleLogEventsListener()) + .build(); + + Request request = new Request.Builder() + .url(server.url("/")) + .build(); + + try (Response response = client.newCall(request).execute()) { + assertEquals("Response code should be: ", 200, response.code()); + assertEquals("Body should be: ", "Hello Baeldung Readers!", response.body().string()); + } + } + + @Test (expected = SocketTimeoutException.class) + public void givenConnectionError_whenRequestSent_thenFailedCallsLogged() throws IOException { + OkHttpClient client = new OkHttpClient.Builder() + .eventListener(new EventTimer()) + .build(); + + Request request = new Request.Builder() + .url(server.url("/")) + .build(); + + client.newCall(request).execute(); + } + +} diff --git a/libraries-http/pom.xml b/libraries-http/pom.xml index 257cb988d6..8eb6142c38 100644 --- a/libraries-http/pom.xml +++ b/libraries-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 libraries-http libraries-http @@ -18,14 +18,12 @@ assertj-core ${assertj.version} - com.squareup.okhttp3 okhttp ${com.squareup.okhttp3.version} - com.google.http-client @@ -37,7 +35,6 @@ google-http-client-jackson2 ${googleclient.version} - com.squareup.retrofit2 @@ -54,33 +51,28 @@ adapter-rxjava ${retrofit.version} - org.asynchttpclient async-http-client ${async.http.client.version} - com.fasterxml.jackson.core jackson-databind ${jackson.version} - com.google.code.gson gson ${gson.version} - com.squareup.okhttp3 mockwebserver ${com.squareup.okhttp3.version} test - com.mashape.unirest unirest-java @@ -118,7 +110,7 @@ 2.8.5 4.5.3 - + 3.6.2 4.9.1 1.23.0 @@ -129,4 +121,4 @@ 3.9.0 - + \ No newline at end of file diff --git a/libraries-io/pom.xml b/libraries-io/pom.xml index 8c2e841630..2f65fd989b 100644 --- a/libraries-io/pom.xml +++ b/libraries-io/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-io libraries-io @@ -38,4 +38,4 @@ 2.4 - + \ No newline at end of file diff --git a/libraries-primitive/pom.xml b/libraries-primitive/pom.xml index a3bf5e0d9d..06c42bd6c9 100644 --- a/libraries-primitive/pom.xml +++ b/libraries-primitive/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 libraries-primitive diff --git a/libraries-rpc/pom.xml b/libraries-rpc/pom.xml index 8741a41062..ab6b74ae84 100644 --- a/libraries-rpc/pom.xml +++ b/libraries-rpc/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libraries-rpc libraries-rpc @@ -13,17 +14,16 @@ - - com.twitter - finagle-core_2.13 - ${finagle.core.version} - - - com.twitter - finagle-http_2.13 - ${finagle.http.version} - - + + com.twitter + finagle-core_2.13 + ${finagle.core.version} + + + com.twitter + finagle-http_2.13 + ${finagle.http.version} + @@ -31,5 +31,4 @@ 20.4.0 - - + \ No newline at end of file diff --git a/libraries-security/pom.xml b/libraries-security/pom.xml index 3b812f0d2c..6ee6b7c358 100644 --- a/libraries-security/pom.xml +++ b/libraries-security/pom.xml @@ -91,4 +91,4 @@ 2.4.0.RELEASE - + \ No newline at end of file diff --git a/libraries-server-2/pom.xml b/libraries-server-2/pom.xml index 5f500a7ced..7377fa3fa9 100644 --- a/libraries-server-2/pom.xml +++ b/libraries-server-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 libraries-server-2 0.0.1-SNAPSHOT @@ -30,7 +31,7 @@ ${jetty.version} - + diff --git a/libraries-server/pom.xml b/libraries-server/pom.xml index d9546f1678..e36ed88f8f 100644 --- a/libraries-server/pom.xml +++ b/libraries-server/pom.xml @@ -66,32 +66,27 @@ ${junit.version} test - org.apache.tomcat tomcat-catalina ${tomcat.version} - org.igniterealtime.smack smack-tcp ${smack.version} - org.igniterealtime.smack smack-extensions ${smack.version} - org.igniterealtime.smack smack-java7 ${smack.version} - org.nanohttpd @@ -103,7 +98,6 @@ nanohttpd-nanolets ${nanohttpd.version} - diff --git a/libraries-testing/pom.xml b/libraries-testing/pom.xml index 8052680ea5..6d7e0c01e1 100644 --- a/libraries-testing/pom.xml +++ b/libraries-testing/pom.xml @@ -129,47 +129,40 @@ asciidoctor-maven-plugin ${asciidoctor.version} - org.dbunit dbunit ${dbunit.version} test - com.h2database h2 ${h2.version} test - org.assertj assertj-core ${assertj-core.version} test - net.bytebuddy byte-buddy ${byte-buddy.version} test - com.tngtech.archunit archunit-junit5 ${archunit.version} test - - net.serenity-bdd.maven.plugins serenity-maven-plugin @@ -184,7 +177,6 @@ - org.apache.maven.plugins maven-compiler-plugin @@ -194,7 +186,6 @@ ${maven-compiler-plugin.target} - @@ -220,4 +211,4 @@ 0.14.1 - + \ No newline at end of file diff --git a/libraries/pom.xml b/libraries/pom.xml index 5924ed009a..13f91fddd0 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -34,7 +34,6 @@ commons-net ${commons-net.version} - org.javatuples javatuples @@ -87,7 +86,6 @@ ${serenity.jira.version} test - org.datanucleus @@ -164,14 +162,12 @@ ${serenity.version} test - org.lucee jets3t ${jets3t-version} - io.rest-assured spring-mock-mvc @@ -226,13 +222,11 @@ ${org.hamcrest.java-hamcrest.version} test - com.codepoetics protonpack ${protonpack.version} - com.google.oauth-client @@ -327,7 +321,6 @@ - org.apache.maven.plugins @@ -361,7 +354,6 @@ - @@ -400,4 +392,4 @@ 2.6 - + \ No newline at end of file diff --git a/linkrest/pom.xml b/linkrest/pom.xml index 89af27d50c..e40efb3930 100644 --- a/linkrest/pom.xml +++ b/linkrest/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 linkrest 0.0.1-SNAPSHOT @@ -44,7 +45,6 @@ ${project.basedir}/src/main/resources/linkrest.map.xml - diff --git a/logging-modules/flogger/pom.xml b/logging-modules/flogger/pom.xml index e9189c8460..b96025f277 100644 --- a/logging-modules/flogger/pom.xml +++ b/logging-modules/flogger/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 flogger @@ -18,20 +18,17 @@ flogger ${flogger.version} - com.google.flogger flogger-system-backend ${flogger.version} runtime - com.google.flogger flogger-slf4j-backend ${flogger.version} - com.google.flogger flogger-log4j-backend @@ -51,7 +48,6 @@ - log4j log4j @@ -67,6 +63,6 @@ 0.4 1.2.17 - + \ No newline at end of file diff --git a/logging-modules/log-mdc/pom.xml b/logging-modules/log-mdc/pom.xml index a7cfd3faa8..ddf1f23f8c 100644 --- a/logging-modules/log-mdc/pom.xml +++ b/logging-modules/log-mdc/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 log-mdc 0.0.1-SNAPSHOT @@ -37,14 +38,12 @@ jackson-databind ${jackson.version} - log4j log4j ${log4j.version} - org.apache.logging.log4j @@ -56,14 +55,12 @@ log4j-core ${log4j2.version} - com.lmax disruptor ${disruptor.version} - org.jboss.logging @@ -80,7 +77,6 @@ logging-service - @@ -104,4 +100,4 @@ 5.6.2 - + \ No newline at end of file diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index 15cd2d530f..864e2253b5 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/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 log4j 1.0-SNAPSHOT @@ -26,7 +26,6 @@ apache-log4j-extras ${log4j.version} - org.apache.logging.log4j diff --git a/logging-modules/log4j2/pom.xml b/logging-modules/log4j2/pom.xml index e09cbd5d33..aaf60a4216 100644 --- a/logging-modules/log4j2/pom.xml +++ b/logging-modules/log4j2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 log4j2 log4j2 @@ -19,28 +20,24 @@ log4j-core ${log4j-core.version} - org.apache.logging.log4j log4j-api ${log4j-core.version} - com.fasterxml.jackson.core jackson-databind ${jackson.version} - com.fasterxml.jackson.dataformat jackson-dataformat-xml ${jackson.version} - com.h2database @@ -52,7 +49,6 @@ commons-dbcp2 ${commons-dbcp2.version} - org.apache.logging.log4j diff --git a/logging-modules/logback/pom.xml b/logging-modules/logback/pom.xml index 9f5a3ef294..c11f20955b 100644 --- a/logging-modules/logback/pom.xml +++ b/logging-modules/logback/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 logback 0.1-SNAPSHOT @@ -71,4 +71,4 @@ 1.1.1 - + \ No newline at end of file diff --git a/logging-modules/pom.xml b/logging-modules/pom.xml index e396d477dc..6d036d5648 100644 --- a/logging-modules/pom.xml +++ b/logging-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 logging-modules logging-modules @@ -24,4 +25,5 @@ 5.6.2 + diff --git a/lombok/pom.xml b/lombok/pom.xml index e347515b40..334d1defc9 100644 --- a/lombok/pom.xml +++ b/lombok/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 lombok 0.1-SNAPSHOT @@ -42,9 +42,7 @@ true - - org.projectlombok lombok-maven-plugin @@ -66,8 +64,9 @@ false - + @@ -76,7 +75,6 @@ 1.18.10 - 1.0.0.Final @@ -84,4 +82,4 @@ 3.8.0 - + \ No newline at end of file diff --git a/lucene/pom.xml b/lucene/pom.xml index 0a0e09f724..0f08abaee9 100644 --- a/lucene/pom.xml +++ b/lucene/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 lucene 0.0.1-SNAPSHOT diff --git a/mapstruct/pom.xml b/mapstruct/pom.xml index 9b416177e7..1434db0d54 100644 --- a/mapstruct/pom.xml +++ b/mapstruct/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mapstruct 1.0 @@ -79,4 +80,4 @@ 3.16.1 - + \ No newline at end of file diff --git a/maven-archetype/pom.xml b/maven-archetype/pom.xml index be616ac299..2eab8ac614 100644 --- a/maven-archetype/pom.xml +++ b/maven-archetype/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.archetypes maven-archetype @@ -26,4 +27,4 @@ 3.0.1 - + \ No newline at end of file diff --git a/maven-modules/compiler-plugin-java-9/pom.xml b/maven-modules/compiler-plugin-java-9/pom.xml index 6baadb451c..1063ee2e8f 100644 --- a/maven-modules/compiler-plugin-java-9/pom.xml +++ b/maven-modules/compiler-plugin-java-9/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 compiler-plugin-java-9 @@ -25,6 +25,6 @@ 3.8.0 9 9 - + \ No newline at end of file diff --git a/maven-modules/maven-copy-files/copy-rename-maven-plugin/pom.xml b/maven-modules/maven-copy-files/copy-rename-maven-plugin/pom.xml new file mode 100644 index 0000000000..24a7c48499 --- /dev/null +++ b/maven-modules/maven-copy-files/copy-rename-maven-plugin/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + + maven-copy-files + com.baeldung + 1.0-SNAPSHOT + + org.baeldung + copy-rename-maven-plugin + 1.0-SNAPSHOT + copy-rename-maven-plugin + + UTF-8 + 1.7 + 1.7 + + + + junit + junit + 4.11 + test + + + + + + com.coderplus.maven.plugins + copy-rename-maven-plugin + 1.0 + + + copy-file + generate-sources + + copy + + + source-files/foo.txt + target/destination-folder/foo.txt + + + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/maven-modules/maven-copy-files/copy-rename-maven-plugin/source-files/foo.txt b/maven-modules/maven-copy-files/copy-rename-maven-plugin/source-files/foo.txt new file mode 100644 index 0000000000..b2fa85b97f --- /dev/null +++ b/maven-modules/maven-copy-files/copy-rename-maven-plugin/source-files/foo.txt @@ -0,0 +1 @@ +Copy File Example diff --git a/maven-modules/maven-copy-files/copy-rename-maven-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java b/maven-modules/maven-copy-files/copy-rename-maven-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java new file mode 100644 index 0000000000..a98db61fa9 --- /dev/null +++ b/maven-modules/maven-copy-files/copy-rename-maven-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java @@ -0,0 +1,16 @@ +package org.baeldung; + +import org.junit.Test; + +import java.io.File; + +import static org.junit.Assert.assertEquals; + +public class CopyFileUnitTest { + + @Test + public void whenCopyingAFileFromSourceToDestination_thenFileShouldBeInDestination() { + File destinationFile = new File("target/destination-folder/foo.txt"); + assertEquals(true, destinationFile.exists()); + } +} diff --git a/maven-modules/maven-copy-files/maven-antrun-plugin/pom.xml b/maven-modules/maven-copy-files/maven-antrun-plugin/pom.xml new file mode 100644 index 0000000000..61017dd18a --- /dev/null +++ b/maven-modules/maven-copy-files/maven-antrun-plugin/pom.xml @@ -0,0 +1,94 @@ + + + 4.0.0 + + maven-copy-files + com.baeldung + 1.0-SNAPSHOT + + org.baeldung + maven-antrun-plugin + 1.0-SNAPSHOT + maven-antrun-plugin + + UTF-8 + 1.7 + 1.7 + + + + junit + junit + 4.11 + test + + + + + + maven-antrun-plugin + 3.0.0 + + + generate-sources + + + + + + + + + + run + + + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/maven-modules/maven-copy-files/maven-antrun-plugin/source-files/foo.txt b/maven-modules/maven-copy-files/maven-antrun-plugin/source-files/foo.txt new file mode 100644 index 0000000000..b2fa85b97f --- /dev/null +++ b/maven-modules/maven-copy-files/maven-antrun-plugin/source-files/foo.txt @@ -0,0 +1 @@ +Copy File Example diff --git a/maven-modules/maven-copy-files/maven-antrun-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java b/maven-modules/maven-copy-files/maven-antrun-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java new file mode 100644 index 0000000000..a98db61fa9 --- /dev/null +++ b/maven-modules/maven-copy-files/maven-antrun-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java @@ -0,0 +1,16 @@ +package org.baeldung; + +import org.junit.Test; + +import java.io.File; + +import static org.junit.Assert.assertEquals; + +public class CopyFileUnitTest { + + @Test + public void whenCopyingAFileFromSourceToDestination_thenFileShouldBeInDestination() { + File destinationFile = new File("target/destination-folder/foo.txt"); + assertEquals(true, destinationFile.exists()); + } +} diff --git a/maven-modules/maven-copy-files/maven-resources-plugin/pom.xml b/maven-modules/maven-copy-files/maven-resources-plugin/pom.xml new file mode 100644 index 0000000000..7dbe851f95 --- /dev/null +++ b/maven-modules/maven-copy-files/maven-resources-plugin/pom.xml @@ -0,0 +1,92 @@ + + + 4.0.0 + + maven-copy-files + com.baeldung + 1.0-SNAPSHOT + + org.baeldung + maven-resources-plugin + 1.0-SNAPSHOT + maven-resoures-plugin + + UTF-8 + 1.7 + 1.7 + + + + junit + junit + 4.11 + test + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + copy-resource-one + generate-sources + + copy-resources + + + ${basedir}/target/destination-folder + + + source-files + + foo.txt + + + + + + + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/maven-modules/maven-copy-files/maven-resources-plugin/source-files/foo.txt b/maven-modules/maven-copy-files/maven-resources-plugin/source-files/foo.txt new file mode 100644 index 0000000000..b2fa85b97f --- /dev/null +++ b/maven-modules/maven-copy-files/maven-resources-plugin/source-files/foo.txt @@ -0,0 +1 @@ +Copy File Example diff --git a/maven-modules/maven-copy-files/maven-resources-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java b/maven-modules/maven-copy-files/maven-resources-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java new file mode 100644 index 0000000000..a98db61fa9 --- /dev/null +++ b/maven-modules/maven-copy-files/maven-resources-plugin/src/test/java/org/baeldung/CopyFileUnitTest.java @@ -0,0 +1,16 @@ +package org.baeldung; + +import org.junit.Test; + +import java.io.File; + +import static org.junit.Assert.assertEquals; + +public class CopyFileUnitTest { + + @Test + public void whenCopyingAFileFromSourceToDestination_thenFileShouldBeInDestination() { + File destinationFile = new File("target/destination-folder/foo.txt"); + assertEquals(true, destinationFile.exists()); + } +} diff --git a/maven-modules/maven-copy-files/pom.xml b/maven-modules/maven-copy-files/pom.xml new file mode 100644 index 0000000000..b7b67286bc --- /dev/null +++ b/maven-modules/maven-copy-files/pom.xml @@ -0,0 +1,80 @@ + + + 4.0.0 + + maven-modules + com.baeldung + 0.0.1-SNAPSHOT + + com.baeldung + maven-copy-files + 1.0-SNAPSHOT + pom + maven-copy-files + + http://www.example.com + + UTF-8 + 1.7 + 1.7 + + + + junit + junit + 4.11 + test + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + + maven-resources-plugin + maven-antrun-plugin + copy-rename-maven-plugin + + diff --git a/maven-modules/maven-custom-plugin/pom.xml b/maven-modules/maven-custom-plugin/pom.xml index ad22c735ff..731abe472d 100644 --- a/maven-modules/maven-custom-plugin/pom.xml +++ b/maven-modules/maven-custom-plugin/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 maven-custom-plugin diff --git a/maven-modules/maven-exec-plugin/pom.xml b/maven-modules/maven-exec-plugin/pom.xml index 6c12971e29..837f31edeb 100644 --- a/maven-modules/maven-exec-plugin/pom.xml +++ b/maven-modules/maven-exec-plugin/pom.xml @@ -1,19 +1,13 @@ + 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 maven-exec-plugin 0.0.1-SNAPSHOT maven-exec-plugin - - 3.8.1 - 1.8 - 1.2.3 - - ch.qos.logback @@ -33,7 +27,6 @@ ${java.version} - org.codehaus.mojo exec-maven-plugin @@ -50,4 +43,10 @@ - + + 3.8.1 + 1.8 + 1.2.3 + + + \ No newline at end of file diff --git a/maven-modules/maven-integration-test/pom.xml b/maven-modules/maven-integration-test/pom.xml index 0031230bb1..4ab8de783d 100644 --- a/maven-modules/maven-integration-test/pom.xml +++ b/maven-modules/maven-integration-test/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 maven-integration-test 0.0.1-SNAPSHOT diff --git a/maven-modules/maven-multi-source/pom.xml b/maven-modules/maven-multi-source/pom.xml index 0c85049df7..65e00419af 100644 --- a/maven-modules/maven-multi-source/pom.xml +++ b/maven-modules/maven-multi-source/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 maven-multi-source 0.0.1-SNAPSHOT diff --git a/maven-modules/maven-plugins/custom-rule/pom.xml b/maven-modules/maven-plugins/custom-rule/pom.xml index 075a5c7943..3426f30457 100644 --- a/maven-modules/maven-plugins/custom-rule/pom.xml +++ b/maven-modules/maven-plugins/custom-rule/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 custom-rule @@ -45,12 +46,6 @@ - - 3.0.0-M2 - 2.0.9 - 1.0-alpha-9 - - @@ -64,4 +59,10 @@ - + + 3.0.0-M2 + 2.0.9 + 1.0-alpha-9 + + + \ No newline at end of file diff --git a/maven-modules/maven-plugins/jaxws/pom.xml b/maven-modules/maven-plugins/jaxws/pom.xml index 161c1dc731..5783907140 100644 --- a/maven-modules/maven-plugins/jaxws/pom.xml +++ b/maven-modules/maven-plugins/jaxws/pom.xml @@ -1,15 +1,16 @@ + 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 + jaxws + maven-plugins com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - jaxws diff --git a/maven-modules/maven-plugins/maven-enforcer/pom.xml b/maven-modules/maven-plugins/maven-enforcer/pom.xml index 01f97a061e..25c608ee36 100644 --- a/maven-modules/maven-plugins/maven-enforcer/pom.xml +++ b/maven-modules/maven-plugins/maven-enforcer/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 maven-enforcer maven-enforcer @@ -18,13 +18,13 @@ org.apache.maven.plugins maven-enforcer-plugin 3.0.0-M2 - - - - - - - + + + + + + + enforce @@ -33,7 +33,7 @@ - + 3.0 Invalid Maven version. It should, at least, be 3.0 @@ -55,7 +55,7 @@ WARN - + diff --git a/maven-modules/maven-plugins/pom.xml b/maven-modules/maven-plugins/pom.xml index 20bdb4b45a..29b3b550ea 100644 --- a/maven-modules/maven-plugins/pom.xml +++ b/maven-modules/maven-plugins/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 maven-plugins diff --git a/maven-modules/maven-printing-plugins/.gitignore b/maven-modules/maven-printing-plugins/.gitignore new file mode 100644 index 0000000000..333c1e910a --- /dev/null +++ b/maven-modules/maven-printing-plugins/.gitignore @@ -0,0 +1 @@ +logs/ diff --git a/maven-modules/maven-printing-plugins/pom.xml b/maven-modules/maven-printing-plugins/pom.xml new file mode 100644 index 0000000000..6ea1ab2a84 --- /dev/null +++ b/maven-modules/maven-printing-plugins/pom.xml @@ -0,0 +1,85 @@ + + + 4.0.0 + maven-printing-plugins + maven-printing-plugins + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../.. + + + + + + maven-antrun-plugin + 3.0.0 + + + antrun-plugin + validate + + run + + + + + + + + + + + + + + com.github.ekryd.echo-maven-plugin + echo-maven-plugin + 1.3.2 + + + echo-maven-plugin-1 + package + + echo + + + Hello, world + Embed a line break: ${line.separator} + ArtifactId is ${project.artifactId} + INFO + /logs/log-echo.txt + true + + + + + + org.codehaus.gmaven + groovy-maven-plugin + 2.1.1 + + + validate + + execute + + + + log.info('Test message: {}', 'Hello, World!') + log.info('Embed a line break {}', System.lineSeparator()) + log.info('ArtifactId is: ${project.artifactId}') + log.warn('Message only in debug mode') + + + + + + + + diff --git a/maven-modules/maven-profiles/pom.xml b/maven-modules/maven-profiles/pom.xml index f3aeb9d549..322dada104 100644 --- a/maven-modules/maven-profiles/pom.xml +++ b/maven-modules/maven-profiles/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 maven-profiles @@ -90,7 +90,7 @@ - 3.2.0 + 3.2.0 \ No newline at end of file diff --git a/maven-modules/maven-war-plugin/pom.xml b/maven-modules/maven-war-plugin/pom.xml index 915be306ca..04188b8995 100644 --- a/maven-modules/maven-war-plugin/pom.xml +++ b/maven-modules/maven-war-plugin/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 maven-war-plugin diff --git a/maven-modules/optional-dependencies/main-project/pom.xml b/maven-modules/optional-dependencies/main-project/pom.xml index 6a42683779..23da40dcf7 100644 --- a/maven-modules/optional-dependencies/main-project/pom.xml +++ b/maven-modules/optional-dependencies/main-project/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 main-project @@ -15,4 +15,5 @@ 0.0.1-SNAPSHOT + \ No newline at end of file diff --git a/maven-modules/optional-dependencies/optional-project/pom.xml b/maven-modules/optional-dependencies/optional-project/pom.xml index 9ad4376c8d..7502e70c4a 100644 --- a/maven-modules/optional-dependencies/optional-project/pom.xml +++ b/maven-modules/optional-dependencies/optional-project/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 optional-project diff --git a/maven-modules/optional-dependencies/pom.xml b/maven-modules/optional-dependencies/pom.xml index 12d028b2d7..761028ec95 100644 --- a/maven-modules/optional-dependencies/pom.xml +++ b/maven-modules/optional-dependencies/pom.xml @@ -1,19 +1,21 @@ + 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 + optional-dependencies + pom + maven-modules com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - optional-dependencies - pom optional-project project-with-optionals main-project + \ No newline at end of file diff --git a/maven-modules/optional-dependencies/project-with-optionals/pom.xml b/maven-modules/optional-dependencies/project-with-optionals/pom.xml index 6a14f3260d..b95217d53d 100644 --- a/maven-modules/optional-dependencies/project-with-optionals/pom.xml +++ b/maven-modules/optional-dependencies/project-with-optionals/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 project-with-optionals @@ -16,4 +16,5 @@ true + \ No newline at end of file diff --git a/maven-modules/pom.xml b/maven-modules/pom.xml index a476eacc64..0f146e26da 100644 --- a/maven-modules/pom.xml +++ b/maven-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 maven-modules 0.0.1-SNAPSHOT @@ -14,9 +15,10 @@ - - maven-custom-plugin - maven-exec-plugin + + maven-copy-files + maven-custom-plugin + maven-exec-plugin maven-integration-test maven-multi-source maven-plugins @@ -29,6 +31,7 @@ version-collision version-overriding-plugins versions-maven-plugin + maven-printing-plugins diff --git a/maven-modules/version-collision/pom.xml b/maven-modules/version-collision/pom.xml index 6d8441aa7b..9c1b9641c8 100644 --- a/maven-modules/version-collision/pom.xml +++ b/maven-modules/version-collision/pom.xml @@ -1,23 +1,24 @@ + 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 + version-collision + pom + maven-modules com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - version-collision - pom project-a project-b project-collision - + @@ -29,26 +30,26 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/maven-modules/version-collision/project-a/pom.xml b/maven-modules/version-collision/project-a/pom.xml index 1b7af7e963..ca06c7daca 100644 --- a/maven-modules/version-collision/project-a/pom.xml +++ b/maven-modules/version-collision/project-a/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 + project-a + version-collision com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - - project-a @@ -18,4 +18,5 @@ 22.0 + \ No newline at end of file diff --git a/maven-modules/version-collision/project-b/pom.xml b/maven-modules/version-collision/project-b/pom.xml index 0b0f50aeb8..a7185ab22d 100644 --- a/maven-modules/version-collision/project-b/pom.xml +++ b/maven-modules/version-collision/project-b/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 + project-b + version-collision com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - - project-b @@ -18,4 +18,5 @@ 29.0-jre + \ No newline at end of file diff --git a/maven-modules/version-collision/project-collision/pom.xml b/maven-modules/version-collision/project-collision/pom.xml index 3bec0ed54a..74f117cdbb 100644 --- a/maven-modules/version-collision/project-collision/pom.xml +++ b/maven-modules/version-collision/project-collision/pom.xml @@ -1,16 +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 + project-collision + version-collision com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - - project-collision - @@ -18,12 +17,12 @@ project-a 0.0.1-SNAPSHOT - - - - - - + + + + + + com.baeldung @@ -31,4 +30,5 @@ 0.0.1-SNAPSHOT + \ No newline at end of file diff --git a/maven-modules/version-overriding-plugins/child-a/pom.xml b/maven-modules/version-overriding-plugins/child-a/pom.xml index 780e1c4125..45098ccef0 100644 --- a/maven-modules/version-overriding-plugins/child-a/pom.xml +++ b/maven-modules/version-overriding-plugins/child-a/pom.xml @@ -1,16 +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 + child-a + pom + version-overriding-plugins com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - pom - child-a @@ -33,4 +34,5 @@ + \ No newline at end of file diff --git a/maven-modules/version-overriding-plugins/child-b/pom.xml b/maven-modules/version-overriding-plugins/child-b/pom.xml index 05f127bc5c..f86a3c2096 100644 --- a/maven-modules/version-overriding-plugins/child-b/pom.xml +++ b/maven-modules/version-overriding-plugins/child-b/pom.xml @@ -1,15 +1,14 @@ + 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 + child-b + version-overriding-plugins com.baeldung 0.0.1-SNAPSHOT - 4.0.0 - - child-b - \ No newline at end of file diff --git a/maven-modules/version-overriding-plugins/pom.xml b/maven-modules/version-overriding-plugins/pom.xml index 8d703ab568..79109a83e1 100644 --- a/maven-modules/version-overriding-plugins/pom.xml +++ b/maven-modules/version-overriding-plugins/pom.xml @@ -1,19 +1,16 @@ + 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 + version-overriding-plugins + pom + maven-modules com.baeldung 0.0.1-SNAPSHOT - - 3.8.0 - - 4.0.0 - - version-overriding-plugins - pom child-a @@ -52,4 +49,9 @@ + + + 3.8.0 + + \ No newline at end of file diff --git a/maven-modules/versions-maven-plugin/original/pom.xml b/maven-modules/versions-maven-plugin/original/pom.xml index c36a5913c2..2d81274611 100644 --- a/maven-modules/versions-maven-plugin/original/pom.xml +++ b/maven-modules/versions-maven-plugin/original/pom.xml @@ -8,37 +8,31 @@ 0.0.1-SNAPSHOT - commons-io commons-io ${commons-io.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.apache.commons commons-compress ${commons-compress-version} - commons-beanutils commons-beanutils ${commons-beanutils.version} - @@ -70,12 +64,12 @@ - + 1.15 2.3 4.0 1.9.1 2.7 - + \ No newline at end of file diff --git a/maven-modules/versions-maven-plugin/pom.xml b/maven-modules/versions-maven-plugin/pom.xml index ff49811430..9c837cefa0 100644 --- a/maven-modules/versions-maven-plugin/pom.xml +++ b/maven-modules/versions-maven-plugin/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 versions-maven-plugin @@ -14,25 +14,21 @@ commons-io ${commons.io.version} - org.apache.commons commons-collections4 ${commons.collections4.version} - org.apache.commons commons-lang3 ${commons.lang3.version} - org.apache.commons commons-compress ${commons-compress-version} - commons-beanutils commons-beanutils diff --git a/maven-polyglot/maven-polyglot-json-extension/pom.xml b/maven-polyglot/maven-polyglot-json-extension/pom.xml index 15166046c1..13d0b2099b 100644 --- a/maven-polyglot/maven-polyglot-json-extension/pom.xml +++ b/maven-polyglot/maven-polyglot-json-extension/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.maven.polyglot maven-polyglot-json-extension diff --git a/maven-polyglot/pom.xml b/maven-polyglot/pom.xml index eb4e629a96..496ce58bf2 100644 --- a/maven-polyglot/pom.xml +++ b/maven-polyglot/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 maven-polyglot 0.0.1-SNAPSHOT @@ -19,4 +20,4 @@ - + \ No newline at end of file diff --git a/mesos-marathon/pom.xml b/mesos-marathon/pom.xml index 42798bb209..58ca14ca93 100644 --- a/mesos-marathon/pom.xml +++ b/mesos-marathon/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mesos-marathon mesos-marathon diff --git a/metrics/pom.xml b/metrics/pom.xml index 07adf15936..2020cd28cf 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 metrics metrics @@ -37,7 +38,6 @@ javax.servlet-api ${dep.ver.servlet} - com.netflix.servo servo-core @@ -50,19 +50,16 @@ ${netflix.servo.ver} test - io.micrometer micrometer-registry-atlas ${micrometer.ver} - org.springframework.boot spring-boot-starter-web ${spring-boot-starter-web.version} - com.fasterxml.jackson.core jackson-databind @@ -73,13 +70,11 @@ jackson-dataformat-smile ${jackson.version} - io.astefanutti.metrics.aspectj metrics-aspectj-deps ${metrics-aspectj.version} - org.assertj assertj-core @@ -93,10 +88,10 @@ 3.1.0 0.12.17 0.12.0.RELEASE - + 2.0.7.RELEASE 3.11.1 1.1.0 - + \ No newline at end of file diff --git a/micronaut/pom.xml b/micronaut/pom.xml index bd0022c9e1..196218d856 100644 --- a/micronaut/pom.xml +++ b/micronaut/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.micronaut micronaut @@ -90,10 +91,12 @@ - + ${exec.mainClass} - + @@ -106,7 +109,7 @@ java -classpath - + ${exec.mainClass} @@ -148,4 +151,4 @@ 3.1.0 - + \ No newline at end of file diff --git a/microprofile/pom.xml b/microprofile/pom.xml index 5a32ad8dba..54ed3a9930 100644 --- a/microprofile/pom.xml +++ b/microprofile/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 microprofile 1.0-SNAPSHOT @@ -87,4 +88,4 @@ 17.0.0.4 - + \ No newline at end of file diff --git a/msf4j/pom.xml b/msf4j/pom.xml index a220ce0229..99e25dbcbf 100644 --- a/msf4j/pom.xml +++ b/msf4j/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.msf4j msf4j diff --git a/mustache/pom.xml b/mustache/pom.xml index 9f2402f353..db72e693c1 100644 --- a/mustache/pom.xml +++ b/mustache/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mustache mustache @@ -19,22 +20,18 @@ compiler ${mustache.compiler.api.version} - org.assertj assertj-core - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-mustache - org.springframework.boot spring-boot-starter-test diff --git a/mybatis/pom.xml b/mybatis/pom.xml index 3b4695fb58..4cd705c917 100644 --- a/mybatis/pom.xml +++ b/mybatis/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 mybatis mybatis diff --git a/netflix-modules/genie/pom.xml b/netflix-modules/genie/pom.xml index c68ecac7a2..61c0dac9ad 100644 --- a/netflix-modules/genie/pom.xml +++ b/netflix-modules/genie/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 genie diff --git a/netflix-modules/mantis/pom.xml b/netflix-modules/mantis/pom.xml index 3f75d448e4..474b8f6dbf 100644 --- a/netflix-modules/mantis/pom.xml +++ b/netflix-modules/mantis/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 mantis @@ -15,13 +16,11 @@ - org.springframework.boot spring-boot-starter 2.1.3.RELEASE - io.mantisrx mantis-runtime @@ -33,39 +32,33 @@ - com.fasterxml.jackson.core jackson-databind 2.10.2 - net.andreinc.mockneat mockneat 0.3.8 - 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 - @@ -75,4 +68,4 @@ - + \ No newline at end of file diff --git a/netflix-modules/pom.xml b/netflix-modules/pom.xml index 4031d007f8..d9660be6a1 100644 --- a/netflix-modules/pom.xml +++ b/netflix-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 netflix-modules netflix-modules diff --git a/ninja/pom.xml b/ninja/pom.xml index 9b80dc26c8..93f22cf718 100644 --- a/ninja/pom.xml +++ b/ninja/pom.xml @@ -1,15 +1,12 @@ - 4.0.0 - ninja jar com.baeldung 1.0.0 - http://www.ninjaframework.org @@ -148,8 +145,10 @@ - - + + ninja.standalone.NinjaJetty diff --git a/oauth2-framework-impl/oauth2-authorization-server/pom.xml b/oauth2-framework-impl/oauth2-authorization-server/pom.xml index e608c09188..f8ced851ba 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/pom.xml +++ b/oauth2-framework-impl/oauth2-authorization-server/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 oauth2-authorization-server oauth2-authorization-server @@ -74,4 +74,4 @@ 1.62 - + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-client/pom.xml b/oauth2-framework-impl/oauth2-client/pom.xml index febfe8dd27..814dabc664 100644 --- a/oauth2-framework-impl/oauth2-client/pom.xml +++ b/oauth2-framework-impl/oauth2-client/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 oauth2-client oauth2-client @@ -27,4 +27,4 @@ 9543 - + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-resource-server/pom.xml b/oauth2-framework-impl/oauth2-resource-server/pom.xml index 62f5889290..8f135055a2 100644 --- a/oauth2-framework-impl/oauth2-resource-server/pom.xml +++ b/oauth2-framework-impl/oauth2-resource-server/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 oauth2-resource-server oauth2-resource-server @@ -39,4 +39,4 @@ 1.1 - + \ No newline at end of file diff --git a/oauth2-framework-impl/pom.xml b/oauth2-framework-impl/pom.xml index 24559d3c4d..31983b08ad 100644 --- a/oauth2-framework-impl/pom.xml +++ b/oauth2-framework-impl/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 com.baeldung.oauth2 oauth2-framework-impl @@ -95,4 +95,4 @@ 1.3 - + \ No newline at end of file diff --git a/open-liberty/pom.xml b/open-liberty/pom.xml index 0e8b159043..aff951cfd8 100644 --- a/open-liberty/pom.xml +++ b/open-liberty/pom.xml @@ -1,9 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung open-liberty 1.0-SNAPSHOT @@ -29,7 +28,6 @@ ${version.derby} provided - junit @@ -87,7 +85,6 @@ maven-war-plugin ${version.maven-war-plugin} - @@ -97,7 +94,6 @@ UTF-8 UTF-8 false - 8.0.0 3.2 @@ -109,7 +105,6 @@ 3.2.6 1.0.4 3.3.1 - openliberty 9080 diff --git a/optaplanner/pom.xml b/optaplanner/pom.xml index d907cfc830..0e5fa9050e 100644 --- a/optaplanner/pom.xml +++ b/optaplanner/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 optaplanner optaplanner diff --git a/orika/pom.xml b/orika/pom.xml index 6974bd296e..c18bb58a51 100644 --- a/orika/pom.xml +++ b/orika/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 orika 1.0 @@ -24,4 +25,4 @@ 1.5.0 - + \ No newline at end of file diff --git a/osgi/osgi-intro-sample-activator/pom.xml b/osgi/osgi-intro-sample-activator/pom.xml index e6611dcf7d..3cabba4cb1 100644 --- a/osgi/osgi-intro-sample-activator/pom.xml +++ b/osgi/osgi-intro-sample-activator/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 osgi-intro-sample-activator osgi-intro-sample-activator @@ -32,19 +33,16 @@ ${project.groupId}.${project.artifactId} ${project.artifactId} ${project.version} - com.baeldung.osgi.sample.activator.HelloWorld - - - + com.baeldung.osgi.sample.activator - - + \ No newline at end of file diff --git a/osgi/osgi-intro-sample-client/pom.xml b/osgi/osgi-intro-sample-client/pom.xml index e91b831db1..b1b04aef78 100644 --- a/osgi/osgi-intro-sample-client/pom.xml +++ b/osgi/osgi-intro-sample-client/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 osgi-intro-sample-client diff --git a/osgi/osgi-intro-sample-service/pom.xml b/osgi/osgi-intro-sample-service/pom.xml index b44e1f9be3..af97d1c90d 100644 --- a/osgi/osgi-intro-sample-service/pom.xml +++ b/osgi/osgi-intro-sample-service/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 osgi-intro-sample-service osgi-intro-sample-service diff --git a/osgi/pom.xml b/osgi/pom.xml index afc980c8bd..3fa2dcdf02 100644 --- a/osgi/pom.xml +++ b/osgi/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 osgi 1.0-SNAPSHOT diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index 2e9c767aa2..96f4b1cbe3 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index f5bf8784a9..c67842e313 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/parent-java/pom.xml b/parent-java/pom.xml index ce79b34f57..c1abe79b2e 100644 --- a/parent-java/pom.xml +++ b/parent-java/pom.xml @@ -1,8 +1,7 @@ - + 4.0.0 parent-java 0.0.1-SNAPSHOT diff --git a/parent-spring-4/pom.xml b/parent-spring-4/pom.xml index 931cad374b..e0e91cec9a 100644 --- a/parent-spring-4/pom.xml +++ b/parent-spring-4/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/parent-spring-5/pom.xml b/parent-spring-5/pom.xml index 3219c504d5..b70ca2bd0f 100644 --- a/parent-spring-5/pom.xml +++ b/parent-spring-5/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 diff --git a/patterns/clean-architecture/pom.xml b/patterns/clean-architecture/pom.xml index b9968095f8..c36f9b83af 100644 --- a/patterns/clean-architecture/pom.xml +++ b/patterns/clean-architecture/pom.xml @@ -69,7 +69,6 @@ - @@ -80,4 +79,4 @@ - + \ No newline at end of file diff --git a/patterns/cqrs-es/pom.xml b/patterns/cqrs-es/pom.xml index 0829e35f34..826440b45d 100644 --- a/patterns/cqrs-es/pom.xml +++ b/patterns/cqrs-es/pom.xml @@ -5,13 +5,13 @@ cqrs-es 1.0-SNAPSHOT cqrs-es - + com.baeldung patterns 1.0.0-SNAPSHOT - + org.projectlombok diff --git a/patterns/design-patterns-architectural/pom.xml b/patterns/design-patterns-architectural/pom.xml index d1945a1d0a..c917744757 100644 --- a/patterns/design-patterns-architectural/pom.xml +++ b/patterns/design-patterns-architectural/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 design-patterns-architectural 1.0 @@ -20,7 +21,6 @@ ${assertj-core.version} test - org.hibernate hibernate-core @@ -40,4 +40,4 @@ 6.0.6 - + \ No newline at end of file diff --git a/patterns/design-patterns-behavioral-2/pom.xml b/patterns/design-patterns-behavioral-2/pom.xml index 3a6d21353e..f123a8f2f5 100644 --- a/patterns/design-patterns-behavioral-2/pom.xml +++ b/patterns/design-patterns-behavioral-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 design-patterns-behavioral-2 1.0 @@ -26,4 +27,4 @@ 3.12.2 - + \ No newline at end of file diff --git a/patterns/design-patterns-behavioral/pom.xml b/patterns/design-patterns-behavioral/pom.xml index aceaabf582..93e07bb477 100644 --- a/patterns/design-patterns-behavioral/pom.xml +++ b/patterns/design-patterns-behavioral/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 design-patterns-behavioral 1.0 @@ -30,7 +31,6 @@ commons-lang3 ${commons-lang3.version} - org.assertj assertj-core @@ -44,4 +44,4 @@ 3.9.1 - + \ No newline at end of file diff --git a/patterns/design-patterns-cloud/pom.xml b/patterns/design-patterns-cloud/pom.xml index 34defb7eac..950b6efb94 100644 --- a/patterns/design-patterns-cloud/pom.xml +++ b/patterns/design-patterns-cloud/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 design-patterns-cloud @@ -9,4 +9,4 @@ design-patterns-cloud pom - + \ No newline at end of file diff --git a/patterns/design-patterns-creational/pom.xml b/patterns/design-patterns-creational/pom.xml index 7c2742ade4..21bc13c21c 100644 --- a/patterns/design-patterns-creational/pom.xml +++ b/patterns/design-patterns-creational/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 design-patterns-creational 1.0 @@ -25,7 +26,6 @@ jsr305 ${javax.annotations.version} - org.assertj assertj-core @@ -40,4 +40,4 @@ 3.9.1 - + \ No newline at end of file diff --git a/patterns/design-patterns-functional/pom.xml b/patterns/design-patterns-functional/pom.xml index e5166dc61e..b801781564 100644 --- a/patterns/design-patterns-functional/pom.xml +++ b/patterns/design-patterns-functional/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 design-patterns-functional 1.0 @@ -13,4 +14,4 @@ 1.0.0-SNAPSHOT - + \ No newline at end of file diff --git a/patterns/design-patterns-structural/pom.xml b/patterns/design-patterns-structural/pom.xml index c37b6845be..f0bcb824b5 100644 --- a/patterns/design-patterns-structural/pom.xml +++ b/patterns/design-patterns-structural/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 design-patterns-structural 1.0 @@ -21,4 +22,4 @@ - + \ No newline at end of file diff --git a/patterns/dip/pom.xml b/patterns/dip/pom.xml index 7217c4fdcc..44062aaede 100644 --- a/patterns/dip/pom.xml +++ b/patterns/dip/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.dip dip @@ -27,4 +27,4 @@ 3.12.1 - + \ No newline at end of file diff --git a/patterns/front-controller/pom.xml b/patterns/front-controller/pom.xml index dc10250946..d25bd774c6 100644 --- a/patterns/front-controller/pom.xml +++ b/patterns/front-controller/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 front-controller front-controller @@ -36,5 +37,5 @@ - - + + \ No newline at end of file diff --git a/patterns/hexagonal-architecture/pom.xml b/patterns/hexagonal-architecture/pom.xml index db7ee69e2e..f8d4524514 100644 --- a/patterns/hexagonal-architecture/pom.xml +++ b/patterns/hexagonal-architecture/pom.xml @@ -1,12 +1,13 @@ - - 4.0.0 - com.baeldung - hexagonal-architecture - 1.0 - hexagonal-architecture - Project for hexagonal architecture in java + + 4.0.0 + com.baeldung + hexagonal-architecture + 1.0 + hexagonal-architecture + Project for hexagonal architecture in java com.baeldung @@ -15,42 +16,41 @@ ../../parent-boot-2 - - - org.springframework.boot - spring-boot-starter-web - + + + org.springframework.boot + spring-boot-starter-web + - - org.springframework.boot - spring-boot-starter-data-mongodb - + + org.springframework.boot + spring-boot-starter-data-mongodb + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.mockito + mockito-core + test + + - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - org.mockito - mockito-core - test - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - + \ No newline at end of file diff --git a/patterns/intercepting-filter/pom.xml b/patterns/intercepting-filter/pom.xml index 7f2f57b5e1..ffc3309ddb 100644 --- a/patterns/intercepting-filter/pom.xml +++ b/patterns/intercepting-filter/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 intercepting-filter intercepting-filter @@ -45,4 +46,4 @@ - + \ No newline at end of file diff --git a/patterns/pom.xml b/patterns/pom.xml index 112eecb606..3bde26cae2 100644 --- a/patterns/pom.xml +++ b/patterns/pom.xml @@ -1,15 +1,18 @@ - + 4.0.0 patterns patterns pom + com.baeldung parent-modules 1.0.0-SNAPSHOT + design-patterns-architectural design-patterns-behavioral @@ -26,6 +29,7 @@ solid clean-architecture + @@ -36,6 +40,7 @@ + @@ -52,7 +57,9 @@ + 9.4.0.v20161208 + \ No newline at end of file diff --git a/patterns/solid/pom.xml b/patterns/solid/pom.xml index ad76ea89fd..76ab54cbb2 100644 --- a/patterns/solid/pom.xml +++ b/patterns/solid/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 solid 1.0-SNAPSHOT @@ -13,4 +13,4 @@ 1.0.0-SNAPSHOT - + \ No newline at end of file diff --git a/pdf/pom.xml b/pdf/pom.xml index 7d7754ee73..fb9508156e 100644 --- a/pdf/pom.xml +++ b/pdf/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 pdf pdf @@ -94,4 +95,4 @@ 9.1.20 - + \ No newline at end of file diff --git a/performance-tests/pom.xml b/performance-tests/pom.xml index c203f0a923..8d402865ef 100644 --- a/performance-tests/pom.xml +++ b/performance-tests/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 performance-tests 1.0 @@ -22,13 +23,12 @@ com.github.dozermapper dozer-core ${dozer.version} - + org.mapstruct mapstruct ${mapstruct.version} - org.modelmapper modelmapper @@ -52,7 +52,6 @@ - @@ -90,16 +89,14 @@ ${uberjar.name} - + org.openjdk.jmh.Main - + *:* META-INF/*.SF @@ -156,16 +153,10 @@ 6.5.0 1.3.1.Final 2.3.8 - 1.6.1.CR2 - - + 1.6.1.CR2 + 1.8 - - + benchmarks 3.1.0 3.0.0-M1 @@ -179,4 +170,4 @@ 3.2.1 - + \ No newline at end of file diff --git a/persistence-modules/activejdbc/pom.xml b/persistence-modules/activejdbc/pom.xml index 84ce1c2b48..5fdf27a679 100644 --- a/persistence-modules/activejdbc/pom.xml +++ b/persistence-modules/activejdbc/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 activejdbc 1.0-SNAPSHOT diff --git a/persistence-modules/apache-bookkeeper/pom.xml b/persistence-modules/apache-bookkeeper/pom.xml index 3ef1f50d63..2d86e3a912 100644 --- a/persistence-modules/apache-bookkeeper/pom.xml +++ b/persistence-modules/apache-bookkeeper/pom.xml @@ -2,7 +2,6 @@ - 4.0.0 apache-bookkeeper 0.0.1-SNAPSHOT @@ -27,14 +26,12 @@ - org.testcontainers testcontainers ${testcontainers.version} test - @@ -42,6 +39,4 @@ 1.14.3 - - - + \ No newline at end of file diff --git a/persistence-modules/apache-cayenne/pom.xml b/persistence-modules/apache-cayenne/pom.xml index d728e18b33..87bf6fe30b 100644 --- a/persistence-modules/apache-cayenne/pom.xml +++ b/persistence-modules/apache-cayenne/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 apache-cayenne 0.0.1-SNAPSHOT @@ -43,4 +44,4 @@ 4.0.M5 - + \ No newline at end of file diff --git a/persistence-modules/core-java-persistence-2/pom.xml b/persistence-modules/core-java-persistence-2/pom.xml index a1088b0801..092900b628 100644 --- a/persistence-modules/core-java-persistence-2/pom.xml +++ b/persistence-modules/core-java-persistence-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.core-java-persistence-2 core-java-persistence-2 @@ -31,24 +32,15 @@ mysql-connector-java ${mysql.driver.version} - + com.microsoft.sqlserver mssql-jdbc ${mssql.driver.version} - @@ -59,4 +51,4 @@ 8.0.22 - + \ No newline at end of file diff --git a/persistence-modules/core-java-persistence/pom.xml b/persistence-modules/core-java-persistence/pom.xml index 3dd8da1b7a..f1d779cf2f 100644 --- a/persistence-modules/core-java-persistence/pom.xml +++ b/persistence-modules/core-java-persistence/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.core-java-persistence core-java-persistence diff --git a/persistence-modules/deltaspike/pom.xml b/persistence-modules/deltaspike/pom.xml index 955ad4abe8..af02ba76c0 100644 --- a/persistence-modules/deltaspike/pom.xml +++ b/persistence-modules/deltaspike/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 deltaspike 1.0 @@ -16,44 +17,39 @@ - - - + javax.enterprise cdi-api provided - - + org.jboss.spec.javax.annotation jboss-annotations-api_1.2_spec provided - org.jboss.resteasy jaxrs-api provided - org.hibernate.javax.persistence hibernate-jpa-2.1-api provided - org.jboss.spec.javax.ejb jboss-ejb-api_3.2_spec provided - @@ -68,62 +64,54 @@ - org.jboss.spec.javax.faces jboss-jsf-api_2.2_spec provided - - org.hibernate hibernate-jpamodelgen provided - - + org.hibernate hibernate-validator-annotation-processor provided - - + org.jboss.arquillian.junit arquillian-junit-container test - org.jboss.arquillian.protocol arquillian-protocol-servlet test - org.jboss.shrinkwrap.resolver shrinkwrap-resolver-impl-maven test - org.apache.deltaspike.modules deltaspike-data-module-api compile - org.apache.deltaspike.modules deltaspike-data-module-impl runtime - com.mysema.querydsl @@ -131,74 +119,64 @@ ${querydsl.version} provided - com.mysema.querydsl querydsl-jpa ${querydsl.version} - org.apache.deltaspike.modules deltaspike-test-control-module-api test - org.apache.deltaspike.modules deltaspike-test-control-module-impl test - org.apache.deltaspike.cdictrl deltaspike-cdictrl-weld test - org.jboss.weld.se weld-se-core ${weld.version} test - org.hibernate hibernate-core provided - org.jboss jandex ${jandex.version} - com.h2database h2 ${h2.version} test - org.hibernate hibernate-entitymanager provided - org.apache.commons commons-lang3 ${commons-lang3.version} - - + ${project.artifactId} @@ -237,9 +215,9 @@ - - + arq-wildfly-managed @@ -259,6 +237,7 @@ http://www.apache.org/licenses/LICENSE-2.0.html + redhat-repository-techpreview @@ -268,10 +247,12 @@ - + org.wildfly.bom jboss-javaee-7.0-with-tools @@ -310,4 +291,4 @@ 1.2.5.Final-redhat-1 - + \ No newline at end of file diff --git a/persistence-modules/elasticsearch/pom.xml b/persistence-modules/elasticsearch/pom.xml index 654d43d622..f04cb3973f 100644 --- a/persistence-modules/elasticsearch/pom.xml +++ b/persistence-modules/elasticsearch/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 elasticsearch 0.0.1-SNAPSHOT @@ -29,5 +30,5 @@ 6.3.1 - - + + \ No newline at end of file diff --git a/persistence-modules/flyway-repair/pom.xml b/persistence-modules/flyway-repair/pom.xml index 2c283cfc04..1a5384a916 100644 --- a/persistence-modules/flyway-repair/pom.xml +++ b/persistence-modules/flyway-repair/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 flyway-repair flyway-repair @@ -39,7 +40,6 @@ - h2 @@ -56,7 +56,6 @@ - postgres @@ -70,12 +69,10 @@ - src/main/resources/application-${spring-boot.run.profiles}.properties - - + \ No newline at end of file diff --git a/persistence-modules/flyway/pom.xml b/persistence-modules/flyway/pom.xml index c4a3363bdc..65534b6f0a 100644 --- a/persistence-modules/flyway/pom.xml +++ b/persistence-modules/flyway/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 flyway flyway @@ -65,7 +66,6 @@ 5.2.3 5.0.2 - - + \ No newline at end of file diff --git a/persistence-modules/hbase/pom.xml b/persistence-modules/hbase/pom.xml index f54f2d8985..e38b73e137 100644 --- a/persistence-modules/hbase/pom.xml +++ b/persistence-modules/hbase/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 hbase hbase diff --git a/persistence-modules/hibernate-annotations/pom.xml b/persistence-modules/hibernate-annotations/pom.xml index d3b786d6c8..e5c19915a4 100644 --- a/persistence-modules/hibernate-annotations/pom.xml +++ b/persistence-modules/hibernate-annotations/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 hibernate-annotations @@ -20,32 +21,28 @@ hibernate-core ${hibernate-core.version} - com.h2database h2 ${h2.version} - - org.apache.commons - commons-lang3 - ${commons-lang3.version} + org.apache.commons + commons-lang3 + ${commons-lang3.version} - org.hibernate hibernate-testing ${hibernate-core.version} - org.hibernate hibernate-spatial ${hibernate-core.version} - + 5.4.7.Final 1.4.200 @@ -55,4 +52,4 @@ 1.4.200 - + \ No newline at end of file diff --git a/persistence-modules/hibernate-enterprise/pom.xml b/persistence-modules/hibernate-enterprise/pom.xml index c088cc1eca..dadfa211be 100644 --- a/persistence-modules/hibernate-enterprise/pom.xml +++ b/persistence-modules/hibernate-enterprise/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 hibernate-enterprise 0.0.1-SNAPSHOT @@ -92,4 +92,4 @@ 2.3.4 - + \ No newline at end of file diff --git a/persistence-modules/hibernate-exceptions/pom.xml b/persistence-modules/hibernate-exceptions/pom.xml index f7eee22960..89e1f4ca7e 100644 --- a/persistence-modules/hibernate-exceptions/pom.xml +++ b/persistence-modules/hibernate-exceptions/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 hibernate-exceptions 0.0.1-SNAPSHOT @@ -35,4 +36,4 @@ 2.3.0 - + \ No newline at end of file diff --git a/persistence-modules/hibernate-jpa/pom.xml b/persistence-modules/hibernate-jpa/pom.xml index e5056c413b..6d300c620b 100644 --- a/persistence-modules/hibernate-jpa/pom.xml +++ b/persistence-modules/hibernate-jpa/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 hibernate-jpa 0.0.1-SNAPSHOT @@ -97,4 +97,4 @@ 2.1.7.RELEASE - + \ No newline at end of file diff --git a/persistence-modules/hibernate-libraries/pom.xml b/persistence-modules/hibernate-libraries/pom.xml index 053ad05167..19537156aa 100644 --- a/persistence-modules/hibernate-libraries/pom.xml +++ b/persistence-modules/hibernate-libraries/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 hibernate-libraries @@ -125,7 +126,7 @@ - hibernate-types + hibernate-libraries src/main/resources @@ -158,7 +159,7 @@ - + @@ -182,4 +183,4 @@ 2.1.3.RELEASE - + \ No newline at end of file diff --git a/persistence-modules/hibernate-mapping/README.md b/persistence-modules/hibernate-mapping/README.md index b5d0cb2f99..984f49bb70 100644 --- a/persistence-modules/hibernate-mapping/README.md +++ b/persistence-modules/hibernate-mapping/README.md @@ -13,3 +13,4 @@ This module contains articles about Object-relational Mapping (ORM) with Hiberna - [Hibernate – Mapping Date and Time](https://www.baeldung.com/hibernate-date-time) - [Mapping LOB Data in Hibernate](https://www.baeldung.com/hibernate-lob) - [FetchMode in Hibernate](https://www.baeldung.com/hibernate-fetchmode) +- [Mapping PostgreSQL Array With Hibernate](https://www.baeldung.com/java-hibernate-map-postgresql-array) diff --git a/persistence-modules/hibernate-mapping/pom.xml b/persistence-modules/hibernate-mapping/pom.xml index ebc854a621..0248f0cb04 100644 --- a/persistence-modules/hibernate-mapping/pom.xml +++ b/persistence-modules/hibernate-mapping/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 hibernate-mapping hibernate-mapping @@ -13,11 +13,22 @@ + + org.postgresql + postgresql + ${postgresql.version} + test + org.hibernate hibernate-core ${hibernate.version} + + com.vladmihalcea + hibernate-types-52 + ${hibernate-types.version} + org.assertj assertj-core @@ -61,16 +72,17 @@ commons-io ${commons-io.version} - + 42.2.20 5.4.12.Final + 2.10.4 3.8.0 6.0.16.Final - 3.0.1-b11 + 3.0.1-b11 1.0.3 1.3 - + \ No newline at end of file diff --git a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/CustomIntegerArrayType.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/CustomIntegerArrayType.java new file mode 100644 index 0000000000..233bb95dc1 --- /dev/null +++ b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/CustomIntegerArrayType.java @@ -0,0 +1,85 @@ +package com.baeldung.hibernate.arraymapping; + +import java.io.Serializable; +import java.sql.Array; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.util.Arrays; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.usertype.UserType; + +public class CustomIntegerArrayType implements UserType { + + @Override + public int[] sqlTypes() { + return new int[]{Types.ARRAY}; + } + + @Override + public Class returnedClass() { + return Integer[].class; + } + + @Override + public boolean equals(Object x, Object y) throws HibernateException { + if (x instanceof Integer[] && y instanceof Integer[]) { + return Arrays.deepEquals((Integer[])x, (Integer[])y); + } else { + return false; + } + } + + @Override + public int hashCode(Object x) throws HibernateException { + return Arrays.hashCode((Integer[])x); + } + + @Override + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) + throws HibernateException, SQLException { + Array array = rs.getArray(names[0]); + return array != null ? array.getArray() : null; + } + + @Override + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) + throws HibernateException, SQLException { + if (value != null && st != null) { + Array array = session.connection().createArrayOf("int", (Integer[])value); + st.setArray(index, array); + } else { + st.setNull(index, sqlTypes()[0]); + } + } + + @Override + public Object deepCopy(Object value) throws HibernateException { + Integer[] a = (Integer[])value; + return Arrays.copyOf(a, a.length); + } + + @Override + public boolean isMutable() { + return false; + } + + @Override + public Serializable disassemble(Object value) throws HibernateException { + return (Serializable) value; + } + + @Override + public Object assemble(Serializable cached, Object owner) throws HibernateException { + return cached; + } + + @Override + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return original; + } + +} diff --git a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/CustomStringArrayType.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/CustomStringArrayType.java new file mode 100644 index 0000000000..7bd284def7 --- /dev/null +++ b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/CustomStringArrayType.java @@ -0,0 +1,85 @@ +package com.baeldung.hibernate.arraymapping; + +import java.io.Serializable; +import java.sql.Array; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Types; +import java.util.Arrays; + +import org.hibernate.HibernateException; +import org.hibernate.engine.spi.SharedSessionContractImplementor; +import org.hibernate.usertype.UserType; + +public class CustomStringArrayType implements UserType { + + @Override + public int[] sqlTypes() { + return new int[]{Types.ARRAY}; + } + + @Override + public Class returnedClass() { + return String[].class; + } + + @Override + public boolean equals(Object x, Object y) throws HibernateException { + if (x instanceof String[] && y instanceof String[]) { + return Arrays.deepEquals((String[])x, (String[])y); + } else { + return false; + } + } + + @Override + public int hashCode(Object x) throws HibernateException { + return Arrays.hashCode((String[])x); + } + + @Override + public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) + throws HibernateException, SQLException { + Array array = rs.getArray(names[0]); + return array != null ? array.getArray() : null; + } + + @Override + public void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor session) + throws HibernateException, SQLException { + if (value != null && st != null) { + Array array = session.connection().createArrayOf("text", (String[])value); + st.setArray(index, array); + } else { + st.setNull(index, sqlTypes()[0]); + } + } + + @Override + public Object deepCopy(Object value) throws HibernateException { + String[] a = (String[])value; + return Arrays.copyOf(a, a.length); + } + + @Override + public boolean isMutable() { + return false; + } + + @Override + public Serializable disassemble(Object value) throws HibernateException { + return (Serializable) value; + } + + @Override + public Object assemble(Serializable cached, Object owner) throws HibernateException { + return cached; + } + + @Override + public Object replace(Object original, Object target, Object owner) throws HibernateException { + return original; + } + +} diff --git a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/HibernateSessionUtil.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/HibernateSessionUtil.java new file mode 100644 index 0000000000..dc3ec93a9d --- /dev/null +++ b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/HibernateSessionUtil.java @@ -0,0 +1,61 @@ +package com.baeldung.hibernate.arraymapping; + +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.util.Properties; + +import org.apache.commons.lang3.StringUtils; +import org.hibernate.SessionFactory; +import org.hibernate.boot.Metadata; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.service.ServiceRegistry; + +import com.baeldung.hibernate.arraymapping.User; + +public class HibernateSessionUtil { + + private static SessionFactory sessionFactory; + private static String PROPERTY_FILE_NAME; + + public static SessionFactory getSessionFactory() throws IOException { + return getSessionFactory(null); + } + + public static SessionFactory getSessionFactory(String propertyFileName) throws IOException { + PROPERTY_FILE_NAME = propertyFileName; + if (sessionFactory == null) { + ServiceRegistry serviceRegistry = configureServiceRegistry(); + sessionFactory = makeSessionFactory(serviceRegistry); + } + return sessionFactory; + } + + private static SessionFactory makeSessionFactory(ServiceRegistry serviceRegistry) { + MetadataSources metadataSources = new MetadataSources(serviceRegistry); + metadataSources.addAnnotatedClass(User.class); + + Metadata metadata = metadataSources.buildMetadata(); + return metadata.getSessionFactoryBuilder() + .build(); + + } + + private static ServiceRegistry configureServiceRegistry() throws IOException { + Properties properties = getProperties(); + return new StandardServiceRegistryBuilder().applySettings(properties) + .build(); + } + + private static Properties getProperties() throws IOException { + Properties properties = new Properties(); + URL propertiesURL = Thread.currentThread() + .getContextClassLoader() + .getResource(StringUtils.defaultString(PROPERTY_FILE_NAME, "hibernate_postgres.properties")); + try (FileInputStream inputStream = new FileInputStream(propertiesURL.getFile())) { + properties.load(inputStream); + } + return properties; + } +} diff --git a/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/User.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/User.java new file mode 100644 index 0000000000..018bedc349 --- /dev/null +++ b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/arraymapping/User.java @@ -0,0 +1,82 @@ +package com.baeldung.hibernate.arraymapping; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +import org.hibernate.annotations.Type; + +import com.vladmihalcea.hibernate.type.array.StringArrayType; + +import org.hibernate.annotations.*; + +@TypeDefs({ + @TypeDef( + name = "string-array", + typeClass = StringArrayType.class + ) +}) +@Entity +public class User { + + @Id + private Long id; + + private String name; + + @Column(columnDefinition = "text[]") + @Type(type = "com.baeldung.hibernate.arraymapping.CustomStringArrayType") + private String[] roles; + + @Column(columnDefinition = "int[]") + @Type(type = "com.baeldung.hibernate.arraymapping.CustomIntegerArrayType") + private Integer[] locations; + + @Type(type = "string-array") + @Column( + name = "phone_numbers", + columnDefinition = "text[]" + ) + private String[] phoneNumbers; + + 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 String[] getRoles() { + return roles; + } + + public void setRoles(String[] roles) { + this.roles = roles; + } + + public Integer[] getLocations() { + return locations; + } + + public void setLocations(Integer[] locations) { + this.locations = locations; + } + + public String[] getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(String[] phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + +} diff --git a/persistence-modules/hibernate-mapping/src/test/java/com/baeldung/hibernate/arraymapping/ArrayMappingIntegrationTest.java b/persistence-modules/hibernate-mapping/src/test/java/com/baeldung/hibernate/arraymapping/ArrayMappingIntegrationTest.java new file mode 100644 index 0000000000..ba0ccc2aa2 --- /dev/null +++ b/persistence-modules/hibernate-mapping/src/test/java/com/baeldung/hibernate/arraymapping/ArrayMappingIntegrationTest.java @@ -0,0 +1,133 @@ +package com.baeldung.hibernate.arraymapping; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; + +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.Transaction; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + + +public class ArrayMappingIntegrationTest { + + private Session session; + private Transaction transaction; + + @BeforeEach + public void setup() throws IOException { + try { + session = HibernateSessionUtil.getSessionFactory().openSession(); + transaction = session.beginTransaction(); + + bootstrapData(); + + } catch (HibernateException | IOException e) { + System.out.println("Can't connect to a PostgreSQL DB"); + } + } + + @AfterEach + public void cleanup() { + if (null != session) { + transaction.rollback(); + session.close(); + } + } + + @Test + public void givenArrayMapping_whenQueried_thenReturnArraysFromDB() throws HibernateException, IOException { + if (null != session) { + User user = session.find(User.class, 1L); + + assertEquals("john", user.getName()); + assertEquals("superuser", user.getRoles()[0]); + assertEquals("admin", user.getRoles()[1]); + assertEquals(100, user.getLocations()[0]); + assertEquals(389, user.getLocations()[1]); + assertEquals("7000000000", user.getPhoneNumbers()[0]); + assertEquals("8000000000", user.getPhoneNumbers()[1]); + } + } + + @Test + public void givenArrayMapping_whenArraysAreInserted_thenPersistInDB() throws HibernateException, IOException { + if (null != session) { + transaction = session.beginTransaction(); + + User user = new User(); + user.setId(2L); + user.setName("smith"); + + String[] roles = {"admin", "employee"}; + user.setRoles(roles); + + Integer[] locations = {190, 578}; + user.setLocations(locations); + + session.persist(user); + session.flush(); + session.clear(); + + transaction.commit(); + + User userDBObj = session.find(User.class, 2L); + + assertEquals("smith", userDBObj.getName()); + assertEquals("admin", userDBObj.getRoles()[0]); + assertEquals(578, userDBObj.getLocations()[1]); + } + } + + @Test + public void givenArrayMapping_whenArrayIsUpdated_thenPersistInDB() throws HibernateException, IOException { + if (null != session) { + transaction = session.beginTransaction(); + + User user = session.find(User.class, 1L); + + String[] updatedRoles = {"superuser", "superadmin"}; + String[] updatedPhoneNumbers = {"9000000000"}; + + user.setRoles(updatedRoles); + user.setPhoneNumbers(updatedPhoneNumbers); + + session.persist(user); + session.flush(); + session.clear(); + + User userDBObj = session.find(User.class, 1L); + + assertEquals("john", userDBObj.getName()); + assertEquals("superadmin", userDBObj.getRoles()[1]); + assertEquals("9000000000", userDBObj.getPhoneNumbers()[0]); + } + } + + public void bootstrapData() { + session.createQuery("delete from User").executeUpdate(); + + User user = new User(); + user.setId(1L); + user.setName("john"); + + String[] roles = {"superuser", "admin"}; + user.setRoles(roles); + + Integer[] locations = {100, 389}; + user.setLocations(locations); + + String[] phoneNumbers = {"7000000000", "8000000000"}; + user.setPhoneNumbers(phoneNumbers); + + session.persist(user); + session.flush(); + session.clear(); + + transaction.commit(); + } + +} diff --git a/persistence-modules/hibernate-mapping/src/test/resources/hibernate_postgres.properties b/persistence-modules/hibernate-mapping/src/test/resources/hibernate_postgres.properties new file mode 100644 index 0000000000..72e3dcd781 --- /dev/null +++ b/persistence-modules/hibernate-mapping/src/test/resources/hibernate_postgres.properties @@ -0,0 +1,14 @@ +hibernate.connection.driver_class=org.postgresql.Driver +hibernate.connection.url=jdbc:postgresql://localhost:5432/postgres +hibernate.connection.username=web +hibernate.connection.autocommit=true +jdbc.password= + +hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect +hibernate.show_sql=true +hibernate.hbm2ddl.auto=none + +hibernate.c3p0.min_size=5 +hibernate.c3p0.max_size=20 +hibernate.c3p0.acquire_increment=5 +hibernate.c3p0.timeout=1800 diff --git a/persistence-modules/hibernate-ogm/pom.xml b/persistence-modules/hibernate-ogm/pom.xml index 8f42c28eee..58098ebb65 100644 --- a/persistence-modules/hibernate-ogm/pom.xml +++ b/persistence-modules/hibernate-ogm/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 hibernate-ogm 0.0.1-SNAPSHOT @@ -45,5 +46,5 @@ 1.4 5.5.23.Final - + \ No newline at end of file diff --git a/persistence-modules/hibernate-queries/pom.xml b/persistence-modules/hibernate-queries/pom.xml index d44bc0f8ae..4a8c578aba 100644 --- a/persistence-modules/hibernate-queries/pom.xml +++ b/persistence-modules/hibernate-queries/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 hibernate-queries 0.0.1-SNAPSHOT @@ -63,4 +63,4 @@ 3.8.0 - + \ No newline at end of file diff --git a/persistence-modules/hibernate5/pom.xml b/persistence-modules/hibernate5/pom.xml index fe0e7680ab..9b4ffff739 100644 --- a/persistence-modules/hibernate5/pom.xml +++ b/persistence-modules/hibernate5/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 hibernate5 0.0.1-SNAPSHOT @@ -55,7 +55,6 @@ jackson-databind ${jackson.version} - org.openjdk.jmh jmh-generator-annprocess @@ -70,4 +69,4 @@ 3.8.0 - + \ No newline at end of file diff --git a/persistence-modules/influxdb/pom.xml b/persistence-modules/influxdb/pom.xml index 23ae64dca1..401e4c3ea7 100644 --- a/persistence-modules/influxdb/pom.xml +++ b/persistence-modules/influxdb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 influxdb 0.1-SNAPSHOT @@ -20,7 +21,6 @@ influxdb-java ${influxdb.sdk.version} - org.projectlombok lombok @@ -34,4 +34,4 @@ 2.8 - + \ No newline at end of file diff --git a/persistence-modules/java-cassandra/pom.xml b/persistence-modules/java-cassandra/pom.xml index 091efaeff4..ad80fc8a83 100644 --- a/persistence-modules/java-cassandra/pom.xml +++ b/persistence-modules/java-cassandra/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 java-cassandra @@ -25,14 +26,12 @@ - org.cassandraunit cassandra-unit ${cassandra-unit.version} - com.datastax.oss @@ -53,4 +52,4 @@ 4.1.0 - + \ No newline at end of file diff --git a/persistence-modules/java-cockroachdb/pom.xml b/persistence-modules/java-cockroachdb/pom.xml index e8c6365ca3..588ad29cb1 100644 --- a/persistence-modules/java-cockroachdb/pom.xml +++ b/persistence-modules/java-cockroachdb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-cockroachdb 1.0-SNAPSHOT diff --git a/persistence-modules/java-jdbi/pom.xml b/persistence-modules/java-jdbi/pom.xml index eb0de45593..e08b3a3c35 100644 --- a/persistence-modules/java-jdbi/pom.xml +++ b/persistence-modules/java-jdbi/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-jdbi 1.0-SNAPSHOT diff --git a/persistence-modules/java-jpa-2/pom.xml b/persistence-modules/java-jpa-2/pom.xml index ab5bb39dfc..daa775f39d 100644 --- a/persistence-modules/java-jpa-2/pom.xml +++ b/persistence-modules/java-jpa-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-jpa-2 java-jpa-2 @@ -27,14 +28,12 @@ h2 ${h2.version} - javax.persistence javax.persistence-api ${javax.persistence-api.version} - org.eclipse.persistence @@ -59,7 +58,6 @@ querydsl-jpa ${querydsl.version} - org.assertj assertj-core @@ -149,4 +147,4 @@ 4.3.1 - + \ No newline at end of file diff --git a/persistence-modules/java-jpa-3/pom.xml b/persistence-modules/java-jpa-3/pom.xml index f931cd90b8..11673935b1 100644 --- a/persistence-modules/java-jpa-3/pom.xml +++ b/persistence-modules/java-jpa-3/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 java-jpa-3 java-jpa-3 @@ -48,7 +49,6 @@ javax.persistence-api ${javax.persistence-api.version} - org.eclipse.persistence @@ -95,4 +95,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/persistence-modules/java-jpa/pom.xml b/persistence-modules/java-jpa/pom.xml index 3601721dac..bb87c10edb 100644 --- a/persistence-modules/java-jpa/pom.xml +++ b/persistence-modules/java-jpa/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 java-jpa java-jpa @@ -28,15 +28,13 @@ h2 ${h2.version} - - + javax.persistence javax.persistence-api ${javax.persistence-api.version} - - + org.eclipse.persistence eclipselink @@ -81,7 +79,6 @@ - org.codehaus.mojo build-helper-maven-plugin diff --git a/persistence-modules/java-mongodb/pom.xml b/persistence-modules/java-mongodb/pom.xml index d62240927a..15d904b12c 100644 --- a/persistence-modules/java-mongodb/pom.xml +++ b/persistence-modules/java-mongodb/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 java-mongodb 1.0-SNAPSHOT @@ -25,7 +25,6 @@ mongo-java-driver ${mongo.version} - dev.morphia.morphia core @@ -39,4 +38,4 @@ 1.5.3 - + \ No newline at end of file diff --git a/persistence-modules/jnosql/jnosql-artemis/pom.xml b/persistence-modules/jnosql/jnosql-artemis/pom.xml index 8570d1072f..0c1a6967d3 100644 --- a/persistence-modules/jnosql/jnosql-artemis/pom.xml +++ b/persistence-modules/jnosql/jnosql-artemis/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 jnosql-artemis jnosql-artemis @@ -83,4 +83,4 @@ 8.0 - + \ No newline at end of file diff --git a/persistence-modules/jnosql/jnosql-diana/pom.xml b/persistence-modules/jnosql/jnosql-diana/pom.xml index d5746eef05..f1a4e746cf 100644 --- a/persistence-modules/jnosql/jnosql-diana/pom.xml +++ b/persistence-modules/jnosql/jnosql-diana/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 jnosql-diana jnosql-diana @@ -13,7 +13,7 @@ - + org.jnosql.diana diana-document @@ -24,8 +24,7 @@ mongodb-driver ${jnosql.version} - - + org.jnosql.diana diana-column @@ -36,8 +35,7 @@ cassandra-driver ${jnosql.version} - - + org.jnosql.diana diana-key-value diff --git a/persistence-modules/jnosql/pom.xml b/persistence-modules/jnosql/pom.xml index 81c62ee562..090350e6e3 100644 --- a/persistence-modules/jnosql/pom.xml +++ b/persistence-modules/jnosql/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.jnosql jnosql @@ -24,4 +24,4 @@ 0.0.6 - + \ No newline at end of file diff --git a/persistence-modules/jooq/pom.xml b/persistence-modules/jooq/pom.xml index 2dababb02d..f4751f412a 100644 --- a/persistence-modules/jooq/pom.xml +++ b/persistence-modules/jooq/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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jooq 0.0.1-SNAPSHOT @@ -49,4 +49,4 @@ 1.4.200 - + \ No newline at end of file diff --git a/persistence-modules/jpa-hibernate-cascade-type/pom.xml b/persistence-modules/jpa-hibernate-cascade-type/pom.xml index e8117290b0..467fe11bc3 100644 --- a/persistence-modules/jpa-hibernate-cascade-type/pom.xml +++ b/persistence-modules/jpa-hibernate-cascade-type/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 jpa-hibernate-cascade-type diff --git a/persistence-modules/liquibase/pom.xml b/persistence-modules/liquibase/pom.xml index af1af2259e..2fc5803037 100644 --- a/persistence-modules/liquibase/pom.xml +++ b/persistence-modules/liquibase/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 liquibase liquibase diff --git a/persistence-modules/orientdb/pom.xml b/persistence-modules/orientdb/pom.xml index 5b28fb01b0..1468f5b611 100644 --- a/persistence-modules/orientdb/pom.xml +++ b/persistence-modules/orientdb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 orientdb 0.0.1-SNAPSHOT @@ -42,4 +43,4 @@ 2.6.0 - + \ No newline at end of file diff --git a/persistence-modules/persistence-libraries/pom.xml b/persistence-modules/persistence-libraries/pom.xml index 42f3a33a40..a3f0ccb728 100644 --- a/persistence-modules/persistence-libraries/pom.xml +++ b/persistence-modules/persistence-libraries/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 persistence-libraries 1.0-SNAPSHOT @@ -31,4 +32,4 @@ 1.6.0 - + \ No newline at end of file diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index 32423a42dd..5e0cd59d18 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 persistence-modules persistence-modules @@ -65,7 +66,6 @@ spring-data-elasticsearch spring-data-gemfire spring-data-geode - spring-data-jpa-annotations spring-data-jpa-crud spring-data-jpa-enterprise @@ -74,16 +74,14 @@ spring-data-jpa-query-2 spring-data-jpa-repo spring-data-jpa-repo-2 - spring-data-jdbc - spring-data-keyvalue spring-data-mongodb spring-data-neo4j spring-data-redis spring-data-solr spring-hibernate-3 - spring-hibernate-5 + spring-hibernate-5 spring-jpa spring-jpa-2 spring-jdbc @@ -101,4 +99,5 @@ 5.6.2 4.13 - + + \ No newline at end of file diff --git a/persistence-modules/querydsl/pom.xml b/persistence-modules/querydsl/pom.xml index a611c309b6..c4b01d787c 100644 --- a/persistence-modules/querydsl/pom.xml +++ b/persistence-modules/querydsl/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 querydsl 0.1-SNAPSHOT @@ -20,14 +21,12 @@ querydsl-jpa ${querydsl.version} - com.querydsl querydsl-apt ${querydsl.version} provided - org.hibernate @@ -35,14 +34,12 @@ ${hibernate.version} compile - org.hibernate.javax.persistence hibernate-jpa-2.1-api ${hibernate-jpa.version} compile - commons-dbcp commons-dbcp @@ -50,7 +47,6 @@ jar compile - commons-pool commons-pool @@ -58,14 +54,12 @@ jar compile - org.hsqldb hsqldb ${hsqldb.version} - org.springframework @@ -78,13 +72,11 @@ - org.springframework spring-webmvc ${spring.version} - org.springframework spring-orm @@ -92,13 +84,11 @@ jar compile - org.springframework spring-aop ${spring.version} - org.springframework spring-test @@ -121,7 +111,6 @@ -proc:none - com.mysema.maven diff --git a/persistence-modules/r2dbc/pom.xml b/persistence-modules/r2dbc/pom.xml index 01f1b351cd..ae4ca4d91d 100644 --- a/persistence-modules/r2dbc/pom.xml +++ b/persistence-modules/r2dbc/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.examples.r2dbc r2dbc @@ -14,7 +14,7 @@ parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - + @@ -25,7 +25,6 @@ org.springframework.boot spring-boot-starter-validation - org.springframework.boot spring-boot-starter-test @@ -36,15 +35,12 @@ reactor-test test - - io.r2dbc r2dbc-h2 ${r2dbc-h2.version} - org.springframework.boot spring-boot-configuration-processor @@ -68,7 +64,6 @@ 0.8.1.RELEASE 1.4.200 - - + \ No newline at end of file diff --git a/persistence-modules/redis/pom.xml b/persistence-modules/redis/pom.xml index fa82bebc64..c407482788 100644 --- a/persistence-modules/redis/pom.xml +++ b/persistence-modules/redis/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 redis 0.1-SNAPSHOT @@ -19,17 +20,14 @@ org.springframework.boot spring-boot-starter - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-redis - redis.clients jedis @@ -56,7 +54,7 @@ - + 0.6 3.13.1 3.3.0 @@ -64,4 +62,4 @@ - + \ No newline at end of file diff --git a/persistence-modules/sirix/pom.xml b/persistence-modules/sirix/pom.xml index da9695081c..85379dc566 100644 --- a/persistence-modules/sirix/pom.xml +++ b/persistence-modules/sirix/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/maven-v4_0_0.xsd"> 4.0.0 io.sirix sirix @@ -53,4 +53,4 @@ 6.1 - + \ No newline at end of file diff --git a/persistence-modules/solr/pom.xml b/persistence-modules/solr/pom.xml index fd993e0c67..de0bd5a4a2 100644 --- a/persistence-modules/solr/pom.xml +++ b/persistence-modules/solr/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 solr diff --git a/persistence-modules/spring-boot-mysql/pom.xml b/persistence-modules/spring-boot-mysql/pom.xml index 834d1d1e64..ed3f7d9279 100644 --- a/persistence-modules/spring-boot-mysql/pom.xml +++ b/persistence-modules/spring-boot-mysql/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-boot-mysql 0.1.0 @@ -39,7 +40,6 @@ 8.0.12 - - + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-2/pom.xml b/persistence-modules/spring-boot-persistence-2/pom.xml index ca6ec93340..b51ab17659 100644 --- a/persistence-modules/spring-boot-persistence-2/pom.xml +++ b/persistence-modules/spring-boot-persistence-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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.boot.persistence spring-boot-persistence-2 @@ -31,13 +31,11 @@ pom import - org.jdbi jdbi3-spring4 ${jdbi.version} - org.jdbi jdbi3-sqlobject @@ -51,22 +49,18 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa - org.jdbi jdbi3-spring4 - org.jdbi jdbi3-sqlobject - org.springframework.boot spring-boot-devtools @@ -93,23 +87,19 @@ spring-boot-starter-test test - com.mchange c3p0 ${c3p0.version} - org.apache.commons commons-dbcp2 - org.apache.tomcat tomcat-jdbc - mysql mysql-connector-java @@ -126,7 +116,6 @@ org.hsqldb hsqldb - com.oracle.database.jdbc ojdbc8 @@ -160,4 +149,4 @@ 19.6.0.0 - + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/pom.xml b/persistence-modules/spring-boot-persistence-h2/pom.xml index c06c35cfee..023e20837b 100644 --- a/persistence-modules/spring-boot-persistence-h2/pom.xml +++ b/persistence-modules/spring-boot-persistence-h2/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.h2db spring-boot-persistence-h2 @@ -46,7 +46,6 @@ com.baeldung.h2db.demo.server.SpringBootApp 1.0.4 - - + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-mongodb/pom.xml b/persistence-modules/spring-boot-persistence-mongodb/pom.xml index 5167483aa3..724fa38f7e 100644 --- a/persistence-modules/spring-boot-persistence-mongodb/pom.xml +++ b/persistence-modules/spring-boot-persistence-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-boot-persistence-mongodb spring-boot-persistence-mongodb @@ -36,6 +36,4 @@ - - \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index 9e44a7b9c1..deac0c2a57 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -78,4 +78,4 @@ 2.0.1.Final - + \ No newline at end of file diff --git a/persistence-modules/spring-data-cassandra-reactive/pom.xml b/persistence-modules/spring-data-cassandra-reactive/pom.xml index f2f71bceac..630e13583b 100644 --- a/persistence-modules/spring-data-cassandra-reactive/pom.xml +++ b/persistence-modules/spring-data-cassandra-reactive/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-data-cassandra-reactive @@ -56,4 +57,4 @@ - + \ No newline at end of file diff --git a/persistence-modules/spring-data-cassandra/pom.xml b/persistence-modules/spring-data-cassandra/pom.xml index 9de1cbf20e..e43e3821ae 100644 --- a/persistence-modules/spring-data-cassandra/pom.xml +++ b/persistence-modules/spring-data-cassandra/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-cassandra spring-data-cassandra @@ -107,4 +108,4 @@ - + \ No newline at end of file diff --git a/persistence-modules/spring-data-cosmosdb/pom.xml b/persistence-modules/spring-data-cosmosdb/pom.xml index 2eb6a6b038..30dc4f999c 100644 --- a/persistence-modules/spring-data-cosmosdb/pom.xml +++ b/persistence-modules/spring-data-cosmosdb/pom.xml @@ -6,17 +6,14 @@ spring-data-cosmosdb spring-data-cosmosdb tutorial for spring-data-cosmosdb + com.baeldung parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - - - 2.3.0 - - + org.springframework.boot @@ -37,7 +34,7 @@ lombok - + @@ -47,4 +44,8 @@ - + + 2.3.0 + + + \ No newline at end of file diff --git a/persistence-modules/spring-data-couchbase-2/pom.xml b/persistence-modules/spring-data-couchbase-2/pom.xml index 0a20a3ff0e..c860f809fd 100644 --- a/persistence-modules/spring-data-couchbase-2/pom.xml +++ b/persistence-modules/spring-data-couchbase-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 spring-data-couchbase-2 @@ -38,20 +38,17 @@ spring-data-couchbase ${spring-data-couchbase.version} - org.hibernate hibernate-validator ${hibernate-validator.version} - joda-time joda-time ${joda-time.version} - org.springframework @@ -79,4 +76,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index 377e35b635..28127179c2 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-dynamodb spring-data-dynamodb @@ -184,4 +185,4 @@ 3.1.1 - + \ No newline at end of file diff --git a/persistence-modules/spring-data-eclipselink/pom.xml b/persistence-modules/spring-data-eclipselink/pom.xml index 4ae43de07a..a344d64864 100644 --- a/persistence-modules/spring-data-eclipselink/pom.xml +++ b/persistence-modules/spring-data-eclipselink/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-eclipselink spring-data-eclipselink @@ -67,4 +68,4 @@ 2.7.0 - + \ No newline at end of file diff --git a/persistence-modules/spring-data-elasticsearch/pom.xml b/persistence-modules/spring-data-elasticsearch/pom.xml index 6a983145ee..7e91a5b15c 100644 --- a/persistence-modules/spring-data-elasticsearch/pom.xml +++ b/persistence-modules/spring-data-elasticsearch/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 spring-data-elasticsearch spring-data-elasticsearch @@ -18,31 +19,26 @@ spring-web ${spring.version} - org.springframework.data spring-data-elasticsearch ${spring-data-elasticsearch.version} - org.elasticsearch elasticsearch ${elasticsearch.version} - com.alibaba fastjson ${fastjson.version} - org.locationtech.spatial4j spatial4j ${spatial4j.version} - org.locationtech.jts jts-core @@ -54,7 +50,6 @@ - org.springframework spring-test @@ -70,4 +65,5 @@ 0.7 1.15.0 + \ No newline at end of file diff --git a/persistence-modules/spring-data-gemfire/pom.xml b/persistence-modules/spring-data-gemfire/pom.xml index a0cc4d5360..53ce67fb6d 100644 --- a/persistence-modules/spring-data-gemfire/pom.xml +++ b/persistence-modules/spring-data-gemfire/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-gemfire spring-data-gemfire @@ -18,7 +19,6 @@ spring-data-gemfire ${spring-data-gemfire-version} - com.gemstone.gemfire gemfire @@ -30,7 +30,6 @@ google-collections ${google-collections-version} - org.springframework spring-context diff --git a/persistence-modules/spring-data-geode/pom.xml b/persistence-modules/spring-data-geode/pom.xml index ebdb37299e..0673701f42 100644 --- a/persistence-modules/spring-data-geode/pom.xml +++ b/persistence-modules/spring-data-geode/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-geode spring-data-geode @@ -41,7 +42,6 @@ spring-geode-starter ${spring-geode-starter-version} - org.springframework.boot spring-boot-autoconfigure diff --git a/persistence-modules/spring-data-jdbc/pom.xml b/persistence-modules/spring-data-jdbc/pom.xml index 15f8d7fb95..2672405dd6 100644 --- a/persistence-modules/spring-data-jdbc/pom.xml +++ b/persistence-modules/spring-data-jdbc/pom.xml @@ -1,32 +1,30 @@ - 4.0.0 - - com.baeldung - parent-boot-2 - 0.0.1-SNAPSHOT - ../../parent-boot-2 - - spring-data-jdbc - spring-data-jdbc + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + spring-data-jdbc + spring-data-jdbc - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-jdbc - - - com.h2database - h2 - runtime - - + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-data-jdbc + + + com.h2database + h2 + runtime + + - - - + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-annotations/pom.xml b/persistence-modules/spring-data-jpa-annotations/pom.xml index ff30790eaf..113d6e5dc6 100644 --- a/persistence-modules/spring-data-jpa-annotations/pom.xml +++ b/persistence-modules/spring-data-jpa-annotations/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-data-jpa-annotations @@ -25,12 +26,10 @@ org.hibernate hibernate-envers - com.h2database h2 - org.testcontainers @@ -38,13 +37,11 @@ ${testcontainers.postgresql.version} test - org.postgresql postgresql - org.springframework.security spring-security-test @@ -59,7 +56,6 @@ spring-boot-starter-test test - com.google.guava guava @@ -72,7 +68,6 @@ 1.10.6 42.2.5 21.0 - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-crud/pom.xml b/persistence-modules/spring-data-jpa-crud/pom.xml index 16ee74aa62..8f9a3cc0e8 100644 --- a/persistence-modules/spring-data-jpa-crud/pom.xml +++ b/persistence-modules/spring-data-jpa-crud/pom.xml @@ -1,7 +1,7 @@ 4.0.0 spring-data-jpa-crud @@ -47,7 +47,6 @@ h2 runtime - org.testcontainers @@ -64,4 +63,4 @@ 1.12.2 - + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-enterprise/pom.xml b/persistence-modules/spring-data-jpa-enterprise/pom.xml index 12ffeee7f0..4367a11222 100644 --- a/persistence-modules/spring-data-jpa-enterprise/pom.xml +++ b/persistence-modules/spring-data-jpa-enterprise/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-jpa-enterprise @@ -12,58 +13,49 @@ 0.0.1-SNAPSHOT ../../parent-boot-2 - + org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa - org.springframework.boot spring-boot-starter-data-jdbc - org.springframework.boot spring-boot-starter-cache - com.h2database h2 - - + org.hibernate hibernate-envers - com.google.guava guava ${guava.version} - org.mapstruct mapstruct-jdk8 ${mapstruct.version} provided - org.springframework.security spring-security-test test - - + org.testcontainers postgresql @@ -100,4 +92,4 @@ 1.12.2 - + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-filtering/pom.xml b/persistence-modules/spring-data-jpa-filtering/pom.xml index 25ef68fe4c..038fd24723 100644 --- a/persistence-modules/spring-data-jpa-filtering/pom.xml +++ b/persistence-modules/spring-data-jpa-filtering/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-data-jpa-filtering @@ -25,12 +26,10 @@ org.hibernate hibernate-envers - com.h2database h2 - org.testcontainers @@ -38,13 +37,11 @@ ${testcontainers.postgresql.version} test - org.postgresql postgresql - org.springframework.security spring-security-test @@ -59,7 +56,6 @@ spring-boot-starter-test test - com.google.guava guava @@ -72,7 +68,6 @@ 1.10.6 42.2.5 21.0 - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query-2/pom.xml b/persistence-modules/spring-data-jpa-query-2/pom.xml index 282a1ff83a..96585d9325 100644 --- a/persistence-modules/spring-data-jpa-query-2/pom.xml +++ b/persistence-modules/spring-data-jpa-query-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-data-jpa-query-2 spring-data-jpa-query-2 @@ -22,17 +22,14 @@ org.springframework.security spring-security-core - com.h2database h2 - com.fasterxml.jackson.core jackson-databind - org.hibernate hibernate-envers @@ -90,4 +87,5 @@ 5.2.10.Final + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-query/pom.xml b/persistence-modules/spring-data-jpa-query/pom.xml index 1576fd729d..c231afdd17 100644 --- a/persistence-modules/spring-data-jpa-query/pom.xml +++ b/persistence-modules/spring-data-jpa-query/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-data-jpa-query spring-data-jpa-query @@ -18,23 +18,19 @@ org.springframework.boot spring-boot-starter-data-jpa - com.h2database h2 - net.ttddyy datasource-proxy ${datasource-proxy.version} - com.fasterxml.jackson.core jackson-databind - org.springframework spring-oxm @@ -43,7 +39,6 @@ 1.4.1 - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo-2/pom.xml b/persistence-modules/spring-data-jpa-repo-2/pom.xml index 3be1068d8c..b382e35e28 100644 --- a/persistence-modules/spring-data-jpa-repo-2/pom.xml +++ b/persistence-modules/spring-data-jpa-repo-2/pom.xml @@ -1,8 +1,10 @@ + 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-data-jpa-repo-2 + spring-data-jpa-repo-2 com.baeldung @@ -11,9 +13,6 @@ ../../parent-boot-2 - spring-data-jpa-repo-2 - spring-data-jpa-repo-2 - @@ -32,7 +31,6 @@ com.h2database h2 - com.google.guava @@ -43,6 +41,5 @@ 29.0-jre - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-repo/pom.xml b/persistence-modules/spring-data-jpa-repo/pom.xml index 16a214fd7f..26fff365a1 100644 --- a/persistence-modules/spring-data-jpa-repo/pom.xml +++ b/persistence-modules/spring-data-jpa-repo/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-jpa-repo spring-data-jpa-repo @@ -17,39 +18,30 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa - org.springframework.boot spring-boot-starter-data-jdbc - mysql mysql-connector-java - org.postgresql postgresql - com.h2database h2 - org.springframework spring-oxm - - - \ No newline at end of file diff --git a/persistence-modules/spring-data-keyvalue/pom.xml b/persistence-modules/spring-data-keyvalue/pom.xml index 3aaee2f00c..aa2696dd12 100644 --- a/persistence-modules/spring-data-keyvalue/pom.xml +++ b/persistence-modules/spring-data-keyvalue/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 spring-data-keyvalue spring-data-keyvalue @@ -16,19 +17,13 @@ org.springframework.boot spring-boot-starter - org.springframework.data spring-data-keyvalue - org.springframework.boot spring-boot-starter-test - - - - \ No newline at end of file diff --git a/persistence-modules/spring-data-mongodb/pom.xml b/persistence-modules/spring-data-mongodb/pom.xml index 448b635667..ef5a0f0550 100644 --- a/persistence-modules/spring-data-mongodb/pom.xml +++ b/persistence-modules/spring-data-mongodb/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-data-mongodb @@ -18,32 +19,27 @@ spring-data-mongodb ${org.springframework.data.version} - org.mongodb mongodb-driver-sync ${mongodb-driver.version} - org.mongodb mongodb-driver-reactivestreams ${mongodb-reactivestreams.version} - io.projectreactor reactor-core ${projectreactor.version} - io.projectreactor reactor-test ${projectreactor.version} test - org.springframework spring-core @@ -107,7 +103,6 @@ 4.1.0 3.2.0.RELEASE 4.0.5 - - + \ No newline at end of file diff --git a/persistence-modules/spring-data-neo4j/pom.xml b/persistence-modules/spring-data-neo4j/pom.xml index d827c32a3c..8c5030779b 100644 --- a/persistence-modules/spring-data-neo4j/pom.xml +++ b/persistence-modules/spring-data-neo4j/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-data-neo4j 1.0 @@ -97,4 +98,4 @@ 3.1.2 - + \ No newline at end of file diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index d271df31c7..5e17f27c06 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-data-redis @@ -32,7 +33,6 @@ reactor-test test - org.springframework spring-test @@ -42,7 +42,6 @@ spring-boot-starter-test test - org.junit.jupiter junit-jupiter-api @@ -52,25 +51,21 @@ junit-platform-runner test - cglib cglib-nodep ${cglib.version} - redis.clients jedis jar - com.lordofthejars nosqlunit-redis ${nosqlunit.version} - com.github.kstyrc embedded-redis @@ -100,4 +95,4 @@ 0.6 - + \ No newline at end of file diff --git a/persistence-modules/spring-data-solr/pom.xml b/persistence-modules/spring-data-solr/pom.xml index 38b5bf8238..d7523e6de2 100644 --- a/persistence-modules/spring-data-solr/pom.xml +++ b/persistence-modules/spring-data-solr/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-data-solr @@ -45,7 +46,6 @@ 2.0.5.RELEASE - \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-3/pom.xml b/persistence-modules/spring-hibernate-3/pom.xml index b28895f86d..9b143597c7 100644 --- a/persistence-modules/spring-hibernate-3/pom.xml +++ b/persistence-modules/spring-hibernate-3/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-hibernate-3 @@ -84,4 +85,4 @@ 19.0 - + \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-5/pom.xml b/persistence-modules/spring-hibernate-5/pom.xml index 8a8b6c15e3..caa1598af4 100644 --- a/persistence-modules/spring-hibernate-5/pom.xml +++ b/persistence-modules/spring-hibernate-5/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-hibernate-5 0.1-SNAPSHOT @@ -13,9 +14,7 @@ - - org.springframework spring-context @@ -32,9 +31,7 @@ spring-aspects ${org.springframework.version} - - org.springframework spring-orm @@ -65,32 +62,25 @@ hibernate-search-orm ${hibernatesearch.version} - org.apache.tomcat tomcat-dbcp ${tomcat-dbcp.version} - - - com.google.guava guava ${guava.version} - - org.apache.commons commons-lang3 ${commons-lang3.version} test - org.springframework spring-test @@ -103,25 +93,21 @@ ${org.springframework.security.version} test - org.hsqldb hsqldb ${hsqldb.version} - mysql mysql-connector-java ${mysql-connector-java.version} - com.h2database h2 ${h2.version} - @@ -129,7 +115,6 @@ 5.0.2.RELEASE 1.10.6.RELEASE 4.2.1.RELEASE - 5.2.10.Final 5.8.2.Final @@ -137,9 +122,8 @@ 9.0.0.M26 1.1 2.3.4 - 21.0 - + \ No newline at end of file diff --git a/persistence-modules/spring-jdbc/pom.xml b/persistence-modules/spring-jdbc/pom.xml index 8a5786e1a5..28a858dd43 100644 --- a/persistence-modules/spring-jdbc/pom.xml +++ b/persistence-modules/spring-jdbc/pom.xml @@ -1,8 +1,10 @@ + 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-jdbc + spring-jdbc com.baeldung @@ -11,9 +13,6 @@ ../../parent-boot-2 - spring-jdbc - spring-jdbc - org.springframework.data @@ -34,6 +33,4 @@ - - \ No newline at end of file diff --git a/persistence-modules/spring-jooq/pom.xml b/persistence-modules/spring-jooq/pom.xml index 6b3d565175..4c195a6c92 100644 --- a/persistence-modules/spring-jooq/pom.xml +++ b/persistence-modules/spring-jooq/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-jooq spring-jooq @@ -32,14 +33,12 @@ jooq ${org.jooq.version} - com.h2database h2 ${h2.version} - org.springframework @@ -63,7 +62,6 @@ org.springframework.boot spring-boot-starter-test - org.springframework @@ -74,7 +72,6 @@ - org.apache.maven.plugins @@ -84,7 +81,6 @@ 0 - org.codehaus.mojo properties-maven-plugin @@ -103,7 +99,6 @@ - org.codehaus.mojo sql-maven-plugin @@ -133,7 +128,6 @@ - org.jooq jooq-codegen-maven @@ -164,11 +158,11 @@ - - + org.eclipse.m2e lifecycle-mapping diff --git a/persistence-modules/spring-jpa-2/pom.xml b/persistence-modules/spring-jpa-2/pom.xml index 52067f3e5e..16168036be 100644 --- a/persistence-modules/spring-jpa-2/pom.xml +++ b/persistence-modules/spring-jpa-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-jpa-2 0.1-SNAPSHOT @@ -25,7 +26,6 @@ spring-boot-starter-data-jpa ${spring-boot.version} - org.springframework spring-orm @@ -42,7 +42,6 @@ spring-context ${org.springframework.version} - org.hibernate @@ -59,14 +58,12 @@ tomcat-dbcp ${tomcat-dbcp.version} - com.google.guava guava ${guava.version} - org.springframework.boot @@ -79,17 +76,14 @@ ${org.springframework.version} test - 5.1.5.RELEASE 2.2.6.RELEASE - 9.0.0.M26 - 21.0 diff --git a/persistence-modules/spring-jpa/pom.xml b/persistence-modules/spring-jpa/pom.xml index e389886d8d..1dca2baa98 100644 --- a/persistence-modules/spring-jpa/pom.xml +++ b/persistence-modules/spring-jpa/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-jpa 0.1-SNAPSHOT @@ -36,9 +37,7 @@ spring-webmvc ${org.springframework.version} - - org.hibernate hibernate-core @@ -70,9 +69,7 @@ h2 ${h2.version} - - org.hibernate hibernate-validator @@ -83,7 +80,6 @@ javax.el-api ${javax.el-api.version} - javax.servlet @@ -96,9 +92,7 @@ provided ${javax.servlet.servlet-api.version} - - com.google.guava guava @@ -109,41 +103,33 @@ assertj-core ${assertj.version} - - org.apache.commons commons-lang3 ${commons-lang3.version} test - org.springframework spring-test ${org.springframework.version} test - 5.1.5.RELEASE 3.21.0-GA - 6.0.6 2.1.5.RELEASE - 2.5 - 6.0.15.Final 1.4.01 2.2.5 - 21.0 3.8.0 diff --git a/persistence-modules/spring-mybatis/pom.xml b/persistence-modules/spring-mybatis/pom.xml index 40d4d915ab..9247d59fe4 100644 --- a/persistence-modules/spring-mybatis/pom.xml +++ b/persistence-modules/spring-mybatis/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-mybatis 0.1-SNAPSHOT @@ -14,76 +15,61 @@ - - org.springframework spring-context ${org.springframework.version} - org.springframework spring-beans ${org.springframework.version} - - org.mybatis.spring.boot mybatis-spring-boot-starter ${mybatis-spring-boot-starter.version} - - com.h2database h2 ${h2.version} - org.springframework spring-jdbc ${org.springframework.version} - org.mybatis mybatis ${mybatis.version} - org.mybatis mybatis-spring ${spring-mybatis.version} - - org.springframework.boot spring-boot-starter-test - org.springframework spring-test ${org.springframework.version} test - org.assertj assertj-core ${assertj-core.version} test - @@ -99,15 +85,13 @@ 5.1.8.RELEASE - 2.0.2 3.5.2 2.1.0 1.4.197 - 3.8.0 - + \ No newline at end of file diff --git a/persistence-modules/spring-persistence-simple/pom.xml b/persistence-modules/spring-persistence-simple/pom.xml index 13898d01e7..437a439b99 100644 --- a/persistence-modules/spring-persistence-simple/pom.xml +++ b/persistence-modules/spring-persistence-simple/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-persistence-simple 0.1-SNAPSHOT @@ -24,7 +25,6 @@ spring-context ${org.springframework.version} - javax.persistence @@ -57,14 +57,12 @@ ${h2.version} test - com.github.h-thurow simple-jndi ${simple-jndi.version} - org.springframework @@ -100,4 +98,5 @@ 3.3.3 + \ No newline at end of file diff --git a/pom.xml b/pom.xml index ab3c73ff8a..f4606ec368 100644 --- a/pom.xml +++ b/pom.xml @@ -623,6 +623,7 @@ spring-boot-rest-2 spring-caching + spring-caching-2 spring-cloud spring-cloud-bus @@ -1079,6 +1080,7 @@ spring-boot-rest-2 spring-caching + spring-caching-2 spring-cloud spring-cloud-bus diff --git a/protobuffer/pom.xml b/protobuffer/pom.xml index e57495e93c..cf8dbe417e 100644 --- a/protobuffer/pom.xml +++ b/protobuffer/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 protobuffer protobuffer diff --git a/quarkus-extension/pom.xml b/quarkus-extension/pom.xml index 394376e59e..c2ae66a3a0 100644 --- a/quarkus-extension/pom.xml +++ b/quarkus-extension/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.quarkus.extension quarkus-extension @@ -14,10 +14,10 @@ parent-modules 1.0.0-SNAPSHOT - + quarkus-liquibase quarkus-app - + \ No newline at end of file diff --git a/quarkus-extension/quarkus-app/pom.xml b/quarkus-extension/quarkus-app/pom.xml index 4c9e9c3cc7..f609261c5a 100644 --- a/quarkus-extension/quarkus-app/pom.xml +++ b/quarkus-extension/quarkus-app/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 com.baeldung.quarkus.app quarkus-app @@ -30,7 +30,6 @@ runtime ${project.version} - io.quarkus quarkus-jdbc-h2 @@ -58,4 +57,4 @@ 1.0.0.Final - + \ No newline at end of file diff --git a/quarkus-extension/quarkus-liquibase/deployment/pom.xml b/quarkus-extension/quarkus-liquibase/deployment/pom.xml index 42d3ca2810..9a9e4485cd 100644 --- a/quarkus-extension/quarkus-liquibase/deployment/pom.xml +++ b/quarkus-extension/quarkus-liquibase/deployment/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.quarkus.liquibase deployment @@ -59,4 +59,4 @@ 3.8.1 - + \ No newline at end of file diff --git a/quarkus-extension/quarkus-liquibase/pom.xml b/quarkus-extension/quarkus-liquibase/pom.xml index fdede2000e..1a86aeb75c 100644 --- a/quarkus-extension/quarkus-liquibase/pom.xml +++ b/quarkus-extension/quarkus-liquibase/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.quarkus.liquibase quarkus-liquibase @@ -13,7 +13,7 @@ quarkus-extension 1.0-SNAPSHOT - + runtime deployment @@ -23,4 +23,4 @@ 1.0.0.Final - + \ No newline at end of file diff --git a/quarkus-extension/quarkus-liquibase/runtime/pom.xml b/quarkus-extension/quarkus-liquibase/runtime/pom.xml index 0250d34711..6656556c4b 100644 --- a/quarkus-extension/quarkus-liquibase/runtime/pom.xml +++ b/quarkus-extension/quarkus-liquibase/runtime/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 com.baeldung.quarkus.liquibase @@ -71,4 +72,4 @@ 3.8.1 - + \ No newline at end of file diff --git a/quarkus/pom.xml b/quarkus/pom.xml index 9826fd1034..6e250a2858 100644 --- a/quarkus/pom.xml +++ b/quarkus/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.quarkus quarkus @@ -159,4 +160,4 @@ 5.6.0 - + \ No newline at end of file diff --git a/rabbitmq/pom.xml b/rabbitmq/pom.xml index 33ccf5402f..8a707a15dd 100644 --- a/rabbitmq/pom.xml +++ b/rabbitmq/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rabbitmq 0.1-SNAPSHOT diff --git a/ratpack/pom.xml b/ratpack/pom.xml index 9ad654fa7d..c57934d8b7 100644 --- a/ratpack/pom.xml +++ b/ratpack/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 ratpack 1.0-SNAPSHOT @@ -93,4 +94,4 @@ 1.6.1 - + \ No newline at end of file diff --git a/reactive-systems/inventory-service/pom.xml b/reactive-systems/inventory-service/pom.xml index b5ec210636..86575d498c 100644 --- a/reactive-systems/inventory-service/pom.xml +++ b/reactive-systems/inventory-service/pom.xml @@ -28,7 +28,6 @@ org.springframework.kafka spring-kafka - org.projectlombok lombok @@ -65,4 +64,5 @@ + \ No newline at end of file diff --git a/reactive-systems/order-service/pom.xml b/reactive-systems/order-service/pom.xml index 603f0373ba..e6453732b4 100644 --- a/reactive-systems/order-service/pom.xml +++ b/reactive-systems/order-service/pom.xml @@ -28,7 +28,6 @@ org.springframework.kafka spring-kafka - org.projectlombok lombok @@ -66,4 +65,4 @@ - + \ No newline at end of file diff --git a/reactive-systems/pom.xml b/reactive-systems/pom.xml index bce2575d9e..81462090b8 100644 --- a/reactive-systems/pom.xml +++ b/reactive-systems/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 reactive-systems 0.0.1-SNAPSHOT @@ -19,4 +20,4 @@ order-service - + \ No newline at end of file diff --git a/reactive-systems/shipping-service/pom.xml b/reactive-systems/shipping-service/pom.xml index 458b91b6ce..f725ca72d1 100644 --- a/reactive-systems/shipping-service/pom.xml +++ b/reactive-systems/shipping-service/pom.xml @@ -24,12 +24,10 @@ org.springframework.kafka spring-kafka - com.fasterxml.jackson.core jackson-databind - org.projectlombok lombok @@ -67,4 +65,4 @@ - + \ No newline at end of file diff --git a/reactor-core/README.md b/reactor-core/README.md index 0214aa26fd..08dac354ab 100644 --- a/reactor-core/README.md +++ b/reactor-core/README.md @@ -8,3 +8,4 @@ This module contains articles about Reactor Core. - [Combining Publishers in Project Reactor](https://www.baeldung.com/reactor-combine-streams) - [Programmatically Creating Sequences with Project Reactor](https://www.baeldung.com/flux-sequences-reactor) - [How to Extract a Mono’s Content in Java](https://www.baeldung.com/java-string-from-mono) +- [How to Convert Mono> Into Flux](https://www.baeldung.com/java-mono-list-to-flux) diff --git a/reactor-core/pom.xml b/reactor-core/pom.xml index 317cbde6e2..6eead97bc2 100644 --- a/reactor-core/pom.xml +++ b/reactor-core/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.baeldung reactor-core @@ -38,4 +39,4 @@ 3.6.1 - + \ No newline at end of file diff --git a/reactor-core/src/test/java/com/baeldung/mono/MonoUnitTest.java b/reactor-core/src/test/java/com/baeldung/mono/MonoUnitTest.java index f9e67b0a2f..0c6e0c07ef 100644 --- a/reactor-core/src/test/java/com/baeldung/mono/MonoUnitTest.java +++ b/reactor-core/src/test/java/com/baeldung/mono/MonoUnitTest.java @@ -1,10 +1,14 @@ package com.baeldung.mono; import org.junit.Test; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; import java.time.Duration; import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; import java.util.Optional; import static org.junit.Assert.assertEquals; @@ -40,4 +44,40 @@ public class MonoUnitTest { // blocking return Mono.just("Hello world!"); } + + @Test + public void whenMonoProducesListOfElements_thenConvertToFluxofElements() { + + Mono> monoList = monoOfList(); + + StepVerifier.create(monoTofluxUsingFlatMapIterable(monoList)) + .expectNext("one", "two", "three", "four") + .verifyComplete(); + + StepVerifier.create(monoTofluxUsingFlatMapMany(monoList)) + .expectNext("one", "two", "three", "four") + .verifyComplete(); + } + + private Flux monoTofluxUsingFlatMapIterable(Mono> monoList) { + return monoList + .flatMapIterable(list -> list) + .log(); + } + + private Flux monoTofluxUsingFlatMapMany(Mono> monoList) { + return monoList + .flatMapMany(Flux::fromIterable) + .log(); + } + + private Mono> monoOfList() { + List list = new ArrayList<>(); + list.add("one"); + list.add("two"); + list.add("three"); + list.add("four"); + + return Mono.just(list); + } } diff --git a/resteasy/pom.xml b/resteasy/pom.xml index ffb6adb3df..d35fc852ba 100644 --- a/resteasy/pom.xml +++ b/resteasy/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 resteasy 1.0 @@ -26,27 +27,22 @@ - org.jboss.resteasy resteasy-client ${resteasy.version} - - org.jboss.resteasy resteasy-jaxb-provider ${resteasy.version} - org.jboss.resteasy resteasy-jackson-provider ${resteasy.version} - commons-io commons-io diff --git a/rsocket/pom.xml b/rsocket/pom.xml index 5b407c2bd0..57c927253f 100644 --- a/rsocket/pom.xml +++ b/rsocket/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rsocket 0.0.1-SNAPSHOT @@ -30,4 +31,4 @@ 0.11.13 - + \ No newline at end of file diff --git a/rule-engines/easy-rules/pom.xml b/rule-engines/easy-rules/pom.xml index b9661cd1c3..a8159f2813 100644 --- a/rule-engines/easy-rules/pom.xml +++ b/rule-engines/easy-rules/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.easyrules easy-rules @@ -25,4 +26,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/rule-engines/jess/pom.xml b/rule-engines/jess/pom.xml index 40d50fae70..f5db0374ef 100644 --- a/rule-engines/jess/pom.xml +++ b/rule-engines/jess/pom.xml @@ -1,9 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.rules.jess jess 1.0-SNAPSHOT diff --git a/rule-engines/openl-tablets/pom.xml b/rule-engines/openl-tablets/pom.xml index 25c4b8365a..03b286e409 100644 --- a/rule-engines/openl-tablets/pom.xml +++ b/rule-engines/openl-tablets/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.openltablets openl-tablets @@ -30,4 +31,4 @@ 5.19.4 - + \ No newline at end of file diff --git a/rule-engines/pom.xml b/rule-engines/pom.xml index 27748a5c3e..db6b2e47ef 100644 --- a/rule-engines/pom.xml +++ b/rule-engines/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rule-engines rule-engines @@ -19,4 +20,4 @@ - + \ No newline at end of file diff --git a/rule-engines/rulebook/pom.xml b/rule-engines/rulebook/pom.xml index 95ededa5f9..55b77c50df 100644 --- a/rule-engines/rulebook/pom.xml +++ b/rule-engines/rulebook/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.rulebook rulebook @@ -25,4 +26,4 @@ 0.6.2 - + \ No newline at end of file diff --git a/rxjava-core/pom.xml b/rxjava-core/pom.xml index daec1f783f..cd6075e127 100644 --- a/rxjava-core/pom.xml +++ b/rxjava-core/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rxjava-core 1.0-SNAPSHOT diff --git a/rxjava-libraries/pom.xml b/rxjava-libraries/pom.xml index 45c1907a58..5d2c9ec3bb 100644 --- a/rxjava-libraries/pom.xml +++ b/rxjava-libraries/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rxjava-libraries 1.0-SNAPSHOT diff --git a/rxjava-observables/pom.xml b/rxjava-observables/pom.xml index 3cedfc4afc..feb4fc1f39 100644 --- a/rxjava-observables/pom.xml +++ b/rxjava-observables/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rxjava-observables 1.0-SNAPSHOT diff --git a/rxjava-operators/pom.xml b/rxjava-operators/pom.xml index 8064613f45..ba85dc428b 100644 --- a/rxjava-operators/pom.xml +++ b/rxjava-operators/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 rxjava-operators 1.0-SNAPSHOT diff --git a/saas/pom.xml b/saas/pom.xml index 93965b37c4..87f273939c 100644 --- a/saas/pom.xml +++ b/saas/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 saas 0.1.0-SNAPSHOT @@ -35,7 +36,6 @@ true - org.codehaus.mojo @@ -47,7 +47,7 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed diff --git a/slack/pom.xml b/slack/pom.xml index 51a4cf029f..690bf5132c 100644 --- a/slack/pom.xml +++ b/slack/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.examples slack @@ -57,4 +58,4 @@ 2.4 - + \ No newline at end of file diff --git a/software-security/sql-injection-samples/pom.xml b/software-security/sql-injection-samples/pom.xml index 6cacaa4ad0..7953e43ebe 100644 --- a/software-security/sql-injection-samples/pom.xml +++ b/software-security/sql-injection-samples/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 sql-injection-samples 0.0.1-SNAPSHOT diff --git a/spark-java/pom.xml b/spark-java/pom.xml index 686cf75058..b5538b4ec3 100644 --- a/spark-java/pom.xml +++ b/spark-java/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spark-java 0.1.0-SNAPSHOT @@ -32,4 +33,4 @@ 2.8.0 - + \ No newline at end of file diff --git a/spf4j/pom.xml b/spf4j/pom.xml index b0568e9f7a..6d325947cf 100644 --- a/spf4j/pom.xml +++ b/spf4j/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.spf4j spf4j @@ -18,4 +19,4 @@ spf4j-aspects-app - + \ No newline at end of file diff --git a/spf4j/spf4j-aspects-app/pom.xml b/spf4j/spf4j-aspects-app/pom.xml index 24a419233e..4a4c7cb804 100644 --- a/spf4j/spf4j-aspects-app/pom.xml +++ b/spf4j/spf4j-aspects-app/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 spf4j-aspects-app 0.0.1-SNAPSHOT @@ -87,4 +87,4 @@ 3.1.1 - + \ No newline at end of file diff --git a/spf4j/spf4j-core-app/pom.xml b/spf4j/spf4j-core-app/pom.xml index 280a59e0d9..2961174a35 100644 --- a/spf4j/spf4j-core-app/pom.xml +++ b/spf4j/spf4j-core-app/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 spf4j-core-app 0.0.1-SNAPSHOT @@ -87,4 +87,4 @@ 3.1.1 - + \ No newline at end of file diff --git a/spring-4/pom.xml b/spring-4/pom.xml index cd6b232317..21de925d99 100644 --- a/spring-4/pom.xml +++ b/spring-4/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-4 spring-4 @@ -8,7 +9,7 @@ jar - + com.baeldung parent-boot-1 0.0.1-SNAPSHOT @@ -83,7 +84,6 @@ ${easymock.version} test - org.hsqldb hsqldb @@ -115,4 +115,4 @@ 2.4.0 - + \ No newline at end of file diff --git a/spring-5-data-reactive/pom.xml b/spring-5-data-reactive/pom.xml index 0fb689f16d..5f12636280 100644 --- a/spring-5-data-reactive/pom.xml +++ b/spring-5-data-reactive/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-5-data-reactive spring-5-data-reactive @@ -44,7 +45,6 @@ io.reactivex.rxjava2 rxjava - org.springframework spring-test @@ -59,18 +59,15 @@ de.flapdoodle.embed.mongo test - org.springframework.boot spring-boot-starter-webflux - org.springframework spring-tx ${spring-tx.version} - org.springframework.data spring-data-r2dbc @@ -118,14 +115,12 @@ ${java.version} - + default-compile none - + default-testCompile none @@ -160,5 +155,4 @@ 2.2.6.RELEASE - - + \ No newline at end of file diff --git a/spring-5-reactive-2/pom.xml b/spring-5-reactive-2/pom.xml index 093be0f03c..0758365932 100644 --- a/spring-5-reactive-2/pom.xml +++ b/spring-5-reactive-2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-5-reactive-2 0.0.1-SNAPSHOT @@ -33,19 +34,16 @@ reactor-spring ${reactor-spring.version} - org.projectlombok lombok provided - org.springframework.boot spring-boot-starter-test test - com.github.tomakehurst wiremock-jre8 @@ -82,4 +80,4 @@ 2.24.0 - + \ No newline at end of file diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index 28f692a735..136f31b49e 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-client/pom.xml @@ -1,6 +1,5 @@ - 4.0.0 @@ -72,7 +71,6 @@ ${okhttp.version} test - org.springframework.boot @@ -84,7 +82,6 @@ h2 runtime - org.springframework spring-test @@ -100,14 +97,12 @@ 2.26.0 test - org.apache.commons commons-collections4 ${commons-collections4.version} test - org.projectlombok lombok @@ -163,4 +158,4 @@ 4.0.1 - + \ No newline at end of file diff --git a/spring-5-reactive-oauth/pom.xml b/spring-5-reactive-oauth/pom.xml index 15f5dcacaa..8e8b472881 100644 --- a/spring-5-reactive-oauth/pom.xml +++ b/spring-5-reactive-oauth/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.reactive.oauth spring-5-reactive-oauth @@ -25,12 +26,10 @@ org.springframework.boot spring-boot-starter-webflux - org.springframework.security spring-security-oauth2-client - org.springframework.boot spring-boot-starter-test @@ -64,4 +63,4 @@ - + \ No newline at end of file diff --git a/spring-5-reactive-security/pom.xml b/spring-5-reactive-security/pom.xml index 2024cb5138..267a683fa7 100644 --- a/spring-5-reactive-security/pom.xml +++ b/spring-5-reactive-security/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-5-reactive-security 0.0.1-SNAPSHOT @@ -60,9 +61,7 @@ org.apache.commons commons-lang3 - - org.springframework.boot spring-boot-devtools @@ -77,14 +76,12 @@ spring-boot-starter-test test - org.apache.commons commons-collections4 ${commons-collections4.version} test - io.reactivex.rxjava2 rxjava @@ -130,4 +127,4 @@ 3.1.6.RELEASE - + \ No newline at end of file diff --git a/spring-5-reactive/pom.xml b/spring-5-reactive/pom.xml index 40791faaaf..408573198b 100644 --- a/spring-5-reactive/pom.xml +++ b/spring-5-reactive/pom.xml @@ -52,9 +52,7 @@ org.apache.commons commons-lang3 - - org.springframework.boot spring-boot-devtools @@ -79,8 +77,6 @@ reactor-test test - - org.springframework.boot @@ -102,14 +98,12 @@ org.springframework.session spring-session-data-redis - org.apache.commons commons-collections4 ${commons-collections4.version} test - io.reactivex.rxjava2 rxjava @@ -162,4 +156,4 @@ 4.1 - + \ No newline at end of file diff --git a/spring-5-webflux/README.md b/spring-5-webflux/README.md index 9f9a12f997..bd667468fb 100644 --- a/spring-5-webflux/README.md +++ b/spring-5-webflux/README.md @@ -9,3 +9,5 @@ This module contains articles about Spring 5 WebFlux - [Spring WebClient Requests with Parameters](https://www.baeldung.com/webflux-webclient-parameters) - [RSocket Using Spring Boot](https://www.baeldung.com/spring-boot-rsocket) - [Spring MVC Async vs Spring WebFlux](https://www.baeldung.com/spring-mvc-async-vs-webflux) +- [Set a Timeout in Spring 5 Webflux WebClient](https://www.baeldung.com/spring-webflux-timeout) +- [Guide to Retry in Spring WebFlux](https://www.baeldung.com/spring-webflux-retry) diff --git a/spring-5-webflux/pom.xml b/spring-5-webflux/pom.xml index 48b5b823fb..ad1a66943c 100644 --- a/spring-5-webflux/pom.xml +++ b/spring-5-webflux/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-5-webflux 1.0-SNAPSHOT @@ -31,28 +32,28 @@ org.springframework.boot spring-boot-starter-webflux - org.springframework.boot spring-boot-starter-rsocket - org.projectlombok lombok - org.springframework.boot spring-boot-starter-test test - io.projectreactor reactor-test test + + com.squareup.okhttp3 + mockwebserver + @@ -68,4 +69,4 @@ 2.3.3.RELEASE - + \ No newline at end of file diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/retry/ExternalConnector.java b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/ExternalConnector.java new file mode 100644 index 0000000000..baace095a7 --- /dev/null +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/ExternalConnector.java @@ -0,0 +1,73 @@ +package com.baeldung.spring.retry; + +import java.time.Duration; + +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.reactive.function.client.WebClient; + +import lombok.AllArgsConstructor; +import reactor.core.publisher.Mono; +import reactor.util.retry.Retry; + +@Component +@AllArgsConstructor +public class ExternalConnector { + + private static final String PATH_BY_ID = "/data/{id}"; + + private final WebClient webClient; + + public Mono getData(String stockId) { + return webClient.get() + .uri(PATH_BY_ID, stockId) + .accept(MediaType.APPLICATION_JSON) + .retrieve() + .onStatus(HttpStatus::is5xxServerError, response -> Mono.error(new ServiceException("Server error", response.rawStatusCode()))) + .bodyToMono(String.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(2)) + .filter(throwable -> throwable instanceof ServiceException) + .onRetryExhaustedThrow((retryBackoffSpec, retrySignal) -> { + throw new ServiceException("External Service failed to process after max retries", HttpStatus.SERVICE_UNAVAILABLE.value()); + })); + } + + public Mono getDataWithRetry(String stockId) { + return webClient.get() + .uri(PATH_BY_ID, stockId) + .accept(MediaType.APPLICATION_JSON) + .retrieve() + .bodyToMono(String.class) + .retryWhen(Retry.max(3)); + } + + public Mono getDataWithRetryFixedDelay(String stockId) { + return webClient.get() + .uri(PATH_BY_ID, stockId) + .accept(MediaType.APPLICATION_JSON) + .retrieve() + .bodyToMono(String.class) + .retryWhen(Retry.fixedDelay(3, Duration.ofSeconds(2))); + } + + public Mono getDataWithRetryBackoff(String stockId) { + return webClient.get() + .uri(PATH_BY_ID, stockId) + .accept(MediaType.APPLICATION_JSON) + .retrieve() + .bodyToMono(String.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(2))); + } + + public Mono getDataWithRetryBackoffJitter(String stockId) { + return webClient.get() + .uri(PATH_BY_ID, stockId) + .accept(MediaType.APPLICATION_JSON) + .retrieve() + .bodyToMono(String.class) + .retryWhen(Retry.backoff(3, Duration.ofSeconds(2)) + .jitter(1)); + } + +} diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/retry/ServiceException.java b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/ServiceException.java new file mode 100644 index 0000000000..cbfa71f986 --- /dev/null +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/ServiceException.java @@ -0,0 +1,15 @@ +package com.baeldung.spring.retry; + +public class ServiceException extends RuntimeException { + + private final int statusCode; + + public ServiceException(String message, int statusCode) { + super(message); + this.statusCode = statusCode; + } + + public int getStatusCode() { + return statusCode; + } +} diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/retry/StockController.java b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/StockController.java new file mode 100644 index 0000000000..b03558d53f --- /dev/null +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/StockController.java @@ -0,0 +1,23 @@ +package com.baeldung.spring.retry; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import lombok.AllArgsConstructor; +import reactor.core.publisher.Mono; + +@AllArgsConstructor +@RestController +@RequestMapping("/stocks/data") +public class StockController { + + private final ExternalConnector externalConnector; + + @GetMapping("/{stockId}") + public Mono getData(@PathVariable String stockId) { + return externalConnector.getData(stockId); + } + +} diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/retry/StockDataApp.java b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/StockDataApp.java new file mode 100644 index 0000000000..cfd1852f62 --- /dev/null +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/retry/StockDataApp.java @@ -0,0 +1,18 @@ +package com.baeldung.spring.retry; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.web.reactive.function.client.WebClient; + +@SpringBootApplication +public class StockDataApp { + public static void main(String[] args) { + SpringApplication.run(StockDataApp.class, args); + } + + @Bean + public WebClient webClient() { + return WebClient.create(); + } +} diff --git a/spring-5-webflux/src/test/java/com/baeldung/spring/retry/ExternalConnectorIntegrationTest.java b/spring-5-webflux/src/test/java/com/baeldung/spring/retry/ExternalConnectorIntegrationTest.java new file mode 100644 index 0000000000..60d22def74 --- /dev/null +++ b/spring-5-webflux/src/test/java/com/baeldung/spring/retry/ExternalConnectorIntegrationTest.java @@ -0,0 +1,90 @@ +package com.baeldung.spring.retry; + +import static io.netty.handler.codec.http.HttpResponseStatus.SERVICE_UNAVAILABLE; +import static io.netty.handler.codec.http.HttpResponseStatus.UNAUTHORIZED; +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.web.reactive.function.client.WebClient; +import org.springframework.web.reactive.function.client.WebClientResponseException; + +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; +import okhttp3.mockwebserver.RecordedRequest; +import reactor.test.StepVerifier; + +class ExternalConnectorIntegrationTest { + + private ExternalConnector externalConnector; + + private MockWebServer mockExternalService; + + @BeforeEach + void setup() throws IOException { + externalConnector = new ExternalConnector(WebClient.builder() + .baseUrl("http://localhost:8090") + .build()); + mockExternalService = new MockWebServer(); + mockExternalService.start(8090); + } + + @AfterEach + void tearDown() throws IOException { + mockExternalService.shutdown(); + } + + @Test + void givenExternalServiceReturnsError_whenGettingData_thenRetryAndReturnResponse() throws Exception { + + mockExternalService.enqueue(new MockResponse().setResponseCode(SERVICE_UNAVAILABLE.code())); + mockExternalService.enqueue(new MockResponse().setResponseCode(SERVICE_UNAVAILABLE.code())); + mockExternalService.enqueue(new MockResponse().setResponseCode(SERVICE_UNAVAILABLE.code())); + mockExternalService.enqueue(new MockResponse().setBody("stock data")); + + StepVerifier.create(externalConnector.getData("ABC")) + .expectNextMatches(response -> response.equals("stock data")) + .verifyComplete(); + + verifyNumberOfGetRequests(4); + } + + @Test + void givenExternalServiceReturnsClientError_whenGettingData_thenNoRetry() throws Exception { + + mockExternalService.enqueue(new MockResponse().setResponseCode(UNAUTHORIZED.code())); + + StepVerifier.create(externalConnector.getData("ABC")) + .expectError(WebClientResponseException.class) + .verify(); + + verifyNumberOfGetRequests(1); + } + + @Test + void givenExternalServiceRetryAttemptsExhausted_whenGettingData_thenRetryAndReturnError() throws Exception { + + mockExternalService.enqueue(new MockResponse().setResponseCode(SERVICE_UNAVAILABLE.code())); + mockExternalService.enqueue(new MockResponse().setResponseCode(SERVICE_UNAVAILABLE.code())); + mockExternalService.enqueue(new MockResponse().setResponseCode(SERVICE_UNAVAILABLE.code())); + mockExternalService.enqueue(new MockResponse().setResponseCode(SERVICE_UNAVAILABLE.code())); + + StepVerifier.create(externalConnector.getData("ABC")) + .expectError(ServiceException.class) + .verify(); + + verifyNumberOfGetRequests(4); + } + + private void verifyNumberOfGetRequests(int times) throws Exception { + for (int i = 0; i < times; i++) { + RecordedRequest recordedRequest = mockExternalService.takeRequest(); + assertThat(recordedRequest.getMethod()).isEqualTo("GET"); + assertThat(recordedRequest.getPath()).isEqualTo("/data/ABC"); + } + } + +} diff --git a/spring-5-webflux/src/test/java/com/baeldung/spring/retry/StockControllerIntegrationTest.java b/spring-5-webflux/src/test/java/com/baeldung/spring/retry/StockControllerIntegrationTest.java new file mode 100644 index 0000000000..2ad94f4d6a --- /dev/null +++ b/spring-5-webflux/src/test/java/com/baeldung/spring/retry/StockControllerIntegrationTest.java @@ -0,0 +1,37 @@ +package com.baeldung.spring.retry; + +import static org.mockito.BDDMockito.given; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.WebTestClient; + +import reactor.core.publisher.Mono; + +@RunWith(SpringRunner.class) +@WebFluxTest +public class StockControllerIntegrationTest { + + @Autowired + private WebTestClient webClient; + + @MockBean + private ExternalConnector externalConnector; + + @Test + public void shouldReturnStockData() { + given(externalConnector.getData("ABC")).willReturn(Mono.just("stock data")); + + webClient.get() + .uri("/stocks/data/{id}", "ABC") + .exchange() + .expectStatus() + .isOk() + .expectBody(String.class) + .isEqualTo("stock data"); + } +} diff --git a/spring-5/pom.xml b/spring-5/pom.xml index 082b1f8a87..5ebeb4dadf 100644 --- a/spring-5/pom.xml +++ b/spring-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-5 0.0.1-SNAPSHOT @@ -55,9 +55,7 @@ org.apache.commons commons-lang3 - - org.springframework.boot spring-boot-devtools @@ -68,7 +66,6 @@ h2 runtime - org.springframework spring-test @@ -133,7 +130,7 @@ - + @@ -144,4 +141,4 @@ ${project.build.directory}/generated-snippets - + \ No newline at end of file diff --git a/spring-activiti/pom.xml b/spring-activiti/pom.xml index a8557b4f56..c685207cc4 100644 --- a/spring-activiti/pom.xml +++ b/spring-activiti/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-activiti spring-activiti @@ -8,7 +9,8 @@ Demo project for Spring Boot - + com.baeldung parent-boot-1 0.0.1-SNAPSHOT @@ -30,7 +32,6 @@ org.springframework.boot spring-boot-starter-thymeleaf - com.h2database h2 @@ -60,4 +61,4 @@ 6.0.0 - + \ No newline at end of file diff --git a/spring-akka/pom.xml b/spring-akka/pom.xml index 23535a8ccc..fb7a6198c3 100644 --- a/spring-akka/pom.xml +++ b/spring-akka/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-akka 0.1-SNAPSHOT diff --git a/spring-amqp/pom.xml b/spring-amqp/pom.xml index f32db5b8b4..1a0b78c26e 100755 --- a/spring-amqp/pom.xml +++ b/spring-amqp/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-amqp 1.0.0-SNAPSHOT @@ -25,4 +26,4 @@ com.baeldung.springamqp.simple.HelloWorldMessageApp - + \ No newline at end of file diff --git a/spring-aop/README.md b/spring-aop/README.md index c92e132d1e..707e0fbf81 100644 --- a/spring-aop/README.md +++ b/spring-aop/README.md @@ -12,3 +12,4 @@ This module contains articles about Spring aspect oriented programming (AOP) - [Introduction to Advice Types in Spring](https://www.baeldung.com/spring-aop-advice-tutorial) - [When Does Java Throw UndeclaredThrowableException?](https://www.baeldung.com/java-undeclaredthrowableexception) - [Get Advised Method Info in Spring AOP](https://www.baeldung.com/spring-aop-get-advised-method-info) +- [Advise Methods on Annotated Classes With AspectJ](https://www.baeldung.com/aspectj-advise-methods) diff --git a/spring-aop/pom.xml b/spring-aop/pom.xml index 09949a95f5..464a830383 100644 --- a/spring-aop/pom.xml +++ b/spring-aop/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-aop @@ -22,7 +23,6 @@ org.aspectj aspectjweaver - org.springframework.boot spring-boot-starter-aop @@ -53,6 +53,9 @@ true ignore UTF-8 + + **/pointcutadvice/** + @@ -68,5 +71,4 @@ 1.11 - - + \ No newline at end of file diff --git a/spring-apache-camel/pom.xml b/spring-apache-camel/pom.xml index 9c7cc14381..de7bd1287a 100644 --- a/spring-apache-camel/pom.xml +++ b/spring-apache-camel/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 org.apache.camel spring-apache-camel @@ -65,4 +66,4 @@ 4.3.4.RELEASE - + \ No newline at end of file diff --git a/spring-batch-2/pom.xml b/spring-batch-2/pom.xml index 183ad610f3..c429c272bd 100644 --- a/spring-batch-2/pom.xml +++ b/spring-batch-2/pom.xml @@ -51,4 +51,4 @@ 2.5.1 - + \ No newline at end of file diff --git a/spring-batch/pom.xml b/spring-batch/pom.xml index 75ec0d4877..b195ff8d13 100644 --- a/spring-batch/pom.xml +++ b/spring-batch/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 spring-batch @@ -24,21 +25,18 @@ ${jaxb.version} runtime - org.glassfish.jaxb jaxb-runtime ${jaxb.version} runtime - org.xerial sqlite-jdbc ${sqlite.version} - org.springframework spring-oxm @@ -50,42 +48,35 @@ - org.springframework spring-jdbc ${spring.version} - org.springframework.batch spring-batch-core ${spring.batch.version} - org.springframework.batch spring-batch-test ${spring.batch.version} - com.opencsv opencsv ${opencsv.version} - org.springframework.boot spring-boot-starter-batch - org.hsqldb hsqldb runtime - org.awaitility awaitility @@ -103,4 +94,4 @@ 3.1.1 - + \ No newline at end of file diff --git a/spring-bom/pom.xml b/spring-bom/pom.xml index e82c650fa9..7ba21ee285 100644 --- a/spring-bom/pom.xml +++ b/spring-bom/pom.xml @@ -1,6 +1,7 @@ - - + + 4.0.0 spring-bom 1.0.0-SNAPSHOT @@ -39,4 +40,4 @@ 4.3.8.RELEASE - + \ No newline at end of file diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index 90be832f2c..7c94d5b7d7 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -1,13 +1,12 @@ - + 4.0.0 - com.baeldung.spring-boot-modules spring-boot-modules 1.0.0-SNAPSHOT pom - spring-boot-modules @@ -77,7 +76,6 @@ spring-boot-react - @@ -112,4 +110,5 @@ 5.6.2 2.22.2 - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-1/pom.xml b/spring-boot-modules/spring-boot-1/pom.xml index d44120b21e..9f91cc8f2e 100644 --- a/spring-boot-modules/spring-boot-1/pom.xml +++ b/spring-boot-modules/spring-boot-1/pom.xml @@ -1,13 +1,14 @@ - + 4.0.0 spring-boot-1 jar Module for Spring Boot version 1.x - + com.baeldung parent-boot-1 0.0.1-SNAPSHOT @@ -43,4 +44,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-actuator/pom.xml b/spring-boot-modules/spring-boot-actuator/pom.xml index 3cb324a0b8..1865974ab0 100644 --- a/spring-boot-modules/spring-boot-actuator/pom.xml +++ b/spring-boot-modules/spring-boot-actuator/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-actuator spring-boot-actuator @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent 2.3.2.RELEASE - + @@ -36,7 +36,6 @@ com.h2database h2 - org.springframework.boot spring-boot-starter-test @@ -68,4 +67,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-admin/pom.xml b/spring-boot-modules/spring-boot-admin/pom.xml index 6109081723..b995b6f02e 100644 --- a/spring-boot-modules/spring-boot-admin/pom.xml +++ b/spring-boot-modules/spring-boot-admin/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-admin + 0.0.1-SNAPSHOT + pom + spring-boot-admin com.baeldung.spring-boot-modules @@ -10,14 +15,9 @@ ../ - spring-boot-admin - 0.0.1-SNAPSHOT - pom - - spring-boot-admin - spring-boot-admin-server spring-boot-admin-client - + + \ No newline at end of file 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 f7a4b157e7..a565b94c79 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 @@ -1,7 +1,13 @@ - + 4.0.0 + spring-boot-admin-client + 0.0.1-SNAPSHOT + jar + spring-boot-admin-client + Spring Boot Admin Client com.baeldung.spring-boot-modules @@ -10,13 +16,6 @@ ../ - spring-boot-admin-client - 0.0.1-SNAPSHOT - jar - - spring-boot-admin-client - Spring Boot Admin Client - org.springframework.boot @@ -64,4 +63,5 @@ 2.4.0 2.0.4.RELEASE - + + \ No newline at end of file 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 bcec12a14c..b53394cdef 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 @@ -1,7 +1,13 @@ - + 4.0.0 + spring-boot-admin-server + 0.0.1-SNAPSHOT + jar + spring-boot-admin-server + Spring Boot Admin Server com.baeldung.spring-boot-modules @@ -10,19 +16,11 @@ ../ - spring-boot-admin-server - 0.0.1-SNAPSHOT - jar - - spring-boot-admin-server - Spring Boot Admin Server - org.springframework.boot spring-boot-starter-web - @@ -30,7 +28,6 @@ spring-boot-admin-starter-server ${spring-boot-admin-server.version} - de.codecentric @@ -45,7 +42,6 @@ com.hazelcast hazelcast - de.codecentric @@ -53,12 +49,10 @@ ${spring-boot-admin-starter-client.version} - org.springframework.boot spring-boot-starter-mail - org.springframework.boot spring-boot-starter-test @@ -87,4 +81,5 @@ 1.5.7 2.0.4.RELEASE - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-angular/pom.xml b/spring-boot-modules/spring-boot-angular/pom.xml index ac63d21bb8..89a8814d2f 100644 --- a/spring-boot-modules/spring-boot-angular/pom.xml +++ b/spring-boot-modules/spring-boot-angular/pom.xml @@ -1,7 +1,13 @@ - + 4.0.0 + com.baeldung.springbootangular + spring-boot-angular + 1.0 + jar + spring-boot-angular com.baeldung.spring-boot-modules @@ -10,13 +16,6 @@ ../ - com.baeldung.springbootangular - spring-boot-angular - 1.0 - jar - - spring-boot-angular - org.springframework.boot @@ -52,4 +51,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-annotations/pom.xml b/spring-boot-modules/spring-boot-annotations/pom.xml index 799692d51b..b495c5de04 100644 --- a/spring-boot-modules/spring-boot-annotations/pom.xml +++ b/spring-boot-modules/spring-boot-annotations/pom.xml @@ -1,7 +1,11 @@ - + 4.0.0 + spring-boot-annotations + war + spring-boot-annotations com.baeldung.spring-boot-modules @@ -10,23 +14,16 @@ ../ - spring-boot-annotations - war - - spring-boot-annotations - org.aspectj aspectjweaver ${aspectjweaver.version} - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-data-jpa @@ -37,12 +34,10 @@ - org.hibernate hibernate-core - org.springframework.boot @@ -50,5 +45,5 @@ test - - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-artifacts-2/pom.xml b/spring-boot-modules/spring-boot-artifacts-2/pom.xml index abea13151e..8cf78b79e0 100644 --- a/spring-boot-modules/spring-boot-artifacts-2/pom.xml +++ b/spring-boot-modules/spring-boot-artifacts-2/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-artifacts-2 + jar + spring-boot-artifacts-2 + Demo project for Spring Boot com.baeldung.spring-boot-modules @@ -10,12 +15,6 @@ ../ - spring-boot-artifacts-2 - jar - - spring-boot-artifacts-2 - Demo project for Spring Boot - org.springframework.boot @@ -45,4 +44,4 @@ com.baeldung.demo.DemoApplication - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-artifacts/pom.xml b/spring-boot-modules/spring-boot-artifacts/pom.xml index 467f931559..7ed91a6626 100644 --- a/spring-boot-modules/spring-boot-artifacts/pom.xml +++ b/spring-boot-modules/spring-boot-artifacts/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-artifacts + war + spring-boot-artifacts + Demo project for Spring Boot com.baeldung.spring-boot-modules @@ -10,88 +15,69 @@ ../ - spring-boot-artifacts - war - - spring-boot-artifacts - Demo project for Spring Boot - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-thymeleaf provided - org.springframework.boot spring-boot-starter-test test - 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.webjars bootstrap ${bootstrap.version} - org.webjars jquery ${jquery.version} - org.apache.httpcomponents httpclient ${httpclient.version} - @@ -116,8 +102,8 @@ maven-failsafe-plugin 2.18 - + integration-tests @@ -125,8 +111,8 @@ verify - + **/ExternalPropertyFileLoaderIntegrationTest.java @@ -134,7 +120,6 @@ - pl.project13.maven git-commit-id-plugin @@ -160,7 +145,6 @@ ${project.build.outputDirectory}/git.properties - @@ -213,4 +197,4 @@ 4.5.8 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-autoconfiguration/pom.xml b/spring-boot-modules/spring-boot-autoconfiguration/pom.xml index 4990e6884c..bf8bcc5a87 100644 --- a/spring-boot-modules/spring-boot-autoconfiguration/pom.xml +++ b/spring-boot-modules/spring-boot-autoconfiguration/pom.xml @@ -1,7 +1,13 @@ - 4.0.0 + spring-boot-autoconfiguration + 0.0.1-SNAPSHOT + war + spring-boot-autoconfiguration + This is simple boot application demonstrating a custom auto-configuration com.baeldung.spring-boot-modules @@ -10,13 +16,6 @@ ../ - spring-boot-autoconfiguration - 0.0.1-SNAPSHOT - war - - spring-boot-autoconfiguration - This is simple boot application demonstrating a custom auto-configuration - org.springframework.boot @@ -39,18 +38,15 @@ spring-boot-starter-test test - mysql mysql-connector-java - org.springframework.boot spring-boot-configuration-processor true - org.hsqldb hsqldb @@ -59,21 +55,19 @@ - spring-boot + spring-boot-autoconfiguration src/main/resources true - org.apache.maven.plugins maven-war-plugin - 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 3ce9266ebe..d42a7fd3de 100644 --- a/spring-boot-modules/spring-boot-basic-customization-2/pom.xml +++ b/spring-boot-modules/spring-boot-basic-customization-2/pom.xml @@ -1,8 +1,12 @@ + 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-basic-customization-2 + jar + spring-boot-basic-customization-2 + Module For Spring Boot Basic Customization 2 com.baeldung.spring-boot-modules @@ -11,18 +15,11 @@ ../ - spring-boot-basic-customization-2 - jar - - spring-boot-basic-customization-2 - Module For Spring Boot Basic Customization 2 - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -30,4 +27,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-basic-customization/pom.xml b/spring-boot-modules/spring-boot-basic-customization/pom.xml index fc34994a85..5ab747cff1 100644 --- a/spring-boot-modules/spring-boot-basic-customization/pom.xml +++ b/spring-boot-modules/spring-boot-basic-customization/pom.xml @@ -1,8 +1,12 @@ + 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-basic-customization + jar + spring-boot-basic-customization + Module For Spring Boot Basic Customization com.baeldung.spring-boot-modules @@ -11,28 +15,19 @@ ../ - spring-boot-basic-customization - jar - - spring-boot-basic-customization - Module For Spring Boot Basic Customization - org.springframework.boot spring-boot-starter - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-thymeleaf - org.springframework.boot spring-boot-starter-test @@ -44,4 +39,5 @@ com.baeldung.changeport.CustomApplication - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-bootstrap/pom.xml b/spring-boot-modules/spring-boot-bootstrap/pom.xml index 5f1cd8fb65..f94ee9ca31 100644 --- a/spring-boot-modules/spring-boot-bootstrap/pom.xml +++ b/spring-boot-modules/spring-boot-bootstrap/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-bootstrap + jar + spring-boot-bootstrap + Demo project for Spring Boot com.baeldung.spring-boot-modules @@ -10,12 +15,6 @@ ../ - spring-boot-bootstrap - jar - - spring-boot-bootstrap - Demo project for Spring Boot - org.springframework.boot @@ -336,4 +335,4 @@ 1.0.0.RELEASE - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-camel/pom.xml b/spring-boot-modules/spring-boot-camel/pom.xml index 46a90b4722..0069dfdbff 100644 --- a/spring-boot-modules/spring-boot-camel/pom.xml +++ b/spring-boot-modules/spring-boot-camel/pom.xml @@ -1,12 +1,13 @@ - 4.0.0 com.example spring-boot-camel 0.0.1-SNAPSHOT - spring-boot-camel - + spring-boot-camel + com.baeldung parent-boot-2 @@ -48,7 +49,6 @@ spring-boot:run - org.springframework.boot @@ -68,4 +68,4 @@ 3.0.0-M4 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-ci-cd/pom.xml b/spring-boot-modules/spring-boot-ci-cd/pom.xml index 61a2e299fb..fb1810c62e 100644 --- a/spring-boot-modules/spring-boot-ci-cd/pom.xml +++ b/spring-boot-modules/spring-boot-ci-cd/pom.xml @@ -1,8 +1,12 @@ + 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-ci-cd + 0.0.1-SNAPSHOT + jar + spring-boot-ci-cd com.baeldung.spring-boot-modules @@ -11,18 +15,11 @@ ../ - spring-boot-ci-cd - 0.0.1-SNAPSHOT - jar - - spring-boot-ci-cd - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-actuator @@ -73,7 +70,8 @@ spring-boot-ci-cd - java $JAVA_OPTS -jar -Dserver.port=$PORT target/${project.build.finalName}.jar + java $JAVA_OPTS -jar -Dserver.port=$PORT + target/${project.build.finalName}.jar diff --git a/spring-boot-modules/spring-boot-client/pom.xml b/spring-boot-modules/spring-boot-client/pom.xml index aa832497e9..7f54d0e541 100644 --- a/spring-boot-modules/spring-boot-client/pom.xml +++ b/spring-boot-modules/spring-boot-client/pom.xml @@ -1,7 +1,13 @@ - 4.0.0 + spring-boot-client + 0.0.1-SNAPSHOT + war + spring-boot-client + This is simple boot client application for Spring boot actuator test com.baeldung.spring-boot-modules @@ -10,13 +16,6 @@ ../ - spring-boot-client - 0.0.1-SNAPSHOT - war - - spring-boot-client - This is simple boot client application for Spring boot actuator test - org.springframework.boot @@ -48,7 +47,6 @@ org.springframework spring-messaging - @@ -59,22 +57,17 @@ true - - org.apache.maven.plugins maven-war-plugin - pl.project13.maven git-commit-id-plugin ${git-commit-id-plugin.version} - - @@ -116,7 +109,7 @@ 18.0 - 2.2.4 + 2.2.4 \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/pom.xml b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/pom.xml index 9a311adfec..12a39b75fe 100644 --- a/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/pom.xml +++ b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-application/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 data-jpa-application 0.0.1-SNAPSHOT diff --git a/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/pom.xml b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/pom.xml index 2da9e5aa2c..c8be287abd 100644 --- a/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/pom.xml +++ b/spring-boot-modules/spring-boot-config-jpa-error/data-jpa-library/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 data-jpa-library 0.0.1-SNAPSHOT diff --git a/spring-boot-modules/spring-boot-config-jpa-error/pom.xml b/spring-boot-modules/spring-boot-config-jpa-error/pom.xml index d236a581d8..b5207f8997 100644 --- a/spring-boot-modules/spring-boot-config-jpa-error/pom.xml +++ b/spring-boot-modules/spring-boot-config-jpa-error/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + com.baeldung.spring-boot-config-jpa-error + spring-boot-config-jpa-error + 0.0.1-SNAPSHOT + pom com.baeldung.spring-boot-modules @@ -10,11 +15,6 @@ ../ - com.baeldung.spring-boot-config-jpa-error - spring-boot-config-jpa-error - 0.0.1-SNAPSHOT - pom - data-jpa-library data-jpa-application @@ -38,14 +38,12 @@ spring-boot-starter-data-jpa ${spring-boot.version} - org.springframework.boot spring-boot-starter-test ${spring-boot.version} test - com.h2database h2 diff --git a/spring-boot-modules/spring-boot-crud/pom.xml b/spring-boot-modules/spring-boot-crud/pom.xml index cf1bfe6da0..79eccf2fba 100644 --- a/spring-boot-modules/spring-boot-crud/pom.xml +++ b/spring-boot-modules/spring-boot-crud/pom.xml @@ -1,8 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 + spring-boot-crud + spring-boot-crud com.baeldung.spring-boot-modules @@ -11,10 +13,6 @@ ../ - spring-boot-crud - - spring-boot-crud - org.springframework.boot @@ -86,4 +84,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-ctx-fluent/pom.xml b/spring-boot-modules/spring-boot-ctx-fluent/pom.xml index cfbc6ffac0..8a7aca076e 100644 --- a/spring-boot-modules/spring-boot-ctx-fluent/pom.xml +++ b/spring-boot-modules/spring-boot-ctx-fluent/pom.xml @@ -1,7 +1,12 @@ - 4.0.0 + spring-boot-ctx-fluent + 0.0.1-SNAPSHOT + jar + spring-boot-ctx-fluent com.baeldung.spring-boot-modules @@ -10,12 +15,6 @@ ../ - spring-boot-ctx-fluent - 0.0.1-SNAPSHOT - jar - - spring-boot-ctx-fluent - org.springframework.boot @@ -23,4 +22,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/greeter-library/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-library/pom.xml index 34cc530f2f..5c9d477502 100644 --- a/spring-boot-modules/spring-boot-custom-starter/greeter-library/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-library/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 greeter-library 0.0.1-SNAPSHOT - greeter-library - + greeter-library + com.baeldung.spring-boot-modules spring-boot-custom-starter diff --git a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml index 4903f21c77..d7f437633d 100644 --- a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 greeter-spring-boot-autoconfigure 0.0.1-SNAPSHOT @@ -18,27 +19,23 @@ spring-boot ${spring-boot.version} - org.springframework.boot spring-boot-autoconfigure ${spring-boot.version} - org.springframework.boot spring-boot-configuration-processor ${spring-boot.version} true - com.baeldung.spring-boot-modules greeter-library ${greeter.version} true - org.springframework.boot spring-boot-starter-test diff --git a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml index 6291756d21..815c3e8366 100644 --- a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml @@ -1,10 +1,11 @@ - 4.0.0 greeter-spring-boot-sample-app 0.0.1-SNAPSHOT - greeter-spring-boot-sample-app + greeter-spring-boot-sample-app com.baeldung.spring-boot-modules @@ -12,34 +13,34 @@ 0.0.1-SNAPSHOT ../ - + com.baeldung.spring-boot-modules greeter-spring-boot-starter ${greeter-starter.version} - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-test + test + - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - - - + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + 0.0.1-SNAPSHOT - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml index 85a6721492..0ea27a839f 100644 --- a/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml @@ -1,10 +1,11 @@ - + 4.0.0 greeter-spring-boot-starter 0.0.1-SNAPSHOT - greeter-spring-boot-starter + greeter-spring-boot-starter com.baeldung.spring-boot-modules @@ -13,25 +14,21 @@ - org.springframework.boot spring-boot-starter ${spring-boot.version} - com.baeldung.spring-boot-modules greeter-spring-boot-autoconfigure ${project.version} - com.baeldung.spring-boot-modules greeter-library ${greeter.version} - diff --git a/spring-boot-modules/spring-boot-custom-starter/greeter/pom.xml b/spring-boot-modules/spring-boot-custom-starter/greeter/pom.xml index 47296990aa..f96880b1cf 100644 --- a/spring-boot-modules/spring-boot-custom-starter/greeter/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/greeter/pom.xml @@ -1,16 +1,17 @@ - 4.0.0 greeter 0.0.1-SNAPSHOT - greeter - + greeter + com.baeldung parent-boot-2 0.0.1-SNAPSHOT ../../../parent-boot-2 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/pom.xml b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/pom.xml index fb235bc479..948482b21b 100644 --- a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/application/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 com.baeldung.example diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/pom.xml b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/pom.xml index d979f1d9bf..5d45de0d1d 100644 --- a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/library/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 com.baeldung.example diff --git a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/pom.xml b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/pom.xml index 75ff927789..2a483a8fef 100644 --- a/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/parent-multi-module/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 com.baeldung diff --git a/spring-boot-modules/spring-boot-custom-starter/pom.xml b/spring-boot-modules/spring-boot-custom-starter/pom.xml index 338bf22f46..27e3a03153 100644 --- a/spring-boot-modules/spring-boot-custom-starter/pom.xml +++ b/spring-boot-modules/spring-boot-custom-starter/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-custom-starter + 0.0.1-SNAPSHOT + spring-boot-custom-starter + pom com.baeldung.spring-boot-modules @@ -10,12 +15,6 @@ ../ - spring-boot-custom-starter - 0.0.1-SNAPSHOT - pom - - spring-boot-custom-starter - greeter-library greeter @@ -24,4 +23,5 @@ greeter-spring-boot-sample-app parent-multi-module + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-data-2/pom.xml b/spring-boot-modules/spring-boot-data-2/pom.xml index fb0d5f2053..b7006782c8 100644 --- a/spring-boot-modules/spring-boot-data-2/pom.xml +++ b/spring-boot-modules/spring-boot-data-2/pom.xml @@ -1,16 +1,17 @@ + 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-boot-data-2 + com.baeldung.spring-boot-modules spring-boot-modules 1.0.0-SNAPSHOT ../ - 4.0.0 - spring-boot-data-2 org.springframework.boot diff --git a/spring-boot-modules/spring-boot-data/pom.xml b/spring-boot-modules/spring-boot-data/pom.xml index 06f09c70fe..447b730c02 100644 --- a/spring-boot-modules/spring-boot-data/pom.xml +++ b/spring-boot-modules/spring-boot-data/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-data + war + spring-boot-data + Spring Boot Data Module com.baeldung.spring-boot-modules @@ -10,12 +15,6 @@ ../ - spring-boot-data - war - - spring-boot-data - Spring Boot Data Module - org.springframework.boot @@ -63,7 +62,6 @@ true - org.apache.maven.plugins @@ -173,5 +171,5 @@ 1.8 1.8 - - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-deployment/pom.xml b/spring-boot-modules/spring-boot-deployment/pom.xml index ae546016f2..7c78d20afc 100644 --- a/spring-boot-modules/spring-boot-deployment/pom.xml +++ b/spring-boot-modules/spring-boot-deployment/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-boot-deployment spring-boot-deployment @@ -19,77 +20,64 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-thymeleaf provided - org.springframework.boot spring-boot-starter-test test - 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.webjars bootstrap ${bootstrap.version} - org.webjars jquery ${jquery.version} - org.apache.httpcomponents httpclient ${httpclient.version} - @@ -123,8 +111,8 @@ maven-failsafe-plugin 2.18 - + integration-tests @@ -132,8 +120,8 @@ verify - + **/ExternalPropertyFileLoaderIntegrationTest.java @@ -192,4 +180,4 @@ 4.5.8 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-di/pom.xml b/spring-boot-modules/spring-boot-di/pom.xml index 58b427a4a8..0e9fb49a95 100644 --- a/spring-boot-modules/spring-boot-di/pom.xml +++ b/spring-boot-modules/spring-boot-di/pom.xml @@ -1,8 +1,12 @@ + 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-di + jar + spring-boot-di + Module For Spring Boot DI com.baeldung.spring-boot-modules @@ -11,34 +15,24 @@ ../ - spring-boot-di - jar - - spring-boot-di - Module For Spring Boot DI - org.aspectj aspectjweaver - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-actuator - org.springframework.boot spring-boot-starter-tomcat provided - org.apache.tomcat.embed tomcat-embed-jasper @@ -49,7 +43,6 @@ spring-boot-starter-test test - @@ -69,4 +62,4 @@ com.baeldung.SpringBootDiApplication - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-disable-logging/disabling-console-jul/pom.xml b/spring-boot-modules/spring-boot-disable-logging/disabling-console-jul/pom.xml index 798332e809..deee4e435f 100644 --- a/spring-boot-modules/spring-boot-disable-logging/disabling-console-jul/pom.xml +++ b/spring-boot-modules/spring-boot-disable-logging/disabling-console-jul/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 disabling-console-jul disabling-console-jul - + com.baeldung.spring-boot-modules spring-boot-disable-logging diff --git a/spring-boot-modules/spring-boot-disable-logging/disabling-console-log4j2/pom.xml b/spring-boot-modules/spring-boot-disable-logging/disabling-console-log4j2/pom.xml index f3f7fdf473..0524f9d401 100644 --- a/spring-boot-modules/spring-boot-disable-logging/disabling-console-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-disable-logging/disabling-console-log4j2/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 disabling-console-log4j2 disabling-console-log4j2 - + com.baeldung.spring-boot-modules spring-boot-disable-logging diff --git a/spring-boot-modules/spring-boot-disable-logging/disabling-console-logback/pom.xml b/spring-boot-modules/spring-boot-disable-logging/disabling-console-logback/pom.xml index 741eae4ba4..0990209ff9 100644 --- a/spring-boot-modules/spring-boot-disable-logging/disabling-console-logback/pom.xml +++ b/spring-boot-modules/spring-boot-disable-logging/disabling-console-logback/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 disabling-console-logback disabling-console-logback diff --git a/spring-boot-modules/spring-boot-disable-logging/pom.xml b/spring-boot-modules/spring-boot-disable-logging/pom.xml index 020592ee29..65de521c63 100644 --- a/spring-boot-modules/spring-boot-disable-logging/pom.xml +++ b/spring-boot-modules/spring-boot-disable-logging/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-disable-logging + 1.0.0-SNAPSHOT + pom + spring-boot-disable-logging com.baeldung.spring-boot-modules @@ -10,15 +15,10 @@ ../ - spring-boot-disable-logging - 1.0.0-SNAPSHOT - pom - - spring-boot-disable-logging - disabling-console-jul disabling-console-log4j2 disabling-console-logback - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-environment/pom.xml b/spring-boot-modules/spring-boot-environment/pom.xml index a3aab63a2d..5327825409 100644 --- a/spring-boot-modules/spring-boot-environment/pom.xml +++ b/spring-boot-modules/spring-boot-environment/pom.xml @@ -3,6 +3,10 @@ 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-environment + war + spring-boot-environment + Demo project for Spring Boot com.baeldung.spring-boot-modules @@ -11,24 +15,16 @@ ../ - spring-boot-environment - war - - spring-boot-environment - Demo project for Spring Boot - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-thymeleaf provided - org.springframework.boot spring-boot-starter-test @@ -45,58 +41,48 @@ - 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.springframework.cloud spring-cloud-context - org.apache.httpcomponents httpclient ${httpclient.version} - @@ -169,4 +155,4 @@ 2020.0.0 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-exceptions/pom.xml b/spring-boot-modules/spring-boot-exceptions/pom.xml index 1bfe8e6751..c0c335f55c 100644 --- a/spring-boot-modules/spring-boot-exceptions/pom.xml +++ b/spring-boot-modules/spring-boot-exceptions/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-exceptions + jar + spring-boot-exceptions + Demo project for working with Spring Boot exceptions com.baeldung.spring-boot-modules @@ -10,12 +15,6 @@ ../ - spring-boot-exceptions - jar - - spring-boot-exceptions - Demo project for working with Spring Boot exceptions - spring-boot-exceptions @@ -26,4 +25,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-flowable/pom.xml b/spring-boot-modules/spring-boot-flowable/pom.xml index f1121ea6a0..fee4d9fdfc 100644 --- a/spring-boot-modules/spring-boot-flowable/pom.xml +++ b/spring-boot-modules/spring-boot-flowable/pom.xml @@ -1,8 +1,12 @@ + 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-flowable + war + spring-boot-flowable + Spring Boot Flowable Module com.baeldung.spring-boot-modules @@ -11,12 +15,6 @@ ../ - spring-boot-flowable - war - - spring-boot-flowable - Spring Boot Flowable Module - org.springframework.boot @@ -61,4 +59,5 @@ 6.4.1 + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-groovy/pom.xml b/spring-boot-modules/spring-boot-groovy/pom.xml index 3392532081..ea9f3231cd 100644 --- a/spring-boot-modules/spring-boot-groovy/pom.xml +++ b/spring-boot-modules/spring-boot-groovy/pom.xml @@ -1,21 +1,20 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.app + spring-boot-groovy + spring-boot-groovy + war + Spring Boot Todo Application with Groovy - 4.0.0 - com.baeldung.app - spring-boot-groovy - spring-boot-groovy - war - Spring Boot Todo Application with Groovy - - + com.baeldung parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - + @@ -30,7 +29,6 @@ org.codehaus.groovy groovy - org.springframework.boot spring-boot-starter-test @@ -41,7 +39,7 @@ h2 runtime - + @@ -54,7 +52,7 @@ gmavenplus-plugin 1.9.0 - + addSources addTestSources @@ -65,7 +63,7 @@ removeStubs removeTestStubs - + @@ -75,4 +73,4 @@ com.baeldung.springwithgroovy.SpringBootGroovyApplication - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-jasypt/pom.xml b/spring-boot-modules/spring-boot-jasypt/pom.xml index 2f0c8a27b4..1032500de7 100644 --- a/spring-boot-modules/spring-boot-jasypt/pom.xml +++ b/spring-boot-modules/spring-boot-jasypt/pom.xml @@ -1,7 +1,13 @@ - + 4.0.0 + com.example.jasypt + spring-boot-jasypt + jar + spring-boot-jasypt + Demo project for Spring Boot com.baeldung.spring-boot-modules @@ -10,31 +16,21 @@ ../ - com.example.jasypt - spring-boot-jasypt - jar - - spring-boot-jasypt - Demo project for Spring Boot - org.springframework.boot spring-boot-starter - org.springframework.boot spring-boot-starter-test test - com.github.ulisesbocchio jasypt-spring-boot-starter ${jasypt.version} - com.github.ulisesbocchio jasypt-spring-boot @@ -55,4 +51,4 @@ 2.0.0 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-keycloak/pom.xml b/spring-boot-modules/spring-boot-keycloak/pom.xml index cfcdcf2c37..37d57d6556 100644 --- a/spring-boot-modules/spring-boot-keycloak/pom.xml +++ b/spring-boot-modules/spring-boot-keycloak/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 com.baeldung.keycloak spring-boot-keycloak @@ -41,7 +42,6 @@ org.springframework.boot spring-boot-starter-data-jpa - org.springframework.boot spring-boot-starter-test @@ -79,4 +79,4 @@ 11.0.2 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-libraries-2/pom.xml b/spring-boot-modules/spring-boot-libraries-2/pom.xml index 629b713cb5..669c07c23a 100644 --- a/spring-boot-modules/spring-boot-libraries-2/pom.xml +++ b/spring-boot-modules/spring-boot-libraries-2/pom.xml @@ -1,22 +1,22 @@ + 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-libraries-2 + spring-boot-modules com.baeldung.spring-boot-modules 1.0.0-SNAPSHOT - 4.0.0 - - spring-boot-libraries-2 org.springframework.boot spring-boot-starter-web - + ch.qos.logback logback-classic @@ -24,15 +24,13 @@ org.springframework.data spring-data-jpa - org.jobrunr jobrunr-spring-boot-starter ${jobrunr.version} - - + org.openapitools openapi-generator @@ -48,13 +46,11 @@ springfox-swagger2 ${springfox.version} - org.springframework.boot spring-boot-starter-test test - org.awaitility awaitility @@ -62,8 +58,8 @@ test - - + + org.openapitools @@ -103,4 +99,4 @@ 2.9.2 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-libraries/pom.xml b/spring-boot-modules/spring-boot-libraries/pom.xml index c96a881573..ad00629e14 100644 --- a/spring-boot-modules/spring-boot-libraries/pom.xml +++ b/spring-boot-modules/spring-boot-libraries/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-libraries spring-boot-libraries @@ -36,20 +36,17 @@ spring-boot-starter-test test - org.togglz togglz-spring-boot-starter ${togglz.version} - org.togglz togglz-spring-security ${togglz.version} - com.graphql-java @@ -65,15 +62,13 @@ com.graphql-java graphiql-spring-boot-starter ${graphql-spring-boot-starter.version} - - + org.zalando problem-spring-web ${problem-spring-web.version} - net.javacrumbs.shedlock @@ -130,11 +125,11 @@ org.springframework.boot spring-boot-starter-cache - + javax.cache cache-api - + com.github.ben-manes.caffeine caffeine @@ -162,14 +157,11 @@ true - - org.apache.maven.plugins maven-war-plugin - pl.project13.maven git-commit-id-plugin @@ -195,9 +187,7 @@ ${project.build.outputDirectory}/git.properties - - @@ -261,4 +251,4 @@ 2.8.2 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-logging-log4j2/pom.xml b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml index 4422405187..2f69870961 100644 --- a/spring-boot-modules/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-boot-logging-log4j2 spring-boot-logging-log4j2 @@ -8,12 +9,11 @@ Demo project for Spring Boot Logging with Log4J2 - org.springframework.boot spring-boot-starter-parent 2.2.2.RELEASE - + @@ -41,7 +41,6 @@ ${lombok.version} provided - @@ -83,4 +82,4 @@ 1.18.4 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-2/pom.xml b/spring-boot-modules/spring-boot-mvc-2/pom.xml index 580224cfd0..43e1f12efc 100644 --- a/spring-boot-modules/spring-boot-mvc-2/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-2/pom.xml @@ -3,6 +3,10 @@ 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-mvc-2 + jar + spring-boot-mvc-2 + Module For Spring Boot MVC Web Fn com.baeldung.spring-boot-modules @@ -11,69 +15,53 @@ ../ - spring-boot-mvc-2 - jar - - spring-boot-mvc-2 - Module For Spring Boot MVC Web Fn - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-validation - org.springframework.boot spring-boot-devtools true - io.springfox springfox-swagger2 ${spring.fox.version} - io.springfox springfox-swagger-ui ${spring.fox.version} - io.springfox springfox-spring-webmvc ${spring.fox.version} - org.apache.commons commons-lang3 - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - com.fasterxml.jackson.core - jackson-databind - - - + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.fasterxml.jackson.core + jackson-databind + + com.h2database h2 - - + com.thoughtworks.xstream xstream ${xstream.version} @@ -101,7 +89,6 @@ - 3.0.0 com.baeldung.swagger2boot.SpringBootSwaggerApplication diff --git a/spring-boot-modules/spring-boot-mvc-3/pom.xml b/spring-boot-modules/spring-boot-mvc-3/pom.xml index 5a5d4c3cd8..a46837e315 100644 --- a/spring-boot-modules/spring-boot-mvc-3/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-3/pom.xml @@ -3,6 +3,10 @@ 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-mvc-3 + jar + spring-boot-mvc-3 + Module For Spring Boot MVC Web com.baeldung.spring-boot-modules @@ -11,12 +15,6 @@ ../ - spring-boot-mvc-3 - jar - - spring-boot-mvc-3 - Module For Spring Boot MVC Web - org.springframework.boot @@ -37,4 +35,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-birt/pom.xml b/spring-boot-modules/spring-boot-mvc-birt/pom.xml index 4963cc3036..54a5091559 100644 --- a/spring-boot-modules/spring-boot-mvc-birt/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-birt/pom.xml @@ -1,31 +1,28 @@ + 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-mvc-birt + 0.0.1-SNAPSHOT + jar + spring-boot-mvc-birt + Module For Spring Boot Integration with BIRT - + org.springframework.boot spring-boot-starter-parent 2.1.1.RELEASE - + - spring-boot-mvc-birt - 0.0.1-SNAPSHOT - jar - - spring-boot-mvc-birt - Module For Spring Boot Integration with BIRT - - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-logging @@ -36,13 +33,11 @@ - org.springframework.boot spring-boot-starter-test test - com.innoventsolutions.birt.runtime org.eclipse.birt.runtime_4.8.0-20180626 @@ -58,7 +53,6 @@ lombok provided - @@ -78,4 +72,4 @@ 1.2.17 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-jersey/pom.xml b/spring-boot-modules/spring-boot-mvc-jersey/pom.xml index ab117c4d2e..e5e4e09721 100644 --- a/spring-boot-modules/spring-boot-mvc-jersey/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-jersey/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-mvc-jersey + 0.0.1-SNAPSHOT + pom + spring-boot-mvc-jersey com.baeldung.spring-boot-modules @@ -10,14 +15,9 @@ ../ - spring-boot-mvc-jersey - 0.0.1-SNAPSHOT - pom - - spring-boot-mvc-jersey - spring-boot-jersey spring-boot-mvc - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-jersey/pom.xml b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-jersey/pom.xml index 5756a27eca..e0b261510c 100644 --- a/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-jersey/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-jersey/pom.xml @@ -1,25 +1,24 @@ - + 4.0.0 + com.baeldung.boot + spring-boot-jersey + 0.0.1-SNAPSHOT org.springframework.boot spring-boot-starter-parent 2.4.2 - + - com.baeldung.boot - spring-boot-jersey - 0.0.1-SNAPSHOT - org.springframework.boot spring-boot-starter-jersey - org.springframework.boot spring-boot-starter-test @@ -35,4 +34,5 @@ - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-mvc/pom.xml b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-mvc/pom.xml index 69d355e574..77c8027974 100644 --- a/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-mvc/pom.xml +++ b/spring-boot-modules/spring-boot-mvc-jersey/spring-boot-mvc/pom.xml @@ -1,25 +1,24 @@ - + 4.0.0 + com.baeldung.boot + spring-boot-mvc + 0.0.1-SNAPSHOT org.springframework.boot spring-boot-starter-parent 2.4.2 - + - com.baeldung.boot - spring-boot-mvc - 0.0.1-SNAPSHOT - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -35,4 +34,5 @@ - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-mvc/pom.xml b/spring-boot-modules/spring-boot-mvc/pom.xml index 560ea1cffa..fdaedb51df 100644 --- a/spring-boot-modules/spring-boot-mvc/pom.xml +++ b/spring-boot-modules/spring-boot-mvc/pom.xml @@ -3,6 +3,10 @@ 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-mvc + jar + spring-boot-mvc + Module For Spring Boot MVC com.baeldung.spring-boot-modules @@ -11,14 +15,7 @@ ../ - spring-boot-mvc - jar - - spring-boot-mvc - Module For Spring Boot MVC - - org.springframework.boot spring-boot-starter-web @@ -44,39 +41,33 @@ org.springframework.boot spring-boot-starter-data-rest - mysql mysql-connector-java - org.hsqldb hsqldb runtime - org.glassfish javax.faces ${javax.faces.version} - org.springframework.boot spring-boot-starter-test test - com.rometools rome ${rome.version} - org.hibernate.validator @@ -90,14 +81,12 @@ org.springframework.boot spring-boot-starter-validation - io.springfox springfox-boot-starter ${spring.fox.version} - org.aspectj @@ -109,7 +98,6 @@ aspectjweaver ${aspectjweaver.version} - @@ -133,4 +121,4 @@ com.baeldung.springbootmvc.SpringBootMvcApplication - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-nashorn/pom.xml b/spring-boot-modules/spring-boot-nashorn/pom.xml index ca0b726a47..debde50595 100644 --- a/spring-boot-modules/spring-boot-nashorn/pom.xml +++ b/spring-boot-modules/spring-boot-nashorn/pom.xml @@ -1,8 +1,13 @@ + 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.nashorn + spring-boot-nashorn + 1.0 + jar + spring-boot-nashorn com.baeldung.spring-boot-modules @@ -11,13 +16,6 @@ ../ - com.baeldung.nashorn - spring-boot-nashorn - 1.0 - jar - - spring-boot-nashorn - org.springframework.boot @@ -50,5 +48,5 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-parent/pom.xml b/spring-boot-modules/spring-boot-parent/pom.xml index ebd3cd5d36..365a3a2639 100644 --- a/spring-boot-modules/spring-boot-parent/pom.xml +++ b/spring-boot-modules/spring-boot-parent/pom.xml @@ -1,8 +1,13 @@ + 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-parent + 1.0.0-SNAPSHOT + pom + spring-boot-parent + spring-boot-parent com.baeldung.spring-boot-modules @@ -11,15 +16,9 @@ ../ - spring-boot-parent - 1.0.0-SNAPSHOT - pom - - spring-boot-parent - spring-boot-parent - spring-boot-with-starter-parent spring-boot-with-custom-parent - + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/pom.xml b/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/pom.xml index 63d6078eca..a61a5fd057 100644 --- a/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/pom.xml +++ b/spring-boot-modules/spring-boot-parent/spring-boot-with-custom-parent/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 + spring-boot-with-custom-parent + 1.0.0-SNAPSHOT + spring-boot-with-custom-parent com.baeldung.spring-boot-modules @@ -11,11 +14,6 @@ ../ - spring-boot-with-custom-parent - 1.0.0-SNAPSHOT - - spring-boot-with-custom-parent - org.springframework.boot @@ -23,4 +21,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml b/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml index 4274f63aa3..184becb657 100644 --- a/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml +++ b/spring-boot-modules/spring-boot-parent/spring-boot-with-starter-parent/pom.xml @@ -1,8 +1,12 @@ + 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-boot-with-starter-parent + 1.0.0-SNAPSHOT + spring-boot-with-starter-parent com.baeldung.spring-boot-modules @@ -11,12 +15,6 @@ ../ - com.baeldung - spring-boot-with-starter-parent - 1.0.0-SNAPSHOT - - spring-boot-with-starter-parent - @@ -41,4 +39,4 @@ 2.2.5.RELEASE - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-performance/pom.xml b/spring-boot-modules/spring-boot-performance/pom.xml index 053f68eea3..02cef986d0 100644 --- a/spring-boot-modules/spring-boot-performance/pom.xml +++ b/spring-boot-modules/spring-boot-performance/pom.xml @@ -1,7 +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 + spring-boot-performance + war + spring-boot-performance + This is a simple Spring Boot application taking advantage of the latest Spring Boot improvements/features. Current version: 2.2 com.baeldung.spring-boot-modules @@ -10,23 +14,15 @@ ../ - spring-boot-performance - war - - spring-boot-performance - This is a simple Spring Boot application taking advantage of the latest Spring Boot improvements/features. Current version: 2.2 - org.springframework.boot spring-boot-starter - org.springframework.boot spring-boot-starter-web - de.codecentric chaos-monkey-spring-boot @@ -42,7 +38,6 @@ true - org.apache.maven.plugins @@ -56,4 +51,4 @@ com.baeldung.lazyinitialization.Application 2.0.0 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-properties-2/pom.xml b/spring-boot-modules/spring-boot-properties-2/pom.xml index e777b8f318..62f23da450 100644 --- a/spring-boot-modules/spring-boot-properties-2/pom.xml +++ b/spring-boot-modules/spring-boot-properties-2/pom.xml @@ -1,7 +1,13 @@ - + 4.0.0 + spring-boot-properties-2 + jar + 0.0.1-SNAPSHOT + spring-boot-properties-2 + Spring Boot Properties Module com.baeldung.spring-boot-modules @@ -10,13 +16,6 @@ ../ - spring-boot-properties-2 - jar - 0.0.1-SNAPSHOT - - spring-boot-properties-2 - Spring Boot Properties Module - org.springframework.boot @@ -28,4 +27,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-properties-3/pom.xml b/spring-boot-modules/spring-boot-properties-3/pom.xml index 33799b557d..400229a662 100644 --- a/spring-boot-modules/spring-boot-properties-3/pom.xml +++ b/spring-boot-modules/spring-boot-properties-3/pom.xml @@ -1,7 +1,13 @@ - + 4.0.0 + spring-boot-properties-3 + 0.0.1-SNAPSHOT + spring-boot-properties-3 + Spring Boot Properties Module + com.baeldung.spring-boot-modules spring-boot-modules @@ -9,11 +15,6 @@ ../ - spring-boot-properties-3 - 0.0.1-SNAPSHOT - spring-boot-properties-3 - Spring Boot Properties Module - org.springframework.boot @@ -39,4 +40,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml index 10570bb738..0f048ffa14 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml +++ b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml @@ -15,6 +15,7 @@ spring: username: SA bael: property: stagingValue + stagingProperty: stagingPropertyValue --- application: servers: diff --git a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/StagingMultidocumentFilesIntegrationTest.java b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/StagingMultidocumentFilesIntegrationTest.java index e02d1de272..851d5e0432 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/StagingMultidocumentFilesIntegrationTest.java +++ b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/multidocument/StagingMultidocumentFilesIntegrationTest.java @@ -17,14 +17,18 @@ public class StagingMultidocumentFilesIntegrationTest { @Value("${bael.property}") private String baelCustomProperty; - + + @Value("${bael.stagingProperty}") + private String baelStagingProperty; + @Value("${bael.root-level-property}") private String baelRootProperty; @Test - @Disabled("Fix and update https://www.baeldung.com/spring-boot-yaml-vs-properties article") public void givenProductionProfileActive_whenApplicationStarts_thenDefaultPropertiesUser() { - assertThat(baelCustomProperty).isEqualTo("stagingValue"); + assertThat(baelStagingProperty).isEqualTo("stagingPropertyValue"); + // application.properties is loaded after the application.yml file and overrides the values + assertThat(baelCustomProperty).isEqualTo("defaultValue"); assertThat(baelRootProperty).isEqualTo("defaultRootLevelValue"); } } diff --git a/spring-boot-modules/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml index 0a7d8a8cbf..adeb41e976 100644 --- a/spring-boot-modules/spring-boot-properties/pom.xml +++ b/spring-boot-modules/spring-boot-properties/pom.xml @@ -3,6 +3,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 + spring-boot-properties + jar + 0.0.1-SNAPSHOT + spring-boot-properties + Spring Boot Properties Module com.baeldung.spring-boot-modules @@ -11,13 +16,6 @@ ../ - spring-boot-properties - jar - 0.0.1-SNAPSHOT - - spring-boot-properties - Spring Boot Properties Module - commons-configuration @@ -76,7 +74,6 @@ true - org.apache.maven.plugins @@ -142,4 +139,4 @@ com.baeldung.yaml.MyApplication - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-property-exp/pom.xml b/spring-boot-modules/spring-boot-property-exp/pom.xml index 2da25fca31..0d55a531c0 100644 --- a/spring-boot-modules/spring-boot-property-exp/pom.xml +++ b/spring-boot-modules/spring-boot-property-exp/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 spring-boot-property-exp spring-boot-property-exp @@ -18,4 +19,4 @@ property-exp-custom-config - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/pom.xml b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/pom.xml index 07aeca9ad2..08fd911e6a 100644 --- a/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/pom.xml +++ b/spring-boot-modules/spring-boot-property-exp/property-exp-custom-config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 property-exp-custom-config 0.0.1-SNAPSHOT @@ -81,4 +82,4 @@ 2.7 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/pom.xml b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/pom.xml index 79e194a3b5..496004b0e2 100644 --- a/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/pom.xml +++ b/spring-boot-modules/spring-boot-property-exp/property-exp-default-config/pom.xml @@ -1,6 +1,7 @@ - + 4.0.0 property-exp-default-config 0.0.1-SNAPSHOT @@ -37,4 +38,4 @@ Custom Property Value - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-react/README.md b/spring-boot-modules/spring-boot-react/README.md index 7d843af9ea..439e9368be 100644 --- a/spring-boot-modules/spring-boot-react/README.md +++ b/spring-boot-modules/spring-boot-react/README.md @@ -1 +1,3 @@ ### Relevant Articles: + +- [CRUD Application With React and Spring Boot](https://www.baeldung.com/spring-boot-react-crud) diff --git a/spring-boot-modules/spring-boot-react/pom.xml b/spring-boot-modules/spring-boot-react/pom.xml index 157ec65b35..f1e10ae12d 100644 --- a/spring-boot-modules/spring-boot-react/pom.xml +++ b/spring-boot-modules/spring-boot-react/pom.xml @@ -1,7 +1,9 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-boot-react spring-boot-modules @@ -9,44 +11,28 @@ 1.0.0-SNAPSHOT - 4.0.0 - - spring-boot-react - - - 11 - 11 - 1.6 - v10.14.2 - v1.12.1 - - org.springframework.boot spring-boot-starter-web 2.4.4 - org.springframework.boot spring-boot-starter-data-jpa 2.4.4 - com.h2database h2 1.4.200 runtime - com.github.javafaker javafaker 1.0.2 - org.springframework.boot spring-boot-starter-test @@ -128,13 +114,19 @@ - org.springframework.boot spring-boot-maven-plugin - + + 11 + 11 + 1.6 + v10.14.2 + v1.12.1 + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-runtime-2/pom.xml b/spring-boot-modules/spring-boot-runtime-2/pom.xml index 8f6351165a..2c97f63746 100644 --- a/spring-boot-modules/spring-boot-runtime-2/pom.xml +++ b/spring-boot-modules/spring-boot-runtime-2/pom.xml @@ -1,7 +1,12 @@ - 4.0.0 + spring-boot-runtime-2 + jar + spring-boot-runtime-2 + Demo project for Spring Boot com.baeldung.spring-boot-modules @@ -10,19 +15,11 @@ ../ - spring-boot-runtime-2 - jar - - spring-boot-runtime-2 - Demo project for Spring Boot - - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test @@ -63,4 +60,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-runtime/pom.xml b/spring-boot-modules/spring-boot-runtime/pom.xml index 54bae61520..92b1458cf6 100644 --- a/spring-boot-modules/spring-boot-runtime/pom.xml +++ b/spring-boot-modules/spring-boot-runtime/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-runtime + jar + spring-boot-runtime + Demo project for Spring Boot Runtime com.baeldung.spring-boot-modules @@ -10,103 +15,81 @@ ../ - spring-boot-runtime - jar - - spring-boot-runtime - Demo project for Spring Boot Runtime - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-validation - 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 - org.springframework.boot spring-boot-starter-security - org.springframework.cloud spring-cloud-starter ${springcloud.version} - org.springframework.boot spring-boot-starter-test test - commons-io commons-io ${commons-io.version} - org.springframework.security spring-security-test - 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 ${httpclient.version} - @@ -117,4 +100,4 @@ 4.5.8 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-security/pom.xml b/spring-boot-modules/spring-boot-security/pom.xml index 3f8d2ff73f..11e5a38eeb 100644 --- a/spring-boot-modules/spring-boot-security/pom.xml +++ b/spring-boot-modules/spring-boot-security/pom.xml @@ -1,7 +1,12 @@ - + 4.0.0 + spring-boot-security + jar + spring-boot-security + Spring Boot Security Auto-Configuration com.baeldung.spring-boot-modules @@ -10,12 +15,6 @@ ../ - spring-boot-security - jar - - spring-boot-security - Spring Boot Security Auto-Configuration - org.springframework.boot @@ -40,13 +39,11 @@ org.springframework.boot spring-boot-starter-web - org.springframework.security spring-security-taglibs - org.apache.tomcat.embed @@ -57,7 +54,6 @@ javax.servlet jstl - org.springframework.boot spring-boot-starter-test @@ -89,4 +85,4 @@ 2.2.2.RELEASE - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-springdoc/pom.xml b/spring-boot-modules/spring-boot-springdoc/pom.xml index 8442504fed..892fbfe4ca 100644 --- a/spring-boot-modules/spring-boot-springdoc/pom.xml +++ b/spring-boot-modules/spring-boot-springdoc/pom.xml @@ -1,9 +1,13 @@ - 4.0.0 + spring-boot-springdoc + 0.0.1-SNAPSHOT + jar + spring-boot-springdoc + Project for Springdoc integration com.baeldung.spring-boot-modules @@ -12,13 +16,6 @@ ../ - spring-boot-springdoc - 0.0.1-SNAPSHOT - jar - - spring-boot-springdoc - Project for Springdoc integration - org.springframework.boot @@ -36,19 +33,16 @@ com.h2database h2 - org.springframework.boot spring-boot-starter-test test - - + org.hibernate hibernate-core ${hibernate.version} - org.springdoc @@ -59,10 +53,9 @@ org.springdoc springdoc-openapi-data-rest ${springdoc.version} - - - - + + + org.springframework.restdocs spring-restdocs-mockmvc test @@ -71,8 +64,7 @@ org.springframework.restdocs spring-restdocs-restassured test - - + org.springdoc @@ -119,8 +111,8 @@ - - + + kotlin-maven-plugin org.jetbrains.kotlin ${kotlin.version} @@ -162,20 +154,12 @@ application.properties data.sql - schema.sql + schema.sql - - 5.2.10.Final - 1.5.2 - 1.5.6 - 1.4.0 - ${project.build.directory}/generated-snippets - - integration @@ -223,4 +207,12 @@ + + 5.2.10.Final + 1.5.2 + 1.5.6 + 1.4.0 + ${project.build.directory}/generated-snippets + + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-swagger-jwt/pom.xml b/spring-boot-modules/spring-boot-swagger-jwt/pom.xml index 6ee7db2ac9..c296b06388 100644 --- a/spring-boot-modules/spring-boot-swagger-jwt/pom.xml +++ b/spring-boot-modules/spring-boot-swagger-jwt/pom.xml @@ -3,6 +3,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 + spring-boot-swagger-jwt + 0.1.0-SNAPSHOT + spring-boot-swagger-jwt + jar + Module For Spring Boot Swagger UI com.baeldung.spring-boot-modules @@ -10,13 +15,7 @@ 1.0.0-SNAPSHOT ../ - - spring-boot-swagger-jwt - 0.1.0-SNAPSHOT - spring-boot-swagger-jwt - jar - - Module For Spring Boot Swagger UI + org.springframework.boot @@ -42,4 +41,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-swagger/pom.xml b/spring-boot-modules/spring-boot-swagger/pom.xml index 2d80cae4d5..a9d8a943e4 100644 --- a/spring-boot-modules/spring-boot-swagger/pom.xml +++ b/spring-boot-modules/spring-boot-swagger/pom.xml @@ -3,6 +3,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 + spring-boot-swagger + 0.1.0-SNAPSHOT + spring-boot-swagger + jar + Module For Spring Boot Swagger com.baeldung.spring-boot-modules @@ -10,13 +15,7 @@ 1.0.0-SNAPSHOT ../ - - spring-boot-swagger - 0.1.0-SNAPSHOT - spring-boot-swagger - jar - - Module For Spring Boot Swagger + org.springframework.boot @@ -42,4 +41,4 @@ 3.0.0 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-testing/README.md b/spring-boot-modules/spring-boot-testing/README.md index 1b7ad661c6..058c78c9bb 100644 --- a/spring-boot-modules/spring-boot-testing/README.md +++ b/spring-boot-modules/spring-boot-testing/README.md @@ -15,3 +15,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Testing Spring Boot @ConfigurationProperties](https://www.baeldung.com/spring-boot-testing-configurationproperties) - [Prevent ApplicationRunner or CommandLineRunner Beans From Executing During Junit Testing](https://www.baeldung.com/spring-junit-prevent-runner-beans-testing-execution) - [Testing in Spring Boot](https://www.baeldung.com/spring-boot-testing) +- [Fixing the NoSuchMethodError JUnit Error](https://www.baeldung.com/junit-nosuchmethoderror) diff --git a/spring-boot-modules/spring-boot-testing/pom.xml b/spring-boot-modules/spring-boot-testing/pom.xml index 50a1ace2fa..1860818b7b 100644 --- a/spring-boot-modules/spring-boot-testing/pom.xml +++ b/spring-boot-modules/spring-boot-testing/pom.xml @@ -1,8 +1,12 @@ + 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-testing + war + spring-boot-testing + This is simple boot application for demonstrating testing features. com.baeldung.spring-boot-modules @@ -11,12 +15,6 @@ ../ - spring-boot-testing - war - - spring-boot-testing - This is simple boot application for demonstrating testing features. - org.springframework.boot @@ -62,7 +60,6 @@ - it.ozimov @@ -77,20 +74,17 @@ ${spock.version} test - org.spockframework spock-spring ${spock.version} test - io.rest-assured rest-assured test - @@ -101,14 +95,11 @@ true - - org.apache.maven.plugins maven-war-plugin - pl.project13.maven git-commit-id-plugin @@ -134,7 +125,6 @@ ${project.build.outputDirectory}/git.properties - org.codehaus.gmavenplus gmavenplus-plugin @@ -159,4 +149,4 @@ 0.7.2 - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-vue/pom.xml b/spring-boot-modules/spring-boot-vue/pom.xml index 9973246115..3d3d51797c 100644 --- a/spring-boot-modules/spring-boot-vue/pom.xml +++ b/spring-boot-modules/spring-boot-vue/pom.xml @@ -1,7 +1,13 @@ - + 4.0.0 + spring-boot-vue + 0.0.1-SNAPSHOT + jar + spring-boot-vue + Demo project for Spring Boot Vue project com.baeldung.spring-boot-modules @@ -10,25 +16,16 @@ ../ - spring-boot-vue - 0.0.1-SNAPSHOT - jar - - spring-boot-vue - Demo project for Spring Boot Vue project - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-test test - org.springframework.boot @@ -45,4 +42,4 @@ - + \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-xml/pom.xml b/spring-boot-modules/spring-boot-xml/pom.xml index e1ddd8f437..b3fd343e4f 100644 --- a/spring-boot-modules/spring-boot-xml/pom.xml +++ b/spring-boot-modules/spring-boot-xml/pom.xml @@ -1,7 +1,10 @@ + 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-xml + parent-boot-2 com.baeldung @@ -9,10 +12,6 @@ ../../parent-boot-2 - 4.0.0 - - spring-boot-xml - org.springframework.boot diff --git a/spring-boot-modules/spring-boot/pom.xml b/spring-boot-modules/spring-boot/pom.xml index 9023ae92f3..8df16a1f9c 100644 --- a/spring-boot-modules/spring-boot/pom.xml +++ b/spring-boot-modules/spring-boot/pom.xml @@ -3,6 +3,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 + spring-boot + 0.0.1-SNAPSHOT + war + spring-boot + This is simple boot application for Spring boot actuator test com.baeldung.spring-boot-modules @@ -11,13 +16,6 @@ ../ - spring-boot - 0.0.1-SNAPSHOT - war - - spring-boot - This is simple boot application for Spring boot actuator test - org.springframework.boot @@ -47,12 +45,10 @@ org.springframework.boot spring-boot-starter-actuator - org.springframework.boot spring-boot-starter-tomcat - org.springframework.boot spring-boot-starter-test @@ -69,17 +65,14 @@ - io.dropwizard.metrics metrics-core - com.h2database h2 - org.springframework.boot spring-boot-starter @@ -89,25 +82,21 @@ json-path test - com.google.guava guava ${guava.version} - org.apache.tomcat tomcat-servlet-api ${tomee-servlet-api.version} provided - org.apache.activemq artemis-server - com.rometools rome @@ -123,14 +112,11 @@ true - - org.apache.maven.plugins maven-war-plugin - org.apache.maven.plugins maven-resources-plugin @@ -142,7 +128,6 @@ - @@ -191,4 +176,4 @@ @ - + \ No newline at end of file diff --git a/spring-caching-2/README.md b/spring-caching-2/README.md new file mode 100644 index 0000000000..1375b5e8e4 --- /dev/null +++ b/spring-caching-2/README.md @@ -0,0 +1,3 @@ +### Relevant articles: + +- [Spring Boot Cache with Redis](https://www.baeldung.com/spring-boot-redis-cache) diff --git a/spring-caching-2/pom.xml b/spring-caching-2/pom.xml new file mode 100644 index 0000000000..6bb828e8bf --- /dev/null +++ b/spring-caching-2/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + spring-caching-2 + 0.1-SNAPSHOT + spring-caching-2 + war + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + 0.7.3 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.data + spring-data-commons + + + com.h2database + h2 + runtime + + + org.projectlombok + lombok + + + org.springframework.boot + spring-boot-starter-cache + + + org.springframework.boot + spring-boot-starter-data-redis + + + + it.ozimov + embedded-redis + ${embedded.redis.version} + + + org.slf4j + slf4j-simple + + + test + + + diff --git a/spring-caching-2/src/main/java/com/baeldung/caching/redis/CacheConfig.java b/spring-caching-2/src/main/java/com/baeldung/caching/redis/CacheConfig.java new file mode 100644 index 0000000000..89bdc2779d --- /dev/null +++ b/spring-caching-2/src/main/java/com/baeldung/caching/redis/CacheConfig.java @@ -0,0 +1,33 @@ +package com.baeldung.caching.redis; + +import org.springframework.boot.autoconfigure.cache.RedisCacheManagerBuilderCustomizer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; + +import java.time.Duration; + +import static org.springframework.data.redis.serializer.RedisSerializationContext.SerializationPair; + +@Configuration +public class CacheConfig { + + @Bean + public RedisCacheManagerBuilderCustomizer redisCacheManagerBuilderCustomizer() { + return (builder) -> builder + .withCacheConfiguration("itemCache", + RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMinutes(10))) + .withCacheConfiguration("customerCache", + RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofMinutes(5))); + } + + @Bean + public RedisCacheConfiguration cacheConfiguration() { + return RedisCacheConfiguration.defaultCacheConfig() + .entryTtl(Duration.ofMinutes(60)) + .disableCachingNullValues() + .serializeValuesWith(SerializationPair.fromSerializer(new GenericJackson2JsonRedisSerializer())); + } + +} diff --git a/spring-caching-2/src/main/java/com/baeldung/caching/redis/Item.java b/spring-caching-2/src/main/java/com/baeldung/caching/redis/Item.java new file mode 100644 index 0000000000..d6115a4833 --- /dev/null +++ b/spring-caching-2/src/main/java/com/baeldung/caching/redis/Item.java @@ -0,0 +1,21 @@ +package com.baeldung.caching.redis; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.persistence.Entity; +import javax.persistence.Id; +import java.io.Serializable; + +@Data +@Entity +@AllArgsConstructor +@NoArgsConstructor +public class Item implements Serializable { + + @Id + String id; + + String description; +} diff --git a/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemController.java b/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemController.java new file mode 100644 index 0000000000..63122c5938 --- /dev/null +++ b/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemController.java @@ -0,0 +1,19 @@ +package com.baeldung.caching.redis; + +import lombok.AllArgsConstructor; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@AllArgsConstructor +public class ItemController { + + private final ItemService itemService; + + @GetMapping("/item/{id}") + public Item getItemById(@PathVariable String id) { + return itemService.getItemForId(id); + } + +} diff --git a/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemRepository.java b/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemRepository.java new file mode 100644 index 0000000000..d6222de621 --- /dev/null +++ b/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemRepository.java @@ -0,0 +1,6 @@ +package com.baeldung.caching.redis; + +import org.springframework.data.repository.CrudRepository; + +public interface ItemRepository extends CrudRepository { +} diff --git a/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemService.java b/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemService.java new file mode 100644 index 0000000000..6a59c7d74e --- /dev/null +++ b/spring-caching-2/src/main/java/com/baeldung/caching/redis/ItemService.java @@ -0,0 +1,19 @@ +package com.baeldung.caching.redis; + +import lombok.AllArgsConstructor; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +public class ItemService { + + private final ItemRepository itemRepository; + + @Cacheable(value = "itemCache") + public Item getItemForId(String id) { + return itemRepository.findById(id) + .orElseThrow(RuntimeException::new); + } + +} diff --git a/spring-caching-2/src/main/java/com/baeldung/caching/redis/RedisCacheApplication.java b/spring-caching-2/src/main/java/com/baeldung/caching/redis/RedisCacheApplication.java new file mode 100644 index 0000000000..3b337def01 --- /dev/null +++ b/spring-caching-2/src/main/java/com/baeldung/caching/redis/RedisCacheApplication.java @@ -0,0 +1,14 @@ +package com.baeldung.caching.redis; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; + +@SpringBootApplication +@EnableCaching +public class RedisCacheApplication { + + public static void main(String[] args) { + SpringApplication.run(RedisCacheApplication.class, args); + } +} diff --git a/spring-caching-2/src/main/resources/application.properties b/spring-caching-2/src/main/resources/application.properties new file mode 100644 index 0000000000..080185b620 --- /dev/null +++ b/spring-caching-2/src/main/resources/application.properties @@ -0,0 +1,12 @@ +spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_ON_EXIT=FALSE +spring.datasource.driverClassName=org.h2.Driver +spring.datasource.username=sa +spring.datasource.password= + +# Enabling H2 Console +spring.h2.console.enabled=true +spring.h2.console.path=/h2 + +# Connection details +#spring.redis.host=localhost +#spring.redis.port=6379 diff --git a/spring-caching-2/src/main/resources/data.sql b/spring-caching-2/src/main/resources/data.sql new file mode 100644 index 0000000000..74e359b877 --- /dev/null +++ b/spring-caching-2/src/main/resources/data.sql @@ -0,0 +1 @@ +INSERT INTO ITEM VALUES('abc','ITEM1'); \ No newline at end of file diff --git a/spring-caching-2/src/test/java/com/baeldung/caching/redis/ItemServiceCachingIntegrationTest.java b/spring-caching-2/src/test/java/com/baeldung/caching/redis/ItemServiceCachingIntegrationTest.java new file mode 100644 index 0000000000..71a9729efd --- /dev/null +++ b/spring-caching-2/src/test/java/com/baeldung/caching/redis/ItemServiceCachingIntegrationTest.java @@ -0,0 +1,84 @@ +package com.baeldung.caching.redis; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration; +import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; +import org.springframework.boot.test.context.TestConfiguration; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Import; +import org.springframework.test.context.junit.jupiter.SpringExtension; +import redis.embedded.RedisServer; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +@Import({ CacheConfig.class, ItemService.class }) +@ExtendWith(SpringExtension.class) +@ImportAutoConfiguration(classes = { CacheAutoConfiguration.class, RedisAutoConfiguration.class }) +@EnableCaching +class ItemServiceCachingIntegrationTest { + + private static final String AN_ID = "id-1"; + private static final String A_DESCRIPTION = "an item"; + + @MockBean + private ItemRepository mockItemRepository; + + @Autowired + private ItemService itemService; + + @Autowired + private CacheManager cacheManager; + + @Test + void givenRedisCaching_whenFindItemById_thenItemReturnedFromCache() { + Item anItem = new Item(AN_ID, A_DESCRIPTION); + given(mockItemRepository.findById(AN_ID)) + .willReturn(Optional.of(anItem)); + + Item itemCacheMiss = itemService.getItemForId(AN_ID); + Item itemCacheHit = itemService.getItemForId(AN_ID); + + assertThat(itemCacheMiss).isEqualTo(anItem); + assertThat(itemCacheHit).isEqualTo(anItem); + + verify(mockItemRepository, times(1)).findById(AN_ID); + assertThat(itemFromCache()).isEqualTo(anItem); + } + + private Object itemFromCache() { + return cacheManager.getCache("itemCache").get(AN_ID).get(); + } + + @TestConfiguration + static class EmbeddedRedisConfiguration { + + private final RedisServer redisServer; + + public EmbeddedRedisConfiguration() { + this.redisServer = new RedisServer(); + } + + @PostConstruct + public void startRedis() { + redisServer.start(); + } + + @PreDestroy + public void stopRedis() { + this.redisServer.stop(); + } + } + +} diff --git a/spring-caching-2/src/test/resources/logback-test.xml b/spring-caching-2/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..215403c6a5 --- /dev/null +++ b/spring-caching-2/src/test/resources/logback-test.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/spring-security-modules/spring-security-web-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java b/spring-security-modules/spring-security-web-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java index adf385140f..23ec605a36 100644 --- a/spring-security-modules/spring-security-web-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java +++ b/spring-security-modules/spring-security-web-boot-1/src/test/java/com/baeldung/roles/web/CustomUserDetailsServiceIntegrationTest.java @@ -9,7 +9,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. import org.apache.http.HttpHeaders; import com.baeldung.roles.custom.Application; import com.baeldung.roles.custom.persistence.model.Foo; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-web-modules/spring-rest-http-2/README.md b/spring-web-modules/spring-rest-http-2/README.md index b5358f888f..74e55c7c40 100644 --- a/spring-web-modules/spring-rest-http-2/README.md +++ b/spring-web-modules/spring-rest-http-2/README.md @@ -9,3 +9,4 @@ The "REST With Spring 2" Classes: http://bit.ly/restwithspring - [How to Turn Off Swagger-ui in Production](https://www.baeldung.com/swagger-ui-turn-off-in-production) - [Setting a Request Timeout for a Spring REST API](https://www.baeldung.com/spring-rest-timeout) +- [Long Polling in Spring MVC](https://www.baeldung.com/spring-mvc-long-polling) diff --git a/spring-web-modules/spring-resttemplate-3/src/test/java/com/baeldung/largefile/LargeFileDownloadIntegrationTest.java b/spring-web-modules/spring-resttemplate-3/src/test/java/com/baeldung/largefile/LargeFileDownloadIntegrationTest.java index d8fc58319f..687203d21a 100644 --- a/spring-web-modules/spring-resttemplate-3/src/test/java/com/baeldung/largefile/LargeFileDownloadIntegrationTest.java +++ b/spring-web-modules/spring-resttemplate-3/src/test/java/com/baeldung/largefile/LargeFileDownloadIntegrationTest.java @@ -14,7 +14,7 @@ import org.springframework.web.client.RestTemplate; public class LargeFileDownloadIntegrationTest { - static String FILE_URL = "http://ovh.net/files/1Mio.dat"; + static String FILE_URL = "https://s3.amazonaws.com/baeldung.com/Do+JSON+with+Jackson+by+Baeldung.pdf"; RestTemplate restTemplate; diff --git a/testing-modules/cucumber/README.md b/testing-modules/cucumber/README.md new file mode 100644 index 0000000000..f9adf759c7 --- /dev/null +++ b/testing-modules/cucumber/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Using Cucumber Tags with JUnit 5](https://www.baeldung.com/junit-cucumber-tags)