From eaadcf96e2b0d2ff4a518d85a7ae78848cf77a4a Mon Sep 17 00:00:00 2001 From: Krzysztof Majewski Date: Mon, 22 Oct 2018 16:36:27 +0200 Subject: [PATCH 01/73] BAEL-2292 --- .../com/baeldung/datetime/DateTimeConfig.java | 29 +++++++++++++++++++ .../baeldung/datetime/DateTimeController.java | 29 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java create mode 100644 spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java diff --git a/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java new file mode 100644 index 0000000000..8a5d1c71af --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeConfig.java @@ -0,0 +1,29 @@ +package com.baeldung.datetime; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; +import org.springframework.format.number.NumberFormatAnnotationFormatterFactory; +import org.springframework.format.support.DefaultFormattingConversionService; +import org.springframework.format.support.FormattingConversionService; + +import java.time.format.DateTimeFormatter; + +@Configuration +class DateTimeConfig { + + @Bean + public FormattingConversionService conversionService() { + DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(false); + + conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory()); + + DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar(); + registrar.setDateFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy")); + registrar.setDateTimeFormatter(DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm:ss")); + registrar.registerFormatters(conversionService); + + return conversionService; + } + +} \ No newline at end of file diff --git a/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java new file mode 100644 index 0000000000..5741b35530 --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/datetime/DateTimeController.java @@ -0,0 +1,29 @@ +package com.baeldung.datetime; + +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.Date; + +@RestController +public class DateTimeController { + + @PostMapping("/date") + public void date(@RequestParam("date") @DateTimeFormat(pattern = "dd.MM.yyyy") Date date) { + // ... + } + + @PostMapping("/localdate") + public void localDate(@RequestParam("localDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate localDate) { + // ... + } + + @PostMapping("/localdatetime") + public void dateTime(@RequestParam("localDateTime") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime localDateTime) { + // ... + } +} \ No newline at end of file From a79f802038e3be1b59abef89b97a98d2644ee4a0 Mon Sep 17 00:00:00 2001 From: saikat Date: Sun, 28 Oct 2018 23:47:00 +0530 Subject: [PATCH 02/73] Add new module for restx-demo --- pom.xml | 1 + restx-demo/data/credentials.json | 12 ++ restx-demo/data/users.json | 4 + restx-demo/md.restx.json | 38 +++++ restx-demo/pom.xml | 156 ++++++++++++++++++ .../src/main/java/restx/demo/AppModule.java | 74 +++++++++ .../src/main/java/restx/demo/AppServer.java | 32 ++++ .../src/main/java/restx/demo/Roles.java | 10 ++ .../main/java/restx/demo/domain/Message.java | 21 +++ .../java/restx/demo/rest/HelloResource.java | 62 +++++++ restx-demo/src/main/resources/logback.xml | 94 +++++++++++ .../resources/restx/demo/settings.properties | 1 + restx-demo/src/main/webapp/WEB-INF/web.xml | 15 ++ .../demo/rest/HelloResourceSpecTest.java | 23 +++ .../hello/should_admin_say_hello.spec.yaml | 10 ++ .../hello/should_anyone_say_hello.spec.yaml | 8 + ..._value_triggers_validation_error.spec.yaml | 17 ++ .../hello/should_user1_say_hello.spec.yaml | 10 ++ .../should_user2_not_say_hello.spec.yaml | 10 ++ 19 files changed, 598 insertions(+) create mode 100644 restx-demo/data/credentials.json create mode 100644 restx-demo/data/users.json create mode 100644 restx-demo/md.restx.json create mode 100644 restx-demo/pom.xml create mode 100644 restx-demo/src/main/java/restx/demo/AppModule.java create mode 100644 restx-demo/src/main/java/restx/demo/AppServer.java create mode 100644 restx-demo/src/main/java/restx/demo/Roles.java create mode 100644 restx-demo/src/main/java/restx/demo/domain/Message.java create mode 100644 restx-demo/src/main/java/restx/demo/rest/HelloResource.java create mode 100644 restx-demo/src/main/resources/logback.xml create mode 100644 restx-demo/src/main/resources/restx/demo/settings.properties create mode 100644 restx-demo/src/main/webapp/WEB-INF/web.xml create mode 100644 restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java create mode 100644 restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml create mode 100644 restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml diff --git a/pom.xml b/pom.xml index 0b5cd16ea0..10e23da0ad 100644 --- a/pom.xml +++ b/pom.xml @@ -1608,6 +1608,7 @@ persistence-modules/spring-data-elasticsearch core-java-concurrency core-java-concurrency-collections + restx-demo diff --git a/restx-demo/data/credentials.json b/restx-demo/data/credentials.json new file mode 100644 index 0000000000..c1a4fcf531 --- /dev/null +++ b/restx-demo/data/credentials.json @@ -0,0 +1,12 @@ +{ + "//": "lines with // keys are just comments (we don't have real comments in json)", + "//": "this file stores password passed through md5+bcrypt hash", + "//": "you can use `restx hash md5+bcrypt {password}` shell command to get hashed passwords to put here", + + "//": "to help startup with restx, there are comments with clear text passwords,", + "//": "which should obviously not be stored here.", + "user1": "$2a$10$iZluFUJShbjb1ue68bLrDuGCeJL9EMLHelVIf8u0SUbCseDOvKnoe", + "//": "user 1 password is 'user1-pwd'", + "user2": "$2a$10$oym3SYMFXf/9gGfDKKHO4eM1vWNqAZMsRZCL.BORCaP4yp5cdiCXu", + "//": "user 2 password is 'user2-pwd'" +} \ No newline at end of file diff --git a/restx-demo/data/users.json b/restx-demo/data/users.json new file mode 100644 index 0000000000..834e03c4b4 --- /dev/null +++ b/restx-demo/data/users.json @@ -0,0 +1,4 @@ +[ + {"name":"user1", "roles": ["hello"]}, + {"name":"user2", "roles": []} +] \ No newline at end of file diff --git a/restx-demo/md.restx.json b/restx-demo/md.restx.json new file mode 100644 index 0000000000..c87244001c --- /dev/null +++ b/restx-demo/md.restx.json @@ -0,0 +1,38 @@ +{ + "module": "restx-demo:restx-demo:0.1-SNAPSHOT", + "packaging": "war", + + "properties": { + "java.version": "1.8", + "restx.version": "0.35-rc4" + }, + "fragments": { + "maven": [ + "classpath:///restx/build/fragments/maven/javadoc-apidoclet.xml" ] + }, + "dependencies": { + "compile": [ + "io.restx:restx-core:${restx.version}", + "io.restx:restx-security-basic:${restx.version}", + "io.restx:restx-core-annotation-processor:${restx.version}", + "io.restx:restx-factory:${restx.version}", + "io.restx:restx-factory-admin:${restx.version}", + "io.restx:restx-validation:${restx.version}", + "io.restx:restx-monitor-codahale:${restx.version}", + "io.restx:restx-monitor-admin:${restx.version}", + "io.restx:restx-log-admin:${restx.version}", + "io.restx:restx-i18n-admin:${restx.version}", + "io.restx:restx-stats-admin:${restx.version}", + "io.restx:restx-servlet:${restx.version}", + "io.restx:restx-server-jetty8:${restx.version}!optional", + "io.restx:restx-apidocs:${restx.version}", + "io.restx:restx-specs-admin:${restx.version}", + "io.restx:restx-admin:${restx.version}", + "ch.qos.logback:logback-classic:1.0.13" + ], + "test": [ + "io.restx:restx-specs-tests:${restx.version}", + "junit:junit:4.11" + ] + } +} diff --git a/restx-demo/pom.xml b/restx-demo/pom.xml new file mode 100644 index 0000000000..da106b8191 --- /dev/null +++ b/restx-demo/pom.xml @@ -0,0 +1,156 @@ + + + 4.0.0 + + restx-demo + restx-demo + 0.1-SNAPSHOT + war + restx-demo + + + 1.8 + 1.8 + 0.35-rc4 + + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + io.restx + restx-core + ${restx.version} + + + io.restx + restx-security-basic + ${restx.version} + + + io.restx + restx-core-annotation-processor + ${restx.version} + + + io.restx + restx-factory + ${restx.version} + + + io.restx + restx-factory-admin + ${restx.version} + + + io.restx + restx-validation + ${restx.version} + + + io.restx + restx-monitor-codahale + ${restx.version} + + + io.restx + restx-monitor-admin + ${restx.version} + + + io.restx + restx-log-admin + ${restx.version} + + + io.restx + restx-i18n-admin + ${restx.version} + + + io.restx + restx-stats-admin + ${restx.version} + + + io.restx + restx-servlet + ${restx.version} + + + io.restx + restx-server-jetty8 + ${restx.version} + true + + + io.restx + restx-apidocs + ${restx.version} + + + io.restx + restx-specs-admin + ${restx.version} + + + io.restx + restx-admin + ${restx.version} + + + ch.qos.logback + logback-classic + 1.0.13 + + + io.restx + restx-specs-tests + ${restx.version} + test + + + junit + junit + 4.11 + test + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-docs + + prepare-package + + jar + + + + + ${maven.compiler.source} + restx.apidocs.doclet.ApidocsDoclet + + io.restx + restx-apidocs-doclet + ${restx.version} + + -restx-target-dir ${project.basedir}/target/classes + + + + + diff --git a/restx-demo/src/main/java/restx/demo/AppModule.java b/restx-demo/src/main/java/restx/demo/AppModule.java new file mode 100644 index 0000000000..26bc681481 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/AppModule.java @@ -0,0 +1,74 @@ +package restx.demo; + +import restx.config.ConfigLoader; +import restx.config.ConfigSupplier; +import restx.factory.Provides; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Charsets; +import com.google.common.collect.ImmutableSet; +import restx.security.*; +import restx.factory.Module; +import restx.factory.Provides; +import javax.inject.Named; + +import java.nio.file.Paths; + +@Module +public class AppModule { + @Provides + public SignatureKey signatureKey() { + return new SignatureKey("restx-demo -447494532235718370 restx-demo 801c9eaf-4116-48f2-906b-e979fba72757".getBytes(Charsets.UTF_8)); + } + + @Provides + @Named("restx.admin.password") + public String restxAdminPassword() { + return "4780"; + } + + @Provides + public ConfigSupplier appConfigSupplier(ConfigLoader configLoader) { + // Load settings.properties in restx.demo package as a set of config entries + return configLoader.fromResource("restx/demo/settings"); + } + + @Provides + public CredentialsStrategy credentialsStrategy() { + return new BCryptCredentialsStrategy(); + } + + @Provides + public BasicPrincipalAuthenticator basicPrincipalAuthenticator( + SecuritySettings securitySettings, CredentialsStrategy credentialsStrategy, + @Named("restx.admin.passwordHash") String defaultAdminPasswordHash, ObjectMapper mapper) { + return new StdBasicPrincipalAuthenticator(new StdUserService<>( + // use file based users repository. + // Developer's note: prefer another storage mechanism for your users if you need real user management + // and better perf + new FileBasedUserRepository<>( + StdUser.class, // this is the class for the User objects, that you can get in your app code + // with RestxSession.current().getPrincipal().get() + // it can be a custom user class, it just need to be json deserializable + mapper, + + // this is the default restx admin, useful to access the restx admin console. + // if one user with restx-admin role is defined in the repository, this default user won't be + // available anymore + new StdUser("admin", ImmutableSet.of("*")), + + // the path where users are stored + Paths.get("data/users.json"), + + // the path where credentials are stored. isolating both is a good practice in terms of security + // it is strongly recommended to follow this approach even if you use your own repository + Paths.get("data/credentials.json"), + + // tells that we want to reload the files dynamically if they are touched. + // this has a performance impact, if you know your users / credentials never change without a + // restart you can disable this to get better perfs + true), + credentialsStrategy, defaultAdminPasswordHash), + securitySettings); + } +} diff --git a/restx-demo/src/main/java/restx/demo/AppServer.java b/restx-demo/src/main/java/restx/demo/AppServer.java new file mode 100644 index 0000000000..d66aadac68 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/AppServer.java @@ -0,0 +1,32 @@ +package restx.demo; + +import com.google.common.base.Optional; +import restx.server.WebServer; +import restx.server.Jetty8WebServer; + +/** + * This class can be used to run the app. + * + * Alternatively, you can deploy the app as a war in a regular container like tomcat or jetty. + * + * Reading the port from system env PORT makes it compatible with heroku. + */ +public class AppServer { + public static final String WEB_INF_LOCATION = "src/main/webapp/WEB-INF/web.xml"; + public static final String WEB_APP_LOCATION = "src/main/webapp"; + + public static void main(String[] args) throws Exception { + int port = Integer.valueOf(Optional.fromNullable(System.getenv("PORT")).or("8080")); + WebServer server = new Jetty8WebServer(WEB_INF_LOCATION, WEB_APP_LOCATION, port, "0.0.0.0"); + + /* + * load mode from system property if defined, or default to dev + * be careful with that setting, if you use this class to launch your server in production, make sure to launch + * it with -Drestx.mode=prod or change the default here + */ + System.setProperty("restx.mode", System.getProperty("restx.mode", "dev")); + System.setProperty("restx.app.package", "restx.demo"); + + server.startAndAwait(); + } +} diff --git a/restx-demo/src/main/java/restx/demo/Roles.java b/restx-demo/src/main/java/restx/demo/Roles.java new file mode 100644 index 0000000000..1240da70d1 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/Roles.java @@ -0,0 +1,10 @@ +package restx.demo; + +/** + * A list of roles for the application. + * + * We don't use an enum here because it must be used inside an annotation. + */ +public final class Roles { + public static final String HELLO_ROLE = "hello"; +} diff --git a/restx-demo/src/main/java/restx/demo/domain/Message.java b/restx-demo/src/main/java/restx/demo/domain/Message.java new file mode 100644 index 0000000000..733c00deff --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/domain/Message.java @@ -0,0 +1,21 @@ +package restx.demo.domain; + +public class Message { + private String message; + + public String getMessage() { + return message; + } + + public Message setMessage(final String message) { + this.message = message; + return this; + } + + @Override + public String toString() { + return "Message{" + + "message='" + message + '\'' + + '}'; + } +} diff --git a/restx-demo/src/main/java/restx/demo/rest/HelloResource.java b/restx-demo/src/main/java/restx/demo/rest/HelloResource.java new file mode 100644 index 0000000000..5cb2c2a5e6 --- /dev/null +++ b/restx-demo/src/main/java/restx/demo/rest/HelloResource.java @@ -0,0 +1,62 @@ +package restx.demo.rest; + +import restx.demo.domain.Message; +import restx.demo.Roles; +import org.joda.time.DateTime; +import restx.annotations.GET; +import restx.annotations.POST; +import restx.annotations.RestxResource; +import restx.factory.Component; +import restx.security.PermitAll; +import restx.security.RolesAllowed; +import restx.security.RestxSession; + +import javax.validation.constraints.NotNull; + +@Component @RestxResource +public class HelloResource { + + /** + * Say hello to currently logged in user. + * + * Authorized only for principals with Roles.HELLO_ROLE role. + * + * @return a Message to say hello + */ + @GET("/message") + @RolesAllowed(Roles.HELLO_ROLE) + public Message sayHello() { + return new Message().setMessage(String.format( + "hello %s, it's %s", + RestxSession.current().getPrincipal().get().getName(), + DateTime.now().toString("HH:mm:ss"))); + } + + /** + * Say hello to anybody. + * + * Does not require authentication. + * + * @return a Message to say hello + */ + @GET("/hello") + @PermitAll + public Message helloPublic(String who) { + return new Message().setMessage(String.format( + "hello %s, it's %s", + who, DateTime.now().toString("HH:mm:ss"))); + } + + public static class MyPOJO { + @NotNull + String value; + public String getValue(){ return value; } + public void setValue(String value){ this.value = value; } + } + @POST("/mypojo") + @PermitAll + public MyPOJO helloPojo(MyPOJO pojo){ + pojo.setValue("hello "+pojo.getValue()); + return pojo; + } +} diff --git a/restx-demo/src/main/resources/logback.xml b/restx-demo/src/main/resources/logback.xml new file mode 100644 index 0000000000..524bca6b1f --- /dev/null +++ b/restx-demo/src/main/resources/logback.xml @@ -0,0 +1,94 @@ + + + true + + + + + ${LOGS_FOLDER}/errors.log + + ERROR + + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + ${LOGS_FOLDER}/errors.%d.log + 30 + + + + + + + + ${LOGS_FOLDER}/app.log + + INFO + + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + ${LOGS_FOLDER}/app.%d.log + 10 + + + + ${LOGS_FOLDER}/debug.log + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + ${LOGS_FOLDER}/debug.%i.log.zip + 1 + 3 + + + + 50MB + + + + + + + + + + + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + + ${LOGS_FOLDER}/app.log + + %d [%-16thread] [%-10X{principal}] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/restx-demo/src/main/resources/restx/demo/settings.properties b/restx-demo/src/main/resources/restx/demo/settings.properties new file mode 100644 index 0000000000..a03c2eea97 --- /dev/null +++ b/restx-demo/src/main/resources/restx/demo/settings.properties @@ -0,0 +1 @@ +app.name=restx-demo \ No newline at end of file diff --git a/restx-demo/src/main/webapp/WEB-INF/web.xml b/restx-demo/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..c651794526 --- /dev/null +++ b/restx-demo/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,15 @@ + + + + restx + restx.servlet.RestxMainRouterServlet + 1 + + + restx + /api/* + + diff --git a/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java b/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java new file mode 100644 index 0000000000..138a22d074 --- /dev/null +++ b/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java @@ -0,0 +1,23 @@ +package restx.demo.rest; + +import restx.demo.AppServer; +import org.junit.runner.RunWith; +import restx.tests.RestxSpecTestsRunner; +import restx.tests.FindSpecsIn; + +@RunWith(RestxSpecTestsRunner.class) +@FindSpecsIn("specs/hello") +public class HelloResourceSpecTest { + + /** + * Useless, thanks to both @RunWith(RestxSpecTestsRunner.class) & @FindSpecsIn() + * + * @Rule + * public RestxSpecRule rule = new RestxSpecRule(); + * + * @Test + * public void test_spec() throws Exception { + * rule.runTest(specTestPath); + * } + */ +} diff --git a/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml new file mode 100644 index 0000000000..1b7b8f0f90 --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml @@ -0,0 +1,10 @@ +title: should admin say hello +given: + - time: 2013-08-28T01:18:00.822+02:00 + - uuids: [ "e2b4430f-9541-4602-9a3a-413d17c56a6b" ] +wts: + - when: | + GET message + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"admin","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + then: | + {"message":"hello admin, it's 01:18:00"} diff --git a/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml new file mode 100644 index 0000000000..29b6faca34 --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml @@ -0,0 +1,8 @@ +title: should admin say hello +given: + - time: 2013-08-28T01:18:00.822+02:00 +wts: + - when: | + GET hello?who=xavier + then: | + {"message":"hello xavier, it's 01:18:00"} diff --git a/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml new file mode 100644 index 0000000000..d0c6323caf --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml @@ -0,0 +1,17 @@ +title: should missing post value triggers a validation error +given: + - time: 2013-08-28T01:18:00.822+02:00 + - uuids: [ "e2b4430f-9541-4602-9a3a-413d17c56a6b" ] +wts: + - when: | + POST mypojo + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + {} + then: | + 400 + - when: | + POST mypojo + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + {"value":"world"} + then: | + {"value":"hello world"} diff --git a/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml new file mode 100644 index 0000000000..791a3a2776 --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml @@ -0,0 +1,10 @@ +title: should user1 say hello +given: + - time: 2013-08-28T01:18:00.822+02:00 + - uuids: [ "e2b4430f-9541-4602-9a3a-413d17c56a6b" ] +wts: + - when: | + GET message + $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} + then: | + {"message":"hello user1, it's 01:18:00"} diff --git a/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml b/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml new file mode 100644 index 0000000000..ead5af8d0c --- /dev/null +++ b/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml @@ -0,0 +1,10 @@ +title: should user2 not say hello +given: + - time: 2013-08-28T01:19:44.770+02:00 + - uuids: [ "56f71fcc-42d3-422f-9458-8ad37fc4a0b5" ] +wts: + - when: | + GET message + $RestxSession: {"_expires":"2013-09-27T01:19:44.770+02:00","principal":"user2","sessionKey":"56f71fcc-42d3-422f-9458-8ad37fc4a0b5"} + then: | + 403 From 8037776d9d73e54a3ee0254ffeb20689b56a5a55 Mon Sep 17 00:00:00 2001 From: Markus Gulden Date: Sun, 28 Oct 2018 20:53:10 +0100 Subject: [PATCH 03/73] BAEL-1658 --- .../connect-file-sink.properties | 20 +++++ .../connect-file-source.properties | 20 +++++ .../connect-standalone.properties | 44 ++++++++++ .../connect-distributed.properties | 88 +++++++++++++++++++ .../02_Distributed/connect-file-sink.json | 9 ++ .../02_Distributed/connect-file-source.json | 9 ++ .../connect-distributed.properties | 88 +++++++++++++++++++ .../connect-file-source-transform.json | 15 ++++ .../04_Custom/connect-distributed.properties | 88 +++++++++++++++++++ .../04_Custom/connect-mongodb-sink.json | 22 +++++ .../04_Custom/connect-mqtt-source.json | 11 +++ 11 files changed, 414 insertions(+) create mode 100644 libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties create mode 100644 libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties create mode 100644 libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties create mode 100644 libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties create mode 100644 libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json create mode 100644 libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json create mode 100644 libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties create mode 100644 libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json create mode 100644 libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties create mode 100644 libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json create mode 100644 libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json diff --git a/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties new file mode 100644 index 0000000000..594ccc6e95 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-sink.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name=local-file-sink +connector.class=FileStreamSink +tasks.max=1 +file=test.sink.txt +topics=connect-test \ No newline at end of file diff --git a/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties new file mode 100644 index 0000000000..599cf4cb2a --- /dev/null +++ b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-file-source.properties @@ -0,0 +1,20 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name=local-file-source +connector.class=FileStreamSource +tasks.max=1 +file=test.txt +topic=connect-test \ No newline at end of file diff --git a/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties new file mode 100644 index 0000000000..a2369fa144 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/01_Quick_Start/connect-standalone.properties @@ -0,0 +1,44 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# These are defaults. This file just demonstrates how to override some settings. +bootstrap.servers=localhost:9092 + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=false +value.converter.schemas.enable=false + +offset.storage.file.filename=/tmp/connect.offsets +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Note: symlinks will be followed to discover dependencies or plugins. +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=C:\Software\confluent-5.0.0\share\java +#plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties b/libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties new file mode 100644 index 0000000000..5b91baddbd --- /dev/null +++ b/libraries-data/src/main/kafka-connect/02_Distributed/connect-distributed.properties @@ -0,0 +1,88 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended +# to be used with the examples, and some settings may differ from those used in a production system, especially +# the `bootstrap.servers` and those specifying replication factors. + +# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. +bootstrap.servers=localhost:9092 + +# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs +group.id=connect-cluster + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=true +value.converter.schemas.enable=true + +# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +offset.storage.topic=connect-offsets +offset.storage.replication.factor=1 +#offset.storage.partitions=25 + +# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated, +# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +config.storage.topic=connect-configs +config.storage.replication.factor=1 + +# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +status.storage.topic=connect-status +status.storage.replication.factor=1 +#status.storage.partitions=5 + +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# These are provided to inform the user about the presence of the REST host and port configs +# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests. +#rest.host.name= +#rest.port=8083 + +# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers. +#rest.advertised.host.name= +#rest.advertised.port= + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json new file mode 100644 index 0000000000..8902ecce52 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-sink.json @@ -0,0 +1,9 @@ +{ + "name": "local-file-sink", + "config": { + "connector.class": "FileStreamSink", + "tasks.max": 1, + "file": "test-distributed.sink.txt", + "topics": "connect-distributed" + } +} diff --git a/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json new file mode 100644 index 0000000000..77e949c91b --- /dev/null +++ b/libraries-data/src/main/kafka-connect/02_Distributed/connect-file-source.json @@ -0,0 +1,9 @@ +{ + "name": "local-file-source", + "config": { + "connector.class": "FileStreamSource", + "tasks.max": 1, + "file": "test-distributed.txt", + "topic": "connect-distributed" + } +} diff --git a/libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties b/libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties new file mode 100644 index 0000000000..fa63be24b8 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/03_Transform/connect-distributed.properties @@ -0,0 +1,88 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended +# to be used with the examples, and some settings may differ from those used in a production system, especially +# the `bootstrap.servers` and those specifying replication factors. + +# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. +bootstrap.servers=localhost:9092 + +# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs +group.id=connect-cluster + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=false +value.converter.schemas.enable=false + +# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +offset.storage.topic=connect-offsets +offset.storage.replication.factor=1 +#offset.storage.partitions=25 + +# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated, +# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +config.storage.topic=connect-configs +config.storage.replication.factor=1 + +# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +status.storage.topic=connect-status +status.storage.replication.factor=1 +#status.storage.partitions=5 + +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# These are provided to inform the user about the presence of the REST host and port configs +# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests. +#rest.host.name= +#rest.port=8083 + +# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers. +#rest.advertised.host.name= +#rest.advertised.port= + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json b/libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json new file mode 100644 index 0000000000..e5e21a0608 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/03_Transform/connect-file-source-transform.json @@ -0,0 +1,15 @@ +{ + "name": "local-file-source", + "config": { + "connector.class": "FileStreamSource", + "tasks.max": 1, + "file": "transformation.txt", + "topic": "connect-transformation", + "transforms": "MakeMap,InsertSource", + "transforms.MakeMap.type": "org.apache.kafka.connect.transforms.HoistField$Value", + "transforms.MakeMap.field": "line", + "transforms.InsertSource.type": "org.apache.kafka.connect.transforms.InsertField$Value", + "transforms.InsertSource.static.field": "data_source", + "transforms.InsertSource.static.value": "test-file-source" + } +} diff --git a/libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties b/libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties new file mode 100644 index 0000000000..5b91baddbd --- /dev/null +++ b/libraries-data/src/main/kafka-connect/04_Custom/connect-distributed.properties @@ -0,0 +1,88 @@ +## +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +# This file contains some of the configurations for the Kafka Connect distributed worker. This file is intended +# to be used with the examples, and some settings may differ from those used in a production system, especially +# the `bootstrap.servers` and those specifying replication factors. + +# A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. +bootstrap.servers=localhost:9092 + +# unique name for the cluster, used in forming the Connect cluster group. Note that this must not conflict with consumer group IDs +group.id=connect-cluster + +# The converters specify the format of data in Kafka and how to translate it into Connect data. Every Connect user will +# need to configure these based on the format they want their data in when loaded from or stored into Kafka +key.converter=org.apache.kafka.connect.json.JsonConverter +value.converter=org.apache.kafka.connect.json.JsonConverter +# Converter-specific settings can be passed in by prefixing the Converter's setting with the converter we want to apply +# it to +key.converter.schemas.enable=true +value.converter.schemas.enable=true + +# Topic to use for storing offsets. This topic should have many partitions and be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +offset.storage.topic=connect-offsets +offset.storage.replication.factor=1 +#offset.storage.partitions=25 + +# Topic to use for storing connector and task configurations; note that this should be a single partition, highly replicated, +# and compacted topic. Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +config.storage.topic=connect-configs +config.storage.replication.factor=1 + +# Topic to use for storing statuses. This topic can have multiple partitions and should be replicated and compacted. +# Kafka Connect will attempt to create the topic automatically when needed, but you can always manually create +# the topic before starting Kafka Connect if a specific topic configuration is needed. +# Most users will want to use the built-in default replication factor of 3 or in some cases even specify a larger value. +# Since this means there must be at least as many brokers as the maximum replication factor used, we'd like to be able +# to run this example on a single-broker cluster and so here we instead set the replication factor to 1. +status.storage.topic=connect-status +status.storage.replication.factor=1 +#status.storage.partitions=5 + +# Flush much faster than normal, which is useful for testing/debugging +offset.flush.interval.ms=10000 + +# These are provided to inform the user about the presence of the REST host and port configs +# Hostname & Port for the REST API to listen on. If this is set, it will bind to the interface used to listen to requests. +#rest.host.name= +#rest.port=8083 + +# The Hostname & Port that will be given out to other workers to connect to i.e. URLs that are routable from other servers. +#rest.advertised.host.name= +#rest.advertised.port= + +# Set to a list of filesystem paths separated by commas (,) to enable class loading isolation for plugins +# (connectors, converters, transformations). The list should consist of top level directories that include +# any combination of: +# a) directories immediately containing jars with plugins and their dependencies +# b) uber-jars with plugins and their dependencies +# c) directories immediately containing the package directory structure of classes of plugins and their dependencies +# Examples: +# plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors, +# Replace the relative path below with an absolute path if you are planning to start Kafka Connect from within a +# directory other than the home directory of Confluent Platform. +plugin.path=./share/java diff --git a/libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json b/libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json new file mode 100644 index 0000000000..333768e4b7 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/04_Custom/connect-mongodb-sink.json @@ -0,0 +1,22 @@ +{ + "firstName": "John", + "lastName": "Smith", + "age": 25, + "address": { + "streetAddress": "21 2nd Street", + "city": "New York", + "state": "NY", + "postalCode": "10021" + }, + "phoneNumber": [{ + "type": "home", + "number": "212 555-1234" + }, { + "type": "fax", + "number": "646 555-4567" + } + ], + "gender": { + "type": "male" + } +} diff --git a/libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json b/libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json new file mode 100644 index 0000000000..02d87c5ad7 --- /dev/null +++ b/libraries-data/src/main/kafka-connect/04_Custom/connect-mqtt-source.json @@ -0,0 +1,11 @@ +{ + "name": "mqtt-source", + "config": { + "connector.class": "io.confluent.connect.mqtt.MqttSourceConnector", + "tasks.max": 1, + "mqtt.server.uri": "ws://broker.hivemq.com:8000/mqtt", + "mqtt.topics": "baeldung", + "kafka.topic": "connect-custom", + "value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter" + } +} From aedf3b5cb570d0aba8cad215f4a40da9ba956623 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 22:47:38 +0000 Subject: [PATCH 04/73] removed race condition between different requests --- .../thymeleaf/controller/BookController.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index b8132cddc8..12e8e8bc41 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -2,6 +2,7 @@ package com.baeldung.thymeleaf.controller; import java.util.List; import java.util.Optional; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -21,18 +22,18 @@ import com.baeldung.thymeleaf.service.BookService; @Controller public class BookController { - private static int currentPage = 1; - private static int pageSize = 5; @Autowired private BookService bookService; - + @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - page.ifPresent(p -> currentPage = p); - size.ifPresent(s -> pageSize = s); + AtomicInteger currentPage = new AtomicInteger(1); + AtomicInteger pageSize = new AtomicInteger(5); + page.ifPresent(p -> currentPage.set(p)); + size.ifPresent(s -> pageSize.set(s)); - Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); + Page bookPage = bookService.findPaginated(PageRequest.of(currentPage.get() - 1, pageSize.get())); model.addAttribute("bookPage", bookPage); From e3fc47dd53de5cd1f8c6e5175aaff175daa9e974 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 22:57:04 +0000 Subject: [PATCH 05/73] use of atomics way too verbose --- .../baeldung/thymeleaf/controller/BookController.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index 12e8e8bc41..7ede80b01d 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -2,7 +2,6 @@ package com.baeldung.thymeleaf.controller; import java.util.List; import java.util.Optional; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -22,18 +21,15 @@ import com.baeldung.thymeleaf.service.BookService; @Controller public class BookController { - @Autowired private BookService bookService; @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - AtomicInteger currentPage = new AtomicInteger(1); - AtomicInteger pageSize = new AtomicInteger(5); - page.ifPresent(p -> currentPage.set(p)); - size.ifPresent(s -> pageSize.set(s)); + int currentPage = page.isPresent()?page.get():5; + int pageSize = size.isPresent()?size.get():1; - Page bookPage = bookService.findPaginated(PageRequest.of(currentPage.get() - 1, pageSize.get())); + Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); model.addAttribute("bookPage", bookPage); From 9663cc09a1d32ec338044c3d61ecd3a7289608d1 Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 23:03:08 +0000 Subject: [PATCH 06/73] orElse is cleaner --- .../com/baeldung/thymeleaf/controller/BookController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index 7ede80b01d..f30ae6e049 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -26,8 +26,8 @@ public class BookController { @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - int currentPage = page.isPresent()?page.get():5; - int pageSize = size.isPresent()?size.get():1; + int currentPage = page.orElse(1); + int pageSize = size.orElse(5); Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); From 5d4d8ff977bf16874e475f9b7dc537140391a23f Mon Sep 17 00:00:00 2001 From: Simon Massey Date: Tue, 30 Oct 2018 23:06:12 +0000 Subject: [PATCH 07/73] may as well use final --- .../com/baeldung/thymeleaf/controller/BookController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java index f30ae6e049..d10caee9e7 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BookController.java @@ -26,8 +26,8 @@ public class BookController { @RequestMapping(value = "/listBooks", method = RequestMethod.GET) public String listBooks(Model model, @RequestParam("page") Optional page, @RequestParam("size") Optional size) { - int currentPage = page.orElse(1); - int pageSize = size.orElse(5); + final int currentPage = page.orElse(1); + final int pageSize = size.orElse(5); Page bookPage = bookService.findPaginated(PageRequest.of(currentPage - 1, pageSize)); From 192c9443bd5ae800288a7dfaddae4e489fae471f Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Sun, 4 Nov 2018 13:04:05 -0600 Subject: [PATCH 08/73] BAEL-2015: add link back to article --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index ce2d5b3e64..35fdcd9132 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -156,3 +156,4 @@ - [The Modulo Operator in Java](https://www.baeldung.com/modulo-java) - [Ternary Operator In Java](https://www.baeldung.com/java-ternary-operator) - [Merging java.util.Properties Objects](https://www.baeldung.com/java-merging-properties) +- [Understanding Memory Leaks in Java](https://www.baeldung.com/java-memory-leaks) From ef541ac96a93f4d9b6236ee0393ecfa9f8faf165 Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Sun, 18 Nov 2018 22:46:55 -0600 Subject: [PATCH 09/73] BAEL-2166 BAEL-2302 add links back to articles --- java-strings/README.md | 1 + spring-data-rest/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/java-strings/README.md b/java-strings/README.md index 1b24a2b821..2847a0d0a8 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -36,3 +36,4 @@ - [String Performance Hints](https://www.baeldung.com/java-string-performance) - [Using indexOf to Find All Occurrences of a Word in a String](https://www.baeldung.com/java-indexOf-find-string-occurrences) - [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) +- [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) diff --git a/spring-data-rest/README.md b/spring-data-rest/README.md index 09f8391406..db94a86a6f 100644 --- a/spring-data-rest/README.md +++ b/spring-data-rest/README.md @@ -20,3 +20,4 @@ To view the running application, visit [http://localhost:8080](http://localhost: - [List of In-Memory Databases](http://www.baeldung.com/java-in-memory-databases) - [Projections and Excerpts in Spring Data REST](http://www.baeldung.com/spring-data-rest-projections-excerpts) - [Spring Data REST Events with @RepositoryEventHandler](http://www.baeldung.com/spring-data-rest-events) +- [Customizing HTTP Endpoints in Spring Data REST](https://www.baeldung.com/spring-data-rest-customize-http-endpoints) From b0ea0e56483771e87333c6ddaec6ab7b48997bb6 Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Tue, 20 Nov 2018 21:28:01 -0600 Subject: [PATCH 10/73] BAEL-2312: add link back to article --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index 11d9fd2ee0..7617897e95 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -85,3 +85,4 @@ - [A Guide to SimpleDateFormat](https://www.baeldung.com/java-simple-date-format) - [SSL Handshake Failures](https://www.baeldung.com/java-ssl-handshake-failures) - [Implementing a Binary Tree in Java](https://www.baeldung.com/java-binary-tree) +- [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) From 56ab8e2049028b784ac2a769a86171cd5a59a852 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Thu, 22 Nov 2018 15:29:58 +0530 Subject: [PATCH 11/73] BAEL-2334: Adding file for the tutorial on Graph in Java --- .../main/java/com/baeldung/graph/Graph.java | 112 ++++++++++++++++++ .../com/baeldung/graph/GraphTraversal.java | 44 +++++++ .../graph/GraphTraversalUnitTest.java | 36 ++++++ 3 files changed, 192 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/graph/Graph.java create mode 100644 core-java/src/main/java/com/baeldung/graph/GraphTraversal.java create mode 100644 core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java diff --git a/core-java/src/main/java/com/baeldung/graph/Graph.java b/core-java/src/main/java/com/baeldung/graph/Graph.java new file mode 100644 index 0000000000..7095f64709 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/graph/Graph.java @@ -0,0 +1,112 @@ +package com.baeldung.graph; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +public class Graph { + private Set vertices; + private Set edges; + private Map> adjVertices; + + Graph() { + this.vertices = new HashSet(); + this.edges = new HashSet(); + this.adjVertices = new HashMap>(); + } + + boolean addVertex(String label) { + return vertices.add(new Vertex(label)); + } + + boolean removeVertex(String label) { + return vertices.remove(new Vertex(label)); + } + + boolean addEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + Edge e = new Edge(v1, v2); + if (this.edges.add(e)) { + adjVertices.putIfAbsent(v1, new HashSet<>()); + adjVertices.putIfAbsent(v2, new HashSet<>()); + adjVertices.get(v1) + .add(e); + adjVertices.get(v2) + .add(e); + } + return true; + } + + boolean removeEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + Edge e = new Edge(v1, v2); + if (this.edges.remove(e)) { + Set eV1 = adjVertices.get(v1); + Set eV2 = adjVertices.get(v2); + + if (eV1 != null) + eV1.remove(e); + if (eV2 != null) + eV2.remove(e); + } + return true; + } + + Set getAdjVertices(String label) { + Vertex v = new Vertex(label); + return adjVertices.get(v) + .stream() + .map(e -> e.v1.equals(v) ? e.v2 : e.v1) + .collect(Collectors.toSet()); + } + + class Vertex { + String label; + Vertex(String label) { + this.label = label; + } + @Override + public boolean equals(Object obj) { + Vertex vertex = (Vertex) obj; + return vertex.label == label; + } + @Override + public int hashCode() { + return label.hashCode(); + } + @Override + public String toString() { + return label; + } + } + + class Edge { + Vertex v1; + Vertex v2; + Edge(String label1, String label2) { + this.v1 = new Vertex(label1); + this.v2 = new Vertex(label2); + } + Edge(Vertex vertex1, Vertex vertex2) { + this.v1 = vertex1; + this.v2 = vertex2; + } + @Override + public boolean equals(Object obj) { + Edge edge = (Edge) obj; + return edge.v1.equals(v1) && edge.v2.equals(v2); + } + @Override + public int hashCode() { + return v1.hashCode() + v2.hashCode(); + } + @Override + public String toString() { + return v1.label + "-" + v2.label; + } + } +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/graph/GraphTraversal.java b/core-java/src/main/java/com/baeldung/graph/GraphTraversal.java new file mode 100644 index 0000000000..479e653a5c --- /dev/null +++ b/core-java/src/main/java/com/baeldung/graph/GraphTraversal.java @@ -0,0 +1,44 @@ +package com.baeldung.graph; + +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.Queue; +import java.util.Set; +import java.util.Stack; + +import com.baeldung.graph.Graph.Vertex; + +public class GraphTraversal { + static Set depthFirstTraversal(Graph graph, String root) { + Set visited = new LinkedHashSet(); + Stack stack = new Stack(); + stack.push(root); + while (!stack.isEmpty()) { + String vertex = stack.pop(); + if (!visited.contains(vertex)) { + visited.add(vertex); + for (Vertex v : graph.getAdjVertices(vertex)) { + stack.push(v.label); + } + } + } + return visited; + } + + static Set breadthFirstTraversal(Graph graph, String root) { + Set visited = new LinkedHashSet(); + Queue queue = new LinkedList(); + queue.add(root); + visited.add(root); + while (!queue.isEmpty()) { + String vertex = queue.poll(); + for (Vertex v : graph.getAdjVertices(vertex)) { + if (!visited.contains(v.label)) { + visited.add(v.label); + queue.add(v.label); + } + } + } + return visited; + } +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java new file mode 100644 index 0000000000..84611a580a --- /dev/null +++ b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java @@ -0,0 +1,36 @@ +package com.baeldung.graph; + +import org.junit.Assert; +import org.junit.Test; + +public class GraphTraversalUnitTest { + @Test + public void givenAGraph_whenTraversingDepthFirst_thenExpectedResult() { + Graph graph = createGraph(); + Assert.assertEquals("[A, D, E, B, C]", + GraphTraversal.depthFirstTraversal(graph, "A").toString()); + } + + @Test + public void givenAGraph_whenTraversingBreadthFirst_thenExpectedResult() { + Graph graph = createGraph(); + Assert.assertEquals("[A, B, D, C, E]", + GraphTraversal.breadthFirstTraversal(graph, "A").toString()); + } + + Graph createGraph() { + Graph graph = new Graph(); + graph.addVertex("A"); + graph.addVertex("B"); + graph.addVertex("C"); + graph.addVertex("D"); + graph.addVertex("E"); + graph.addEdge("A", "B"); + graph.addEdge("A", "D"); + graph.addEdge("B", "C"); + graph.addEdge("D", "C"); + graph.addEdge("B", "E"); + graph.addEdge("D", "E"); + return graph; + } +} \ No newline at end of file From 991436fa16b659cbe79a053f8ed4781f0662d284 Mon Sep 17 00:00:00 2001 From: saikat Date: Sat, 24 Nov 2018 18:58:48 +0530 Subject: [PATCH 12/73] Rename project module --- pom.xml | 2 +- {restx-demo => restx}/data/credentials.json | 0 {restx-demo => restx}/data/users.json | 0 {restx-demo => restx}/md.restx.json | 0 {restx-demo => restx}/pom.xml | 3 +-- {restx-demo => restx}/src/main/java/restx/demo/AppModule.java | 0 {restx-demo => restx}/src/main/java/restx/demo/AppServer.java | 0 {restx-demo => restx}/src/main/java/restx/demo/Roles.java | 0 .../src/main/java/restx/demo/domain/Message.java | 0 .../src/main/java/restx/demo/rest/HelloResource.java | 0 {restx-demo => restx}/src/main/resources/logback.xml | 0 .../src/main/resources/restx/demo/settings.properties | 0 {restx-demo => restx}/src/main/webapp/WEB-INF/web.xml | 0 .../test/java/restx/demo/rest/HelloResourceSpecUnitTest.java | 0 .../resources/specs/hello/should_admin_say_hello.spec.yaml | 0 .../resources/specs/hello/should_anyone_say_hello.spec.yaml | 0 .../should_missing_value_triggers_validation_error.spec.yaml | 0 .../resources/specs/hello/should_user1_say_hello.spec.yaml | 0 .../resources/specs/hello/should_user2_not_say_hello.spec.yaml | 0 19 files changed, 2 insertions(+), 3 deletions(-) rename {restx-demo => restx}/data/credentials.json (100%) rename {restx-demo => restx}/data/users.json (100%) rename {restx-demo => restx}/md.restx.json (100%) rename {restx-demo => restx}/pom.xml (98%) rename {restx-demo => restx}/src/main/java/restx/demo/AppModule.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/AppServer.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/Roles.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/domain/Message.java (100%) rename {restx-demo => restx}/src/main/java/restx/demo/rest/HelloResource.java (100%) rename {restx-demo => restx}/src/main/resources/logback.xml (100%) rename {restx-demo => restx}/src/main/resources/restx/demo/settings.properties (100%) rename {restx-demo => restx}/src/main/webapp/WEB-INF/web.xml (100%) rename restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java => restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml (100%) rename {restx-demo => restx}/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml (100%) diff --git a/pom.xml b/pom.xml index 10e23da0ad..77c666b3ab 100644 --- a/pom.xml +++ b/pom.xml @@ -1608,7 +1608,7 @@ persistence-modules/spring-data-elasticsearch core-java-concurrency core-java-concurrency-collections - restx-demo + restx diff --git a/restx-demo/data/credentials.json b/restx/data/credentials.json similarity index 100% rename from restx-demo/data/credentials.json rename to restx/data/credentials.json diff --git a/restx-demo/data/users.json b/restx/data/users.json similarity index 100% rename from restx-demo/data/users.json rename to restx/data/users.json diff --git a/restx-demo/md.restx.json b/restx/md.restx.json similarity index 100% rename from restx-demo/md.restx.json rename to restx/md.restx.json diff --git a/restx-demo/pom.xml b/restx/pom.xml similarity index 98% rename from restx-demo/pom.xml rename to restx/pom.xml index da106b8191..c6233b968c 100644 --- a/restx-demo/pom.xml +++ b/restx/pom.xml @@ -4,8 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - restx-demo - restx-demo + restx 0.1-SNAPSHOT war restx-demo diff --git a/restx-demo/src/main/java/restx/demo/AppModule.java b/restx/src/main/java/restx/demo/AppModule.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/AppModule.java rename to restx/src/main/java/restx/demo/AppModule.java diff --git a/restx-demo/src/main/java/restx/demo/AppServer.java b/restx/src/main/java/restx/demo/AppServer.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/AppServer.java rename to restx/src/main/java/restx/demo/AppServer.java diff --git a/restx-demo/src/main/java/restx/demo/Roles.java b/restx/src/main/java/restx/demo/Roles.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/Roles.java rename to restx/src/main/java/restx/demo/Roles.java diff --git a/restx-demo/src/main/java/restx/demo/domain/Message.java b/restx/src/main/java/restx/demo/domain/Message.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/domain/Message.java rename to restx/src/main/java/restx/demo/domain/Message.java diff --git a/restx-demo/src/main/java/restx/demo/rest/HelloResource.java b/restx/src/main/java/restx/demo/rest/HelloResource.java similarity index 100% rename from restx-demo/src/main/java/restx/demo/rest/HelloResource.java rename to restx/src/main/java/restx/demo/rest/HelloResource.java diff --git a/restx-demo/src/main/resources/logback.xml b/restx/src/main/resources/logback.xml similarity index 100% rename from restx-demo/src/main/resources/logback.xml rename to restx/src/main/resources/logback.xml diff --git a/restx-demo/src/main/resources/restx/demo/settings.properties b/restx/src/main/resources/restx/demo/settings.properties similarity index 100% rename from restx-demo/src/main/resources/restx/demo/settings.properties rename to restx/src/main/resources/restx/demo/settings.properties diff --git a/restx-demo/src/main/webapp/WEB-INF/web.xml b/restx/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from restx-demo/src/main/webapp/WEB-INF/web.xml rename to restx/src/main/webapp/WEB-INF/web.xml diff --git a/restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java b/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java similarity index 100% rename from restx-demo/src/test/java/restx/demo/rest/HelloResourceSpecTest.java rename to restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java diff --git a/restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml b/restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml rename to restx/src/test/resources/specs/hello/should_missing_value_triggers_validation_error.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml diff --git a/restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml similarity index 100% rename from restx-demo/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml rename to restx/src/test/resources/specs/hello/should_user2_not_say_hello.spec.yaml From 9ba79376452c320ebb8b9b6cca7a61920a0f9767 Mon Sep 17 00:00:00 2001 From: saikat Date: Sat, 24 Nov 2018 19:00:09 +0530 Subject: [PATCH 13/73] Rename unit test to fix PMD failure --- .../java/restx/demo/rest/HelloResourceSpecUnitTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java b/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java index 138a22d074..f67e4565b3 100644 --- a/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java +++ b/restx/src/test/java/restx/demo/rest/HelloResourceSpecUnitTest.java @@ -1,13 +1,13 @@ package restx.demo.rest; -import restx.demo.AppServer; import org.junit.runner.RunWith; -import restx.tests.RestxSpecTestsRunner; + import restx.tests.FindSpecsIn; +import restx.tests.RestxSpecTestsRunner; @RunWith(RestxSpecTestsRunner.class) @FindSpecsIn("specs/hello") -public class HelloResourceSpecTest { +public class HelloResourceSpecUnitTest { /** * Useless, thanks to both @RunWith(RestxSpecTestsRunner.class) & @FindSpecsIn() From 7410f52561a0949751cc27e60a5902fc8d0f65d5 Mon Sep 17 00:00:00 2001 From: Kumar Chandrakant Date: Wed, 28 Nov 2018 01:00:16 +0530 Subject: [PATCH 14/73] Changed the source files for incorporating review comments on the tutorial. --- .../main/java/com/baeldung/graph/Graph.java | 116 ++++++------------ .../graph/GraphTraversalUnitTest.java | 30 ++--- 2 files changed, 55 insertions(+), 91 deletions(-) diff --git a/core-java/src/main/java/com/baeldung/graph/Graph.java b/core-java/src/main/java/com/baeldung/graph/Graph.java index 7095f64709..43b5c0aa08 100644 --- a/core-java/src/main/java/com/baeldung/graph/Graph.java +++ b/core-java/src/main/java/com/baeldung/graph/Graph.java @@ -1,67 +1,57 @@ package com.baeldung.graph; +import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; +import java.util.List; import java.util.Map; -import java.util.Set; import java.util.stream.Collectors; public class Graph { - private Set vertices; - private Set edges; - private Map> adjVertices; + private Map> adjVertices; Graph() { - this.vertices = new HashSet(); - this.edges = new HashSet(); - this.adjVertices = new HashMap>(); + this.adjVertices = new HashMap>(); } - boolean addVertex(String label) { - return vertices.add(new Vertex(label)); + void addVertex(String label) { + adjVertices.putIfAbsent(new Vertex(label), new ArrayList<>()); } - boolean removeVertex(String label) { - return vertices.remove(new Vertex(label)); - } - - boolean addEdge(String label1, String label2) { - Vertex v1 = new Vertex(label1); - Vertex v2 = new Vertex(label2); - Edge e = new Edge(v1, v2); - if (this.edges.add(e)) { - adjVertices.putIfAbsent(v1, new HashSet<>()); - adjVertices.putIfAbsent(v2, new HashSet<>()); - adjVertices.get(v1) - .add(e); - adjVertices.get(v2) - .add(e); - } - return true; - } - - boolean removeEdge(String label1, String label2) { - Vertex v1 = new Vertex(label1); - Vertex v2 = new Vertex(label2); - Edge e = new Edge(v1, v2); - if (this.edges.remove(e)) { - Set eV1 = adjVertices.get(v1); - Set eV2 = adjVertices.get(v2); - - if (eV1 != null) - eV1.remove(e); - if (eV2 != null) - eV2.remove(e); - } - return true; - } - - Set getAdjVertices(String label) { + void removeVertex(String label) { Vertex v = new Vertex(label); - return adjVertices.get(v) - .stream() - .map(e -> e.v1.equals(v) ? e.v2 : e.v1) - .collect(Collectors.toSet()); + adjVertices.values().stream().map(e -> e.remove(v)).collect(Collectors.toList()); + adjVertices.remove(new Vertex(label)); + } + + void addEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + adjVertices.get(v1).add(v2); + adjVertices.get(v2).add(v1); + } + + void removeEdge(String label1, String label2) { + Vertex v1 = new Vertex(label1); + Vertex v2 = new Vertex(label2); + List eV1 = adjVertices.get(v1); + List eV2 = adjVertices.get(v2); + if (eV1 != null) + eV1.remove(v2); + if (eV2 != null) + eV2.remove(v1); + } + + List getAdjVertices(String label) { + return adjVertices.get(new Vertex(label)); + } + + String printGraph() { + StringBuffer sb = new StringBuffer(); + for(Vertex v : adjVertices.keySet()) { + sb.append(v); + sb.append(adjVertices.get(v)); + } + return sb.toString(); } class Vertex { @@ -83,30 +73,4 @@ public class Graph { return label; } } - - class Edge { - Vertex v1; - Vertex v2; - Edge(String label1, String label2) { - this.v1 = new Vertex(label1); - this.v2 = new Vertex(label2); - } - Edge(Vertex vertex1, Vertex vertex2) { - this.v1 = vertex1; - this.v2 = vertex2; - } - @Override - public boolean equals(Object obj) { - Edge edge = (Edge) obj; - return edge.v1.equals(v1) && edge.v2.equals(v2); - } - @Override - public int hashCode() { - return v1.hashCode() + v2.hashCode(); - } - @Override - public String toString() { - return v1.label + "-" + v2.label; - } - } } \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java index 84611a580a..d955d56d95 100644 --- a/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java +++ b/core-java/src/test/java/com/baeldung/graph/GraphTraversalUnitTest.java @@ -7,30 +7,30 @@ public class GraphTraversalUnitTest { @Test public void givenAGraph_whenTraversingDepthFirst_thenExpectedResult() { Graph graph = createGraph(); - Assert.assertEquals("[A, D, E, B, C]", - GraphTraversal.depthFirstTraversal(graph, "A").toString()); + Assert.assertEquals("[Bob, Rob, Maria, Alice, Mark]", + GraphTraversal.depthFirstTraversal(graph, "Bob").toString()); } @Test public void givenAGraph_whenTraversingBreadthFirst_thenExpectedResult() { Graph graph = createGraph(); - Assert.assertEquals("[A, B, D, C, E]", - GraphTraversal.breadthFirstTraversal(graph, "A").toString()); + Assert.assertEquals("[Bob, Alice, Rob, Mark, Maria]", + GraphTraversal.breadthFirstTraversal(graph, "Bob").toString()); } Graph createGraph() { Graph graph = new Graph(); - graph.addVertex("A"); - graph.addVertex("B"); - graph.addVertex("C"); - graph.addVertex("D"); - graph.addVertex("E"); - graph.addEdge("A", "B"); - graph.addEdge("A", "D"); - graph.addEdge("B", "C"); - graph.addEdge("D", "C"); - graph.addEdge("B", "E"); - graph.addEdge("D", "E"); + graph.addVertex("Bob"); + graph.addVertex("Alice"); + graph.addVertex("Mark"); + graph.addVertex("Rob"); + graph.addVertex("Maria"); + graph.addEdge("Bob", "Alice"); + graph.addEdge("Bob", "Rob"); + graph.addEdge("Alice", "Mark"); + graph.addEdge("Rob", "Mark"); + graph.addEdge("Alice", "Maria"); + graph.addEdge("Rob", "Maria"); return graph; } } \ No newline at end of file From ac37b4fb65bcceb3f977a208508f894f0e66fb3e Mon Sep 17 00:00:00 2001 From: Kuba Date: Wed, 28 Nov 2018 15:42:07 +0100 Subject: [PATCH 15/73] BAEL-2279 - Logging reactive sequence * BAEL-2279 - Logging reactive sequence * BAEL-2279 - Logging reactive sequence * Format fix. * Add all examples. Fix formatting. * BAEL 2279 - rename file, formatting fixes, update deps. * BAEL-2279 - Move code to reactive module. * BAEL 2279 - Remove old code. --- logging-modules/log4j/pom.xml | 7 ------- .../baeldung/webflux/logging}/WebFluxLoggingExample.java | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) rename {logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging => spring-5-reactive/src/main/java/com/baeldung/webflux/logging}/WebFluxLoggingExample.java (91%) diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index 1b27e03445..c5ce1d06ad 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/pom.xml @@ -44,12 +44,6 @@ disruptor ${disruptor.version} - - - org.springframework.boot - spring-boot-starter-webflux - ${spring-boot.version} - @@ -57,7 +51,6 @@ 2.7 2.7 3.3.6 - 2.1.0.RELEASE \ No newline at end of file diff --git a/logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java b/spring-5-reactive/src/main/java/com/baeldung/webflux/logging/WebFluxLoggingExample.java similarity index 91% rename from logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java rename to spring-5-reactive/src/main/java/com/baeldung/webflux/logging/WebFluxLoggingExample.java index f429fd57f3..c4881b2296 100644 --- a/logging-modules/log4j/src/main/java/com/baeldung/webFluxLogging/WebFluxLoggingExample.java +++ b/spring-5-reactive/src/main/java/com/baeldung/webflux/logging/WebFluxLoggingExample.java @@ -1,4 +1,4 @@ -package com.baeldung.webFluxLogging; +package com.baeldung.webflux.logging; import reactor.core.publisher.Flux; From b6431622ed022ca029a725a902bb0458ccbd5720 Mon Sep 17 00:00:00 2001 From: Aravind Ranganathan Date: Wed, 28 Nov 2018 12:01:32 -0500 Subject: [PATCH 16/73] Spring Data Cassandra Reactive Issue: BAEL-1870 --- .../spring-data-cassandra-reactive/pom.xml | 70 +++++++++++++++++++ ...pringDataCassandraReactiveApplication.java | 12 ++++ .../controller/EmployeeController.java | 49 +++++++++++++ .../cassandra/reactive/model/Employee.java | 20 ++++++ .../repository/EmployeeRepository.java | 11 +++ .../reactive/service/EmployeeService.java | 35 ++++++++++ .../src/main/resources/application.properties | 2 + ...tiveEmployeeRepositoryIntegrationTest.java | 55 +++++++++++++++ 8 files changed, 254 insertions(+) create mode 100644 persistence-modules/spring-data-cassandra-reactive/pom.xml create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties create mode 100644 persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java diff --git a/persistence-modules/spring-data-cassandra-reactive/pom.xml b/persistence-modules/spring-data-cassandra-reactive/pom.xml new file mode 100644 index 0000000000..037b1fd3c1 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/pom.xml @@ -0,0 +1,70 @@ + + + 4.0.0 + + com.baeldung + spring-data-cassandra-reactive + 0.0.1-SNAPSHOT + jar + + spring-data-cassandra-reactive + Spring Data Cassandra reactive + + + org.springframework.boot + spring-boot-starter-parent + 2.1.0.RELEASE + + + + + UTF-8 + UTF-8 + + 1.8 + + + + + org.springframework.data + spring-data-cassandra + 2.1.2.RELEASE + + + io.projectreactor + reactor-core + + + org.springframework.boot + spring-boot-starter-web + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java new file mode 100644 index 0000000000..5f467042a3 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/SpringDataCassandraReactiveApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.cassandra.reactive; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringDataCassandraReactiveApplication { + + public static void main(String[] args) { + SpringApplication.run(SpringDataCassandraReactiveApplication.class, args); + } +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java new file mode 100644 index 0000000000..e9de213e61 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/controller/EmployeeController.java @@ -0,0 +1,49 @@ +package com.baeldung.cassandra.reactive.controller; + +import com.baeldung.cassandra.reactive.model.Employee; +import com.baeldung.cassandra.reactive.service.EmployeeService; +import org.springframework.beans.factory.annotation.Autowired; +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 reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import javax.annotation.PostConstruct; +import java.util.ArrayList; +import java.util.List; + +@RestController +@RequestMapping("employee") +public class EmployeeController { + + @Autowired + EmployeeService employeeService; + + @PostConstruct + public void saveEmployees() { + List employees = new ArrayList<>(); + employees.add(new Employee(123, "John Doe", "Delaware", "jdoe@xyz.com", 31)); + employees.add(new Employee(324, "Adam Smith", "North Carolina", "asmith@xyz.com", 43)); + employees.add(new Employee(355, "Kevin Dunner", "Virginia", "kdunner@xyz.com", 24)); + employees.add(new Employee(643, "Mike Lauren", "New York", "mlauren@xyz.com", 41)); + employeeService.initializeEmployees(employees); + } + + @GetMapping("/list") + public Flux getAllEmployees() { + Flux employees = employeeService.getAllEmployees(); + return employees; + } + + @GetMapping("/{id}") + public Mono getEmployeeById(@PathVariable int id) { + return employeeService.getEmployeeById(id); + } + + @GetMapping("/filterByAge/{age}") + public Flux getEmployeesFilterByAge(@PathVariable int age) { + return employeeService.getEmployeesFilterByAge(age); + } +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java new file mode 100644 index 0000000000..a78f884778 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/model/Employee.java @@ -0,0 +1,20 @@ +package com.baeldung.cassandra.reactive.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.data.cassandra.core.mapping.PrimaryKey; +import org.springframework.data.cassandra.core.mapping.Table; + +@Table +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Employee { + @PrimaryKey + private int id; + private String name; + private String address; + private String email; + private int age; +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java new file mode 100644 index 0000000000..22dc2b4565 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/repository/EmployeeRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.cassandra.reactive.repository; + +import com.baeldung.cassandra.reactive.model.Employee; +import org.springframework.data.cassandra.repository.AllowFiltering; +import org.springframework.data.cassandra.repository.ReactiveCassandraRepository; +import reactor.core.publisher.Flux; + +public interface EmployeeRepository extends ReactiveCassandraRepository { + @AllowFiltering + Flux findByAgeGreaterThan(int age); +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java new file mode 100644 index 0000000000..40c330937a --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/java/com/baeldung/cassandra/reactive/service/EmployeeService.java @@ -0,0 +1,35 @@ +package com.baeldung.cassandra.reactive.service; + +import com.baeldung.cassandra.reactive.model.Employee; +import com.baeldung.cassandra.reactive.repository.EmployeeRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.util.List; + +@Service +public class EmployeeService { + + @Autowired + EmployeeRepository employeeRepository; + + public void initializeEmployees(List employees) { + Flux savedEmployees = employeeRepository.saveAll(employees); + savedEmployees.subscribe(); + } + + public Flux getAllEmployees() { + Flux employees = employeeRepository.findAll(); + return employees; + } + + public Flux getEmployeesFilterByAge(int age) { + return employeeRepository.findByAgeGreaterThan(age); + } + + public Mono getEmployeeById(int id) { + return employeeRepository.findById(id); + } +} diff --git a/persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties b/persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties new file mode 100644 index 0000000000..7ed2f10131 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/main/resources/application.properties @@ -0,0 +1,2 @@ +spring.data.cassandra.keyspace-name=practice +spring.data.cassandra.port=9042 \ No newline at end of file diff --git a/persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java b/persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java new file mode 100644 index 0000000000..ad726fe969 --- /dev/null +++ b/persistence-modules/spring-data-cassandra-reactive/src/test/java/com/baeldung/cassandra/reactive/ReactiveEmployeeRepositoryIntegrationTest.java @@ -0,0 +1,55 @@ +package com.baeldung.cassandra.reactive; + +import com.baeldung.cassandra.reactive.model.Employee; +import com.baeldung.cassandra.reactive.repository.EmployeeRepository; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + + +@RunWith(SpringRunner.class) +@SpringBootTest +public class ReactiveEmployeeRepositoryIntegrationTest { + + @Autowired + EmployeeRepository repository; + + @Before + public void setUp() { + + Flux deleteAndInsert = repository.deleteAll() // + .thenMany(repository.saveAll(Flux.just( + new Employee(111, "John Doe", "Delaware", "jdoe@xyz.com", 31), + new Employee(222, "Adam Smith", "North Carolina", "asmith@xyz.com", 43), + new Employee(333, "Kevin Dunner", "Virginia", "kdunner@xyz.com", 24), + new Employee(444, "Mike Lauren", "New York", "mlauren@xyz.com", 41)))); + + StepVerifier.create(deleteAndInsert).expectNextCount(4).verifyComplete(); + } + + @Test + public void givenRecordsAreInserted_whenDbIsQueried_thenShouldIncludeNewRecords() { + + Mono saveAndCount = repository.count() + .doOnNext(System.out::println) + .thenMany(repository.saveAll(Flux.just(new Employee(325, "Kim Jones", "Florida", "kjones@xyz.com", 42), + new Employee(654, "Tom Moody", "New Hampshire", "tmoody@xyz.com", 44)))) + .last() + .flatMap(v -> repository.count()) + .doOnNext(System.out::println); + + StepVerifier.create(saveAndCount).expectNext(6L).verifyComplete(); + } + + @Test + public void givenAgeForFilter_whenDbIsQueried_thenShouldReturnFilteredRecords() { + StepVerifier.create(repository.findByAgeGreaterThan(35)).expectNextCount(2).verifyComplete(); + } + +} From c81567741e2072face906788d33f366056c95fea Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 28 Nov 2018 10:02:09 -0700 Subject: [PATCH 17/73] Move ClassName to core-java-lang (#5796) Issue: BAEL-2309 --- .../src/main/java/com/baeldung/className/RetrievingClassName.java | 0 .../java/com/baeldung/className/RetrievingClassNameUnitTest.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {core-java => core-java-lang}/src/main/java/com/baeldung/className/RetrievingClassName.java (100%) rename {core-java => core-java-lang}/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java (100%) diff --git a/core-java/src/main/java/com/baeldung/className/RetrievingClassName.java b/core-java-lang/src/main/java/com/baeldung/className/RetrievingClassName.java similarity index 100% rename from core-java/src/main/java/com/baeldung/className/RetrievingClassName.java rename to core-java-lang/src/main/java/com/baeldung/className/RetrievingClassName.java diff --git a/core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java b/core-java-lang/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java rename to core-java-lang/src/test/java/com/baeldung/className/RetrievingClassNameUnitTest.java From 866666f3db77a8d72a58a4f269561537d9389533 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Wed, 28 Nov 2018 10:02:35 -0700 Subject: [PATCH 18/73] Add load-testing-comparison to Build (#5757) Issue: bael-46 --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 70248b9993..b998967bbf 100644 --- a/pom.xml +++ b/pom.xml @@ -377,6 +377,7 @@ feign flips testing-modules/groovy-spock + testing-modules/load-testing-comparison google-cloud google-web-toolkit gson From 4b6515d8a379b5bfc0aaae572a21ecb7581cb21f Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Wed, 28 Nov 2018 20:46:43 +0100 Subject: [PATCH 19/73] added readme --- restx/README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 restx/README.md diff --git a/restx/README.md b/restx/README.md new file mode 100644 index 0000000000..f586f08a21 --- /dev/null +++ b/restx/README.md @@ -0,0 +1,3 @@ +# Relevant Articles + +* [Introduction to RESTX](https://www.baeldung.com/java-restx) From 5871653e65d41da0191afe56ed2b1ce2cac92338 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Wed, 28 Nov 2018 23:42:40 +0200 Subject: [PATCH 20/73] Update and rename OptimizedMatcherUnitTest.java to OptimizedMatcherManualTest.java --- ...izedMatcherUnitTest.java => OptimizedMatcherManualTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-java/src/test/java/com/baeldung/regexp/optmization/{OptimizedMatcherUnitTest.java => OptimizedMatcherManualTest.java} (98%) diff --git a/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java b/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherManualTest.java similarity index 98% rename from core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java rename to core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherManualTest.java index 2be6b6ad4b..f44968a5a7 100644 --- a/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherUnitTest.java +++ b/core-java/src/test/java/com/baeldung/regexp/optmization/OptimizedMatcherManualTest.java @@ -11,7 +11,7 @@ import java.util.regex.Pattern; import static org.junit.Assert.assertTrue; -public class OptimizedMatcherUnitTest { +public class OptimizedMatcherManualTest { private String action; From 2ee5e03b887585e5a4f1b4657b5d47583f2984fb Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 22 Nov 2018 23:07:29 +0330 Subject: [PATCH 21/73] Added the codes used for operator overloading article --- .../kotlin/com/baeldung/operators/Money.kt | 27 +++++++++++++++++ .../kotlin/com/baeldung/operators/Page.kt | 14 +++++++++ .../kotlin/com/baeldung/operators/Point.kt | 14 +++++++++ .../main/kotlin/com/baeldung/operators/UI.kt | 30 +++++++++++++++++++ .../kotlin/com/baeldung/operators/Utils.kt | 4 +++ 5 files changed, 89 insertions(+) create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt create mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt new file mode 100644 index 0000000000..ffaea71e1e --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt @@ -0,0 +1,27 @@ +enum class Currency { + DOLLARS, EURO +} + +class Money(val amount: BigDecimal, val currency: Currency) : Comparable { + + override fun compareTo(other: Money): Int = + convert(Currency.DOLLARS).compareTo(other.convert(Currency.DOLLARS)) + + fun convert(currency: Currency): BigDecimal = TODO() + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is Money) return false + + if (amount != other.amount) return false + if (currency != other.currency) return false + + return true + } + + override fun hashCode(): Int { + var result = amount.hashCode() + result = 31 * result + currency.hashCode() + return result + } +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt new file mode 100644 index 0000000000..db03779b35 --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt @@ -0,0 +1,14 @@ +interface Page { + fun pageNumber(): Int + fun pageSize(): Int + fun elements(): MutableList +} + +operator fun Page.get(index: Int): T = elements()[index] +operator fun Page.get(start: Int, endExclusive: Int): List = elements().subList(start, endExclusive) +operator fun Page.set(index: Int, value: T) { + elements()[index] = value +} + +operator fun Page.contains(element: T): Boolean = element in elements() +operator fun Page.iterator() = elements().iterator() \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt new file mode 100644 index 0000000000..7af2fc1cad --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt @@ -0,0 +1,14 @@ +data class Point(val x: Int, val y: Int) + +operator fun Point.unaryMinus() = Point(-x, -y) +operator fun Point.not() = Point(y, x) +operator fun Point.inc() = Point(x + 1, y + 1) +operator fun Point.dec() = Point(x - 1, y - 1) + +operator fun Point.plus(other: Point): Point = Point(x + other.x, y + other.y) +operator fun Point.minus(other: Point): Point = Point(x - other.x, y - other.y) +operator fun Point.times(other: Point): Point = Point(x * other.x, y * other.y) +operator fun Point.div(other: Point): Point = Point(x / other.x, y / other.y) +operator fun Point.rem(other: Point): Point = Point(x % other.x, y % other.y) +operator fun Point.times(factor: Int): Point = Point(x * factor, y * factor) +operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt new file mode 100644 index 0000000000..abb4a4a00c --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt @@ -0,0 +1,30 @@ +interface View +class TextView(val value: String) : View +class ImageView(val url: String) : View + +class UI { + private val views = mutableListOf() + + operator fun String.unaryPlus() { + views.add(TextView(this)) + } + + operator fun View.unaryPlus() { + views.add(this) + } +} + +fun ui(init: UI.() -> Unit): UI { + val ui = UI() + ui.init() + + return ui +} + +fun main(args: Array) { + val header = ui { + +ImageView("http://logo.com") + +"Brand name" + +"Brand description" + } +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt new file mode 100644 index 0000000000..a3c671369c --- /dev/null +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt @@ -0,0 +1,4 @@ +operator fun MutableCollection.plusAssign(element: T) { + add(element) +} +operator fun BigInteger.plus(other: Int): BigInteger = add(BigInteger("$other")) \ No newline at end of file From a8d9eb084a9f48d14dd9af46e2f870b12df74c33 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 22 Nov 2018 23:47:49 +0330 Subject: [PATCH 22/73] Added two missing import statements --- core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt | 2 ++ core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt index ffaea71e1e..1bb015ac27 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt @@ -1,3 +1,5 @@ +import java.math.BigDecimal + enum class Currency { DOLLARS, EURO } diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt index a3c671369c..ba33d3e7a2 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt @@ -1,3 +1,5 @@ +import java.math.BigInteger + operator fun MutableCollection.plusAssign(element: T) { add(element) } From 1250605e19850ea102e4275fcc8a882220c82d97 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Sun, 25 Nov 2018 00:51:27 +0330 Subject: [PATCH 23/73] Added a new shape class instead of UI. --- .../kotlin/com/baeldung/operators/Point.kt | 17 ++++++++++- .../main/kotlin/com/baeldung/operators/UI.kt | 30 ------------------- 2 files changed, 16 insertions(+), 31 deletions(-) delete mode 100644 core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt index 7af2fc1cad..22617a4ee6 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt @@ -11,4 +11,19 @@ operator fun Point.times(other: Point): Point = Point(x * other.x, y * other.y) operator fun Point.div(other: Point): Point = Point(x / other.x, y / other.y) operator fun Point.rem(other: Point): Point = Point(x % other.x, y % other.y) operator fun Point.times(factor: Int): Point = Point(x * factor, y * factor) -operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) \ No newline at end of file +operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) + +class Shape { + private val points = mutableListOf() + + operator fun Point.unaryPlus() { + points.add(this) + } +} + +fun shape(init: Shape.() -> Unit): Shape { + val shape = Shape() + shape.init() + + return shape +} \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt deleted file mode 100644 index abb4a4a00c..0000000000 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/UI.kt +++ /dev/null @@ -1,30 +0,0 @@ -interface View -class TextView(val value: String) : View -class ImageView(val url: String) : View - -class UI { - private val views = mutableListOf() - - operator fun String.unaryPlus() { - views.add(TextView(this)) - } - - operator fun View.unaryPlus() { - views.add(this) - } -} - -fun ui(init: UI.() -> Unit): UI { - val ui = UI() - ui.init() - - return ui -} - -fun main(args: Array) { - val header = ui { - +ImageView("http://logo.com") - +"Brand name" - +"Brand description" - } -} \ No newline at end of file From ad8ae556a8a8e0673d8810490447366e5a544584 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 29 Nov 2018 13:30:52 +0330 Subject: [PATCH 24/73] Added a few unit tests for kotlin operator examples. --- .../kotlin/com/baeldung/operators/Money.kt | 2 + .../kotlin/com/baeldung/operators/Page.kt | 2 + .../kotlin/com/baeldung/operators/Point.kt | 4 +- .../kotlin/com/baeldung/operators/Utils.kt | 2 + .../kotlin/com/baeldung/operators/PageTest.kt | 28 +++++++++++ .../com/baeldung/operators/PointTest.kt | 48 +++++++++++++++++++ 6 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt index 1bb015ac27..93eb78c5b6 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Money.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + import java.math.BigDecimal enum class Currency { diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt index db03779b35..1077eb94f9 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Page.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + interface Page { fun pageNumber(): Int fun pageSize(): Int diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt index 22617a4ee6..e3282e64cc 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Point.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + data class Point(val x: Int, val y: Int) operator fun Point.unaryMinus() = Point(-x, -y) @@ -14,7 +16,7 @@ operator fun Point.times(factor: Int): Point = Point(x * factor, y * factor) operator fun Int.times(point: Point): Point = Point(point.x * this, point.y * this) class Shape { - private val points = mutableListOf() + val points = mutableListOf() operator fun Point.unaryPlus() { points.add(this) diff --git a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt index ba33d3e7a2..0f16544f38 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt +++ b/core-kotlin/src/main/kotlin/com/baeldung/operators/Utils.kt @@ -1,3 +1,5 @@ +package com.baeldung.operators + import java.math.BigInteger operator fun MutableCollection.plusAssign(element: T) { diff --git a/core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt new file mode 100644 index 0000000000..4217fc0c08 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/operators/PageTest.kt @@ -0,0 +1,28 @@ +package com.baeldung.operators + +import org.junit.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class PageTest { + + private val page = PageImpl(1, 10, "Java", "Kotlin", "Scala") + + @Test + fun `Get convention should work as expected`() { + assertEquals(page[1], "Kotlin") + assertEquals(page[1, 3], listOf("Kotlin", "Scala")) + } + + @Test + fun `In convention should work on a page as expected`() { + assertTrue("Kotlin" in page) + } + +} + +private class PageImpl(val page: Int, val size: Int, vararg val elements: T) : Page { + override fun pageNumber(): Int = page + override fun pageSize(): Int = size + override fun elements(): MutableList = mutableListOf(*elements) +} \ No newline at end of file diff --git a/core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt new file mode 100644 index 0000000000..168ab6431d --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/operators/PointTest.kt @@ -0,0 +1,48 @@ +package com.baeldung.operators + +import org.junit.Test +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +class PointTest { + + private val p1 = Point(1, 2) + private val p2 = Point(2, 3) + + @Test + fun `We should be able to add two points together using +`() { + assertEquals(p1 + p2, Point(3, 5)) + } + + @Test + fun `We shoud be able to subtract one point from another using -`() { + assertEquals(p1 - p2, Point(-1, -1)) + } + + @Test + fun `We should be able to multiply two points together with *`() { + assertEquals(p1 * p2, Point(2, 6)) + } + + @Test + fun `We should be able to divide one point by another`() { + assertEquals(p1 / p2, Point(0, 0)) + } + + @Test + fun `We should be able to scale a point by an integral factor`() { + assertEquals(p1 * 2, Point(2, 4)) + assertEquals(2 * p1, Point(2, 4)) + } + + @Test + fun `We should be able to add points to an empty shape`() { + val line = shape { + +Point(0, 0) + +Point(1, 3) + } + + assertTrue(Point(0, 0) in line.points) + assertTrue(Point(1, 3) in line.points) + } +} \ No newline at end of file From ef74a2538e126eec8bec6e5b81d6ecd570454c12 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Thu, 29 Nov 2018 15:57:06 +0330 Subject: [PATCH 25/73] Added a few unit tests for kotlin operator examples. --- .../test/kotlin/com/baeldung/operators/UtilsTest.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt b/core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt new file mode 100644 index 0000000000..4abe962cb5 --- /dev/null +++ b/core-kotlin/src/test/kotlin/com/baeldung/operators/UtilsTest.kt @@ -0,0 +1,13 @@ +package com.baeldung.operators + +import java.math.BigInteger +import org.junit.Test +import kotlin.test.assertEquals + +class UtilsTest { + + @Test + fun `We should be able to add an int value to an existing BigInteger using +`() { + assertEquals(BigInteger.ZERO + 1, BigInteger.ONE) + } +} \ No newline at end of file From f5b4a5e7023881474110c19e192246694b1bc99d Mon Sep 17 00:00:00 2001 From: Dionis Prifti Date: Thu, 29 Nov 2018 15:46:33 +0100 Subject: [PATCH 26/73] BAEL-2347: Added test examples for Coupound Assignment Operators. --- .../CompoundOperatorsTest.java | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java diff --git a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java new file mode 100644 index 0000000000..4a7833af95 --- /dev/null +++ b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java @@ -0,0 +1,111 @@ +package com.baeldung.compoundoperators; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class CompoundOperatorsTest { + + @Test + public void whenAssignmentOperatorIsUsed_thenValueIsAssigned() { + int x = 5; + + assertEquals(5, x); + } + + @Test + public void whenCompoundAssignmentUsed_thenSameAsSimpleAssignment() { + int a = 3, b = 3, c = -2; + a = a * c; // Simple assignment operator + b *= c; // Compound assignment operator + + assertEquals(a, b); + } + + @Test + public void whenAssignmentOperatorIsUsed_thenValueIsReturned() { + long x = 5; + long y = (x=3); + + assertEquals(3, y); + assertEquals(y, x); + } + + @Test + public void whenCompoundOperatorsAreUsed_thenOperationsArePerformedAndAssigned() { + //Simple assignment + int x = 5; //x is 5 + + //Incrementation + x += 5; //x is 10 + assertEquals(10, x); + + //Decrementation + x -= 2; //x is 8 + assertEquals(8, x); + + //Multiplication + x *= 2; //x is 16 + assertEquals(16, x); + + //Division + x /= 4; //x is 4 + assertEquals(4, x); + + //Modulus + x %= 3; //x is 1 + assertEquals(1, x); + + + //Binary AND + x &= 4; //x is 0 + assertEquals(0, x); + + //Binary exclusive OR + x ^= 4; //x is 4 + assertEquals(4, x); + + //Binary inclusive OR + x |= 8; //x is 12 + assertEquals(12, x); + + + //Binary Left Shift + x <<= 2; //x is 48 + assertEquals(48, x); + + //Binary Right Shift + x >>= 2; //x is 12 + assertEquals(12, x); + + //Shift right zero fill + x >>>= 1; //x is 6 + assertEquals(6, x); + } + + @Test(expected = NullPointerException.class) + public void whenArrayIsNull_thenThrowNullException() { + int[] numbers = null; + + //Trying Incrementation + numbers[2] += 5; + } + + @Test(expected = ArrayIndexOutOfBoundsException.class) + public void whenArrayIndexNotCorrect_thenThrowArrayIndexException() { + int[] numbers = {0, 1}; + + //Trying Incrementation + numbers[2] += 5; + } + + @Test + public void whenArrayIndexIsCorrect_thenPerformOperation() { + int[] numbers = {0, 1}; + + //Incrementation + numbers[1] += 5; + assertEquals(6, numbers[1]); + } + +} From 7b3e306d2288022591f0f63ac89fbaad606253be Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Thu, 29 Nov 2018 08:06:18 -0800 Subject: [PATCH 27/73] BAEL-2309 update readme --- core-java-lang/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 62af72818f..79d2375c24 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -57,4 +57,5 @@ - [“Sneaky Throws” in Java](http://www.baeldung.com/java-sneaky-throws) - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) +- [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) From 5812866573fbd12890b909f88331b238974b509f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Carrasquel?= Date: Thu, 29 Nov 2018 11:58:12 -0500 Subject: [PATCH 28/73] Ways to iterate over a list Issue: BAEL-2311 --- .../com/baeldung/java/list/WaysToIterate.java | 67 +++++++++++++++++ .../java/list/WaysToIterateUnitTest.java | 71 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java create mode 100644 core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java diff --git a/core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java b/core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java new file mode 100644 index 0000000000..3cce08eabb --- /dev/null +++ b/core-java-collections/src/main/java/com/baeldung/java/list/WaysToIterate.java @@ -0,0 +1,67 @@ +package com.baeldung.java.list; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +/** + * Demonstrates the different ways to loop over + * the elements of a list. + */ +public class WaysToIterate { + + List countries = Arrays.asList("Germany", "Panama", "Australia"); + + /** + * Iterate over a list using a basic for loop + */ + public void iterateWithForLoop() { + for (int i = 0; i < countries.size(); i++) { + System.out.println(countries.get(i)); + } + } + + /** + * Iterate over a list using the enhanced for loop + */ + public void iterateWithEnhancedForLoop() { + for (String country : countries) { + System.out.println(country); + } + } + + /** + * Iterate over a list using an Iterator + */ + public void iterateWithIterator() { + Iterator countriesIterator = countries.iterator(); + while(countriesIterator.hasNext()) { + System.out.println(countriesIterator.next()); + } + } + + /** + * Iterate over a list using a ListIterator + */ + public void iterateWithListIterator() { + ListIterator listIterator = countries.listIterator(); + while(listIterator.hasNext()) { + System.out.println(listIterator.next()); + } + } + + /** + * Iterate over a list using the Iterable.forEach() method + */ + public void iterateWithForEach() { + countries.forEach(System.out::println); + } + + /** + * Iterate over a list using the Stream.forEach() method + */ + public void iterateWithStreamForEach() { + countries.stream().forEach((c) -> System.out.println(c)); + } +} \ No newline at end of file diff --git a/core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java b/core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java new file mode 100644 index 0000000000..973c60b233 --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/java/list/WaysToIterateUnitTest.java @@ -0,0 +1,71 @@ +package com.baeldung.java.list; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +import org.junit.Test; + +public class WaysToIterateUnitTest { + + List globalCountries = new ArrayList(); + List europeanCountries = Arrays.asList("Germany", "Panama", "Australia"); + + @Test + public void whenIteratingUsingForLoop_thenReturnThreeAsSizeOfList() { + for (int i = 0; i < europeanCountries.size(); i++) { + globalCountries.add(europeanCountries.get(i)); + } + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingEnhancedForLoop_thenReturnThreeAsSizeOfList() { + for (String country : europeanCountries) { + globalCountries.add(country); + } + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingIterator_thenReturnThreeAsSizeOfList() { + Iterator countriesIterator = europeanCountries.iterator(); + while (countriesIterator.hasNext()) { + globalCountries.add(countriesIterator.next()); + } + + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingListIterator_thenReturnThreeAsSizeOfList() { + ListIterator countriesIterator = europeanCountries.listIterator(); + while (countriesIterator.hasNext()) { + globalCountries.add(countriesIterator.next()); + } + + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingForEach_thenReturnThreeAsSizeOfList() { + europeanCountries.forEach(country -> globalCountries.add(country)); + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } + + @Test + public void whenIteratingUsingStreamForEach_thenReturnThreeAsSizeOfList() { + europeanCountries.stream().forEach((country) -> globalCountries.add(country)); + assertEquals(globalCountries.size(), 3); + globalCountries.clear(); + } +} \ No newline at end of file From 3b42c4882005976595e55d9eb2239133859e4a34 Mon Sep 17 00:00:00 2001 From: Dionis Prifti Date: Thu, 29 Nov 2018 21:05:59 +0100 Subject: [PATCH 29/73] BAEL-2347: Fixed test about return value of assignment operator. --- .../com/baeldung/compoundoperators/CompoundOperatorsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java index 4a7833af95..3b3478b38e 100644 --- a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java +++ b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java @@ -24,8 +24,8 @@ public class CompoundOperatorsTest { @Test public void whenAssignmentOperatorIsUsed_thenValueIsReturned() { - long x = 5; - long y = (x=3); + long x = 1; + long y = (x+=2); assertEquals(3, y); assertEquals(y, x); From 97fe04aace59891d3746cf60d46929608053d12d Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Thu, 29 Nov 2018 23:30:46 +0200 Subject: [PATCH 30/73] reenabling some modules --- pom.xml | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 35a2de9a45..8fa93373fc 100644 --- a/pom.xml +++ b/pom.xml @@ -637,7 +637,7 @@ dubbo persistence-modules/flyway - + JGit jni jooby @@ -662,24 +662,13 @@ sse-jaxrs static-analysis stripe - + structurizr Twitter4J wicket xstream cas/cas-secured-app cas/cas-server - - - - - - - - - - - - + graphql/graphql-java @@ -687,9 +676,6 @@ spring-boot-custom-starter/greeter persistence-modules/spring-boot-h2/spring-boot-h2-database - - - flyway-cdi-extension spring-security-acl @@ -711,7 +697,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -734,8 +720,8 @@ spring-rest-angular spring-rest-full spring-rest-query-language - - + spring-rest + spring-rest-simple spring-resttemplate helidon @@ -1030,7 +1016,7 @@ jackson java-strings - + java-collections-conversions java-collections-maps java-streams @@ -1114,9 +1100,10 @@ rabbitmq - persistence-modules/spring-data-mongodb - --> From 71f76d28ccddb5780254968c81a2810818f8e9ae Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Thu, 29 Nov 2018 16:15:20 -0800 Subject: [PATCH 31/73] BAEL-2279 update readme --- spring-5-reactive/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 267925b798..4fab0c12ad 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -16,3 +16,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Server-Sent Events in Spring](https://www.baeldung.com/spring-server-sent-events) - [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) - [Validation for Functional Endpoints in Spring 5](https://www.baeldung.com/spring-functional-endpoints-validation) +- [Logging a Reactive Sequence](https://www.baeldung.com/spring-reactive-sequence-logging) From 02fc56c41bd5004bef4d2d4c091eccde2a341285 Mon Sep 17 00:00:00 2001 From: Kevin Gilmore Date: Thu, 29 Nov 2018 20:54:00 -0600 Subject: [PATCH 32/73] BAEL-2354: add link back to article --- cdi/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cdi/README.md b/cdi/README.md index 0477ce85bd..1523aacf6b 100644 --- a/cdi/README.md +++ b/cdi/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [CDI Interceptor vs Spring AspectJ](http://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) - [An Introduction to CDI (Contexts and Dependency Injection) in Java](http://www.baeldung.com/java-ee-cdi) +- [Introduction to the Event Notification Model in CDI 2.0](https://www.baeldung.com/cdi-event-notification) From f4c5f8b8ae250190defaabe7df9c832a3a80659a Mon Sep 17 00:00:00 2001 From: raghav-jha Date: Fri, 30 Nov 2018 11:40:11 +0530 Subject: [PATCH 33/73] JPA One-To-One Association Tutorial Issue: BAEL-2394 --- .../hibernate/onetoone/HibernateUtil.java | 38 +++++++++ .../baeldung/hibernate/onetoone/Strategy.java | 25 ++++++ .../onetoone/foreignkeybased/Address.java | 60 ++++++++++++++ .../onetoone/foreignkeybased/User.java | 51 ++++++++++++ .../onetoone/jointablebased/Employee.java | 53 ++++++++++++ .../onetoone/jointablebased/WorkStation.java | 61 ++++++++++++++ .../onetoone/sharedkeybased/Address.java | 60 ++++++++++++++ .../onetoone/sharedkeybased/User.java | 50 ++++++++++++ .../src/main/resources/one-to-one.cfg.xml | 16 ++++ ...ToOneAnnotationFKBasedIntegrationTest.java | 80 +++++++++++++++++++ ...ToOneAnnotationJTBasedIntegrationTest.java | 80 +++++++++++++++++++ ...oOneAnnotationSPKBasedIntegrationTest.java | 79 ++++++++++++++++++ .../src/test/resources/one-to-one.cfg.xml | 16 ++++ 13 files changed, 669 insertions(+) create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java create mode 100644 persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml create mode 100644 persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java create mode 100644 persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java create mode 100644 persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java create mode 100644 persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java new file mode 100644 index 0000000000..899fcde947 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/HibernateUtil.java @@ -0,0 +1,38 @@ +package com.baeldung.hibernate.onetoone; + +import org.hibernate.SessionFactory; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.Configuration; +import org.hibernate.service.ServiceRegistry; + +public class HibernateUtil { + private static SessionFactory sessionFactory; + + private static SessionFactory buildSessionFactory(Strategy strategy) { + try { + // Create the SessionFactory from hibernate-annotation.cfg.xml + Configuration configuration = new Configuration(); + + for (Class entityClass : strategy.getEntityClasses()) { + configuration.addAnnotatedClass(entityClass); + } + configuration.configure("one-to-one.cfg.xml"); + + ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()) + .build(); + + SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry); + + return sessionFactory; + } catch (Throwable ex) { + ex.printStackTrace(); + throw new ExceptionInInitializerError(ex); + } + } + + public static SessionFactory getSessionFactory(Strategy strategy) { + if (sessionFactory == null) + sessionFactory = buildSessionFactory(strategy); + return sessionFactory; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java new file mode 100644 index 0000000000..3180566ca5 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/Strategy.java @@ -0,0 +1,25 @@ +package com.baeldung.hibernate.onetoone; + + +import java.util.Arrays; +import java.util.List; + +public enum Strategy { + //See that the classes belongs to different packages + FOREIGN_KEY(Arrays.asList(com.baeldung.hibernate.onetoone.foreignkeybased.User.class, + com.baeldung.hibernate.onetoone.foreignkeybased.Address.class)), + SHARED_PRIMARY_KEY(Arrays.asList(com.baeldung.hibernate.onetoone.sharedkeybased.User.class, + com.baeldung.hibernate.onetoone.sharedkeybased.Address.class)), + JOIN_TABLE_BASED(Arrays.asList(com.baeldung.hibernate.onetoone.jointablebased.Employee.class, + com.baeldung.hibernate.onetoone.jointablebased.WorkStation.class)); + + private List> entityClasses; + + Strategy(List> entityClasses) { + this.entityClasses = entityClasses; + } + + public List> getEntityClasses() { + return entityClasses; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java new file mode 100644 index 0000000000..e05eb46030 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/Address.java @@ -0,0 +1,60 @@ +package com.baeldung.hibernate.onetoone.foreignkeybased; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "address") +public class Address { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "street") + private String street; + + @Column(name = "city") + private String city; + + @OneToOne(mappedBy = "address") + private User user; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java new file mode 100644 index 0000000000..56b108d0d1 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/foreignkeybased/User.java @@ -0,0 +1,51 @@ +package com.baeldung.hibernate.onetoone.foreignkeybased; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "users") +public class User { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "username") + private String userName; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "address_id", referencedColumnName = "id") + private Address address; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java new file mode 100644 index 0000000000..a0bc101b9f --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/Employee.java @@ -0,0 +1,53 @@ +package com.baeldung.hibernate.onetoone.jointablebased; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "employee") +public class Employee { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "ename") + private String name; + + @OneToOne(cascade = CascadeType.ALL) + @JoinTable(name = "emp_workstation", joinColumns = {@JoinColumn(name = "employee_id", referencedColumnName = "id")}, + inverseJoinColumns = {@JoinColumn(name = "workstation_id", referencedColumnName = "id")}) + private WorkStation workStation; + + 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 WorkStation getWorkStation() { + return workStation; + } + + public void setWorkStation(WorkStation workStation) { + this.workStation = workStation; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java new file mode 100644 index 0000000000..f530611f6e --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/jointablebased/WorkStation.java @@ -0,0 +1,61 @@ +package com.baeldung.hibernate.onetoone.jointablebased; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "workstation") +public class WorkStation { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "workstation_number") + private Integer workstationNumber; + + @Column(name = "floor") + private String floor; + + @OneToOne(mappedBy = "workStation") + private Employee employee; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getWorkstationNumber() { + return workstationNumber; + } + + public void setWorkstationNumber(Integer workstationNumber) { + this.workstationNumber = workstationNumber; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public Employee getEmployee() { + return employee; + } + + public void setEmployee(Employee employee) { + this.employee = employee; + } +} \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java new file mode 100644 index 0000000000..927516f6bb --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/Address.java @@ -0,0 +1,60 @@ +package com.baeldung.hibernate.onetoone.sharedkeybased; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.MapsId; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "address") +public class Address { + + @Id + @Column(name = "id") + private Long id; + + @Column(name = "street") + private String street; + + @Column(name = "city") + private String city; + + @OneToOne + @MapsId + private User user; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java new file mode 100644 index 0000000000..fa00db1271 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/java/com/baeldung/hibernate/onetoone/sharedkeybased/User.java @@ -0,0 +1,50 @@ +package com.baeldung.hibernate.onetoone.sharedkeybased; + + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "users") +public class User { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @Column(name = "id") + private Long id; + + @Column(name = "username") + private String userName; + + @OneToOne(mappedBy = "user", cascade = CascadeType.ALL) + private Address address; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } +} diff --git a/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml b/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml new file mode 100644 index 0000000000..7522036acb --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/main/resources/one-to-one.cfg.xml @@ -0,0 +1,16 @@ + + + + + org.h2.Driver + + jdbc:h2:mem:spring_hibernate_one_to_one + sa + org.hibernate.dialect.H2Dialect + thread + true + create-drop + + \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java new file mode 100644 index 0000000000..475c93f6ff --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationFKBasedIntegrationTest.java @@ -0,0 +1,80 @@ +package com.baeldung.hibernate.onetoone; + +import com.baeldung.hibernate.onetoone.foreignkeybased.Address; +import com.baeldung.hibernate.onetoone.foreignkeybased.User; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class HibernateOneToOneAnnotationFKBasedIntegrationTest { + + private static SessionFactory sessionFactory; + + private Session session; + + @BeforeClass + public static void beforeTests() { + sessionFactory = HibernateUtil.getSessionFactory(Strategy.FOREIGN_KEY); + } + + @Before + public void setUp() { + session = sessionFactory.openSession(); + session.beginTransaction(); + } + + @Test + public void givenData_whenInsert_thenCreates1to1relationship() { + User user = new User(); + user.setUserName("alice@baeldung.com"); + + Address address = new Address(); + address.setStreet("FK Street"); + address.setCity("FK City"); + + address.setUser(user); + user.setAddress(address); + + //Address entry will automatically be created by hibernate, since cascade type is specified as ALL + session.persist(user); + session.getTransaction().commit(); + + assert1to1InsertedData(); + } + + private void assert1to1InsertedData() { + @SuppressWarnings("unchecked") + List userList = session.createQuery("FROM User").list(); + + assertNotNull(userList); + assertEquals(1, userList.size()); + + User user = userList.get(0); + assertEquals("alice@baeldung.com", user.getUserName()); + + Address address = user.getAddress(); + assertNotNull(address); + assertEquals("FK Street", address.getStreet()); + assertEquals("FK City", address.getCity()); + + } + + @After + public void tearDown() { + session.close(); + } + + @AfterClass + public static void afterTests() { + sessionFactory.close(); + } +} diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java new file mode 100644 index 0000000000..df4cd4d137 --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationJTBasedIntegrationTest.java @@ -0,0 +1,80 @@ +package com.baeldung.hibernate.onetoone; + +import com.baeldung.hibernate.onetoone.jointablebased.Employee; +import com.baeldung.hibernate.onetoone.jointablebased.WorkStation; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class HibernateOneToOneAnnotationJTBasedIntegrationTest { + + private static SessionFactory sessionFactory; + + private Session session; + + @BeforeClass + public static void beforeTests() { + sessionFactory = HibernateUtil.getSessionFactory(Strategy.JOIN_TABLE_BASED); + } + + @Before + public void setUp() { + session = sessionFactory.openSession(); + session.beginTransaction(); + } + + @Test + public void givenData_whenInsert_thenCreates1to1relationship() { + Employee employee = new Employee(); + employee.setName("bob@baeldung.com"); + + WorkStation workStation = new WorkStation(); + workStation.setWorkstationNumber(626); + workStation.setFloor("Sixth Floor"); + + + employee.setWorkStation(workStation); + workStation.setEmployee(employee); + + session.persist(employee); + session.getTransaction().commit(); + + assert1to1InsertedData(); + } + + private void assert1to1InsertedData() { + @SuppressWarnings("unchecked") + List employeeList = session.createQuery("FROM Employee").list(); + assertNotNull(employeeList); + assertEquals(1, employeeList.size()); + + Employee employee = employeeList.get(0); + assertEquals("bob@baeldung.com", employee.getName()); + + WorkStation workStation = employee.getWorkStation(); + + assertNotNull(workStation); + assertEquals((long) 626, (long) workStation.getWorkstationNumber()); + assertEquals("Sixth Floor", workStation.getFloor()); + + } + + @After + public void tearDown() { + session.close(); + } + + @AfterClass + public static void afterTests() { + sessionFactory.close(); + } +} diff --git a/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java new file mode 100644 index 0000000000..7931a8e3fe --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/java/com/baeldung/hibernate/onetoone/HibernateOneToOneAnnotationSPKBasedIntegrationTest.java @@ -0,0 +1,79 @@ +package com.baeldung.hibernate.onetoone; + +import com.baeldung.hibernate.onetoone.sharedkeybased.Address; +import com.baeldung.hibernate.onetoone.sharedkeybased.User; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class HibernateOneToOneAnnotationSPKBasedIntegrationTest { + + private static SessionFactory sessionFactory; + + private Session session; + + @BeforeClass + public static void beforeTests() { + sessionFactory = HibernateUtil.getSessionFactory(Strategy.SHARED_PRIMARY_KEY); + } + + @Before + public void setUp() { + session = sessionFactory.openSession(); + session.beginTransaction(); + } + + @Test + public void givenData_whenInsert_thenCreates1to1relationship() { + User user = new User(); + user.setUserName("alice@baeldung.com"); + + Address address = new Address(); + address.setStreet("SPK Street"); + address.setCity("SPK City"); + + address.setUser(user); + user.setAddress(address); + + //Address entry will automatically be created by hibernate, since cascade type is specified as ALL + session.persist(user); + session.getTransaction().commit(); + + assert1to1InsertedData(); + } + + + private void assert1to1InsertedData() { + @SuppressWarnings("unchecked") + List userList = session.createQuery("FROM User").list(); + assertNotNull(userList); + assertEquals(1, userList.size()); + + User user = userList.get(0); + assertEquals("alice@baeldung.com", user.getUserName()); + + Address address = user.getAddress(); + assertNotNull(address); + assertEquals("SPK Street", address.getStreet()); + assertEquals("SPK City", address.getCity()); + } + + @After + public void tearDown() { + session.close(); + } + + @AfterClass + public static void afterTests() { + sessionFactory.close(); + } +} diff --git a/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml b/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml new file mode 100644 index 0000000000..60417e312d --- /dev/null +++ b/persistence-modules/spring-hibernate-5/src/test/resources/one-to-one.cfg.xml @@ -0,0 +1,16 @@ + + + + + org.h2.Driver + + jdbc:h2:mem:spring_hibernate_one_to_one + sa + org.hibernate.dialect.H2Dialect + thread + true + create-drop + + From ee6162e04b5394ce234c3e8c0cdd283bf26fa989 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 09:05:42 +0200 Subject: [PATCH 34/73] Update README.md (#5794) --- patterns/design-patterns/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/patterns/design-patterns/README.md b/patterns/design-patterns/README.md index ae372bd460..e56872b3fd 100644 --- a/patterns/design-patterns/README.md +++ b/patterns/design-patterns/README.md @@ -13,3 +13,4 @@ - [Interpreter Design Pattern in Java](http://www.baeldung.com/java-interpreter-pattern) - [State Design Pattern in Java](https://www.baeldung.com/java-state-design-pattern) - [The Decorator Pattern in Java](https://www.baeldung.com/java-decorator-pattern) +- [Abstract Factory Pattern in Java](https://www.baeldung.com/java-abstract-factory-pattern) From e98f2f4f605f8fb805609bbe6ecb664c699e3b57 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 10:27:43 +0200 Subject: [PATCH 35/73] Update README.md --- core-java-lang/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 79d2375c24..607abbcdc5 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -58,4 +58,3 @@ - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) - From 30bbc946d203b16c81b21c7bdbf4d12714a87830 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Fri, 30 Nov 2018 12:06:24 +0200 Subject: [PATCH 36/73] pom cleanup --- pom.xml | 1043 +++++++++++++++++-------------------------------------- 1 file changed, 316 insertions(+), 727 deletions(-) diff --git a/pom.xml b/pom.xml index 8fa93373fc..d149e07f57 100644 --- a/pom.xml +++ b/pom.xml @@ -323,207 +323,164 @@ parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin - asm - atomix - persistence-modules/apache-cayenne - aws - aws-lambda - akka-streams - algorithms-genetic - algorithms-miscellaneous-1 - algorithms-miscellaneous-2 - algorithms-sorting - annotations - apache-cxf - apache-fop - apache-geode - apache-poi - apache-tika - apache-thrift - apache-curator - apache-zookeeper - apache-opennlp - autovalue - axon - azure - bootique - cdi - java-strings - - core-java - core-java-lang - core-java-arrays - core-java-collections - java-collections-conversions - java-collections-maps - core-java-io - core-java-8 - java-streams - persistence-modules/core-java-persistence - core-kotlin - kotlin-libraries - core-groovy - core-java-concurrency - core-java-concurrency-collections - couchbase - persistence-modules/deltaspike - dozer - ethereum - feign - flips - testing-modules/groovy-spock - testing-modules/load-testing-comparison - google-cloud - google-web-toolkit - gson - guava - guava-collections - guava-modules/guava-18 - guava-modules/guava-19 - guava-modules/guava-21 - guice - disruptor - core-scala - spring-static-resources - hazelcast - persistence-modules/hbase - persistence-modules/hibernate5 - httpclient - hystrix - image-processing - immutables - persistence-modules/influxdb - jackson - persistence-modules/java-cassandra - vavr - java-lite - java-numbers - java-rmi - java-vavr-stream - javax-servlets - javaxval - jaxb - javafx - jgroups - jee-7 - jee-7-security - jhipster - jjwt - jsf - json-path - json - jsoup - testing-modules/junit-5 - - libraries - libraries-data - libraries-security - libraries-server - linkrest - logging-modules/log-mdc - logging-modules/log4j - logging-modules/log4j2 - logging-modules/logback - lombok - mapstruct - metrics - maven - mesos-marathon - msf4j - testing-modules/mockito - testing-modules/mockito-2 - testing-modules/mocks - mustache - mvn-wrapper - noexception - persistence-modules/orientdb - osgi - orika - patterns - pdf - protobuffer - persistence-modules/querydsl - reactor-core - persistence-modules/redis - testing-modules/rest-assured - testing-modules/rest-testing - resteasy - rxjava - rxjava-2 - spring-swagger-codegen - testing-modules/selenium-junit-testng - persistence-modules/solr - spark-java - spring-4 - spring-5 - spring-5-data-reactive - spring-5-reactive - spring-5-reactive-security - spring-5-reactive-client - spring-5-mvc - spring-5-security - spring-5-security-oauth - spring-5-reactive-oauth - spring-activiti - spring-akka - spring-amqp - spring-all - spring-amqp-simple - spring-apache-camel - spring-batch - spring-bom - spring-boot - spring-boot-client - spring-boot-keycloak - spring-boot-bootstrap - spring-boot-admin - spring-boot-camel - spring-boot-ops - persistence-modules/spring-boot-persistence - spring-boot-security - spring-boot-mvc - spring-boot-vue - spring-boot-logging-log4j2 - spring-boot-disable-console-logging - spring-cloud-data-flow - spring-cloud - spring-cloud-bus - spring-core - spring-cucumber - spring-ejb - spring-aop - persistence-modules/spring-data-cassandra - persistence-modules/spring-data-couchbase-2 - persistence-modules/spring-data-dynamodb - persistence-modules/spring-data-elasticsearch - persistence-modules/spring-data-jpa - persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb - persistence-modules/spring-data-neo4j - persistence-modules/spring-data-redis - spring-data-rest - persistence-modules/spring-data-solr - spring-dispatcher-servlet - spring-exceptions - spring-freemarker - persistence-modules/spring-hibernate-3 - persistence-modules/spring-hibernate4 - persistence-modules/spring-hibernate-5 - persistence-modules/spring-data-eclipselink - spring-integration - spring-jenkins-pipeline - spring-jersey - jmeter - spring-jms - spring-jooq - persistence-modules/spring-jpa - ddd - + parent-boot-2 + parent-spring-4 + parent-spring-5 + parent-java + parent-kotlin + + asm + atomix + aws + aws-lambda + akka-streams + algorithms-genetic + algorithms-miscellaneous-1 + algorithms-miscellaneous-2 + algorithms-sorting + annotations + apache-cxf + apache-fop + apache-poi + apache-tika + apache-thrift + apache-curator + apache-zookeeper + apache-opennlp + autovalue + axon + azure + apache-velocity + apache-solrj + apache-meecrowave + antlr + + bootique + + cdi + core-java-collections + core-java-io + core-java-8 + core-groovy + couchbase + + dozer + disruptor + drools + deeplearning4j + + ethereum + + feign + flips + + google-cloud + gson + guava + guava-collections + guava-modules/guava-18 + guava-modules/guava-19 + guava-modules/guava-21 + guice + + hazelcast + hystrix + httpclient + + image-processing + immutables + + jackson + java-strings + + java-collections-conversions + java-collections-maps + java-streams + java-lite + java-numbers + java-rmi + java-vavr-stream + javax-servlets + javaxval + jaxb + javafx + jgroups + jee-7 + jee-7-security + jjwt + jsf + json-path + json + jsoup + jta + jws + jersey + java-spi + java-ee-8-security-api + + libraries-data + linkrest + logging-modules/log-mdc + logging-modules/log4j + logging-modules/logback + lombok + lucene + + mapstruct + maven + mesos-marathon + msf4j + mustache + mvn-wrapper + mybatis + metrics + maven-archetype + + noexception + + osgi + orika + + patterns + pdf + protobuffer + performance-tests + + persistence-modules/java-jdbi + persistence-modules/redis + persistence-modules/orientdb + persistence-modules/querydsl + persistence-modules/apache-cayenne + persistence-modules/solr + persistence-modules/spring-data-dynamodb + persistence-modules/spring-data-keyvalue + persistence-modules/spring-data-neo4j + persistence-modules/spring-data-solr + persistence-modules/spring-hibernate-5 + persistence-modules/spring-data-eclipselink + persistence-modules/spring-jpa + persistence-modules/spring-hibernate-3 + persistence-modules/spring-data-gemfire + persistence-modules/spring-boot-persistence + persistence-modules/liquibase + persistence-modules/java-cockroachdb + persistence-modules/deltaspike + persistence-modules/hbase + persistence-modules/influxdb + persistence-modules/spring-hibernate4 + + reactor-core + resteasy + rxjava + rxjava-2 + rabbitmq + + + + persistence-modules/spring-data-mongodb + @@ -562,148 +519,50 @@ parent-java parent-kotlin - spring-session - spring-sleuth - spring-social-login - spring-spel - spring-state-machine - spring-thymeleaf - spring-userservice - spring-zuul - spring-remoting - spring-reactor - spring-vertx - spring-jinq - spring-rest-embedded-tomcat - testing-modules/testing - testing-modules/testng - video-tutorials - xml - xmlunit-2 - struts-2 - apache-velocity - apache-solrj - rabbitmq - vertx - persistence-modules/spring-data-gemfire - mybatis - spring-drools - drools - persistence-modules/liquibase - spring-boot-property-exp - testing-modules/mockserver - testing-modules/test-containers - undertow - vaadin - vertx-and-rxjava - saas - deeplearning4j - lucene - vraptor - persistence-modules/java-cockroachdb - spring-security-thymeleaf - persistence-modules/java-jdbi - jersey - java-spi - performance-tests - twilio - spring-boot-ctx-fluent - java-ee-8-security-api - spring-webflux-amqp - antlr - maven-archetype - optaplanner - apache-meecrowave - spring-reactive-kotlin - persistence-modules/jnosql - spring-boot-angular-ecommerce - jta - - java-websocket - persistence-modules/activejdbc - animal-sniffer-mvn-plugin - apache-avro - apache-bval - apache-shiro - apache-spark - asciidoctor - checker-plugin - - - core-java-sun - custom-pmd - dagger - data-structures - dubbo - persistence-modules/flyway - - JGit - jni - jooby - - - - ratpack - rest-with-spark-java - spring-boot-autoconfiguration - spring-boot-custom-starter - spring-boot-jasypt - spring-data-rest-querydsl - spring-groovy - spring-mobile - spring-mustache - spring-mvc-simple - spring-mybatis - spring-rest-hal-browser - spring-rest-shell - spring-rest-template - spring-roo - spring-security-stormpath - sse-jaxrs - static-analysis - stripe - structurizr - Twitter4J - wicket - xstream - cas/cas-secured-app - cas/cas-server - graphql/graphql-java - - - - - spring-boot-custom-starter/greeter - persistence-modules/spring-boot-h2/spring-boot-h2-database - - flyway-cdi-extension + spring-4 + spring-5 + spring-5-reactive + spring-5-reactive-security + spring-5-reactive-client + spring-5-mvc + spring-5-security + spring-5-security-oauth + spring-activiti + spring-akka + spring-amqp + spring-all + spring-apache-camel + spring-batch + spring-bom - spring-security-acl - spring-security-cache-control - spring-security-client/spring-security-jsp-authentication - spring-security-client/spring-security-jsp-authorize - spring-security-client/spring-security-jsp-config - spring-security-client/spring-security-mvc - spring-security-client/spring-security-thymeleaf-authentication - spring-security-client/spring-security-thymeleaf-authorize - spring-security-client/spring-security-thymeleaf-config - spring-security-core - spring-security-mvc-boot - spring-security-mvc-custom - spring-security-mvc-digest-auth - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc-session - spring-security-mvc-socket - spring-security-openid - spring-security-react - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-rest - spring-security-sso - spring-security-x509 + spring-boot-keycloak + spring-boot-bootstrap + spring-boot-admin + spring-boot-camel + spring-boot-security + spring-boot-mvc + spring-boot-logging-log4j2 + spring-boot-disable-console-logging + spring-cloud-data-flow + spring-cloud + spring-cloud-bus + spring-core + spring-cucumber + spring-ejb + spring-aop + + spring-data-rest + spring-dispatcher-servlet + spring-exceptions + spring-freemarker + + spring-integration + spring-jenkins-pipeline + spring-jersey + + spring-jms + spring-jooq spring-kafka spring-katharsis spring-ldap @@ -721,49 +580,118 @@ spring-rest-full spring-rest-query-language spring-rest - spring-rest-simple spring-resttemplate - helidon - - - - - - default-third - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 3 - true - - **/*IntegrationTest.java - **/*IntTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - **/*JdbcTest.java - **/*LiveTest.java - - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin + spring-rest-simple + spring-security-acl + spring-security-cache-control + spring-security-client/spring-security-jsp-authentication + spring-security-client/spring-security-jsp-authorize + spring-security-client/spring-security-jsp-config + spring-security-client/spring-security-mvc + spring-security-client/spring-security-thymeleaf-authentication + spring-security-client/spring-security-thymeleaf-authorize + spring-security-client/spring-security-thymeleaf-config + spring-security-core + spring-security-mvc-boot + spring-security-mvc-digest-auth + spring-security-mvc-ldap + spring-security-mvc-login + spring-security-mvc-persisted-remember-me + spring-security-mvc-session + spring-security-mvc-socket + spring-security-openid + + spring-security-rest-basic-auth + spring-security-rest-custom + spring-security-rest + spring-security-sso + spring-security-x509 + spring-session + spring-sleuth + spring-social-login + spring-spel + spring-state-machine + spring-thymeleaf + spring-userservice + spring-zuul + spring-remoting + spring-reactor + spring-vertx + spring-vault + spring-jinq + spring-rest-embedded-tomcat + spring-static-resources + spring-swagger-codegen + spring-drools + spring-boot-property-exp + spring-security-thymeleaf + spring-boot-ctx-fluent + spring-webflux-amqp + + spark-java + saas + struts-2 + + testing-modules/selenium-junit-testng + testing-modules/groovy-spock + testing-modules/mockito + testing-modules/mockito-2 + testing-modules/mocks + testing-modules/rest-assured + testing-modules/rest-testing + testing-modules/junit-5 + testing-modules/junit5-migration + testing-modules/testing + testing-modules/testng + testing-modules/mockserver + testing-modules/test-containers + twilio + + undertow + + video-tutorials + vaadin + vertx-and-rxjava + vraptor + vertx + vavr + + xmlunit-2 + xml + + + + + + + spring-boot + spring-boot-ops + core-kotlin + core-java + google-web-toolkit + spring-security-mvc-custom + core-java-concurrency + --> + + + + @@ -1140,6 +1068,7 @@ parent-kotlin spring-4 + spring-5 spring-5-reactive spring-5-reactive-security spring-5-reactive-client @@ -1248,45 +1177,6 @@ spring-boot-ctx-fluent spring-webflux-amqp - - - - - - - - - integration-lite-third - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin spark-java saas @@ -1338,320 +1228,19 @@ testing-modules/gatling spring-boot spring-boot-ops - spring-5 core-kotlin core-java google-web-toolkit spring-security-mvc-custom core-java-concurrency --> - - - - - - - - integration - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*ManualTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*IntTest.java - - - - - - - - - parent-boot-1 - parent-boot-2 - parent-spring-4 - parent-spring-5 - parent-java - parent-kotlin - - - - - - - - - - testing-modules/mockito - testing-modules/mockito-2 - testing-modules/mocks - mustache - mvn-wrapper - noexception - persistence-modules/orientdb - osgi - orika - patterns - pdf - protobuffer - persistence-modules/querydsl - reactor-core - persistence-modules/redis - testing-modules/rest-assured - testing-modules/rest-testing - resteasy - rxjava - rxjava-2 - spring-swagger-codegen - testing-modules/selenium-junit-testng - persistence-modules/solr - spark-java - spring-4 - spring-5 - spring-5-data-reactive - spring-5-reactive - spring-5-reactive-security - spring-5-reactive-client - spring-5-mvc - spring-5-security - spring-5-security-oauth - spring-activiti - spring-akka - spring-amqp - spring-all + + + - - - - spring-bom - spring-boot - spring-boot-client - spring-boot-keycloak - spring-boot-bootstrap - spring-boot-admin - spring-boot-camel - spring-boot-ops - persistence-modules/spring-boot-persistence - spring-boot-security - spring-boot-mvc - spring-boot-logging-log4j2 - spring-boot-disable-console-logging - spring-cloud-data-flow - spring-cloud - spring-cloud-bus - spring-core - spring-cucumber - spring-ejb - spring-aop - persistence-modules/spring-data-cassandra - persistence-modules/spring-data-couchbase-2 - persistence-modules/spring-data-dynamodb - persistence-modules/spring-data-elasticsearch - persistence-modules/spring-data-keyvalue - persistence-modules/spring-data-mongodb - persistence-modules/spring-data-jpa - persistence-modules/spring-data-neo4j - persistence-modules/spring-data-redis - spring-data-rest - - - - - - - persistence-modules/spring-data-solr - spring-dispatcher-servlet - spring-exceptions - spring-freemarker - persistence-modules/spring-hibernate-3 - persistence-modules/spring-hibernate4 - persistence-modules/spring-hibernate-5 - persistence-modules/spring-data-eclipselink - spring-integration - spring-jenkins-pipeline - spring-jersey - spring-jms - spring-jooq - persistence-modules/spring-jpa - spring-kafka - spring-katharsis - spring-ldap - spring-mockito - spring-mvc-forms-jsp - spring-mvc-forms-thymeleaf - spring-mvc-java - spring-mvc-velocity - spring-mvc-webflow - spring-mvc-xml - spring-mvc-kotlin - spring-protobuf - spring-quartz - spring-rest-angular - spring-rest-full - spring-rest-query-language - spring-rest - spring-resttemplate - spring-rest-simple - spring-reactive-kotlin - - - - - - - - - - - - - - - - java-websocket - persistence-modules/activejdbc - animal-sniffer-mvn-plugin - apache-avro - apache-bval - apache-shiro - apache-spark - asciidoctor - checker-plugin - - - core-java-sun - custom-pmd - dagger - data-structures - dubbo - persistence-modules/flyway - - - jni - jooby - - - - ratpack - rest-with-spark-java - spring-boot-autoconfiguration - spring-boot-custom-starter - spring-boot-jasypt - spring-data-rest-querydsl - spring-groovy - spring-mobile - spring-mustache - spring-mvc-simple - spring-mybatis - spring-rest-hal-browser - spring-rest-shell - spring-rest-template - spring-roo - spring-security-stormpath - sse-jaxrs - static-analysis - stripe - - - wicket - xstream - cas/cas-secured-app - - - - - - - - - - - - - - jenkins/hello-world - - - - spring-boot-custom-starter/greeter - persistence-modules/spring-boot-h2/spring-boot-h2-database - - - - + spring-5-data-reactive + --> + From 7be6c2f8de71a4e60f6177b2dd33d2d0c9c9098a Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Fri, 30 Nov 2018 13:10:10 +0200 Subject: [PATCH 37/73] minor pom cleanup --- pom.xml | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index d149e07f57..ef7a7f6b1d 100644 --- a/pom.xml +++ b/pom.xml @@ -468,6 +468,11 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 + persistence-modules/spring-data-mongodb + persistence-modules/java-cassandra + persistence-modules/spring-data-cassandra + persistence-modules/spring-data-couchbase-2 + persistence-modules/spring-data-redis reactor-core resteasy @@ -475,12 +480,6 @@ rxjava-2 rabbitmq - - - persistence-modules/spring-data-mongodb - @@ -600,7 +599,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -628,7 +627,7 @@ spring-security-thymeleaf spring-boot-ctx-fluent spring-webflux-amqp - + spark-java saas struts-2 @@ -662,12 +661,7 @@ @@ -1020,6 +1014,11 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 + persistence-modules/spring-data-mongodb + persistence-modules/java-cassandra + persistence-modules/spring-data-cassandra + persistence-modules/spring-data-couchbase-2 + persistence-modules/spring-data-redis reactor-core resteasy @@ -1027,12 +1026,6 @@ rxjava-2 rabbitmq - - - persistence-modules/spring-data-mongodb - @@ -1148,7 +1141,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From 55aff7f5f21fefbf89f8854b38f99813d1e5fd4e Mon Sep 17 00:00:00 2001 From: FrancoCorleone Date: Fri, 30 Nov 2018 13:35:27 +0100 Subject: [PATCH 38/73] Upgrading commons lang3 and guava dependencies (#5790) * Upgrading Guava package * Upgrading commons lang3 package --- java-strings/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-strings/pom.xml b/java-strings/pom.xml index ab94c28d4d..f4fb1c0865 100755 --- a/java-strings/pom.xml +++ b/java-strings/pom.xml @@ -122,13 +122,13 @@ - 3.5 + 3.8.1 1.10 3.6.1 1.19 61.1 - 26.0-jre + 27.0.1-jre From a797be29bd1a75868e9714d3a84c0f86260a79cc Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Fri, 30 Nov 2018 18:43:11 +0200 Subject: [PATCH 39/73] temporarily disabling the module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ef7a7f6b1d..da17fc2931 100644 --- a/pom.xml +++ b/pom.xml @@ -599,7 +599,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -1141,7 +1141,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From 4058bfc60114b9a32e69474bfb6e4b148ff06331 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 30 Nov 2018 22:16:08 +0530 Subject: [PATCH 40/73] BAEL-9567 Align module names, folder names and artifact id - Added "name" in pom.xml whereever it was missing and aligned the present ones with the artifactid and foldername --- algorithms-genetic/pom.xml | 4 +-- algorithms-miscellaneous-1/pom.xml | 4 +-- algorithms-miscellaneous-2/pom.xml | 2 +- algorithms-sorting/pom.xml | 2 +- annotations/annotation-processing/pom.xml | 3 +- annotations/annotation-user/pom.xml | 1 + annotations/pom.xml | 3 +- apache-avro/pom.xml | 3 +- apache-bval/pom.xml | 3 +- apache-curator/pom.xml | 1 + apache-cxf/cxf-aegis/pom.xml | 3 +- apache-cxf/cxf-introduction/pom.xml | 3 +- apache-cxf/cxf-jaxrs-implementation/pom.xml | 3 +- apache-cxf/cxf-spring/pom.xml | 1 + apache-cxf/pom.xml | 2 +- apache-cxf/sse-jaxrs/pom.xml | 2 +- apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml | 7 ++-- apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml | 8 ++--- apache-geode/pom.xml | 5 ++- apache-opennlp/pom.xml | 1 + apache-poi/pom.xml | 2 +- apache-pulsar/pom.xml | 33 ++++++++++--------- apache-shiro/pom.xml | 3 +- apache-thrift/pom.xml | 2 +- apache-tika/pom.xml | 4 +-- apache-zookeeper/pom.xml | 2 +- asm/pom.xml | 1 + atomix/pom.xml | 3 +- axon/pom.xml | 3 +- cas/cas-server/pom.xml | 3 +- cdi/pom.xml | 2 +- core-groovy/pom.xml | 1 + core-java-9/pom.xml | 1 - core-java/pom.xml | 2 +- core-kotlin/pom.xml | 1 + core-scala/pom.xml | 1 + data-structures/pom.xml | 2 +- drools/pom.xml | 3 +- dubbo/pom.xml | 1 + flyway-cdi-extension/pom.xml | 2 +- guava-modules/guava-18/pom.xml | 4 +-- guava-modules/guava-19/pom.xml | 4 +-- guava-modules/guava-21/pom.xml | 3 +- guest/core-java-9/pom.xml | 3 +- guest/core-java/pom.xml | 1 + guest/core-kotlin/pom.xml | 3 +- guest/deep-jsf/pom.xml | 1 + guest/junit5-example/pom.xml | 3 +- guest/log4j2-example/pom.xml | 3 +- guest/logback-example/pom.xml | 1 + guest/memory-leaks/pom.xml | 4 +-- guest/remote-debugging/pom.xml | 2 +- guest/slf4j/guide/pom.xml | 3 +- guest/slf4j/guide/slf4j-log4j/pom.xml | 2 +- guest/slf4j/guide/slf4j-log4j2/pom.xml | 2 +- guest/slf4j/guide/slf4j-logback/pom.xml | 2 +- guest/spring-boot-app/pom.xml | 1 + guest/spring-mvc/pom.xml | 2 +- guest/thread-pools/pom.xml | 3 +- guest/tomcat-app/pom.xml | 1 + guest/webservices/rest-client/pom.xml | 1 + guest/webservices/rest-server/pom.xml | 1 + guest/webservices/spring-rest-service/pom.xml | 1 + helidon/helidon-mp/pom.xml | 4 +-- helidon/helidon-se/pom.xml | 4 +-- helidon/pom.xml | 3 +- image-processing/pom.xml | 4 +-- immutables/pom.xml | 4 +-- .../app-auth-basic-store-db/pom.xml | 2 +- .../app-auth-custom-form-store-custom/pom.xml | 2 +- .../app-auth-custom-no-store/pom.xml | 2 +- .../app-auth-form-store-ldap/pom.xml | 2 +- java-ee-8-security-api/pom.xml | 1 + java-lite/pom.xml | 1 + java-rmi/pom.xml | 1 + java-spi/exchange-rate-api/pom.xml | 1 + java-spi/exchange-rate-app/pom.xml | 1 + java-spi/exchange-rate-impl/pom.xml | 1 + java-spi/pom.xml | 1 + java-vavr-stream/pom.xml | 1 + java-websocket/pom.xml | 4 +-- javafx/pom.xml | 3 +- javax-servlets/pom.xml | 1 + javaxval/pom.xml | 4 +-- jee-7/pom.xml | 1 + jenkins/hello-world/pom.xml | 4 +-- jersey/pom.xml | 2 +- jhipster/jhipster-microservice/pom.xml | 4 +-- jhipster/jhipster-monolithic/pom.xml | 1 + jni/pom.xml | 3 +- jsf/pom.xml | 1 + json/pom.xml | 3 +- jsoup/pom.xml | 1 + jta/pom.xml | 3 +- jws/pom.xml | 4 +-- kotlin-libraries/pom.xml | 1 + libraries-server/pom.xml | 3 +- linkrest/pom.xml | 2 +- logging-modules/log4j/pom.xml | 1 + logging-modules/log4j2/pom.xml | 3 +- maven-archetype/pom.xml | 3 +- .../maven-polyglot-json-extension/pom.xml | 4 +-- maven/pom.xml | 1 + maven/versions-maven-plugin/pom.xml | 5 +-- mesos-marathon/pom.xml | 3 +- metrics/pom.xml | 3 +- microprofile/pom.xml | 1 + msf4j/pom.xml | 1 + muleesb/pom.xml | 6 ++-- mybatis/pom.xml | 3 +- optaplanner/pom.xml | 7 ++-- parent-boot-1/pom.xml | 1 + parent-boot-2/pom.xml | 1 + patterns/design-patterns/pom.xml | 4 ++- patterns/front-controller/pom.xml | 1 + patterns/intercepting-filter/pom.xml | 2 +- patterns/pom.xml | 1 + performance-tests/pom.xml | 3 +- persistence-modules/hbase/pom.xml | 1 + persistence-modules/hibernate5/pom.xml | 1 + persistence-modules/java-cassandra/pom.xml | 1 + persistence-modules/java-cockroachdb/pom.xml | 1 + persistence-modules/java-jdbi/pom.xml | 1 + persistence-modules/java-jpa/pom.xml | 7 ++-- persistence-modules/java-mongodb/pom.xml | 1 + .../jnosql/jnosql-artemis/pom.xml | 6 ++-- .../jnosql/jnosql-diana/pom.xml | 6 ++-- persistence-modules/jnosql/pom.xml | 2 +- persistence-modules/liquibase/pom.xml | 1 + persistence-modules/orientdb/pom.xml | 2 +- .../spring-boot-h2-database/pom.xml | 2 +- .../spring-boot-persistence/pom.xml | 4 +-- .../spring-data-gemfire/pom.xml | 1 + persistence-modules/spring-data-jpa/pom.xml | 1 + .../spring-data-keyvalue/pom.xml | 1 + persistence-modules/spring-data-neo4j/pom.xml | 3 +- persistence-modules/spring-data-redis/pom.xml | 1 + protobuffer/pom.xml | 3 +- reactor-core/pom.xml | 4 +-- rxjava-2/pom.xml | 4 +-- rxjava/pom.xml | 4 +-- spring-5-data-reactive/pom.xml | 1 + spring-amqp-simple/pom.xml | 1 + spring-boot-admin/pom.xml | 1 + spring-boot-autoconfiguration/pom.xml | 2 +- spring-boot-camel/pom.xml | 3 +- spring-boot-crud/pom.xml | 2 +- spring-boot-ctx-fluent/pom.xml | 2 +- .../greeter-library/pom.xml | 3 +- .../greeter-spring-boot-autoconfigure/pom.xml | 2 +- .../greeter-spring-boot-sample-app/pom.xml | 2 +- .../greeter-spring-boot-starter/pom.xml | 2 +- spring-boot-custom-starter/greeter/pom.xml | 3 +- spring-boot-custom-starter/pom.xml | 1 + .../disabling-console-jul/pom.xml | 2 +- .../disabling-console-log4j2/pom.xml | 2 +- .../disabling-console-logback/pom.xml | 4 ++- spring-boot-disable-console-logging/pom.xml | 1 + spring-boot-logging-log4j2/pom.xml | 2 +- .../property-exp-custom-config/pom.xml | 3 +- .../property-exp-default-config/pom.xml | 3 +- spring-cloud-bus/pom.xml | 1 + spring-cloud-data-flow/etl/pom.xml | 3 +- spring-cloud-data-flow/pom.xml | 3 +- .../dynamodb-config/pom.xml | 1 + .../spring-cloud-archaius/jdbc-config/pom.xml | 1 + .../zookeeper-config/pom.xml | 1 + spring-cloud/spring-cloud-aws/pom.xml | 2 +- .../spring-cloud-bootstrap/config/pom.xml | 1 + .../spring-cloud-bootstrap/discovery/pom.xml | 2 +- .../spring-cloud-bootstrap/gateway/pom.xml | 1 + spring-cloud/spring-cloud-bootstrap/pom.xml | 1 + .../spring-cloud-bootstrap/svc-book/pom.xml | 2 +- .../spring-cloud-bootstrap/svc-rating/pom.xml | 2 +- .../spring-cloud-bootstrap/zipkin/pom.xml | 1 + .../spring-cloud-config/client/pom.xml | 5 +-- spring-cloud/spring-cloud-config/pom.xml | 1 + .../spring-cloud-config/server/pom.xml | 5 +-- .../spring-cloud-connectors-heroku/pom.xml | 1 + spring-cloud/spring-cloud-contract/pom.xml | 1 + spring-cloud/spring-cloud-eureka/pom.xml | 2 +- .../spring-cloud-eureka-client/pom.xml | 4 +-- .../spring-cloud-eureka-feign-client/pom.xml | 2 +- .../spring-cloud-eureka-server/pom.xml | 2 +- spring-cloud/spring-cloud-functions/pom.xml | 6 ++-- spring-cloud/spring-cloud-gateway/pom.xml | 2 +- .../demo-backend/pom.xml | 3 +- .../demo-frontend/pom.xml | 3 +- spring-cloud/spring-cloud-kubernetes/pom.xml | 2 +- .../spring-cloud-security/auth-server/pom.xml | 1 + spring-cloud/spring-cloud-task/pom.xml | 1 + spring-cloud/spring-cloud-zookeeper/pom.xml | 3 +- .../eureka-client/pom.xml | 2 +- .../eureka-server/pom.xml | 2 +- .../pom.xml | 2 +- .../zuul-server/pom.xml | 1 + spring-drools/pom.xml | 3 +- spring-ejb/spring-ejb-remote/pom.xml | 3 +- spring-ejb/wildfly/pom.xml | 4 +-- spring-ejb/wildfly/widlfly-web/pom.xml | 3 +- spring-ejb/wildfly/wildfly-ear/pom.xml | 3 +- .../wildfly/wildfly-ejb-interfaces/pom.xml | 3 +- spring-ejb/wildfly/wildfly-ejb/pom.xml | 3 +- spring-ejb/wildfly/wildfly-jpa/pom.xml | 3 +- spring-freemarker/pom.xml | 2 +- spring-jersey/pom.xml | 3 +- spring-jooq/pom.xml | 3 +- spring-katharsis/pom.xml | 3 +- spring-ldap/pom.xml | 1 + spring-mvc-simple/pom.xml | 3 +- spring-mybatis/pom.xml | 3 +- spring-reactive-kotlin/pom.xml | 2 +- .../remoting-hessian-burlap/pom.xml | 1 + .../remoting-hessian-burlap-client/pom.xml | 11 ++++--- .../remoting-hessian-burlap-server/pom.xml | 7 ++-- spring-remoting/remoting-http/pom.xml | 4 ++- .../remoting-http-client/pom.xml | 1 + .../remoting-http-server/pom.xml | 1 + spring-remoting/remoting-jms/pom.xml | 10 +++--- .../remoting-jms/remoting-jms-client/pom.xml | 7 ++-- .../remoting-jms/remoting-jms-server/pom.xml | 7 ++-- spring-remoting/remoting-rmi/pom.xml | 3 +- .../remoting-rmi/remoting-rmi-client/pom.xml | 9 ++--- .../remoting-rmi/remoting-rmi-server/pom.xml | 7 ++-- spring-rest-hal-browser/pom.xml | 3 +- spring-roo/pom.xml | 2 +- spring-security-angular/server/pom.xml | 4 +-- spring-security-cache-control/pom.xml | 2 +- .../pom.xml | 2 +- spring-security-x509/pom.xml | 3 +- .../spring-security-x509-basic-auth/pom.xml | 3 +- .../spring-security-x509-client-auth/pom.xml | 3 +- spring-session/spring-session-redis/pom.xml | 1 + spring-sleuth/pom.xml | 3 +- spring-spel/pom.xml | 2 +- spring-state-machine/pom.xml | 3 +- spring-swagger-codegen/pom.xml | 1 + .../spring-swagger-codegen-app/pom.xml | 3 +- spring-thymeleaf/pom.xml | 1 + spring-userservice/pom.xml | 4 +-- spring-vertx/pom.xml | 3 +- sse-jaxrs/pom.xml | 2 +- sse-jaxrs/sse-jaxrs-client/pom.xml | 4 +-- sse-jaxrs/sse-jaxrs-server/pom.xml | 8 ++--- static-analysis/pom.xml | 2 +- structurizr/pom.xml | 2 +- struts-2/pom.xml | 2 +- testing-modules/gatling/pom.xml | 3 +- testing-modules/groovy-spock/pom.xml | 1 + .../load-testing-comparison/pom.xml | 7 ++-- testing-modules/mockito-2/pom.xml | 2 +- testing-modules/mockserver/pom.xml | 3 +- testing-modules/parallel-tests-junit/pom.xml | 2 ++ testing-modules/selenium-junit-testng/pom.xml | 3 +- twilio/pom.xml | 3 +- vertx-and-rxjava/pom.xml | 3 +- video-tutorials/jackson-annotations/pom.xml | 3 +- vraptor/pom.xml | 2 +- xmlunit-2/pom.xml | 1 + 259 files changed, 421 insertions(+), 279 deletions(-) diff --git a/algorithms-genetic/pom.xml b/algorithms-genetic/pom.xml index 2a10a81980..662e0c5913 100644 --- a/algorithms-genetic/pom.xml +++ b/algorithms-genetic/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung algorithms-genetic 0.0.1-SNAPSHOT - + algorithms-genetic + com.baeldung parent-modules diff --git a/algorithms-miscellaneous-1/pom.xml b/algorithms-miscellaneous-1/pom.xml index 16749d452e..75b031282b 100644 --- a/algorithms-miscellaneous-1/pom.xml +++ b/algorithms-miscellaneous-1/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung algorithms-miscellaneous-1 0.0.1-SNAPSHOT - + algorithms-miscellaneous-1 + com.baeldung parent-modules diff --git a/algorithms-miscellaneous-2/pom.xml b/algorithms-miscellaneous-2/pom.xml index eeae544612..25472d4888 100644 --- a/algorithms-miscellaneous-2/pom.xml +++ b/algorithms-miscellaneous-2/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung algorithms-miscellaneous-2 0.0.1-SNAPSHOT + algorithms-miscellaneous-2 com.baeldung diff --git a/algorithms-sorting/pom.xml b/algorithms-sorting/pom.xml index 60ae37f2a4..2aee6e9199 100644 --- a/algorithms-sorting/pom.xml +++ b/algorithms-sorting/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung algorithms-sorting 0.0.1-SNAPSHOT + algorithms-sorting com.baeldung diff --git a/annotations/annotation-processing/pom.xml b/annotations/annotation-processing/pom.xml index 8e53334521..d9aca6040d 100644 --- a/annotations/annotation-processing/pom.xml +++ b/annotations/annotation-processing/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 annotation-processing - + annotation-processing + com.baeldung 1.0.0-SNAPSHOT diff --git a/annotations/annotation-user/pom.xml b/annotations/annotation-user/pom.xml index 07ea9a5b5a..422cc7f119 100644 --- a/annotations/annotation-user/pom.xml +++ b/annotations/annotation-user/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 annotation-user + annotation-user annotations diff --git a/annotations/pom.xml b/annotations/pom.xml index 2c73d3d91b..6d83f5b057 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -4,7 +4,8 @@ 4.0.0 annotations pom - + annotations + parent-modules com.baeldung diff --git a/apache-avro/pom.xml b/apache-avro/pom.xml index ddf5844271..18f9c34d64 100644 --- a/apache-avro/pom.xml +++ b/apache-avro/pom.xml @@ -3,10 +3,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 - com.baeldung apache-avro 0.0.1-SNAPSHOT - Apache Avro + apache-avro UTF-8 diff --git a/apache-bval/pom.xml b/apache-bval/pom.xml index 5ddb1ecb59..786f587fb1 100644 --- a/apache-bval/pom.xml +++ b/apache-bval/pom.xml @@ -4,7 +4,8 @@ apache-bval apache-bval 0.0.1-SNAPSHOT - + apache-bval + com.baeldung parent-modules diff --git a/apache-curator/pom.xml b/apache-curator/pom.xml index ac10811e7a..bcca38b199 100644 --- a/apache-curator/pom.xml +++ b/apache-curator/pom.xml @@ -4,6 +4,7 @@ apache-curator 0.0.1-SNAPSHOT jar + apache-curator com.baeldung diff --git a/apache-cxf/cxf-aegis/pom.xml b/apache-cxf/cxf-aegis/pom.xml index b7e9e426a2..1d36178b82 100644 --- a/apache-cxf/cxf-aegis/pom.xml +++ b/apache-cxf/cxf-aegis/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-aegis - + cxf-aegis + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-introduction/pom.xml b/apache-cxf/cxf-introduction/pom.xml index a9e82c16b3..17f03afd25 100644 --- a/apache-cxf/cxf-introduction/pom.xml +++ b/apache-cxf/cxf-introduction/pom.xml @@ -4,7 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-introduction - + cxf-introduction + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-jaxrs-implementation/pom.xml b/apache-cxf/cxf-jaxrs-implementation/pom.xml index 89acbdf1bd..03d0f67c90 100644 --- a/apache-cxf/cxf-jaxrs-implementation/pom.xml +++ b/apache-cxf/cxf-jaxrs-implementation/pom.xml @@ -4,7 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-jaxrs-implementation - + cxf-jaxrs-implementation + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-spring/pom.xml b/apache-cxf/cxf-spring/pom.xml index 31e75e7cdd..97715af54c 100644 --- a/apache-cxf/cxf-spring/pom.xml +++ b/apache-cxf/cxf-spring/pom.xml @@ -3,6 +3,7 @@ 4.0.0 cxf-spring war + cxf-spring com.baeldung diff --git a/apache-cxf/pom.xml b/apache-cxf/pom.xml index 8918fd4450..0016f33d70 100644 --- a/apache-cxf/pom.xml +++ b/apache-cxf/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-cxf 0.0.1-SNAPSHOT + apache-cxf pom diff --git a/apache-cxf/sse-jaxrs/pom.xml b/apache-cxf/sse-jaxrs/pom.xml index d4b6c19d03..cb5c96660a 100644 --- a/apache-cxf/sse-jaxrs/pom.xml +++ b/apache-cxf/sse-jaxrs/pom.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - sse-jaxrs + sse-jaxrs pom diff --git a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml index 0f5406fbc7..c7acf22c32 100644 --- a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml +++ b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml @@ -3,15 +3,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 - + sse-jaxrs-client + sse-jaxrs-client + com.baeldung sse-jaxrs 0.0.1-SNAPSHOT - sse-jaxrs-client - 3.2.0 @@ -21,7 +21,6 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 singleEvent diff --git a/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml b/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml index 2e82dc3829..eeb5726ee1 100644 --- a/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml +++ b/apache-cxf/sse-jaxrs/sse-jaxrs-server/pom.xml @@ -3,16 +3,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 - + sse-jaxrs-server + sse-jaxrs-server + war + com.baeldung sse-jaxrs 0.0.1-SNAPSHOT - sse-jaxrs-server - war - 2.4.2 false diff --git a/apache-geode/pom.xml b/apache-geode/pom.xml index a3f6604ac4..738accdcb8 100644 --- a/apache-geode/pom.xml +++ b/apache-geode/pom.xml @@ -3,11 +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 - - com.baeldung apache-geode 1.0-SNAPSHOT - + apache-geode + com.baeldung parent-modules diff --git a/apache-opennlp/pom.xml b/apache-opennlp/pom.xml index 985c9a2df2..6b2e6a9729 100644 --- a/apache-opennlp/pom.xml +++ b/apache-opennlp/pom.xml @@ -4,6 +4,7 @@ 4.0.0 apache-opennlp 1.0-SNAPSHOT + apache-opennlp jar diff --git a/apache-poi/pom.xml b/apache-poi/pom.xml index a1ec626d43..54c3e8e928 100644 --- a/apache-poi/pom.xml +++ b/apache-poi/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-poi 0.0.1-SNAPSHOT + apache-poi com.baeldung diff --git a/apache-pulsar/pom.xml b/apache-pulsar/pom.xml index da004a7638..a4c09586eb 100644 --- a/apache-pulsar/pom.xml +++ b/apache-pulsar/pom.xml @@ -1,21 +1,22 @@ - 4.0.0 - com.baeldung.pulsar - pulsar-java - 0.0.1 + 4.0.0 + com.baeldung.pulsar + apache-pulsar + 0.0.1 + apache-pulsar - - - org.apache.pulsar - pulsar-client - 2.1.1-incubating - compile - - - - 1.8 - 1.8 - + + + org.apache.pulsar + pulsar-client + 2.1.1-incubating + compile + + + + 1.8 + 1.8 + diff --git a/apache-shiro/pom.xml b/apache-shiro/pom.xml index 98d9563284..644d70b30a 100644 --- a/apache-shiro/pom.xml +++ b/apache-shiro/pom.xml @@ -5,7 +5,8 @@ 4.0.0 apache-shiro 1.0-SNAPSHOT - + apache-shiro + parent-boot-1 com.baeldung diff --git a/apache-thrift/pom.xml b/apache-thrift/pom.xml index b22364cb19..ab54fc2cef 100644 --- a/apache-thrift/pom.xml +++ b/apache-thrift/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-thrift 0.0.1-SNAPSHOT + apache-thrift pom diff --git a/apache-tika/pom.xml b/apache-tika/pom.xml index 5a76fdeeda..0399914a5f 100644 --- a/apache-tika/pom.xml +++ b/apache-tika/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung apache-tika 0.0.1-SNAPSHOT - + apache-tika + com.baeldung parent-modules diff --git a/apache-zookeeper/pom.xml b/apache-zookeeper/pom.xml index 0b29186ccc..53e4217358 100644 --- a/apache-zookeeper/pom.xml +++ b/apache-zookeeper/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung apache-zookeeper 0.0.1-SNAPSHOT + apache-zookeeper jar diff --git a/asm/pom.xml b/asm/pom.xml index 5aad2a0e37..e56438c808 100644 --- a/asm/pom.xml +++ b/asm/pom.xml @@ -5,6 +5,7 @@ com.baeldung.examples asm 1.0 + asm jar diff --git a/atomix/pom.xml b/atomix/pom.xml index f85d2d7484..e50c1d867f 100644 --- a/atomix/pom.xml +++ b/atomix/pom.xml @@ -4,7 +4,8 @@ com.atomix.io atomix 0.0.1-SNAPSHOT - + atomix + com.baeldung parent-modules diff --git a/axon/pom.xml b/axon/pom.xml index 915a04feb5..c643ea9e57 100644 --- a/axon/pom.xml +++ b/axon/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 axon - + axon + parent-modules com.baeldung diff --git a/cas/cas-server/pom.xml b/cas/cas-server/pom.xml index 9b61aaec3d..98f5f10493 100644 --- a/cas/cas-server/pom.xml +++ b/cas/cas-server/pom.xml @@ -3,8 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd "> 4.0.0 cas-server - war 1.0 + cas-server + war parent-boot-1 diff --git a/cdi/pom.xml b/cdi/pom.xml index 0b735e0ca5..0cf5062ccc 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - com.baeldung cdi 1.0-SNAPSHOT + cdi com.baeldung diff --git a/core-groovy/pom.xml b/core-groovy/pom.xml index 909250710e..e54c766280 100644 --- a/core-groovy/pom.xml +++ b/core-groovy/pom.xml @@ -4,6 +4,7 @@ 4.0.0 core-groovy 1.0-SNAPSHOT + core-groovy jar diff --git a/core-java-9/pom.xml b/core-java-9/pom.xml index f22d0a3ed9..cd1fa74dbb 100644 --- a/core-java-9/pom.xml +++ b/core-java-9/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - com.baeldung core-java-9 0.2-SNAPSHOT core-java-9 diff --git a/core-java/pom.xml b/core-java/pom.xml index 9fbc8f6810..64345ab14c 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -3,8 +3,8 @@ 4.0.0 core-java 0.1.0-SNAPSHOT - jar core-java + jar com.baeldung diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml index 2b559b19e0..ed79ebc01b 100644 --- a/core-kotlin/pom.xml +++ b/core-kotlin/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 core-kotlin + core-kotlin jar diff --git a/core-scala/pom.xml b/core-scala/pom.xml index eb7c1c3330..343f21484a 100644 --- a/core-scala/pom.xml +++ b/core-scala/pom.xml @@ -4,6 +4,7 @@ 4.0.0 core-scala 1.0-SNAPSHOT + core-scala jar diff --git a/data-structures/pom.xml b/data-structures/pom.xml index c1a1f1d371..4958598234 100644 --- a/data-structures/pom.xml +++ b/data-structures/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung data-structures 0.0.1-SNAPSHOT + data-structures com.baeldung diff --git a/drools/pom.xml b/drools/pom.xml index 009ac8acec..b5cfc7d6dc 100644 --- a/drools/pom.xml +++ b/drools/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 drools - + drools + com.baeldung parent-spring-4 diff --git a/dubbo/pom.xml b/dubbo/pom.xml index 6f81ec5cff..9fe228bf89 100644 --- a/dubbo/pom.xml +++ b/dubbo/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 dubbo + dubbo parent-modules diff --git a/flyway-cdi-extension/pom.xml b/flyway-cdi-extension/pom.xml index c6ee26f783..dbb32f1e5a 100644 --- a/flyway-cdi-extension/pom.xml +++ b/flyway-cdi-extension/pom.xml @@ -3,10 +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 - com.baeldung flyway-cdi-extension 1.0-SNAPSHOT + flyway-cdi-extension 1.8 diff --git a/guava-modules/guava-18/pom.xml b/guava-modules/guava-18/pom.xml index ce9395fbf4..d55aa9ce82 100644 --- a/guava-modules/guava-18/pom.xml +++ b/guava-modules/guava-18/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung guava-18 0.1.0-SNAPSHOT - + guava-18 + com.baeldung parent-java diff --git a/guava-modules/guava-19/pom.xml b/guava-modules/guava-19/pom.xml index 5dfb4d2cec..0548bb0c1f 100644 --- a/guava-modules/guava-19/pom.xml +++ b/guava-modules/guava-19/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung guava-19 0.1.0-SNAPSHOT - + guava-19 + com.baeldung parent-java diff --git a/guava-modules/guava-21/pom.xml b/guava-modules/guava-21/pom.xml index 945b7c27c1..bdb1058a48 100644 --- a/guava-modules/guava-21/pom.xml +++ b/guava-modules/guava-21/pom.xml @@ -4,7 +4,8 @@ 4.0.0 guava-21 1.0-SNAPSHOT - + guava-21 + com.baeldung parent-java diff --git a/guest/core-java-9/pom.xml b/guest/core-java-9/pom.xml index e9271b42ff..3847c19d16 100644 --- a/guest/core-java-9/pom.xml +++ b/guest/core-java-9/pom.xml @@ -4,7 +4,8 @@ com.stackify core-java-9 0.0.1-SNAPSHOT - + core-java-9 + com.baeldung parent-modules diff --git a/guest/core-java/pom.xml b/guest/core-java/pom.xml index 787dd764a1..5057f7eaed 100644 --- a/guest/core-java/pom.xml +++ b/guest/core-java/pom.xml @@ -4,6 +4,7 @@ com.stackify core-java 0.0.1-SNAPSHOT + core-java com.baeldung diff --git a/guest/core-kotlin/pom.xml b/guest/core-kotlin/pom.xml index 6b189143a4..a57dd28ffd 100644 --- a/guest/core-kotlin/pom.xml +++ b/guest/core-kotlin/pom.xml @@ -6,7 +6,8 @@ 1.0-SNAPSHOT com.stackify jar - + core-kotlin + jcenter diff --git a/guest/deep-jsf/pom.xml b/guest/deep-jsf/pom.xml index e09b5e0606..12426a8833 100644 --- a/guest/deep-jsf/pom.xml +++ b/guest/deep-jsf/pom.xml @@ -4,6 +4,7 @@ com.stackify deep-jsf 0.0.1-SNAPSHOT + deep-jsf war diff --git a/guest/junit5-example/pom.xml b/guest/junit5-example/pom.xml index 457fb1fcaa..7c0cc3e776 100644 --- a/guest/junit5-example/pom.xml +++ b/guest/junit5-example/pom.xml @@ -4,7 +4,8 @@ junit5-example junit5-example 0.0.1-SNAPSHOT - + junit5-example + com.baeldung parent-modules diff --git a/guest/log4j2-example/pom.xml b/guest/log4j2-example/pom.xml index f64869879f..ab55e0b60e 100644 --- a/guest/log4j2-example/pom.xml +++ b/guest/log4j2-example/pom.xml @@ -4,7 +4,8 @@ log4j2-example log4j2-example 0.0.1-SNAPSHOT - + log4j2-example + com.baeldung parent-modules diff --git a/guest/logback-example/pom.xml b/guest/logback-example/pom.xml index 04de6a00a2..6e9fe0ddea 100644 --- a/guest/logback-example/pom.xml +++ b/guest/logback-example/pom.xml @@ -4,6 +4,7 @@ com.stackify logback-example 0.0.1-SNAPSHOT + logback-example com.baeldung diff --git a/guest/memory-leaks/pom.xml b/guest/memory-leaks/pom.xml index 956ae9c408..f1d411acbc 100644 --- a/guest/memory-leaks/pom.xml +++ b/guest/memory-leaks/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung memory-leaks 0.0.1-SNAPSHOT - + memory-leaks + com.baeldung parent-modules diff --git a/guest/remote-debugging/pom.xml b/guest/remote-debugging/pom.xml index 974421de97..07b9cc49d8 100644 --- a/guest/remote-debugging/pom.xml +++ b/guest/remote-debugging/pom.xml @@ -5,8 +5,8 @@ com.stackify remote-debugging 0.0.1-SNAPSHOT + remote-debugging war - remote-debugging org.springframework.boot diff --git a/guest/slf4j/guide/pom.xml b/guest/slf4j/guide/pom.xml index 0db9b46247..657ede73b6 100644 --- a/guest/slf4j/guide/pom.xml +++ b/guest/slf4j/guide/pom.xml @@ -2,13 +2,12 @@ 4.0.0 - com.stackify.slf4j.guide slf4j-parent-module 1.0.0-SNAPSHOT + slf4j-parent-module pom - org.springframework.boot spring-boot-starter-parent diff --git a/guest/slf4j/guide/slf4j-log4j/pom.xml b/guest/slf4j/guide/slf4j-log4j/pom.xml index 0d08fa6191..bca5392f4d 100644 --- a/guest/slf4j/guide/slf4j-log4j/pom.xml +++ b/guest/slf4j/guide/slf4j-log4j/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - slf4j-log4j 0.0.1-SNAPSHOT + slf4j-log4j jar diff --git a/guest/slf4j/guide/slf4j-log4j2/pom.xml b/guest/slf4j/guide/slf4j-log4j2/pom.xml index 643649335f..9473362cb8 100644 --- a/guest/slf4j/guide/slf4j-log4j2/pom.xml +++ b/guest/slf4j/guide/slf4j-log4j2/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - slf4j-log4j2 0.0.1-SNAPSHOT + slf4j-log4j2 jar diff --git a/guest/slf4j/guide/slf4j-logback/pom.xml b/guest/slf4j/guide/slf4j-logback/pom.xml index e8aebf0ef6..0327e79732 100644 --- a/guest/slf4j/guide/slf4j-logback/pom.xml +++ b/guest/slf4j/guide/slf4j-logback/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - slf4j-logback 0.0.1-SNAPSHOT + slf4j-logback jar diff --git a/guest/spring-boot-app/pom.xml b/guest/spring-boot-app/pom.xml index 7daa8f668e..423dadbb99 100644 --- a/guest/spring-boot-app/pom.xml +++ b/guest/spring-boot-app/pom.xml @@ -4,6 +4,7 @@ spring-boot-app spring-boot-app 0.0.1-SNAPSHOT + spring-boot-app war diff --git a/guest/spring-mvc/pom.xml b/guest/spring-mvc/pom.xml index c0ef451605..3bffb1530d 100644 --- a/guest/spring-mvc/pom.xml +++ b/guest/spring-mvc/pom.xml @@ -5,8 +5,8 @@ com.stackify.guest spring-mvc 0.0.1-SNAPSHOT - jar spring-mvc + jar Spring MVC sample project diff --git a/guest/thread-pools/pom.xml b/guest/thread-pools/pom.xml index db9a5ac89f..2591cb2746 100644 --- a/guest/thread-pools/pom.xml +++ b/guest/thread-pools/pom.xml @@ -4,7 +4,8 @@ com.stackify thread-pools 0.0.1-SNAPSHOT - + thread-pools + com.baeldung parent-modules diff --git a/guest/tomcat-app/pom.xml b/guest/tomcat-app/pom.xml index 7fd27e869b..9ce77c758a 100644 --- a/guest/tomcat-app/pom.xml +++ b/guest/tomcat-app/pom.xml @@ -4,6 +4,7 @@ com.stackify tomcat-app 0.0.1-SNAPSHOT + tomcat-app war diff --git a/guest/webservices/rest-client/pom.xml b/guest/webservices/rest-client/pom.xml index 5e52b7161c..8508186e86 100644 --- a/guest/webservices/rest-client/pom.xml +++ b/guest/webservices/rest-client/pom.xml @@ -3,6 +3,7 @@ com.stackify rest-client 0.0.1-SNAPSHOT + rest-client war diff --git a/guest/webservices/rest-server/pom.xml b/guest/webservices/rest-server/pom.xml index 4b3d241293..c576924215 100644 --- a/guest/webservices/rest-server/pom.xml +++ b/guest/webservices/rest-server/pom.xml @@ -4,6 +4,7 @@ com.stackify rest-server 0.0.1-SNAPSHOT + rest-server war diff --git a/guest/webservices/spring-rest-service/pom.xml b/guest/webservices/spring-rest-service/pom.xml index 49d35766e8..fcec8a3e12 100644 --- a/guest/webservices/spring-rest-service/pom.xml +++ b/guest/webservices/spring-rest-service/pom.xml @@ -4,6 +4,7 @@ com.stackify spring-rest-service 0.0.1-SNAPSHOT + spring-rest-service war diff --git a/helidon/helidon-mp/pom.xml b/helidon/helidon-mp/pom.xml index 1ec1131a67..1f39431886 100644 --- a/helidon/helidon-mp/pom.xml +++ b/helidon/helidon-mp/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - helidon-mp - + helidon-mp + com.baeldung.helidon helidon diff --git a/helidon/helidon-se/pom.xml b/helidon/helidon-se/pom.xml index 5e14ecb81c..8982bf048e 100644 --- a/helidon/helidon-se/pom.xml +++ b/helidon/helidon-se/pom.xml @@ -3,9 +3,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 - helidon-se - + helidon-se + com.baeldung.helidon helidon diff --git a/helidon/pom.xml b/helidon/pom.xml index ea8cc52ee0..85bab4db42 100644 --- a/helidon/pom.xml +++ b/helidon/pom.xml @@ -2,10 +2,9 @@ 4.0.0 - com.baeldung.helidon helidon - 1.0.0-SNAPSHOT + helidon pom diff --git a/image-processing/pom.xml b/image-processing/pom.xml index fe8001ae3a..ce75145dc7 100644 --- a/image-processing/pom.xml +++ b/image-processing/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung image-processing 1.0-SNAPSHOT - + image-processing + com.baeldung parent-modules diff --git a/immutables/pom.xml b/immutables/pom.xml index 17510690b0..efb21e584a 100644 --- a/immutables/pom.xml +++ b/immutables/pom.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 immutables - 1.0.0-SNAPSHOT - + immutables + com.baeldung parent-modules 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 6ecc9f7e80..cf92fe2ecd 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 @@ -2,8 +2,8 @@ 4.0.0 - app-auth-basic-store-db + app-auth-basic-store-db war 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 bf5315e993..43809f1cd5 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 @@ -2,8 +2,8 @@ 4.0.0 - app-auth-custom-form-store-custom + app-auth-custom-form-store-custom war 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 c05c0f19be..f9d63f8623 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 @@ -2,8 +2,8 @@ 4.0.0 - app-auth-custom-no-store + app-auth-custom-no-store war 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 570b36add5..6a7b97b2d7 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 @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - app-auth-form-store-ldap + app-auth-form-store-ldap war diff --git a/java-ee-8-security-api/pom.xml b/java-ee-8-security-api/pom.xml index 7546839492..ad33c74ad3 100644 --- a/java-ee-8-security-api/pom.xml +++ b/java-ee-8-security-api/pom.xml @@ -5,6 +5,7 @@ 4.0.0 java-ee-8-security-api 1.0-SNAPSHOT + java-ee-8-security-api pom diff --git a/java-lite/pom.xml b/java-lite/pom.xml index 5111cd2e7f..03f4e29f4e 100644 --- a/java-lite/pom.xml +++ b/java-lite/pom.xml @@ -5,6 +5,7 @@ org.baeldung java-lite 1.0-SNAPSHOT + java-lite war diff --git a/java-rmi/pom.xml b/java-rmi/pom.xml index 33931baedf..ad413b66ab 100644 --- a/java-rmi/pom.xml +++ b/java-rmi/pom.xml @@ -4,6 +4,7 @@ com.baeldung.rmi java-rmi 1.0-SNAPSHOT + java-rmi jar diff --git a/java-spi/exchange-rate-api/pom.xml b/java-spi/exchange-rate-api/pom.xml index b626916b56..fd3a7ae0a7 100644 --- a/java-spi/exchange-rate-api/pom.xml +++ b/java-spi/exchange-rate-api/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 exchange-rate-api + exchange-rate-api jar diff --git a/java-spi/exchange-rate-app/pom.xml b/java-spi/exchange-rate-app/pom.xml index a42a30ceda..7a076d560c 100644 --- a/java-spi/exchange-rate-app/pom.xml +++ b/java-spi/exchange-rate-app/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 exchange-rate-app + exchange-rate-app jar diff --git a/java-spi/exchange-rate-impl/pom.xml b/java-spi/exchange-rate-impl/pom.xml index 41c874c659..8a77b51793 100644 --- a/java-spi/exchange-rate-impl/pom.xml +++ b/java-spi/exchange-rate-impl/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 exchange-rate-impl + exchange-rate-impl jar diff --git a/java-spi/pom.xml b/java-spi/pom.xml index 9ac87bf960..97a22024bd 100644 --- a/java-spi/pom.xml +++ b/java-spi/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 java-spi + java-spi pom diff --git a/java-vavr-stream/pom.xml b/java-vavr-stream/pom.xml index 395d2c81ba..c92f3c8742 100644 --- a/java-vavr-stream/pom.xml +++ b/java-vavr-stream/pom.xml @@ -5,6 +5,7 @@ com.baeldung.samples java-vavr-stream 1.0 + java-vavr-stream jar diff --git a/java-websocket/pom.xml b/java-websocket/pom.xml index e8ff8dfc36..7ba3ca61d0 100644 --- a/java-websocket/pom.xml +++ b/java-websocket/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung java-websocket - war 0.0.1-SNAPSHOT + java-websocket + war com.baeldung diff --git a/javafx/pom.xml b/javafx/pom.xml index c9c5bc294e..44e6f7e8da 100644 --- a/javafx/pom.xml +++ b/javafx/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 javafx - + javafx + parent-modules com.baeldung diff --git a/javax-servlets/pom.xml b/javax-servlets/pom.xml index 7b4eecd880..f00dd0ebe8 100644 --- a/javax-servlets/pom.xml +++ b/javax-servlets/pom.xml @@ -5,6 +5,7 @@ com.baeldung.javax-servlets javax-servlets 1.0-SNAPSHOT + javax-servlets war diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 22f1827213..5f2690b5b4 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung javaxval 0.1-SNAPSHOT - + javaxval + com.baeldung parent-modules diff --git a/jee-7/pom.xml b/jee-7/pom.xml index 9011648d17..97ed2cc51d 100644 --- a/jee-7/pom.xml +++ b/jee-7/pom.xml @@ -5,6 +5,7 @@ 4.0.0 jee-7 1.0-SNAPSHOT + jee-7 war JavaEE 7 Arquillian Archetype Sample diff --git a/jenkins/hello-world/pom.xml b/jenkins/hello-world/pom.xml index fb2154c7ad..f00a551173 100644 --- a/jenkins/hello-world/pom.xml +++ b/jenkins/hello-world/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - jenkins-hello-world + hello-world 1.0-SNAPSHOT + hello-world hpi - Hello World Plugin A sample Jenkins Hello World plugin diff --git a/jersey/pom.xml b/jersey/pom.xml index b55bdc5330..a3adb4cf5a 100644 --- a/jersey/pom.xml +++ b/jersey/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - com.baeldung jersey 0.0.1-SNAPSHOT + jersey war diff --git a/jhipster/jhipster-microservice/pom.xml b/jhipster/jhipster-microservice/pom.xml index 4a60e47f87..051d5f70b7 100644 --- a/jhipster/jhipster-microservice/pom.xml +++ b/jhipster/jhipster-microservice/pom.xml @@ -3,9 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jhipster-microservice + jhipster-microservice pom - JHipster Microservice - + jhipster com.baeldung.jhipster diff --git a/jhipster/jhipster-monolithic/pom.xml b/jhipster/jhipster-monolithic/pom.xml index e242668759..12dead99df 100644 --- a/jhipster/jhipster-monolithic/pom.xml +++ b/jhipster/jhipster-monolithic/pom.xml @@ -3,6 +3,7 @@ 4.0.0 jhipster-monolithic war + jhipster-monolithic JHipster Monolithic Application diff --git a/jni/pom.xml b/jni/pom.xml index d4cc409d33..4850e07ed7 100644 --- a/jni/pom.xml +++ b/jni/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jni - + jni + com.baeldung parent-modules diff --git a/jsf/pom.xml b/jsf/pom.xml index 2ac8a9f7c2..fc6d4a0ee2 100644 --- a/jsf/pom.xml +++ b/jsf/pom.xml @@ -4,6 +4,7 @@ 4.0.0 jsf 0.1-SNAPSHOT + jsf war diff --git a/json/pom.xml b/json/pom.xml index b688baec06..db98ec437e 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -4,7 +4,8 @@ org.baeldung json 0.0.1-SNAPSHOT - + json + com.baeldung parent-modules diff --git a/jsoup/pom.xml b/jsoup/pom.xml index 2704d7bc00..f6e25e7a23 100644 --- a/jsoup/pom.xml +++ b/jsoup/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jsoup + jsoup jar diff --git a/jta/pom.xml b/jta/pom.xml index 89bdccf25e..4754c1872b 100644 --- a/jta/pom.xml +++ b/jta/pom.xml @@ -3,8 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung - jta-demo + jta 1.0-SNAPSHOT + jta jar JEE JTA demo diff --git a/jws/pom.xml b/jws/pom.xml index 1970ab9921..2c89b687f8 100644 --- a/jws/pom.xml +++ b/jws/pom.xml @@ -3,9 +3,9 @@ 4.0.0 com.example jws - war 0.0.1-SNAPSHOT - jws-example + jws + war com.baeldung diff --git a/kotlin-libraries/pom.xml b/kotlin-libraries/pom.xml index 92a643e458..ae77a9aa2d 100644 --- a/kotlin-libraries/pom.xml +++ b/kotlin-libraries/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 kotlin-libraries + kotlin-libraries jar diff --git a/libraries-server/pom.xml b/libraries-server/pom.xml index 6fca09faf4..661f5f01d5 100644 --- a/libraries-server/pom.xml +++ b/libraries-server/pom.xml @@ -1,9 +1,10 @@ 4.0.0 - com.baeldung libraries-server 0.0.1-SNAPSHOT + libraries-server + com.baeldung parent-modules diff --git a/linkrest/pom.xml b/linkrest/pom.xml index a27caea1ff..073a173aff 100644 --- a/linkrest/pom.xml +++ b/linkrest/pom.xml @@ -1,9 +1,9 @@ 4.0.0 - com.baeldung linkrest 0.0.1-SNAPSHOT + linkrest war diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index 1b27e03445..40db69fb94 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/pom.xml @@ -6,6 +6,7 @@ com.baeldung log4j 1.0-SNAPSHOT + log4j com.baeldung diff --git a/logging-modules/log4j2/pom.xml b/logging-modules/log4j2/pom.xml index 65da318636..d46f92dcd6 100644 --- a/logging-modules/log4j2/pom.xml +++ b/logging-modules/log4j2/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 log4j2 - + log4j2 + com.baeldung parent-modules diff --git a/maven-archetype/pom.xml b/maven-archetype/pom.xml index f7871c81ea..73ddc78fc7 100644 --- a/maven-archetype/pom.xml +++ b/maven-archetype/pom.xml @@ -5,9 +5,10 @@ com.baeldung.archetypes maven-archetype 1.0-SNAPSHOT + maven-archetype maven-archetype Archetype used to generate rest application based on jaxrs 2.1 - + diff --git a/maven-polyglot/maven-polyglot-json-extension/pom.xml b/maven-polyglot/maven-polyglot-json-extension/pom.xml index d5c5b7ab55..fe1e025d1f 100644 --- a/maven-polyglot/maven-polyglot-json-extension/pom.xml +++ b/maven-polyglot/maven-polyglot-json-extension/pom.xml @@ -3,11 +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 - com.baeldung.maven.polyglot maven-polyglot-json-extension 1.0-SNAPSHOT - + maven-polyglot-json-extension + 1.8 1.8 diff --git a/maven/pom.xml b/maven/pom.xml index 4bec533226..01fd28db74 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -4,6 +4,7 @@ com.baeldung maven 0.0.1-SNAPSHOT + maven war diff --git a/maven/versions-maven-plugin/pom.xml b/maven/versions-maven-plugin/pom.xml index 295c77b860..dc0cba75f9 100644 --- a/maven/versions-maven-plugin/pom.xml +++ b/maven/versions-maven-plugin/pom.xml @@ -3,9 +3,10 @@ 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-example + versions-maven-plugin 0.0.1-SNAPSHOT - + versions-maven-plugin + 1.15 diff --git a/mesos-marathon/pom.xml b/mesos-marathon/pom.xml index f92c00892b..dee8eca10d 100644 --- a/mesos-marathon/pom.xml +++ b/mesos-marathon/pom.xml @@ -5,7 +5,8 @@ com.baeldung mesos-marathon 0.0.1-SNAPSHOT - + mesos-marathon + parent-boot-1 com.baeldung diff --git a/metrics/pom.xml b/metrics/pom.xml index 9cf1ec588f..79d340aa49 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 metrics - + metrics + parent-modules com.baeldung diff --git a/microprofile/pom.xml b/microprofile/pom.xml index d75b6443ed..52df348ace 100644 --- a/microprofile/pom.xml +++ b/microprofile/pom.xml @@ -5,6 +5,7 @@ com.baeldung microprofile 1.0-SNAPSHOT + microprofile war diff --git a/msf4j/pom.xml b/msf4j/pom.xml index 9a6483772b..4a6f63159d 100644 --- a/msf4j/pom.xml +++ b/msf4j/pom.xml @@ -5,6 +5,7 @@ com.baeldung.msf4j msf4j 0.0.1-SNAPSHOT + msf4j parent-modules diff --git a/muleesb/pom.xml b/muleesb/pom.xml index b34123567a..4b74b6d4f4 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -6,9 +6,9 @@ com.mycompany muleesb 1.0.0-SNAPSHOT - mule - Mule muleesb Application - + muleesb + mule + com.baeldung parent-modules diff --git a/mybatis/pom.xml b/mybatis/pom.xml index aa9ff9e288..4e63d14ded 100644 --- a/mybatis/pom.xml +++ b/mybatis/pom.xml @@ -5,7 +5,8 @@ com.baeldung mybatis 1.0.0-SNAPSHOT - + mybatis + com.baeldung parent-modules diff --git a/optaplanner/pom.xml b/optaplanner/pom.xml index 22abbedc8c..fbce0ea072 100644 --- a/optaplanner/pom.xml +++ b/optaplanner/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + optaplanner + optaplanner + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - optaplanner diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index 171806390d..53f91f975d 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -3,6 +3,7 @@ 4.0.0 parent-boot-1 0.0.1-SNAPSHOT + parent-boot-1 pom Parent for all Spring Boot 1.x modules diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index 67837e1a4e..89afd79bf4 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -3,6 +3,7 @@ 4.0.0 parent-boot-2 0.0.1-SNAPSHOT + parent-boot-2 pom Parent for all Spring Boot 2 modules diff --git a/patterns/design-patterns/pom.xml b/patterns/design-patterns/pom.xml index dc2631b36e..ac201ad653 100644 --- a/patterns/design-patterns/pom.xml +++ b/patterns/design-patterns/pom.xml @@ -4,7 +4,9 @@ 4.0.0 design-patterns 1.0 - jar + design-patterns + jar + com.baeldung patterns diff --git a/patterns/front-controller/pom.xml b/patterns/front-controller/pom.xml index 435b0dd9cd..bb003dd00a 100644 --- a/patterns/front-controller/pom.xml +++ b/patterns/front-controller/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 front-controller + front-controller war diff --git a/patterns/intercepting-filter/pom.xml b/patterns/intercepting-filter/pom.xml index fa94d5d1fd..33589dc242 100644 --- a/patterns/intercepting-filter/pom.xml +++ b/patterns/intercepting-filter/pom.xml @@ -2,8 +2,8 @@ 4.0.0 - intercepting-filter + intercepting-filter war diff --git a/patterns/pom.xml b/patterns/pom.xml index df09f1836a..bc1f5173e2 100644 --- a/patterns/pom.xml +++ b/patterns/pom.xml @@ -4,6 +4,7 @@ 4.0.0 patterns pom + patterns com.baeldung diff --git a/performance-tests/pom.xml b/performance-tests/pom.xml index 8c9d027724..7d77c2a0e3 100644 --- a/performance-tests/pom.xml +++ b/performance-tests/pom.xml @@ -4,7 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 performance-tests - + performance-tests + parent-modules com.baeldung diff --git a/persistence-modules/hbase/pom.xml b/persistence-modules/hbase/pom.xml index ffd1464482..daf0db5291 100644 --- a/persistence-modules/hbase/pom.xml +++ b/persistence-modules/hbase/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 hbase + hbase parent-modules diff --git a/persistence-modules/hibernate5/pom.xml b/persistence-modules/hibernate5/pom.xml index 24f4055a82..363e2153b6 100644 --- a/persistence-modules/hibernate5/pom.xml +++ b/persistence-modules/hibernate5/pom.xml @@ -5,6 +5,7 @@ com.baeldung hibernate5 0.0.1-SNAPSHOT + hibernate5 com.baeldung diff --git a/persistence-modules/java-cassandra/pom.xml b/persistence-modules/java-cassandra/pom.xml index 36ec6b5ac8..aac5d49547 100644 --- a/persistence-modules/java-cassandra/pom.xml +++ b/persistence-modules/java-cassandra/pom.xml @@ -4,6 +4,7 @@ com.baeldung java-cassandra 1.0.0-SNAPSHOT + java-cassandra com.baeldung diff --git a/persistence-modules/java-cockroachdb/pom.xml b/persistence-modules/java-cockroachdb/pom.xml index 870707c750..2a92934a6e 100644 --- a/persistence-modules/java-cockroachdb/pom.xml +++ b/persistence-modules/java-cockroachdb/pom.xml @@ -5,6 +5,7 @@ com.baeldung java-cockroachdb 1.0-SNAPSHOT + java-cockroachdb parent-modules diff --git a/persistence-modules/java-jdbi/pom.xml b/persistence-modules/java-jdbi/pom.xml index 885906fcd0..9281f4fd9d 100644 --- a/persistence-modules/java-jdbi/pom.xml +++ b/persistence-modules/java-jdbi/pom.xml @@ -4,6 +4,7 @@ 4.0.0 java-jdbi 1.0-SNAPSHOT + java-jdbi parent-modules diff --git a/persistence-modules/java-jpa/pom.xml b/persistence-modules/java-jpa/pom.xml index 78764f7148..ddab51a2e2 100644 --- a/persistence-modules/java-jpa/pom.xml +++ b/persistence-modules/java-jpa/pom.xml @@ -2,15 +2,16 @@ + 4.0.0 + java-jpa + java-jpa + parent-modules com.baeldung 1.0.0-SNAPSHOT ../../pom.xml - 4.0.0 - - java-jpa diff --git a/persistence-modules/java-mongodb/pom.xml b/persistence-modules/java-mongodb/pom.xml index bbc48f54c2..9658ef567f 100644 --- a/persistence-modules/java-mongodb/pom.xml +++ b/persistence-modules/java-mongodb/pom.xml @@ -5,6 +5,7 @@ com.baeldung java-mongodb 1.0-SNAPSHOT + java-mongodb com.baeldung diff --git a/persistence-modules/jnosql/jnosql-artemis/pom.xml b/persistence-modules/jnosql/jnosql-artemis/pom.xml index 9c2bfd1ba0..8a978fb179 100644 --- a/persistence-modules/jnosql/jnosql-artemis/pom.xml +++ b/persistence-modules/jnosql/jnosql-artemis/pom.xml @@ -3,6 +3,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 + jnosql-artemis + jnosql-artemis + war com.baeldung.jnosql @@ -10,9 +13,6 @@ 1.0-SNAPSHOT - jnosql-artemis - war - 2.4.2 false diff --git a/persistence-modules/jnosql/jnosql-diana/pom.xml b/persistence-modules/jnosql/jnosql-diana/pom.xml index 767defb2a8..126f0314d9 100644 --- a/persistence-modules/jnosql/jnosql-diana/pom.xml +++ b/persistence-modules/jnosql/jnosql-diana/pom.xml @@ -3,15 +3,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 - + jnosql-diana + jnosql-diana + com.baeldung.jnosql jnosql 1.0-SNAPSHOT - jnosql-diana - diff --git a/persistence-modules/jnosql/pom.xml b/persistence-modules/jnosql/pom.xml index c87ad3cf4b..5fb29a3b9c 100644 --- a/persistence-modules/jnosql/pom.xml +++ b/persistence-modules/jnosql/pom.xml @@ -3,10 +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 - com.baeldung.jnosql jnosql 1.0-SNAPSHOT + jnosql pom diff --git a/persistence-modules/liquibase/pom.xml b/persistence-modules/liquibase/pom.xml index cb2bee8d48..b06d38e6a0 100644 --- a/persistence-modules/liquibase/pom.xml +++ b/persistence-modules/liquibase/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 liquibase + liquibase parent-modules diff --git a/persistence-modules/orientdb/pom.xml b/persistence-modules/orientdb/pom.xml index e4bc9a0585..a8ac3fb789 100644 --- a/persistence-modules/orientdb/pom.xml +++ b/persistence-modules/orientdb/pom.xml @@ -4,8 +4,8 @@ 4.0.0 orientdb 0.0.1-SNAPSHOT + orientdb jar - intro-orientdb introduction to the OrientDB Java APIs diff --git a/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml b/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml index 4d677ab0d4..6ebc75de8d 100644 --- a/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml +++ b/persistence-modules/spring-boot-h2/spring-boot-h2-database/pom.xml @@ -3,10 +3,10 @@ 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-h2-database 0.0.1-SNAPSHOT + spring-boot-h2-database jar Demo Spring Boot applications that starts H2 in memory database diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index 80472fdd57..0ea42b1cb7 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -2,11 +2,11 @@ - 4.0.0 - + 4.0.0 com.baeldung spring-boot-persistence 0.1.0 + spring-boot-persistence parent-boot-2 diff --git a/persistence-modules/spring-data-gemfire/pom.xml b/persistence-modules/spring-data-gemfire/pom.xml index 34346c502f..292b7387ac 100644 --- a/persistence-modules/spring-data-gemfire/pom.xml +++ b/persistence-modules/spring-data-gemfire/pom.xml @@ -5,6 +5,7 @@ com.baeldung spring-data-gemfire 1.0.0-SNAPSHOT + spring-data-gemfire jar diff --git a/persistence-modules/spring-data-jpa/pom.xml b/persistence-modules/spring-data-jpa/pom.xml index 643210ab89..786e587734 100644 --- a/persistence-modules/spring-data-jpa/pom.xml +++ b/persistence-modules/spring-data-jpa/pom.xml @@ -5,6 +5,7 @@ 4.0.0 com.baeldung spring-data-jpa + spring-data-jpa parent-boot-2 diff --git a/persistence-modules/spring-data-keyvalue/pom.xml b/persistence-modules/spring-data-keyvalue/pom.xml index 6675595f2b..1fee0a88d4 100644 --- a/persistence-modules/spring-data-keyvalue/pom.xml +++ b/persistence-modules/spring-data-keyvalue/pom.xml @@ -2,6 +2,7 @@ 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-keyvalue + spring-data-keyvalue parent-boot-2 diff --git a/persistence-modules/spring-data-neo4j/pom.xml b/persistence-modules/spring-data-neo4j/pom.xml index 2be4df71be..1e5d51ddf2 100644 --- a/persistence-modules/spring-data-neo4j/pom.xml +++ b/persistence-modules/spring-data-neo4j/pom.xml @@ -3,7 +3,8 @@ 4.0.0 spring-data-neo4j 1.0 - + spring-data-neo4j + com.baeldung parent-modules diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index bee3d683b8..683f874b6c 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -4,6 +4,7 @@ com.baeldung spring-data-redis 1.0 + spring-data-redis jar diff --git a/protobuffer/pom.xml b/protobuffer/pom.xml index ff443a1615..d9e6cb26e4 100644 --- a/protobuffer/pom.xml +++ b/protobuffer/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 protobuffer - + protobuffer + parent-modules com.baeldung diff --git a/reactor-core/pom.xml b/reactor-core/pom.xml index cf720ad6ea..db9550df7b 100644 --- a/reactor-core/pom.xml +++ b/reactor-core/pom.xml @@ -1,11 +1,11 @@ 4.0.0 - org.baeldung reactor-core 0.0.1-SNAPSHOT - + reactor-core + com.baeldung parent-modules diff --git a/rxjava-2/pom.xml b/rxjava-2/pom.xml index a18b096b6d..3b4c167f3a 100644 --- a/rxjava-2/pom.xml +++ b/rxjava-2/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - rxjava-2 1.0-SNAPSHOT - + rxjava-2 + com.baeldung parent-java diff --git a/rxjava/pom.xml b/rxjava/pom.xml index b316001d87..596a5196da 100644 --- a/rxjava/pom.xml +++ b/rxjava/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - rxjava 1.0-SNAPSHOT - + rxjava + com.baeldung parent-java diff --git a/spring-5-data-reactive/pom.xml b/spring-5-data-reactive/pom.xml index 5c723c6e29..aa73cf11ae 100644 --- a/spring-5-data-reactive/pom.xml +++ b/spring-5-data-reactive/pom.xml @@ -3,6 +3,7 @@ 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-data-reactive + spring-5-data-reactive jar diff --git a/spring-amqp-simple/pom.xml b/spring-amqp-simple/pom.xml index ea9c227d8c..57d84acee6 100644 --- a/spring-amqp-simple/pom.xml +++ b/spring-amqp-simple/pom.xml @@ -5,6 +5,7 @@ com.baeldung spring-amqp-simple 1.0.0-SNAPSHOT + spring-amqp-simple parent-boot-1 diff --git a/spring-boot-admin/pom.xml b/spring-boot-admin/pom.xml index 58cea728cc..23852dee57 100644 --- a/spring-boot-admin/pom.xml +++ b/spring-boot-admin/pom.xml @@ -3,6 +3,7 @@ 4.0.0 spring-boot-admin 0.0.1-SNAPSHOT + spring-boot-admin pom diff --git a/spring-boot-autoconfiguration/pom.xml b/spring-boot-autoconfiguration/pom.xml index b88587f731..1c3d8796ed 100644 --- a/spring-boot-autoconfiguration/pom.xml +++ b/spring-boot-autoconfiguration/pom.xml @@ -5,7 +5,7 @@ spring-boot-autoconfiguration 0.0.1-SNAPSHOT war - spring-boot-auto-configuration + spring-boot-autoconfiguration This is simple boot application demonstrating a custom auto-configuration diff --git a/spring-boot-camel/pom.xml b/spring-boot-camel/pom.xml index 19a0bec809..8bab0ed5c8 100644 --- a/spring-boot-camel/pom.xml +++ b/spring-boot-camel/pom.xml @@ -5,7 +5,8 @@ com.example spring-boot-camel 0.0.1-SNAPSHOT - + spring-boot-camel + com.baeldung parent-modules diff --git a/spring-boot-crud/pom.xml b/spring-boot-crud/pom.xml index f803a7e70b..749bf9cb5a 100644 --- a/spring-boot-crud/pom.xml +++ b/spring-boot-crud/pom.xml @@ -3,10 +3,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 - com.baeldung.spring-boot-crud spring-boot-crud 0.1.0 + spring-boot-crud org.springframework.boot diff --git a/spring-boot-ctx-fluent/pom.xml b/spring-boot-ctx-fluent/pom.xml index f9b691aea7..b238374612 100644 --- a/spring-boot-ctx-fluent/pom.xml +++ b/spring-boot-ctx-fluent/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung spring-boot-ctx-fluent 0.0.1-SNAPSHOT + spring-boot-ctx-fluent jar diff --git a/spring-boot-custom-starter/greeter-library/pom.xml b/spring-boot-custom-starter/greeter-library/pom.xml index 3717ba005c..7e0c5c4d22 100644 --- a/spring-boot-custom-starter/greeter-library/pom.xml +++ b/spring-boot-custom-starter/greeter-library/pom.xml @@ -1,10 +1,11 @@ 4.0.0 - com.baeldung greeter-library 0.0.1-SNAPSHOT + greeter-library + spring-boot-custom-starter com.baeldung diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml index 5862bdd6c8..1e4ee698c6 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung greeter-spring-boot-autoconfigure 0.0.1-SNAPSHOT + greeter-spring-boot-autoconfigure spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml index 88c5d1caf5..91cc41d669 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung greeter-spring-boot-sample-app 0.0.1-SNAPSHOT + greeter-spring-boot-sample-app spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml index e71882db29..560d6fa79b 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml @@ -1,10 +1,10 @@ 4.0.0 - com.baeldung greeter-spring-boot-starter 0.0.1-SNAPSHOT + greeter-spring-boot-starter spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter/pom.xml b/spring-boot-custom-starter/greeter/pom.xml index 3cfd6da09e..95fcaa66c8 100644 --- a/spring-boot-custom-starter/greeter/pom.xml +++ b/spring-boot-custom-starter/greeter/pom.xml @@ -1,10 +1,11 @@ 4.0.0 - com.baeldung greeter 0.0.1-SNAPSHOT + greeter + parent-boot-1 com.baeldung diff --git a/spring-boot-custom-starter/pom.xml b/spring-boot-custom-starter/pom.xml index 97b33ce2b8..9c03cfdd0e 100644 --- a/spring-boot-custom-starter/pom.xml +++ b/spring-boot-custom-starter/pom.xml @@ -4,6 +4,7 @@ com.baeldung spring-boot-custom-starter 0.0.1-SNAPSHOT + spring-boot-custom-starter pom diff --git a/spring-boot-disable-console-logging/disabling-console-jul/pom.xml b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml index ceac0616e9..fbcd0768f9 100644 --- a/spring-boot-disable-console-logging/disabling-console-jul/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-jul/pom.xml @@ -2,7 +2,7 @@ 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-jul - + disabling-console-jul diff --git a/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml index d6e9a8b5e5..6f3f01669e 100644 --- a/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-log4j2/pom.xml @@ -2,7 +2,7 @@ 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-log4j2 - + disabling-console-log4j2 diff --git a/spring-boot-disable-console-logging/disabling-console-logback/pom.xml b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml index f18066ea03..fef0a1f4c6 100644 --- a/spring-boot-disable-console-logging/disabling-console-logback/pom.xml +++ b/spring-boot-disable-console-logging/disabling-console-logback/pom.xml @@ -1,11 +1,13 @@ 4.0.0 + disabling-console-logback + disabling-console-logback + com.baeldung spring-boot-disable-console-logging 0.0.1-SNAPSHOT - disabling-console-logback diff --git a/spring-boot-disable-console-logging/pom.xml b/spring-boot-disable-console-logging/pom.xml index ec84372f99..63ed129347 100644 --- a/spring-boot-disable-console-logging/pom.xml +++ b/spring-boot-disable-console-logging/pom.xml @@ -2,6 +2,7 @@ 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-disable-console-logging + spring-boot-disable-console-logging pom Projects for Disabling Spring Boot Console Logging tutorials diff --git a/spring-boot-logging-log4j2/pom.xml b/spring-boot-logging-log4j2/pom.xml index 38dc5fb341..ad678a14cf 100644 --- a/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-logging-log4j2/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - spring-boot-logging-log4j2 jar + spring-boot-logging-log4j2 Demo project for Spring Boot Logging with Log4J2 diff --git a/spring-boot-property-exp/property-exp-custom-config/pom.xml b/spring-boot-property-exp/property-exp-custom-config/pom.xml index ab22c5ad30..9988924408 100644 --- a/spring-boot-property-exp/property-exp-custom-config/pom.xml +++ b/spring-boot-property-exp/property-exp-custom-config/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - property-exp-custom - com.baeldung property-exp-custom-config 0.0.1-SNAPSHOT + property-exp-custom-config jar diff --git a/spring-boot-property-exp/property-exp-default-config/pom.xml b/spring-boot-property-exp/property-exp-default-config/pom.xml index 4ede36e61a..7892288f45 100644 --- a/spring-boot-property-exp/property-exp-default-config/pom.xml +++ b/spring-boot-property-exp/property-exp-default-config/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - property-exp-default - com.baeldung property-exp-default-config 0.0.1-SNAPSHOT + property-exp-default-config jar diff --git a/spring-cloud-bus/pom.xml b/spring-cloud-bus/pom.xml index d493c4e984..784e4cbae6 100644 --- a/spring-cloud-bus/pom.xml +++ b/spring-cloud-bus/pom.xml @@ -7,6 +7,7 @@ spring-cloud-bus 1.0.0-SNAPSHOT pom + spring-cloud-bus parent-boot-1 diff --git a/spring-cloud-data-flow/etl/pom.xml b/spring-cloud-data-flow/etl/pom.xml index 2b904f6e0d..e203999ee9 100644 --- a/spring-cloud-data-flow/etl/pom.xml +++ b/spring-cloud-data-flow/etl/pom.xml @@ -5,7 +5,8 @@ etl-spring-cloud-data-flow 0.0.1-SNAPSHOT pom - + etl-spring-cloud-data-flow + org.baeldung.spring.cloud spring-cloud-data-flow diff --git a/spring-cloud-data-flow/pom.xml b/spring-cloud-data-flow/pom.xml index 5a007f3c7d..dd1ceed71a 100644 --- a/spring-cloud-data-flow/pom.xml +++ b/spring-cloud-data-flow/pom.xml @@ -5,7 +5,8 @@ spring-cloud-data-flow 0.0.1-SNAPSHOT pom - + spring-cloud-data-flow + com.baeldung parent-modules diff --git a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml index 3ffbf8f619..96f6c8711e 100644 --- a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 dynamodb-config + dynamodb-config jar diff --git a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml index bb283576d8..59dea4890e 100644 --- a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jdbc-config + jdbc-config jar diff --git a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml index 8f8ec99ad8..51010eefb2 100644 --- a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 zookeeper-config + zookeeper-config jar diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index 09518483a4..7edabd03f5 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -5,7 +5,7 @@ com.baeldung.spring.cloud spring-cloud-aws jar - Spring Cloud AWS + spring-cloud-aws Spring Cloud AWS Examples diff --git a/spring-cloud/spring-cloud-bootstrap/config/pom.xml b/spring-cloud/spring-cloud-bootstrap/config/pom.xml index 14a926fc2c..1379af0b05 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/config/pom.xml @@ -4,6 +4,7 @@ 4.0.0 config 1.0.0-SNAPSHOT + config parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml index f94d8829f6..735d3745d7 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - discovery 1.0.0-SNAPSHOT + discovery parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index fc69c16738..2efa926e3a 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -4,6 +4,7 @@ 4.0.0 gateway 1.0.0-SNAPSHOT + gateway parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/pom.xml b/spring-cloud/spring-cloud-bootstrap/pom.xml index 74801159eb..46460c0d74 100644 --- a/spring-cloud/spring-cloud-bootstrap/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/pom.xml @@ -4,6 +4,7 @@ 4.0.0 spring-cloud-bootstrap 1.0.0-SNAPSHOT + spring-cloud-bootstrap pom diff --git a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml index c0d920d373..eb855a91e3 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung.spring.cloud svc-book 1.0.0-SNAPSHOT + svc-book parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index 3aa2db8f65..7c1e93bad1 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung.spring.cloud svc-rating 1.0.0-SNAPSHOT + svc-rating parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml index 8735e24d48..1bf9ecb9e7 100644 --- a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml @@ -4,6 +4,7 @@ 4.0.0 zipkin 1.0.0-SNAPSHOT + zipkin parent-boot-1 diff --git a/spring-cloud/spring-cloud-config/client/pom.xml b/spring-cloud/spring-cloud-config/client/pom.xml index 800a496a82..c55f9bc471 100644 --- a/spring-cloud/spring-cloud-config/client/pom.xml +++ b/spring-cloud/spring-cloud-config/client/pom.xml @@ -3,13 +3,14 @@ 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 - + client + client + com.baeldung.spring.cloud spring-cloud-config 1.0-SNAPSHOT - client diff --git a/spring-cloud/spring-cloud-config/pom.xml b/spring-cloud/spring-cloud-config/pom.xml index b28828bf37..1a4efc7a60 100644 --- a/spring-cloud/spring-cloud-config/pom.xml +++ b/spring-cloud/spring-cloud-config/pom.xml @@ -5,6 +5,7 @@ com.baeldung.spring.cloud spring-cloud-config 1.0-SNAPSHOT + spring-cloud-config pom diff --git a/spring-cloud/spring-cloud-config/server/pom.xml b/spring-cloud/spring-cloud-config/server/pom.xml index 7bbb903cf9..b4be7663e2 100644 --- a/spring-cloud/spring-cloud-config/server/pom.xml +++ b/spring-cloud/spring-cloud-config/server/pom.xml @@ -3,13 +3,14 @@ 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 - + server + server + com.baeldung.spring.cloud spring-cloud-config 1.0-SNAPSHOT - server diff --git a/spring-cloud/spring-cloud-connectors-heroku/pom.xml b/spring-cloud/spring-cloud-connectors-heroku/pom.xml index f00c9eb1fc..d2e9292511 100644 --- a/spring-cloud/spring-cloud-connectors-heroku/pom.xml +++ b/spring-cloud/spring-cloud-connectors-heroku/pom.xml @@ -5,6 +5,7 @@ com.baeldung.spring.cloud spring-cloud-connectors-heroku 1.0.0-SNAPSHOT + spring-cloud-connectors-heroku parent-boot-1 diff --git a/spring-cloud/spring-cloud-contract/pom.xml b/spring-cloud/spring-cloud-contract/pom.xml index 5dde6a7a99..3563d0ee58 100644 --- a/spring-cloud/spring-cloud-contract/pom.xml +++ b/spring-cloud/spring-cloud-contract/pom.xml @@ -6,6 +6,7 @@ com.baeldung.spring.cloud spring-cloud-contract 1.0.0-SNAPSHOT + spring-cloud-contract com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-eureka/pom.xml b/spring-cloud/spring-cloud-eureka/pom.xml index 7f7e2650d5..99d8c0ed40 100644 --- a/spring-cloud/spring-cloud-eureka/pom.xml +++ b/spring-cloud/spring-cloud-eureka/pom.xml @@ -6,7 +6,7 @@ spring-cloud-eureka 1.0.0-SNAPSHOT pom - Spring Cloud Eureka + spring-cloud-eureka Spring Cloud Eureka Server and Sample Clients diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml index 0bf9547aff..5378095af0 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml @@ -2,12 +2,10 @@ 4.0.0 - spring-cloud-eureka-client 1.0.0-SNAPSHOT jar - - Spring Cloud Eureka Client + spring-cloud-eureka-client Spring Cloud Eureka Sample Client diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml index d572b10d40..f2057c8a76 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml @@ -5,7 +5,7 @@ spring-cloud-eureka-feign-client 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Feign Client + spring-cloud-eureka-feign-client Spring Cloud Eureka - Sample Feign Client diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml index da2c50d3c7..587aed6c49 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml @@ -5,7 +5,7 @@ spring-cloud-eureka-server 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Server + spring-cloud-eureka-server Spring Cloud Eureka Server Demo diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml index 8b2b0ad385..5686fc8c64 100644 --- a/spring-cloud/spring-cloud-functions/pom.xml +++ b/spring-cloud/spring-cloud-functions/pom.xml @@ -3,13 +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 - com.baeldung.spring - cloudfunction-aws + spring-cloud-functions 0.0.1-SNAPSHOT jar - - cloudfunction-aws + spring-cloud-functions Demo project for Spring Cloud Function diff --git a/spring-cloud/spring-cloud-gateway/pom.xml b/spring-cloud/spring-cloud-gateway/pom.xml index 4d8b57d4cf..c297d90896 100644 --- a/spring-cloud/spring-cloud-gateway/pom.xml +++ b/spring-cloud/spring-cloud-gateway/pom.xml @@ -4,7 +4,7 @@ 4.0.0 spring-cloud-gateway jar - Spring Cloud Gateway + spring-cloud-gateway com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml b/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml index 308a81fd74..f7b04baec3 100644 --- a/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 demo-backend - + demo-backend + com.baeldung.spring.cloud spring-cloud-kubernetes diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml b/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml index 968529c648..da55ca5034 100644 --- a/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 demo-frontend - + demo-frontend + com.baeldung.spring.cloud spring-cloud-kubernetes diff --git a/spring-cloud/spring-cloud-kubernetes/pom.xml b/spring-cloud/spring-cloud-kubernetes/pom.xml index fd9f7b5876..984b3811dd 100644 --- a/spring-cloud/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/pom.xml @@ -2,11 +2,11 @@ 4.0.0 - com.baeldung.spring.cloud spring-cloud-kubernetes 1.0-SNAPSHOT pom + spring-cloud-kubernetes demo-frontend diff --git a/spring-cloud/spring-cloud-security/auth-server/pom.xml b/spring-cloud/spring-cloud-security/auth-server/pom.xml index 92f92808f6..4b3f94b825 100644 --- a/spring-cloud/spring-cloud-security/auth-server/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-server/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 auth-server + auth-server Spring Cloud Security APP Server Module diff --git a/spring-cloud/spring-cloud-task/pom.xml b/spring-cloud/spring-cloud-task/pom.xml index ef76d464bc..748cc378f1 100644 --- a/spring-cloud/spring-cloud-task/pom.xml +++ b/spring-cloud/spring-cloud-task/pom.xml @@ -6,6 +6,7 @@ spring-cloud-task 1.0.0-SNAPSHOT pom + spring-cloud-task parent-boot-1 diff --git a/spring-cloud/spring-cloud-zookeeper/pom.xml b/spring-cloud/spring-cloud-zookeeper/pom.xml index 4535c2072d..9661f2b71a 100644 --- a/spring-cloud/spring-cloud-zookeeper/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/pom.xml @@ -4,7 +4,8 @@ 4.0.0 spring-cloud-zookeeper pom - + spring-cloud-zookeeper + com.baeldung.spring.cloud spring-cloud diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml index 6a5b7ddb55..c4f7ae704a 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml @@ -5,7 +5,7 @@ eureka-client 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Client + eureka-client Spring Cloud Eureka Sample Client diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml index e3c5109a26..0256ee7000 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml @@ -5,7 +5,7 @@ eureka-server 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Server + eureka-server Spring Cloud Eureka Server Demo diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml index 4d3687134f..edd7b9d99e 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml @@ -7,7 +7,7 @@ spring-cloud-zuul-eureka-integration 1.0.0-SNAPSHOT pom - Spring Cloud Zuul and Eureka Integration + spring-cloud-zuul-eureka-integration Spring Cloud Zuul and Eureka Integration diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml index e64ceb501e..39f94efdf0 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 zuul-server + zuul-server com.baeldung.spring.cloud diff --git a/spring-drools/pom.xml b/spring-drools/pom.xml index 8c65d5e34e..5bb2d6a8e9 100644 --- a/spring-drools/pom.xml +++ b/spring-drools/pom.xml @@ -5,7 +5,8 @@ com.baeldung spring-drools 1.0.0-SNAPSHOT - + spring-drools + com.baeldung parent-modules diff --git a/spring-ejb/spring-ejb-remote/pom.xml b/spring-ejb/spring-ejb-remote/pom.xml index 4756846cc8..797cc3ac68 100644 --- a/spring-ejb/spring-ejb-remote/pom.xml +++ b/spring-ejb/spring-ejb-remote/pom.xml @@ -4,7 +4,8 @@ 4.0.0 spring-ejb-remote ejb - + spring-ejb-remote + com.baeldung.spring.ejb spring-ejb diff --git a/spring-ejb/wildfly/pom.xml b/spring-ejb/wildfly/pom.xml index 8f7d4c287a..f50dad82f1 100644 --- a/spring-ejb/wildfly/pom.xml +++ b/spring-ejb/wildfly/pom.xml @@ -2,10 +2,10 @@ 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.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT pom - wildfly-example + wildfly com.baeldung.spring.ejb diff --git a/spring-ejb/wildfly/widlfly-web/pom.xml b/spring-ejb/wildfly/widlfly-web/pom.xml index 559c5f1755..1dcb18a230 100644 --- a/spring-ejb/wildfly/widlfly-web/pom.xml +++ b/spring-ejb/wildfly/widlfly-web/pom.xml @@ -3,7 +3,8 @@ 4.0.0 widlfly-web war - + widlfly-web + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-ear/pom.xml b/spring-ejb/wildfly/wildfly-ear/pom.xml index d1e47ecd0f..dc9059370f 100644 --- a/spring-ejb/wildfly/wildfly-ear/pom.xml +++ b/spring-ejb/wildfly/wildfly-ear/pom.xml @@ -3,7 +3,8 @@ 4.0.0 wildfly-ear ear - + wildfly-ear + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml index ec502f2ab3..0324aa8e47 100644 --- a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 wildfly-ejb-interfaces - + wildfly-ejb-interfaces + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-ejb/pom.xml b/spring-ejb/wildfly/wildfly-ejb/pom.xml index 2c87ec8449..22bceef044 100644 --- a/spring-ejb/wildfly/wildfly-ejb/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb/pom.xml @@ -3,7 +3,8 @@ 4.0.0 wildfly-ejb ejb - + wildfly-ejb + com.baeldung.wildfly wildfly-example diff --git a/spring-ejb/wildfly/wildfly-jpa/pom.xml b/spring-ejb/wildfly/wildfly-jpa/pom.xml index 12cf2c81e4..6a0352c102 100644 --- a/spring-ejb/wildfly/wildfly-jpa/pom.xml +++ b/spring-ejb/wildfly/wildfly-jpa/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 wildfly-jpa - + wildfly-jpa + com.baeldung.wildfly wildfly-example diff --git a/spring-freemarker/pom.xml b/spring-freemarker/pom.xml index 4ff57e27f0..02f2a3fd06 100644 --- a/spring-freemarker/pom.xml +++ b/spring-freemarker/pom.xml @@ -5,7 +5,7 @@ spring-freemarker war 1.0-SNAPSHOT - Spring Freemarker Example + spring-freemarker com.baeldung diff --git a/spring-jersey/pom.xml b/spring-jersey/pom.xml index 872835177d..5e7b50d291 100644 --- a/spring-jersey/pom.xml +++ b/spring-jersey/pom.xml @@ -6,7 +6,8 @@ spring-jersey 0.1-SNAPSHOT war - + spring-jersey + com.baeldung parent-modules diff --git a/spring-jooq/pom.xml b/spring-jooq/pom.xml index 744ae34cc8..bbd6025418 100644 --- a/spring-jooq/pom.xml +++ b/spring-jooq/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-jooq - + spring-jooq + parent-boot-1 com.baeldung diff --git a/spring-katharsis/pom.xml b/spring-katharsis/pom.xml index 39648a982c..756aae93d3 100644 --- a/spring-katharsis/pom.xml +++ b/spring-katharsis/pom.xml @@ -5,7 +5,8 @@ spring-katharsis 0.0.1-SNAPSHOT war - + spring-katharsis + parent-boot-1 com.baeldung diff --git a/spring-ldap/pom.xml b/spring-ldap/pom.xml index 3b2525d899..7399a84c2b 100644 --- a/spring-ldap/pom.xml +++ b/spring-ldap/pom.xml @@ -5,6 +5,7 @@ spring-ldap 0.1-SNAPSHOT jar + spring-ldap com.baeldung diff --git a/spring-mvc-simple/pom.xml b/spring-mvc-simple/pom.xml index e4e30183eb..8d7ad0fa7f 100644 --- a/spring-mvc-simple/pom.xml +++ b/spring-mvc-simple/pom.xml @@ -4,8 +4,7 @@ spring-mvc-simple war 0.0.1-SNAPSHOT - Spring MVC simple Maven Webapp - http://maven.apache.org + spring-mvc-simple com.baeldung diff --git a/spring-mybatis/pom.xml b/spring-mybatis/pom.xml index 7b8b66fef1..af70cb6377 100644 --- a/spring-mybatis/pom.xml +++ b/spring-mybatis/pom.xml @@ -5,8 +5,7 @@ spring-mybatis jar 0.0.1-SNAPSHOT - spring-mybatis Maven Webapp - http://maven.apache.org + spring-mybatis com.baeldung diff --git a/spring-reactive-kotlin/pom.xml b/spring-reactive-kotlin/pom.xml index bff39984e0..7bd31396f7 100644 --- a/spring-reactive-kotlin/pom.xml +++ b/spring-reactive-kotlin/pom.xml @@ -4,7 +4,7 @@ 4.0.0 spring-reactive-kotlin jar - Spring Reactive Kotlin + spring-reactive-kotlin Demo project for Spring Boot diff --git a/spring-remoting/remoting-hessian-burlap/pom.xml b/spring-remoting/remoting-hessian-burlap/pom.xml index 6cb5a51812..e63d0ee22e 100644 --- a/spring-remoting/remoting-hessian-burlap/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/pom.xml @@ -5,6 +5,7 @@ 4.0.0 remoting-hessian-burlap pom + remoting-hessian-burlap spring-remoting diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml index f337d5e51f..104712c3d7 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml @@ -2,15 +2,16 @@ - + 4.0.0 + spring-remoting-hessian-burlap-client + spring-remoting-hessian-burlap-client + + remoting-hessian-burlap com.baeldung 1.0-SNAPSHOT - 4.0.0 - - spring-remoting-hessian-burlap-client - + org.springframework.boot diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml index 5b6e03348f..33b824442f 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-hessian-burlap-server + remoting-hessian-burlap-server + remoting-hessian-burlap com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-hessian-burlap-server diff --git a/spring-remoting/remoting-http/pom.xml b/spring-remoting/remoting-http/pom.xml index 3262736ec8..886a28b886 100644 --- a/spring-remoting/remoting-http/pom.xml +++ b/spring-remoting/remoting-http/pom.xml @@ -4,8 +4,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http - Parent for all modules related to HTTP Spring Remoting. pom + + remoting-http + Parent for all modules related to HTTP Spring Remoting. com.baeldung diff --git a/spring-remoting/remoting-http/remoting-http-client/pom.xml b/spring-remoting/remoting-http/remoting-http-client/pom.xml index 9a6e98ffdd..56412d3cdf 100644 --- a/spring-remoting/remoting-http/remoting-http-client/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-client/pom.xml @@ -4,6 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http-client + remoting-http-client Shows how to invoke a remote service using Spring Remoting HTTP. diff --git a/spring-remoting/remoting-http/remoting-http-server/pom.xml b/spring-remoting/remoting-http/remoting-http-server/pom.xml index 53d27a5efa..c3f87e776e 100644 --- a/spring-remoting/remoting-http/remoting-http-server/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-server/pom.xml @@ -4,6 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http-server + remoting-http-server Shows how to expose a service using Spring Remoting HTTP. diff --git a/spring-remoting/remoting-jms/pom.xml b/spring-remoting/remoting-jms/pom.xml index fe36431423..e24b5b7929 100644 --- a/spring-remoting/remoting-jms/pom.xml +++ b/spring-remoting/remoting-jms/pom.xml @@ -2,18 +2,20 @@ + 4.0.0 + remoting-jms + remoting-jms + pom + spring-remoting com.baeldung 1.0-SNAPSHOT - 4.0.0 - pom + remoting-jms-client remoting-jms-server - remoting-jms - \ No newline at end of file diff --git a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml index ed27282a38..b7b1af5a1a 100644 --- a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-jms-client + remoting-jms-client + remoting-jms com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-jms-client UTF-8 diff --git a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml index 7657267f1d..8a17cdb0a9 100644 --- a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-jms-server + remoting-jms-server + remoting-jms com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-jms-server UTF-8 diff --git a/spring-remoting/remoting-rmi/pom.xml b/spring-remoting/remoting-rmi/pom.xml index cd15a6ec60..b3b84786b8 100644 --- a/spring-remoting/remoting-rmi/pom.xml +++ b/spring-remoting/remoting-rmi/pom.xml @@ -3,8 +3,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 - pom remoting-rmi + pom + remoting-rmi spring-remoting diff --git a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml index 1e3cd4b977..4ac0283e94 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml @@ -2,15 +2,16 @@ + 4.0.0 + remoting-rmi-client + remoting-rmi-client + remoting-rmi com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-rmi-client - + org.springframework.boot diff --git a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml index 68b01829e1..7fb4d2c1bc 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml @@ -2,14 +2,15 @@ + 4.0.0 + remoting-rmi-server + remoting-rmi-server + remoting-rmi com.baeldung 1.0-SNAPSHOT - 4.0.0 - - remoting-rmi-server UTF-8 diff --git a/spring-rest-hal-browser/pom.xml b/spring-rest-hal-browser/pom.xml index 6c56faf0b2..ee0a2c043d 100644 --- a/spring-rest-hal-browser/pom.xml +++ b/spring-rest-hal-browser/pom.xml @@ -3,10 +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 - com.baeldung spring-rest-hal-browser 1.0-SNAPSHOT + spring-rest-hal-browser + diff --git a/spring-roo/pom.xml b/spring-roo/pom.xml index c205c98dc0..baa0e7f5e6 100644 --- a/spring-roo/pom.xml +++ b/spring-roo/pom.xml @@ -6,7 +6,7 @@ com.baeldung spring-roo 1.0.0.BUILD-SNAPSHOT - Spring Roo + spring-roo jar diff --git a/spring-security-angular/server/pom.xml b/spring-security-angular/server/pom.xml index c1faecca55..55269bb35f 100644 --- a/spring-security-angular/server/pom.xml +++ b/spring-security-angular/server/pom.xml @@ -3,10 +3,10 @@ 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-security-angular + server 0.0.1-SNAPSHOT jar - spring-security-angular + server Spring Security Angular diff --git a/spring-security-cache-control/pom.xml b/spring-security-cache-control/pom.xml index b7dfc9db3a..c630774849 100644 --- a/spring-security-cache-control/pom.xml +++ b/spring-security-cache-control/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung spring-security-cache-control 1.0-SNAPSHOT + spring-security-cache-control parent-boot-1 diff --git a/spring-security-client/spring-security-jsp-authentication/pom.xml b/spring-security-client/spring-security-jsp-authentication/pom.xml index 0e564b47b8..9bb58863d9 100644 --- a/spring-security-client/spring-security-jsp-authentication/pom.xml +++ b/spring-security-client/spring-security-jsp-authentication/pom.xml @@ -6,7 +6,7 @@ spring-security-jsp-authentication 0.0.1-SNAPSHOT war - spring-security-jsp-authenticate + spring-security-jsp-authentication Spring Security JSP Authentication tag sample diff --git a/spring-security-x509/pom.xml b/spring-security-x509/pom.xml index 0cee3b3129..658840e866 100644 --- a/spring-security-x509/pom.xml +++ b/spring-security-x509/pom.xml @@ -6,7 +6,8 @@ spring-security-x509 0.0.1-SNAPSHOT pom - + spring-security-x509 + parent-boot-1 com.baeldung diff --git a/spring-security-x509/spring-security-x509-basic-auth/pom.xml b/spring-security-x509/spring-security-x509-basic-auth/pom.xml index 67f2b4fbcd..5b68a8e63b 100644 --- a/spring-security-x509/spring-security-x509-basic-auth/pom.xml +++ b/spring-security-x509/spring-security-x509-basic-auth/pom.xml @@ -2,11 +2,10 @@ 4.0.0 - spring-security-x509-basic-auth 0.0.1-SNAPSHOT jar - Spring Security x.509 Basic Authentication + spring-security-x509-basic-auth Spring x.509 Authentication Demo diff --git a/spring-security-x509/spring-security-x509-client-auth/pom.xml b/spring-security-x509/spring-security-x509-client-auth/pom.xml index 5cb4001a94..47ec7f971d 100644 --- a/spring-security-x509/spring-security-x509-client-auth/pom.xml +++ b/spring-security-x509/spring-security-x509-client-auth/pom.xml @@ -2,11 +2,10 @@ 4.0.0 - spring-security-x509-client-auth 0.0.1-SNAPSHOT jar - Spring Security x.509 Client Authentication + spring-security-x509-client-auth Spring x.509 Client Authentication Demo diff --git a/spring-session/spring-session-redis/pom.xml b/spring-session/spring-session-redis/pom.xml index 00da656226..96d90b2776 100644 --- a/spring-session/spring-session-redis/pom.xml +++ b/spring-session/spring-session-redis/pom.xml @@ -5,6 +5,7 @@ spring-session-redis 1.0.0-SNAPSHOT jar + spring-session-redis parent-boot-1 diff --git a/spring-sleuth/pom.xml b/spring-sleuth/pom.xml index a9a8d3e96e..5ce9e07858 100644 --- a/spring-sleuth/pom.xml +++ b/spring-sleuth/pom.xml @@ -6,7 +6,8 @@ spring-sleuth 1.0.0-SNAPSHOT jar - + spring-sleuth + parent-boot-1 com.baeldung diff --git a/spring-spel/pom.xml b/spring-spel/pom.xml index 4af318fde2..aa6eb45158 100644 --- a/spring-spel/pom.xml +++ b/spring-spel/pom.xml @@ -5,7 +5,7 @@ com.baeldung spring-spel 1.0-SNAPSHOT - Spring SpEL + spring-spel com.baeldung diff --git a/spring-state-machine/pom.xml b/spring-state-machine/pom.xml index 5d15e4dfad..b911b5b5ee 100644 --- a/spring-state-machine/pom.xml +++ b/spring-state-machine/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-state-machine - + spring-state-machine + parent-modules com.baeldung diff --git a/spring-swagger-codegen/pom.xml b/spring-swagger-codegen/pom.xml index 8e551d850f..e1bb98360e 100644 --- a/spring-swagger-codegen/pom.xml +++ b/spring-swagger-codegen/pom.xml @@ -4,6 +4,7 @@ spring-swagger-codegen 0.0.1-SNAPSHOT pom + spring-swagger-codegen com.baeldung diff --git a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml index 4aff696828..f9410b6865 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml @@ -2,7 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-swagger-codegen-app - + spring-swagger-codegen-app + com.baeldung spring-swagger-codegen diff --git a/spring-thymeleaf/pom.xml b/spring-thymeleaf/pom.xml index 0926728aba..78f95fe1df 100644 --- a/spring-thymeleaf/pom.xml +++ b/spring-thymeleaf/pom.xml @@ -5,6 +5,7 @@ spring-thymeleaf 0.1-SNAPSHOT war + spring-thymeleaf com.baeldung diff --git a/spring-userservice/pom.xml b/spring-userservice/pom.xml index 7144a57ca6..e562171103 100644 --- a/spring-userservice/pom.xml +++ b/spring-userservice/pom.xml @@ -1,12 +1,12 @@ 4.0.0 - spring-userservice spring-userservice 0.0.1-SNAPSHOT war - + spring-userservice + com.baeldung parent-spring-4 diff --git a/spring-vertx/pom.xml b/spring-vertx/pom.xml index 790eeff128..14ed77d359 100644 --- a/spring-vertx/pom.xml +++ b/spring-vertx/pom.xml @@ -2,10 +2,9 @@ 4.0.0 - spring-vertx jar - Spring Vertx + spring-vertx A demo project with vertx spring integration diff --git a/sse-jaxrs/pom.xml b/sse-jaxrs/pom.xml index ac9bff937f..68d1b1bc2b 100644 --- a/sse-jaxrs/pom.xml +++ b/sse-jaxrs/pom.xml @@ -3,10 +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 - com.baeldung.sse sse-jaxrs 1.0-SNAPSHOT + sse-jaxrs pom diff --git a/sse-jaxrs/sse-jaxrs-client/pom.xml b/sse-jaxrs/sse-jaxrs-client/pom.xml index a9068e133f..15a991bfc0 100644 --- a/sse-jaxrs/sse-jaxrs-client/pom.xml +++ b/sse-jaxrs/sse-jaxrs-client/pom.xml @@ -3,6 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + sse-jaxrs-client + sse-jaxrs-client com.baeldung.sse @@ -10,8 +12,6 @@ 1.0-SNAPSHOT - sse-jaxrs-client - 3.2.0 diff --git a/sse-jaxrs/sse-jaxrs-server/pom.xml b/sse-jaxrs/sse-jaxrs-server/pom.xml index 1e89c70e13..825dcddbdf 100644 --- a/sse-jaxrs/sse-jaxrs-server/pom.xml +++ b/sse-jaxrs/sse-jaxrs-server/pom.xml @@ -3,16 +3,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 - + sse-jaxrs-server + war + sse-jaxrs-server + com.baeldung.sse sse-jaxrs 1.0-SNAPSHOT - sse-jaxrs-server - war - 2.4.2 false diff --git a/static-analysis/pom.xml b/static-analysis/pom.xml index 14853d81f7..94d68f895b 100644 --- a/static-analysis/pom.xml +++ b/static-analysis/pom.xml @@ -2,10 +2,10 @@ 4.0.0 - com.baeldung static-analysis 1.0-SNAPSHOT + static-analysis com.baeldung diff --git a/structurizr/pom.xml b/structurizr/pom.xml index cbbbf8d68c..76b1e355f1 100644 --- a/structurizr/pom.xml +++ b/structurizr/pom.xml @@ -2,9 +2,9 @@ 4.0.0 - com.baeldung structurizr + structurizr com.baeldung diff --git a/struts-2/pom.xml b/struts-2/pom.xml index fee68c8303..ac8579d9e0 100644 --- a/struts-2/pom.xml +++ b/struts-2/pom.xml @@ -5,7 +5,7 @@ struts-2 0.0.1-SNAPSHOT pom - Struts 2 + struts-2 com.baeldung diff --git a/testing-modules/gatling/pom.xml b/testing-modules/gatling/pom.xml index 8d4c89ec62..158da176c6 100644 --- a/testing-modules/gatling/pom.xml +++ b/testing-modules/gatling/pom.xml @@ -6,7 +6,8 @@ org.baeldung gatling 1.0-SNAPSHOT - + gatling + com.baeldung parent-modules diff --git a/testing-modules/groovy-spock/pom.xml b/testing-modules/groovy-spock/pom.xml index e0da345eb4..3dd01c29ab 100644 --- a/testing-modules/groovy-spock/pom.xml +++ b/testing-modules/groovy-spock/pom.xml @@ -6,6 +6,7 @@ groovy-spock 1.0-SNAPSHOT jar + groovy-spock com.baeldung diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml index 869eda1bb5..42614d310b 100644 --- a/testing-modules/load-testing-comparison/pom.xml +++ b/testing-modules/load-testing-comparison/pom.xml @@ -2,15 +2,16 @@ + 4.0.0 + load-testing-comparison + load-testing-comparison + parent-modules com.baeldung 1.0.0-SNAPSHOT ../../pom.xml - 4.0.0 - - load-testing-bakeoff 1.8 diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index cab4d7977b..5f60566566 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/pom.xml @@ -5,7 +5,7 @@ mockito-2 0.0.1-SNAPSHOT jar - mockito-2-with-java8 + mockito-2 com.baeldung diff --git a/testing-modules/mockserver/pom.xml b/testing-modules/mockserver/pom.xml index c2fa2870e2..1db409bd7c 100644 --- a/testing-modules/mockserver/pom.xml +++ b/testing-modules/mockserver/pom.xml @@ -5,7 +5,8 @@ com.baeldung mockserver 1.0.0-SNAPSHOT - + mockserver + com.baeldung parent-modules diff --git a/testing-modules/parallel-tests-junit/pom.xml b/testing-modules/parallel-tests-junit/pom.xml index 3fd4e695e5..ecca8b3930 100644 --- a/testing-modules/parallel-tests-junit/pom.xml +++ b/testing-modules/parallel-tests-junit/pom.xml @@ -5,6 +5,8 @@ parallel-tests-junit 0.0.1-SNAPSHOT pom + parallel-tests-junit + math-test-functions string-test-functions diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index e22f7421cf..ae15fc97c0 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/pom.xml @@ -4,7 +4,8 @@ com.baeldung selenium-junit-testng 0.0.1-SNAPSHOT - + selenium-junit-testng + com.baeldung parent-modules diff --git a/twilio/pom.xml b/twilio/pom.xml index 610cc04b60..81fbf8ab20 100644 --- a/twilio/pom.xml +++ b/twilio/pom.xml @@ -4,7 +4,8 @@ 4.0.0 twilio 1.0-SNAPSHOT - + twilio + parent-modules com.baeldung diff --git a/vertx-and-rxjava/pom.xml b/vertx-and-rxjava/pom.xml index cbc94dd8f1..389eaf687b 100644 --- a/vertx-and-rxjava/pom.xml +++ b/vertx-and-rxjava/pom.xml @@ -3,7 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 vertx-and-rxjava - + vertx-and-rxjava + com.baeldung parent-modules diff --git a/video-tutorials/jackson-annotations/pom.xml b/video-tutorials/jackson-annotations/pom.xml index 748721b83c..121609ad4d 100644 --- a/video-tutorials/jackson-annotations/pom.xml +++ b/video-tutorials/jackson-annotations/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - com.baeldung jackson-annotations 1.0.0-SNAPSHOT - jacksonannotation + jackson-annotations com.baeldung diff --git a/vraptor/pom.xml b/vraptor/pom.xml index ae43d8e083..97005bd158 100644 --- a/vraptor/pom.xml +++ b/vraptor/pom.xml @@ -1,11 +1,11 @@ 4.0.0 - com.baeldung vraptor 1.0.0 war + vraptor A demo project to start using VRaptor 4 diff --git a/xmlunit-2/pom.xml b/xmlunit-2/pom.xml index 806ebb6c0e..faefeca7a1 100644 --- a/xmlunit-2/pom.xml +++ b/xmlunit-2/pom.xml @@ -4,6 +4,7 @@ com.baeldung xmlunit-2 1.0 + xmlunit-2 com.baeldung From 30864ad7bf208a24a6e7d445828a2dea1d22d4bb Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Fri, 30 Nov 2018 22:28:32 +0530 Subject: [PATCH 41/73] BAEL-9567 Align module names, folder names and artifact id - Fixed parent pom id --- spring-ejb/wildfly/widlfly-web/pom.xml | 4 ++-- spring-ejb/wildfly/wildfly-ear/pom.xml | 2 +- spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml | 2 +- spring-ejb/wildfly/wildfly-ejb/pom.xml | 2 +- spring-ejb/wildfly/wildfly-jpa/pom.xml | 2 +- spring-ejb/wildfly/wildfly-mdb/pom.xml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spring-ejb/wildfly/widlfly-web/pom.xml b/spring-ejb/wildfly/widlfly-web/pom.xml index 1dcb18a230..f0baac10dd 100644 --- a/spring-ejb/wildfly/widlfly-web/pom.xml +++ b/spring-ejb/wildfly/widlfly-web/pom.xml @@ -4,10 +4,10 @@ widlfly-web war widlfly-web - + com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-ear/pom.xml b/spring-ejb/wildfly/wildfly-ear/pom.xml index dc9059370f..93d6df96e5 100644 --- a/spring-ejb/wildfly/wildfly-ear/pom.xml +++ b/spring-ejb/wildfly/wildfly-ear/pom.xml @@ -7,7 +7,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml index 0324aa8e47..41c7012ea9 100644 --- a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml @@ -6,7 +6,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-ejb/pom.xml b/spring-ejb/wildfly/wildfly-ejb/pom.xml index 22bceef044..12bfc9c1bf 100644 --- a/spring-ejb/wildfly/wildfly-ejb/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb/pom.xml @@ -7,7 +7,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-jpa/pom.xml b/spring-ejb/wildfly/wildfly-jpa/pom.xml index 6a0352c102..3005ab714c 100644 --- a/spring-ejb/wildfly/wildfly-jpa/pom.xml +++ b/spring-ejb/wildfly/wildfly-jpa/pom.xml @@ -6,7 +6,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT diff --git a/spring-ejb/wildfly/wildfly-mdb/pom.xml b/spring-ejb/wildfly/wildfly-mdb/pom.xml index 186ddc50c0..a2ffca2fc5 100644 --- a/spring-ejb/wildfly/wildfly-mdb/pom.xml +++ b/spring-ejb/wildfly/wildfly-mdb/pom.xml @@ -6,7 +6,7 @@ com.baeldung.wildfly - wildfly-example + wildfly 0.0.1-SNAPSHOT From b02321519f0193b25a193cdbf5a7a7ce0313f5b1 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 19:28:39 +0200 Subject: [PATCH 42/73] Update CustomRequestSecurityConfig.java --- .../java/com/baeldung/oauth2/CustomRequestSecurityConfig.java | 1 - 1 file changed, 1 deletion(-) diff --git a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java index 51caee8178..2aba5a82ac 100644 --- a/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java +++ b/spring-5-security-oauth/src/main/java/com/baeldung/oauth2/CustomRequestSecurityConfig.java @@ -115,5 +115,4 @@ public class CustomRequestSecurityConfig extends WebSecurityConfigurerAdapter { } return null; } - } From dfa76b232f6a5d0299acf763bfb19a190c7a6621 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 19:41:31 +0200 Subject: [PATCH 43/73] Update README.md --- spring-5-reactive/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 4fab0c12ad..fc898a56dc 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -17,3 +17,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [A Guide to Spring Session Reactive Support: WebSession](https://www.baeldung.com/spring-session-reactive) - [Validation for Functional Endpoints in Spring 5](https://www.baeldung.com/spring-functional-endpoints-validation) - [Logging a Reactive Sequence](https://www.baeldung.com/spring-reactive-sequence-logging) + From 2c44ec056e1056ece63ebdc722a700cfbe7321c5 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 19:56:53 +0200 Subject: [PATCH 44/73] Update README.md --- cdi/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cdi/README.md b/cdi/README.md index 1523aacf6b..bfb635be9e 100644 --- a/cdi/README.md +++ b/cdi/README.md @@ -2,3 +2,4 @@ - [CDI Interceptor vs Spring AspectJ](http://www.baeldung.com/cdi-interceptor-vs-spring-aspectj) - [An Introduction to CDI (Contexts and Dependency Injection) in Java](http://www.baeldung.com/java-ee-cdi) - [Introduction to the Event Notification Model in CDI 2.0](https://www.baeldung.com/cdi-event-notification) + From 6f717e04d5f119f39fd1753f6f3a234217b7a5bf Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 20:26:30 +0200 Subject: [PATCH 45/73] Update and rename CompoundOperatorsTest.java to CompoundOperatorsUnitTest.java --- ...ompoundOperatorsTest.java => CompoundOperatorsUnitTest.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-java-lang/src/test/java/com/baeldung/compoundoperators/{CompoundOperatorsTest.java => CompoundOperatorsUnitTest.java} (98%) diff --git a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java similarity index 98% rename from core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java rename to core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java index 3b3478b38e..532776edd4 100644 --- a/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsTest.java +++ b/core-java-lang/src/test/java/com/baeldung/compoundoperators/CompoundOperatorsUnitTest.java @@ -4,7 +4,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; -public class CompoundOperatorsTest { +public class CompoundOperatorsUnitTest { @Test public void whenAssignmentOperatorIsUsed_thenValueIsAssigned() { From a2982271e3362b467d57dd36b3557c8eb0dbc094 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 21:16:33 +0200 Subject: [PATCH 46/73] Update README.md --- core-java-lang/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 607abbcdc5..79d2375c24 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -58,3 +58,4 @@ - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) + From b740a59e2baa23032febb4abb5892c7072f95f37 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 21:17:29 +0200 Subject: [PATCH 47/73] Update README.md --- restx/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/restx/README.md b/restx/README.md index f586f08a21..665f7ea82d 100644 --- a/restx/README.md +++ b/restx/README.md @@ -1,3 +1,4 @@ # Relevant Articles * [Introduction to RESTX](https://www.baeldung.com/java-restx) + From 95dc6fd367ab733887dd7f7a314965d98ee43764 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 21:17:59 +0200 Subject: [PATCH 48/73] Update pom.xml --- algorithms-genetic/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/algorithms-genetic/pom.xml b/algorithms-genetic/pom.xml index 662e0c5913..fc6d36dac1 100644 --- a/algorithms-genetic/pom.xml +++ b/algorithms-genetic/pom.xml @@ -61,4 +61,5 @@ 1.11 - \ No newline at end of file + + From 6e478c5fed04af8807be8afce9d5266cf59b68d3 Mon Sep 17 00:00:00 2001 From: Muhammad Asif Anwar Date: Sat, 1 Dec 2018 00:57:07 +0400 Subject: [PATCH 49/73] for BAEL 10834 (#5816) * Update pom.xml * enabling spring-security-react module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index da17fc2931..ef7a7f6b1d 100644 --- a/pom.xml +++ b/pom.xml @@ -599,7 +599,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -1141,7 +1141,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-react spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From eeb02d95ae78750ea0254be3338c007a20df5f3e Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Fri, 30 Nov 2018 23:20:02 +0200 Subject: [PATCH 50/73] Update pom.xml --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ef7a7f6b1d..7b295abc24 100644 --- a/pom.xml +++ b/pom.xml @@ -405,7 +405,8 @@ jaxb javafx jgroups - jee-7 + jee-7-security jjwt jsf From b0039348cfa292774718babb813e4dde15955e77 Mon Sep 17 00:00:00 2001 From: Loredana Date: Fri, 30 Nov 2018 23:50:52 +0200 Subject: [PATCH 51/73] fix module names --- spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml | 1 - spring-cloud-data-flow/etl/customer-transform/pom.xml | 1 - spring-cloud-data-flow/etl/pom.xml | 5 ++--- spring-cloud-data-flow/pom.xml | 3 +-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml b/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml index 468d8e17d0..779a4a803a 100644 --- a/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml +++ b/spring-cloud-data-flow/etl/customer-mongodb-sink/pom.xml @@ -4,7 +4,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.customer customer-mongodb-sink jar diff --git a/spring-cloud-data-flow/etl/customer-transform/pom.xml b/spring-cloud-data-flow/etl/customer-transform/pom.xml index bc4b648907..c344b0fc57 100644 --- a/spring-cloud-data-flow/etl/customer-transform/pom.xml +++ b/spring-cloud-data-flow/etl/customer-transform/pom.xml @@ -4,7 +4,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.customer customer-transform 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/etl/pom.xml b/spring-cloud-data-flow/etl/pom.xml index e203999ee9..1f35d2072b 100644 --- a/spring-cloud-data-flow/etl/pom.xml +++ b/spring-cloud-data-flow/etl/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - org.baeldung.spring.cloud - etl-spring-cloud-data-flow + etl + etl 0.0.1-SNAPSHOT pom - etl-spring-cloud-data-flow org.baeldung.spring.cloud diff --git a/spring-cloud-data-flow/pom.xml b/spring-cloud-data-flow/pom.xml index dd1ceed71a..b5ef5d2c2a 100644 --- a/spring-cloud-data-flow/pom.xml +++ b/spring-cloud-data-flow/pom.xml @@ -1,11 +1,10 @@ 4.0.0 - org.baeldung.spring.cloud spring-cloud-data-flow 0.0.1-SNAPSHOT pom - spring-cloud-data-flow + spring-cloud-data-flow com.baeldung From eb1a92698b544a30e9ec5ad2f99711ca9a8f1309 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Fri, 30 Nov 2018 15:26:54 -0800 Subject: [PATCH 52/73] BAEL-2368 update readme --- java-collections-conversions/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java-collections-conversions/README.md b/java-collections-conversions/README.md index 761a78d7b0..0f89e07d63 100644 --- a/java-collections-conversions/README.md +++ b/java-collections-conversions/README.md @@ -8,4 +8,5 @@ - [Converting between a List and a Set in Java](http://www.baeldung.com/convert-list-to-set-and-set-to-list) - [Convert a Map to an Array, List or Set in Java](http://www.baeldung.com/convert-map-values-to-array-list-set) - [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) -- [How to Convert List to Map in Java](http://www.baeldung.com/java-list-to-map) \ No newline at end of file +- [How to Convert List to Map in Java](http://www.baeldung.com/java-list-to-map) +- [Array to String Conversions](https://www.baeldung.com/java-array-to-string) From b81bcc75f68ab9db34e1e761c6aedc78c2dcdda0 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Fri, 30 Nov 2018 15:27:12 -0800 Subject: [PATCH 53/73] Update README.md --- core-java-lang/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 79d2375c24..0f75e9474b 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -59,3 +59,4 @@ - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) + From e884dc106340904c5af72dd54932c1bf8d3e6d94 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Fri, 30 Nov 2018 22:39:06 -0600 Subject: [PATCH 54/73] Fixed compiler errors in spring-boot-crud --- .../src/main/java/com/baeldung/crud/Application.java | 2 -- .../baeldung/crud/controllers/UserController.java | 6 ++++-- .../com/baeldung/crud/UserControllerUnitTest.java | 12 +++++++----- .../test/java/com/baeldung/crud/UserUnitTest.java | 4 +++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java index 436cccb964..d9f594fb75 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java @@ -14,8 +14,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @EnableJpaRepositories(basePackages="com.baeldung.crud.repositories") @EnableTransactionManagement @EntityScan(basePackages="com.baeldung.crud.entities") - -@SpringBootApplication public class Application { public static void main(String[] args) { diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java index 1b7185c2fd..9a6cb477aa 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/controllers/UserController.java @@ -1,8 +1,7 @@ package com.baeldung.crud.controllers; -import com.baeldung.crud.UserRepository; -import com.baeldung.crud.entities.User; import javax.validation.Valid; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; @@ -11,6 +10,9 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + @Controller public class UserController { diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java index 7773a962fb..2de0828ae5 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserControllerUnitTest.java @@ -1,16 +1,18 @@ package com.baeldung.crud; -import com.baeldung.crud.UserController; -import com.baeldung.crud.entities.User; -import com.baeldung.crud.UserRepository; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.BeforeClass; -import org.junit.Test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; + +import org.junit.BeforeClass; +import org.junit.Test; import org.springframework.ui.Model; import org.springframework.validation.BindingResult; +import com.baeldung.crud.controllers.UserController; +import com.baeldung.crud.entities.User; +import com.baeldung.crud.repositories.UserRepository; + public class UserControllerUnitTest { private static UserController userController; diff --git a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java index a3c6a922d8..565f6727c3 100644 --- a/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java +++ b/spring-boot-crud/src/test/java/com/baeldung/crud/UserUnitTest.java @@ -1,9 +1,11 @@ package com.baeldung.crud; -import com.baeldung.crud.User; import static org.assertj.core.api.Assertions.assertThat; + import org.junit.Test; +import com.baeldung.crud.entities.User; + public class UserUnitTest { @Test From a303df4442c3d7c038f50f412c6248e913290dba Mon Sep 17 00:00:00 2001 From: Loredana Date: Sat, 1 Dec 2018 08:51:37 +0200 Subject: [PATCH 55/73] fix module names --- spring-cloud-data-flow/data-flow-server/pom.xml | 1 - spring-cloud-data-flow/data-flow-shell/pom.xml | 1 - spring-cloud-data-flow/etl/pom.xml | 2 +- spring-cloud-data-flow/log-sink/pom.xml | 1 - spring-cloud-data-flow/time-processor/pom.xml | 1 - spring-cloud-data-flow/time-source/pom.xml | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/spring-cloud-data-flow/data-flow-server/pom.xml b/spring-cloud-data-flow/data-flow-server/pom.xml index 0133d65978..a02d2984c1 100644 --- a/spring-cloud-data-flow/data-flow-server/pom.xml +++ b/spring-cloud-data-flow/data-flow-server/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud data-flow-server 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/data-flow-shell/pom.xml b/spring-cloud-data-flow/data-flow-shell/pom.xml index e4ec145277..3b155736c3 100644 --- a/spring-cloud-data-flow/data-flow-shell/pom.xml +++ b/spring-cloud-data-flow/data-flow-shell/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud data-flow-shell 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/etl/pom.xml b/spring-cloud-data-flow/etl/pom.xml index 1f35d2072b..7d5040e8ad 100644 --- a/spring-cloud-data-flow/etl/pom.xml +++ b/spring-cloud-data-flow/etl/pom.xml @@ -7,7 +7,7 @@ pom - org.baeldung.spring.cloud + com.baeldung spring-cloud-data-flow 0.0.1-SNAPSHOT diff --git a/spring-cloud-data-flow/log-sink/pom.xml b/spring-cloud-data-flow/log-sink/pom.xml index 33a0a4df45..69de679c2a 100644 --- a/spring-cloud-data-flow/log-sink/pom.xml +++ b/spring-cloud-data-flow/log-sink/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud log-sink 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/time-processor/pom.xml b/spring-cloud-data-flow/time-processor/pom.xml index 4f31e55b96..e630df1865 100644 --- a/spring-cloud-data-flow/time-processor/pom.xml +++ b/spring-cloud-data-flow/time-processor/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud time-processor 0.0.1-SNAPSHOT jar diff --git a/spring-cloud-data-flow/time-source/pom.xml b/spring-cloud-data-flow/time-source/pom.xml index dc593fdb14..649af32cf0 100644 --- a/spring-cloud-data-flow/time-source/pom.xml +++ b/spring-cloud-data-flow/time-source/pom.xml @@ -3,7 +3,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung.spring.cloud time-source 0.0.1-SNAPSHOT jar From 8a48239decdea2f491d6d3845f2cfbefbaec66d5 Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 1 Dec 2018 08:53:41 +0200 Subject: [PATCH 56/73] Update pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7b295abc24..3c5c171c96 100644 --- a/pom.xml +++ b/pom.xml @@ -600,7 +600,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From 51352c470f98c417bb4ecb9b3150eb9f167bc361 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Sat, 1 Dec 2018 00:40:53 -0700 Subject: [PATCH 57/73] SQLite with Spring Boot Added custom dialect for SQLite database. Simplify spring-data-rest Configuration Now uses profiles so that learners don't need to uncomment code in order for demonstrations to work. Issue: BAEL-2213 --- spring-data-rest/pom.xml | 11 +++ .../java/com/baeldung/config/DbConfig.java | 26 ++++++- .../com/baeldung/dialect/SQLiteDialect.java | 78 +++++++++++++++++++ .../dialect/SQLiteIdentityColumnSupport.java | 22 ++++++ .../src/main/resources/application.properties | 1 + .../resources/persistence-sqlite.properties | 7 +- 6 files changed, 142 insertions(+), 3 deletions(-) create mode 100644 spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java create mode 100644 spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index a6f12e1904..2fe4715bac 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -33,6 +33,15 @@ com.h2database h2 + + org.springframework.boot + spring-boot-autoconfigure + + + org.xerial + sqlite-jdbc + ${sqlite.version} + @@ -43,6 +52,8 @@ + com.baeldung.SpringDataRestApplication + 3.25.2 2.1.0.RELEASE diff --git a/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java b/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java index 8d1f9de497..26d882d6a0 100644 --- a/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java +++ b/spring-data-rest/src/main/java/com/baeldung/config/DbConfig.java @@ -7,6 +7,7 @@ import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; @@ -14,11 +15,12 @@ import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; -//@Configuration +@Configuration @EnableJpaRepositories(basePackages = "com.baeldung.repositories") // @PropertySource("persistence-h2.properties") // @PropertySource("persistence-hsqldb.properties") // @PropertySource("persistence-derby.properties") +//@PropertySource("persistence-sqlite.properties") public class DbConfig { @Autowired @@ -59,3 +61,25 @@ public class DbConfig { } } + +@Configuration +@Profile("h2") +@PropertySource("persistence-h2.properties") +class H2Config {} + +@Configuration +@Profile("hsqldb") +@PropertySource("persistence-hsqldb.properties") +class HsqldbConfig {} + + +@Configuration +@Profile("derby") +@PropertySource("persistence-derby.properties") +class DerbyConfig {} + + +@Configuration +@Profile("sqlite") +@PropertySource("persistence-sqlite.properties") +class SqliteConfig {} diff --git a/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java new file mode 100644 index 0000000000..4512f7d34d --- /dev/null +++ b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteDialect.java @@ -0,0 +1,78 @@ +package com.baeldung.dialect; + +import org.hibernate.dialect.Dialect; +import org.hibernate.dialect.identity.IdentityColumnSupport; + +import java.sql.Types; + +public class SQLiteDialect extends Dialect { + + public SQLiteDialect() { + registerColumnType(Types.BIT, "integer"); + registerColumnType(Types.TINYINT, "tinyint"); + registerColumnType(Types.SMALLINT, "smallint"); + registerColumnType(Types.INTEGER, "integer"); + registerColumnType(Types.BIGINT, "bigint"); + registerColumnType(Types.FLOAT, "float"); + registerColumnType(Types.REAL, "real"); + registerColumnType(Types.DOUBLE, "double"); + registerColumnType(Types.NUMERIC, "numeric"); + registerColumnType(Types.DECIMAL, "decimal"); + registerColumnType(Types.CHAR, "char"); + registerColumnType(Types.VARCHAR, "varchar"); + registerColumnType(Types.LONGVARCHAR, "longvarchar"); + registerColumnType(Types.DATE, "date"); + registerColumnType(Types.TIME, "time"); + registerColumnType(Types.TIMESTAMP, "timestamp"); + registerColumnType(Types.BINARY, "blob"); + registerColumnType(Types.VARBINARY, "blob"); + registerColumnType(Types.LONGVARBINARY, "blob"); + registerColumnType(Types.BLOB, "blob"); + registerColumnType(Types.CLOB, "clob"); + registerColumnType(Types.BOOLEAN, "integer"); + } + + public IdentityColumnSupport getIdentityColumnSupport() { + return new SQLiteIdentityColumnSupport(); + } + + public boolean hasAlterTable() { + return false; + } + + public boolean dropConstraints() { + return false; + } + + public String getDropForeignKeyString() { + return ""; + } + + public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey) { + return ""; + } + + public String getAddPrimaryKeyConstraintString(String constraintName) { + return ""; + } + + public String getForUpdateString() { + return ""; + } + + public String getAddColumnString() { + return "add column"; + } + + public boolean supportsOuterJoinForUpdate() { + return false; + } + + public boolean supportsIfExistsBeforeTableName() { + return true; + } + + public boolean supportsCascadeDelete() { + return false; + } +} diff --git a/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java new file mode 100644 index 0000000000..cf6e3a9a97 --- /dev/null +++ b/spring-data-rest/src/main/java/com/baeldung/dialect/SQLiteIdentityColumnSupport.java @@ -0,0 +1,22 @@ +package com.baeldung.dialect; + +import org.hibernate.MappingException; +import org.hibernate.dialect.identity.IdentityColumnSupportImpl; + +public class SQLiteIdentityColumnSupport extends IdentityColumnSupportImpl { + + @Override + public boolean supportsIdentityColumns() { + return true; + } + + @Override + public String getIdentitySelectString(String table, String column, int type) throws MappingException { + return "select last_insert_rowid()"; + } + + @Override + public String getIdentityColumnString(int type) throws MappingException { + return "integer"; + } +} diff --git a/spring-data-rest/src/main/resources/application.properties b/spring-data-rest/src/main/resources/application.properties index e69de29bb2..06cb22a4fe 100644 --- a/spring-data-rest/src/main/resources/application.properties +++ b/spring-data-rest/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.profiles.default=h2 \ No newline at end of file diff --git a/spring-data-rest/src/main/resources/persistence-sqlite.properties b/spring-data-rest/src/main/resources/persistence-sqlite.properties index 018c2cbaca..b6b5f4e4d6 100644 --- a/spring-data-rest/src/main/resources/persistence-sqlite.properties +++ b/spring-data-rest/src/main/resources/persistence-sqlite.properties @@ -1,4 +1,7 @@ driverClassName=org.sqlite.JDBC -url=jdbc:sqlite:memory:myDb +url=jdbc:sqlite:memory:myDb?cache=shared username=sa -password=sa \ No newline at end of file +password=sa +hibernate.dialect=com.baeldung.dialect.SQLiteDialect +hibernate.hbm2ddl.auto=create-drop +hibernate.show_sql=true From d2f148c90fee69b4e60b288e9defe1c476c056fa Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 1 Dec 2018 09:53:13 +0200 Subject: [PATCH 58/73] Update Application.java --- .../src/main/java/com/baeldung/crud/Application.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java index d9f594fb75..0b686e90e9 100644 --- a/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java +++ b/spring-boot-crud/src/main/java/com/baeldung/crud/Application.java @@ -19,4 +19,5 @@ public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } + } From 0bdc4f6602b530d4f009a8582edb7a3a2a93650c Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Sat, 1 Dec 2018 09:53:40 +0200 Subject: [PATCH 59/73] Update README.md --- core-java-lang/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/core-java-lang/README.md b/core-java-lang/README.md index 0f75e9474b..79d2375c24 100644 --- a/core-java-lang/README.md +++ b/core-java-lang/README.md @@ -59,4 +59,3 @@ - [A Guide to Constructors in Java](https://www.baeldung.com/java-constructors) - [Retrieving a Class Name in Java](https://www.baeldung.com/java-class-name) - From 7cbd26433d079de819e1c564941fac67ca2d59e5 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 11:22:23 +0200 Subject: [PATCH 60/73] pom cleanup work --- pom.xml | 186 +++++++++++++++++++++++++++----------------------------- 1 file changed, 88 insertions(+), 98 deletions(-) diff --git a/pom.xml b/pom.xml index 3c5c171c96..86ed229bce 100644 --- a/pom.xml +++ b/pom.xml @@ -363,6 +363,9 @@ core-java-8 core-groovy couchbase + core-java-concurrency + core-kotlin + core-java dozer disruptor @@ -419,6 +422,7 @@ java-spi java-ee-8-security-api + libraries libraries-data linkrest logging-modules/log-mdc @@ -469,7 +473,7 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 - persistence-modules/spring-data-mongodb + persistence-modules/spring-data-mongodb persistence-modules/java-cassandra persistence-modules/spring-data-cassandra persistence-modules/spring-data-couchbase-2 @@ -527,6 +531,8 @@ spring-5-mvc spring-5-security spring-5-security-oauth + + spring-aop spring-activiti spring-akka spring-amqp @@ -534,7 +540,6 @@ spring-apache-camel spring-batch spring-bom - spring-boot-keycloak spring-boot-bootstrap spring-boot-admin @@ -543,29 +548,34 @@ spring-boot-mvc spring-boot-logging-log4j2 spring-boot-disable-console-logging + spring-boot-property-exp + spring-boot-ctx-fluent + spring-boot + spring-boot-ops spring-cloud-data-flow spring-cloud spring-cloud-bus spring-core spring-cucumber - spring-ejb - spring-aop - spring-data-rest + spring-drools spring-dispatcher-servlet + spring-ejb spring-exceptions + spring-freemarker - spring-integration + + spring-jinq spring-jenkins-pipeline spring-jersey - spring-jms spring-jooq spring-kafka spring-katharsis spring-ldap + spring-mockito spring-mvc-forms-jsp spring-mvc-forms-thymeleaf @@ -574,6 +584,7 @@ spring-mvc-webflow spring-mvc-xml spring-mvc-kotlin + spring-protobuf spring-quartz spring-rest-angular @@ -582,6 +593,26 @@ spring-rest spring-resttemplate spring-rest-simple + spring-remoting + + spring-session + spring-sleuth + spring-social-login + spring-spel + spring-state-machine + spring-thymeleaf + spring-userservice + + spring-zuul + spring-reactor + spring-vertx + spring-vault + spring-rest-embedded-tomcat + spring-swagger-codegen + spring-webflux-amqp + + spring-static-resources + spring-security-thymeleaf spring-security-acl spring-security-cache-control spring-security-client/spring-security-jsp-authentication @@ -600,34 +631,13 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest spring-security-sso spring-security-x509 - spring-session - spring-sleuth - spring-social-login - spring-spel - spring-state-machine - spring-thymeleaf - spring-userservice - spring-zuul - spring-remoting - spring-reactor - spring-vertx - spring-vault - spring-jinq - spring-rest-embedded-tomcat - - spring-static-resources - spring-swagger-codegen - spring-drools - spring-boot-property-exp - spring-security-thymeleaf - spring-boot-ctx-fluent - spring-webflux-amqp + spring-security-mvc-custom spark-java saas @@ -668,17 +678,12 @@ @@ -910,6 +915,9 @@ core-java-8 core-groovy couchbase + core-java-concurrency + core-kotlin + core-java dozer disruptor @@ -952,7 +960,8 @@ jaxb javafx jgroups - jee-7 + jee-7-security jjwt jsf @@ -965,6 +974,7 @@ java-spi java-ee-8-security-api + libraries libraries-data linkrest logging-modules/log-mdc @@ -1015,7 +1025,7 @@ persistence-modules/hbase persistence-modules/influxdb persistence-modules/spring-hibernate4 - persistence-modules/spring-data-mongodb + persistence-modules/spring-data-mongodb persistence-modules/java-cassandra persistence-modules/spring-data-cassandra persistence-modules/spring-data-couchbase-2 @@ -1069,6 +1079,8 @@ spring-5-mvc spring-5-security spring-5-security-oauth + + spring-aop spring-activiti spring-akka spring-amqp @@ -1076,7 +1088,6 @@ spring-apache-camel spring-batch spring-bom - spring-boot-keycloak spring-boot-bootstrap spring-boot-admin @@ -1085,29 +1096,34 @@ spring-boot-mvc spring-boot-logging-log4j2 spring-boot-disable-console-logging + spring-boot-property-exp + spring-boot-ctx-fluent + spring-boot + spring-boot-ops spring-cloud-data-flow spring-cloud spring-cloud-bus spring-core spring-cucumber - spring-ejb - spring-aop - spring-data-rest + spring-drools spring-dispatcher-servlet + spring-ejb spring-exceptions + spring-freemarker - spring-integration + + spring-jinq spring-jenkins-pipeline spring-jersey - spring-jms spring-jooq spring-kafka spring-katharsis spring-ldap + spring-mockito spring-mvc-forms-jsp spring-mvc-forms-thymeleaf @@ -1116,6 +1132,7 @@ spring-mvc-webflow spring-mvc-xml spring-mvc-kotlin + spring-protobuf spring-quartz spring-rest-angular @@ -1124,6 +1141,26 @@ spring-rest spring-resttemplate spring-rest-simple + spring-remoting + + spring-session + spring-sleuth + spring-social-login + spring-spel + spring-state-machine + spring-thymeleaf + spring-userservice + + spring-zuul + spring-reactor + spring-vertx + spring-vault + spring-rest-embedded-tomcat + spring-swagger-codegen + spring-webflux-amqp + + spring-static-resources + spring-security-thymeleaf spring-security-acl spring-security-cache-control spring-security-client/spring-security-jsp-authentication @@ -1142,35 +1179,13 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - spring-security-react + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest spring-security-sso spring-security-x509 - spring-session - spring-sleuth - spring-social-login - spring-spel - spring-state-machine - spring-thymeleaf - spring-userservice - spring-zuul - spring-remoting - spring-reactor - spring-vertx - spring-vault - spring-jinq - spring-rest-embedded-tomcat - - spring-static-resources - spring-swagger-codegen - spring-drools - spring-boot-property-exp - spring-security-thymeleaf - spring-boot-ctx-fluent - spring-webflux-amqp - + spring-security-mvc-custom spark-java saas @@ -1205,28 +1220,18 @@ @@ -1268,23 +1273,8 @@ parent-spring-5 parent-java parent-kotlin - libraries - geotools - jhipster - testing-modules/gatling - spring-boot - spring-boot-ops - spring-5 - core-kotlin - kotlin-libraries - core-java - google-web-toolkit - spring-security-mvc-custom - persistence-modules/hibernate5 - persistence-modules/spring-data-elasticsearch - core-java-concurrency - core-java-concurrency-collections - restx + + From 5d512da017bcdf653fb6d96c4fb2d4ee6951f193 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 11:23:47 +0200 Subject: [PATCH 61/73] adding the jira --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 86ed229bce..cd128aa4c5 100644 --- a/pom.xml +++ b/pom.xml @@ -631,7 +631,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest @@ -1179,7 +1179,7 @@ spring-security-mvc-session spring-security-mvc-socket spring-security-openid - + spring-security-rest-basic-auth spring-security-rest-custom spring-security-rest From a2b79472d9cbd74f076f32f792a1c31d138762c4 Mon Sep 17 00:00:00 2001 From: KevinGilmore Date: Sat, 1 Dec 2018 07:10:46 -0600 Subject: [PATCH 62/73] BAEL-2246: add link back to article (#5824) --- java-strings/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java-strings/README.md b/java-strings/README.md index 222b28e8ad..11893e68a2 100644 --- a/java-strings/README.md +++ b/java-strings/README.md @@ -38,3 +38,4 @@ - [Java Base64 Encoding and Decoding](https://www.baeldung.com/java-base64-encode-and-decode) - [Generate a Secure Random Password in Java](https://www.baeldung.com/java-generate-secure-password) - [Removing Repeated Characters from a String](https://www.baeldung.com/java-remove-repeated-char) +- [Join Array of Primitives with Separator in Java](https://www.baeldung.com/java-join-primitive-array) From 2fa22543451c87fd28f98280e4abd19997f6af53 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 18:49:06 +0200 Subject: [PATCH 63/73] ignoring module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cd128aa4c5..4b64a1a27e 100644 --- a/pom.xml +++ b/pom.xml @@ -364,7 +364,7 @@ core-groovy couchbase core-java-concurrency - core-kotlin + core-java dozer @@ -916,7 +916,7 @@ core-groovy couchbase core-java-concurrency - core-kotlin + core-java dozer From 90ca342016f2495acb1d551d17143be3043650e5 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 19:39:47 +0200 Subject: [PATCH 64/73] disabling very long running module --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b64a1a27e..f9eee3b5e6 100644 --- a/pom.xml +++ b/pom.xml @@ -363,7 +363,7 @@ core-java-8 core-groovy couchbase - core-java-concurrency + core-java From 56400babbf49417074097d0b10c4747610a4cdfa Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 19:40:23 +0200 Subject: [PATCH 65/73] disabling very long running module --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f9eee3b5e6..2bed3c4960 100644 --- a/pom.xml +++ b/pom.xml @@ -915,7 +915,7 @@ core-java-8 core-groovy couchbase - core-java-concurrency + core-java From fe7e4f87f2ad412e60ac50405870ad89baf49b29 Mon Sep 17 00:00:00 2001 From: Eugen Paraschiv Date: Sat, 1 Dec 2018 20:45:56 +0200 Subject: [PATCH 66/73] ignoring long running module --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2bed3c4960..6480193201 100644 --- a/pom.xml +++ b/pom.xml @@ -422,7 +422,7 @@ java-spi java-ee-8-security-api - libraries + libraries-data linkrest logging-modules/log-mdc @@ -974,7 +974,7 @@ java-spi java-ee-8-security-api - libraries + libraries-data linkrest logging-modules/log-mdc From dcb2dd46027ea9ed32e579a025b3f96496c506b5 Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Sun, 2 Dec 2018 07:41:24 -0800 Subject: [PATCH 67/73] BAEL-2300 update readme --- core-java/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java/README.md b/core-java/README.md index e8923e9a2f..b8ad28cc0c 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -88,3 +88,4 @@ - [Changing the Order in a Sum Operation Can Produce Different Results?](https://www.baeldung.com/java-floating-point-sum-order) - [Java – Try with Resources](https://www.baeldung.com/java-try-with-resources) - [Abstract Classes in Java](https://www.baeldung.com/java-abstract-class) +- [Guide to Character Encoding](https://www.baeldung.com/java-char-encoding) From 0a87548bf80fdb8cfbd15edab2621df836ba1bda Mon Sep 17 00:00:00 2001 From: Emily Cheyne Date: Sun, 2 Dec 2018 08:11:11 -0800 Subject: [PATCH 68/73] BAEL-2089 update readme --- persistence-modules/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/persistence-modules/README.md b/persistence-modules/README.md index f12163bd6a..75ccc749e5 100644 --- a/persistence-modules/README.md +++ b/persistence-modules/README.md @@ -9,3 +9,4 @@ - [Introduction to Lettuce – the Java Redis Client](http://www.baeldung.com/java-redis-lettuce) - [A Guide to Jdbi](http://www.baeldung.com/jdbi) - [Pessimistic Locking in JPA](http://www.baeldung.com/jpa-pessimistic-locking) +- [Get All Data from a Table with Hibernate](https://www.baeldung.com/hibernate-select-all) From 857192358caf26bba0fec77f6991aed290fa91ab Mon Sep 17 00:00:00 2001 From: fanatixan Date: Sun, 2 Dec 2018 19:36:38 +0100 Subject: [PATCH 69/73] bael-2361 (#5804) * bael-2361 * Update RemoveLeadingAndTrailingZeroes.java * moving examples to java-string project --- .../RemoveLeadingAndTrailingZeroes.java | 103 +++++++++++++ ...emoveLeadingAndTrailingZeroesUnitTest.java | 143 ++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java create mode 100644 java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java diff --git a/java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java b/java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java new file mode 100644 index 0000000000..c9d748e897 --- /dev/null +++ b/java-strings/src/main/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroes.java @@ -0,0 +1,103 @@ +package com.baeldung.string.removeleadingtrailingchar; + + +import org.apache.commons.lang3.StringUtils; + +import com.google.common.base.CharMatcher; + +public class RemoveLeadingAndTrailingZeroes { + + public static String removeLeadingZeroesWithStringBuilder(String s) { + StringBuilder sb = new StringBuilder(s); + + while (sb.length() > 1 && sb.charAt(0) == '0') { + sb.deleteCharAt(0); + } + + return sb.toString(); + } + + public static String removeTrailingZeroesWithStringBuilder(String s) { + StringBuilder sb = new StringBuilder(s); + + while (sb.length() > 1 && sb.charAt(sb.length() - 1) == '0') { + sb.setLength(sb.length() - 1); + } + + return sb.toString(); + } + + public static String removeLeadingZeroesWithSubstring(String s) { + int index = 0; + + for (; index < s.length() - 1; index++) { + if (s.charAt(index) != '0') { + break; + } + } + + return s.substring(index); + } + + public static String removeTrailingZeroesWithSubstring(String s) { + int index = s.length() - 1; + + for (; index > 0; index--) { + if (s.charAt(index) != '0') { + break; + } + } + + return s.substring(0, index + 1); + } + + public static String removeLeadingZeroesWithApacheCommonsStripStart(String s) { + String stripped = StringUtils.stripStart(s, "0"); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeTrailingZeroesWithApacheCommonsStripEnd(String s) { + String stripped = StringUtils.stripEnd(s, "0"); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeLeadingZeroesWithGuavaTrimLeadingFrom(String s) { + String stripped = CharMatcher.is('0') + .trimLeadingFrom(s); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeTrailingZeroesWithGuavaTrimTrailingFrom(String s) { + String stripped = CharMatcher.is('0') + .trimTrailingFrom(s); + + if (stripped.isEmpty() && !s.isEmpty()) { + return "0"; + } + + return stripped; + } + + public static String removeLeadingZeroesWithRegex(String s) { + return s.replaceAll("^0+(?!$)", ""); + } + + public static String removeTrailingZeroesWithRegex(String s) { + return s.replaceAll("(?!^)0+$", ""); + } +} diff --git a/java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java b/java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java new file mode 100644 index 0000000000..55f932fea1 --- /dev/null +++ b/java-strings/src/test/java/com/baeldung/string/removeleadingtrailingchar/RemoveLeadingAndTrailingZeroesUnitTest.java @@ -0,0 +1,143 @@ +package com.baeldung.string.removeleadingtrailingchar; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.stream.Stream; + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +public class RemoveLeadingAndTrailingZeroesUnitTest { + + public static Stream leadingZeroTestProvider() { + return Stream.of(Arguments.of("", ""), Arguments.of("abc", "abc"), Arguments.of("123", "123"), Arguments.of("0abc", "abc"), Arguments.of("0123", "123"), Arguments.of("0000123", "123"), Arguments.of("1230", "1230"), Arguments.of("01230", "1230"), Arguments.of("01", "1"), + Arguments.of("0001", "1"), Arguments.of("0", "0"), Arguments.of("00", "0"), Arguments.of("0000", "0"), Arguments.of("12034", "12034"), Arguments.of("1200034", "1200034"), Arguments.of("0012034", "12034"), Arguments.of("1203400", "1203400")); + } + + public static Stream trailingZeroTestProvider() { + return Stream.of(Arguments.of("", ""), Arguments.of("abc", "abc"), Arguments.of("123", "123"), Arguments.of("abc0", "abc"), Arguments.of("1230", "123"), Arguments.of("1230000", "123"), Arguments.of("0123", "0123"), Arguments.of("01230", "0123"), Arguments.of("10", "1"), + Arguments.of("1000", "1"), Arguments.of("0", "0"), Arguments.of("00", "0"), Arguments.of("0000", "0"), Arguments.of("12034", "12034"), Arguments.of("1200034", "1200034"), Arguments.of("0012034", "0012034"), Arguments.of("1203400", "12034")); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithStringBuilder_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithStringBuilder(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithStringBuilder_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithStringBuilder(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithSubstring_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithSubstring(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithSubstring_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithSubstring(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithApacheCommonsStripStart_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithApacheCommonsStripStart(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithApacheCommonsStripEnd_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithApacheCommonsStripEnd(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithGuavaTrimLeadingFrom_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithGuavaTrimLeadingFrom(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithGuavaTrimTrailingFrom_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithGuavaTrimTrailingFrom(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("leadingZeroTestProvider") + public void givenTestStrings_whenRemoveLeadingZeroesWithRegex_thenReturnWithoutLeadingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeLeadingZeroesWithRegex(input); + + // then + assertThat(result).isEqualTo(expected); + } + + @ParameterizedTest + @MethodSource("trailingZeroTestProvider") + public void givenTestStrings_whenRemoveTrailingZeroesWithRegex_thenReturnWithoutTrailingZeroes(String input, String expected) { + // given + + // when + String result = RemoveLeadingAndTrailingZeroes.removeTrailingZeroesWithRegex(input); + + // then + assertThat(result).isEqualTo(expected); + } + +} From 6b29e94a406d81e23f6d7534c3692b7c855da12a Mon Sep 17 00:00:00 2001 From: chrisoberle Date: Sun, 2 Dec 2018 21:23:39 -0500 Subject: [PATCH 70/73] BAEL-2174 How to use proxies in core java (#5805) * move samples from core-java to new core-java-net module * remove erroneous commit of .vscode dir --- core-java-net/.gitignore | 25 +++++++++++++++++++ core-java-net/README.md | 3 +++ core-java-net/pom.xml | 19 ++++++++++++++ .../proxies/CommandLineProxyDemo.java | 0 .../networking/proxies/DirectProxyDemo.java | 0 .../networking/proxies/SocksProxyDemo.java | 0 .../proxies/SystemPropertyProxyDemo.java | 0 .../proxies/UrlConnectionUtils.java | 0 .../networking/proxies/WebProxyDemo.java | 0 core-java-net/src/test/resources/.gitignore | 13 ++++++++++ pom.xml | 4 ++- 11 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 core-java-net/.gitignore create mode 100644 core-java-net/README.md create mode 100644 core-java-net/pom.xml rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java (100%) rename {core-java => core-java-net}/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java (100%) create mode 100644 core-java-net/src/test/resources/.gitignore diff --git a/core-java-net/.gitignore b/core-java-net/.gitignore new file mode 100644 index 0000000000..374c8bf907 --- /dev/null +++ b/core-java-net/.gitignore @@ -0,0 +1,25 @@ +*.class + +0.* + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* +.resourceCache + +# Packaged files # +*.jar +*.war +*.ear + +# Files generated by integration tests +backup-pom.xml +/bin/ +/temp + +#IntelliJ specific +.idea/ +*.iml \ No newline at end of file diff --git a/core-java-net/README.md b/core-java-net/README.md new file mode 100644 index 0000000000..b7a142ea27 --- /dev/null +++ b/core-java-net/README.md @@ -0,0 +1,3 @@ +========= + +## Core Java Net diff --git a/core-java-net/pom.xml b/core-java-net/pom.xml new file mode 100644 index 0000000000..28d5766a9a --- /dev/null +++ b/core-java-net/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + core-java-net + 0.1.0-SNAPSHOT + jar + core-java-net + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../parent-java + + + + core-java-net + + diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/CommandLineProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/DirectProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/SocksProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/SystemPropertyProxyDemo.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/UrlConnectionUtils.java diff --git a/core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java b/core-java-net/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java similarity index 100% rename from core-java/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java rename to core-java-net/src/main/java/com/baeldung/networking/proxies/WebProxyDemo.java diff --git a/core-java-net/src/test/resources/.gitignore b/core-java-net/src/test/resources/.gitignore new file mode 100644 index 0000000000..83c05e60c8 --- /dev/null +++ b/core-java-net/src/test/resources/.gitignore @@ -0,0 +1,13 @@ +*.class + +#folders# +/target +/neoDb* +/data +/src/main/webapp/WEB-INF/classes +*/META-INF/* + +# Packaged files # +*.jar +*.war +*.ear \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6480193201..b5c61dff9d 100644 --- a/pom.xml +++ b/pom.xml @@ -366,7 +366,8 @@ core-java - + core-java-net + dozer disruptor drools @@ -918,6 +919,7 @@ core-java + core-java-net dozer disruptor From dcf28dd16638a27ea620d5d47b904ebe1195afc5 Mon Sep 17 00:00:00 2001 From: Seun Matt Date: Mon, 3 Dec 2018 17:03:41 +0100 Subject: [PATCH 71/73] refactor the spring boot persistence mongodb module (#5829) * added example code for BAEL-2366 * moved example code for BAEL-2366 * example code for BAEL-1961 * moved example code into integration test * updated the test assertions * refactor the spring boot persistence mongodb module * remove redundant example code * declared the spring boot persistence module in the root pom * fixed issue with non-imported file --- .../.gitignore | 4 + .../spring-boot-persistence-mongodb/pom.xml | 106 ++++++++++++++++++ .../SpringBootPersistenceApplication.java | 13 +++ .../baeldung/mongodb/daos/UserRepository.java | 0 .../mongodb/events/UserModelListener.java | 0 .../mongodb/models/DatabaseSequence.java | 0 .../com/baeldung/mongodb/models/User.java | 0 .../services/SequenceGeneratorService.java | 0 .../src/main/resources/application.properties | 8 ++ ...goDbAutoGeneratedFieldIntegrationTest.java | 7 +- pom.xml | 1 + .../com/baeldung/mongodb/Application.java | 19 ---- .../mongodb/MongoDbSpringIntegrationTest.java | 1 + 13 files changed, 137 insertions(+), 22 deletions(-) create mode 100644 persistence-modules/spring-boot-persistence-mongodb/.gitignore create mode 100644 persistence-modules/spring-boot-persistence-mongodb/pom.xml create mode 100644 persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/daos/UserRepository.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/events/UserModelListener.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/models/User.java (100%) rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java (100%) create mode 100644 persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties rename {spring-boot => persistence-modules/spring-boot-persistence-mongodb}/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java (88%) delete mode 100644 spring-boot/src/main/java/com/baeldung/mongodb/Application.java diff --git a/persistence-modules/spring-boot-persistence-mongodb/.gitignore b/persistence-modules/spring-boot-persistence-mongodb/.gitignore new file mode 100644 index 0000000000..f96dae6a60 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/.gitignore @@ -0,0 +1,4 @@ + +/.idea/ +/target/ +/spring-boot-persistence.iml diff --git a/persistence-modules/spring-boot-persistence-mongodb/pom.xml b/persistence-modules/spring-boot-persistence-mongodb/pom.xml new file mode 100644 index 0000000000..fc267eedf6 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/pom.xml @@ -0,0 +1,106 @@ + + + 4.0.0 + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../../parent-boot-2 + + + spring-boot-persistence-mongodb + war + spring-boot-persistence-mongodb + This is simple boot application for Spring boot persistence mongodb test + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-data-mongodb + + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + org.junit.platform + junit-platform-launcher + ${junit-platform.version} + test + + + org.springframework.boot + spring-boot-starter-test + test + + + + + spring-boot-persistence + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-war-plugin + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + + + + + json + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java new file mode 100644 index 0000000000..2dff3f37df --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/SpringBootPersistenceApplication.java @@ -0,0 +1,13 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SpringBootPersistenceApplication { + + public static void main(String ... args) { + SpringApplication.run(SpringBootPersistenceApplication.class, args); + } + +} diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/daos/UserRepository.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/daos/UserRepository.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/daos/UserRepository.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/events/UserModelListener.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/events/UserModelListener.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/events/UserModelListener.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/DatabaseSequence.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/models/User.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/User.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/models/User.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/models/User.java diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java b/persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java similarity index 100% rename from spring-boot/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java rename to persistence-modules/spring-boot-persistence-mongodb/src/main/java/com/baeldung/mongodb/services/SequenceGeneratorService.java diff --git a/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties new file mode 100644 index 0000000000..5b1b8000d0 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-mongodb/src/main/resources/application.properties @@ -0,0 +1,8 @@ +spring.application.name=spring-boot-persistence +server.port=${PORT:0} + +#spring boot mongodb +spring.data.mongodb.host=localhost +spring.data.mongodb.port=27017 +spring.data.mongodb.database=springboot-mongo + diff --git a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java b/persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java similarity index 88% rename from spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java rename to persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java index 3430bca69a..cec1ad5fea 100644 --- a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java +++ b/persistence-modules/spring-boot-persistence-mongodb/src/test/java/com/baeldung/mongodb/MongoDbAutoGeneratedFieldIntegrationTest.java @@ -5,17 +5,18 @@ import com.baeldung.mongodb.models.User; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import static org.assertj.core.api.Assertions.assertThat; -import java.util.List; +import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) +@SpringBootTest public class MongoDbAutoGeneratedFieldIntegrationTest { @Autowired - private UserRepository userRepository; + UserRepository userRepository; @Test public void contextLoads() {} diff --git a/pom.xml b/pom.xml index b5c61dff9d..dabb4a9628 100644 --- a/pom.xml +++ b/pom.xml @@ -479,6 +479,7 @@ persistence-modules/spring-data-cassandra persistence-modules/spring-data-couchbase-2 persistence-modules/spring-data-redis + persistence-modules/spring-boot-persistence-mongodb reactor-core resteasy diff --git a/spring-boot/src/main/java/com/baeldung/mongodb/Application.java b/spring-boot/src/main/java/com/baeldung/mongodb/Application.java deleted file mode 100644 index c0a9ad59a7..0000000000 --- a/spring-boot/src/main/java/com/baeldung/mongodb/Application.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.baeldung.mongodb; - -import com.baeldung.mongodb.daos.UserRepository; -import com.baeldung.mongodb.models.User; -import org.springframework.boot.CommandLineRunner; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; - -import java.util.List; - -@SpringBootApplication -public class Application { - - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } - -} diff --git a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java b/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java index 5431217c3e..39127f62e9 100644 --- a/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java +++ b/spring-boot/src/test/java/com/baeldung/mongodb/MongoDbSpringIntegrationTest.java @@ -2,6 +2,7 @@ package com.baeldung.mongodb; import static org.assertj.core.api.Assertions.assertThat; +import org.baeldung.boot.Application; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; From d25f0f1bb3e4dae3618ccfdcc09e2bf61212c978 Mon Sep 17 00:00:00 2001 From: yatendragoel Date: Mon, 3 Dec 2018 23:02:16 +0530 Subject: [PATCH 72/73] BAEL-2403: Immutable Map implementations in Java (#5828) * BAEL-2203 - Convert java.time.Instant to java.sql.Timestamp and vice-versa * BAEL-2203: Review edits * Removed ZoneId code * Converted class to JUnit Test * Update and rename ConvertInstantToTimestampTest.java to ConvertInstantToTimestampUnitTest.java * BAEL-2403: Immutable Map implementations in Java * BAEL-2403: Immutable Map implementations in Java - Changed file name --- .../java/map/ImmutableMapUnitTest.java | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java diff --git a/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java b/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java new file mode 100644 index 0000000000..b239ae07d8 --- /dev/null +++ b/java-collections-maps/src/test/java/com/baeldung/java/map/ImmutableMapUnitTest.java @@ -0,0 +1,87 @@ +package com.baeldung.java.map; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import org.junit.jupiter.api.Test; + +import com.google.common.collect.ImmutableMap; + + +public class ImmutableMapUnitTest { + + @Test + public void whenCollectionsUnModifiableMapMethod_thenOriginalCollectionChangesReflectInUnmodifiableMap() { + + Map mutableMap = new HashMap<>(); + mutableMap.put("USA", "North America"); + + Map unmodifiableMap = Collections.unmodifiableMap(mutableMap); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableMap.put("Canada", "North America")); + + mutableMap.remove("USA"); + assertFalse(unmodifiableMap.containsKey("USA")); + + mutableMap.put("Mexico", "North America"); + assertTrue(unmodifiableMap.containsKey("Mexico")); + } + + @Test + @SuppressWarnings("deprecation") + public void whenGuavaImmutableMapFromCopyOfMethod_thenOriginalCollectionChangesDoNotReflectInImmutableMap() { + + Map mutableMap = new HashMap<>(); + mutableMap.put("USA", "North America"); + + ImmutableMap immutableMap = ImmutableMap.copyOf(mutableMap); + assertTrue(immutableMap.containsKey("USA")); + + assertThrows(UnsupportedOperationException.class, () -> immutableMap.put("Canada", "North America")); + + mutableMap.remove("USA"); + assertTrue(immutableMap.containsKey("USA")); + + mutableMap.put("Mexico", "North America"); + assertFalse(immutableMap.containsKey("Mexico")); + } + + @Test + @SuppressWarnings("deprecation") + public void whenGuavaImmutableMapFromBuilderMethod_thenOriginalCollectionChangesDoNotReflectInImmutableMap() { + + Map mutableMap = new HashMap<>(); + mutableMap.put("USA", "North America"); + + ImmutableMap immutableMap = ImmutableMap.builder() + .putAll(mutableMap) + .put("Costa Rica", "North America") + .build(); + assertTrue(immutableMap.containsKey("USA")); + assertTrue(immutableMap.containsKey("Costa Rica")); + + assertThrows(UnsupportedOperationException.class, () -> immutableMap.put("Canada", "North America")); + + mutableMap.remove("USA"); + assertTrue(immutableMap.containsKey("USA")); + + mutableMap.put("Mexico", "North America"); + assertFalse(immutableMap.containsKey("Mexico")); + } + + @Test + @SuppressWarnings("deprecation") + public void whenGuavaImmutableMapFromOfMethod_thenOriginalCollectionChangesDoNotReflectInImmutableMap() { + + ImmutableMap immutableMap = ImmutableMap.of("USA", "North America", "Costa Rica", "North America"); + assertTrue(immutableMap.containsKey("USA")); + assertTrue(immutableMap.containsKey("Costa Rica")); + + assertThrows(UnsupportedOperationException.class, () -> immutableMap.put("Canada", "North America")); + } + +} From 3addff050fd2d2c67408f6151f3a96f42752e832 Mon Sep 17 00:00:00 2001 From: Mher Baghinyan Date: Tue, 4 Dec 2018 09:17:57 +0400 Subject: [PATCH 73/73] printf examples Issue: BAEL-2228 --- .../com/baeldung/printf/PrintfExamples.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 core-java/src/main/java/com/baeldung/printf/PrintfExamples.java diff --git a/core-java/src/main/java/com/baeldung/printf/PrintfExamples.java b/core-java/src/main/java/com/baeldung/printf/PrintfExamples.java new file mode 100644 index 0000000000..3d451f6f50 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/printf/PrintfExamples.java @@ -0,0 +1,61 @@ +package com.baeldung.printf; + +import java.util.Date; +import java.util.Locale; + +public class PrintfExamples { + + public static void main(String[] args) { + + printfNewLine(); + printfChar(); + printfString(); + printfNumber(); + printfDateTime(); + printfBoolean(); + } + + private static void printfNewLine() { + System.out.printf("baeldung%nline%nterminator"); + } + + private static void printfString() { + System.out.printf("'%s' %n", "baeldung"); + System.out.printf("'%S' %n", "baeldung"); + System.out.printf("'%15s' %n", "baeldung"); + System.out.printf("'%-10s' %n", "baeldung"); + } + + private static void printfChar() { + System.out.printf("%c%n", 's'); + System.out.printf("%C%n", 's'); + } + + private static void printfNumber() { + System.out.printf("simple integer: %d%n", 10000L); + + System.out.printf(Locale.US, "%,d %n", 10000); + System.out.printf(Locale.ITALY, "%,d %n", 10000); + + System.out.printf("%f%n", 5.1473); + System.out.printf("'%5.2f'%n", 5.1473); + System.out.printf("'%5.2e'%n", 5.1473); + } + + private static void printfBoolean() { + System.out.printf("%b%n", null); + System.out.printf("%B%n", false); + System.out.printf("%B%n", 5.3); + System.out.printf("%b%n", "random text"); + } + + private static void printfDateTime() { + Date date = new Date(); + System.out.printf("%tT%n", date); + System.out.printf("hours %tH: minutes %tM: seconds %tS%n", date, date, date); + System.out.printf("%1$tH:%1$tM:%1$tS %1$tp %1$tL %1$tN %1$tz %n", date); + + System.out.printf("%1$tA %1$tB %1$tY %n", date); + System.out.printf("%1$td.%1$tm.%1$ty %n", date); + } +}