Merge branch 'eugenp:master' into master
This commit is contained in:
commit
b03292b9c2
@ -83,4 +83,4 @@
|
||||
<olingo.version>2.0.11</olingo.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -34,6 +34,28 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>core-java-9-new-features</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
<url>https://repository.apache.org/snapshots/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>incubator-features</id>
|
||||
@ -126,28 +148,6 @@
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<finalName>core-java-9-new-features</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>apache.snapshots</id>
|
||||
<url>https://repository.apache.org/snapshots/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
<properties>
|
||||
<rxjava.version>3.0.0</rxjava.version>
|
||||
<awaitility.version>4.0.2</awaitility.version>
|
||||
|
@ -24,4 +24,4 @@
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -25,7 +25,6 @@
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${commons-lang3.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.darwinsys</groupId>
|
||||
<artifactId>hirondelle-date4j</artifactId>
|
||||
|
@ -259,7 +259,7 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
|
@ -64,13 +64,6 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<javaassist.version>3.27.0-GA</javaassist.version>
|
||||
<sun.tools.version>1.8.0</sun.tools.version>
|
||||
<jol-core.version>0.10</jol-core.version>
|
||||
<asm.version>8.0.1</asm.version>
|
||||
<bcel.version>6.5.0</bcel.version>
|
||||
</properties>
|
||||
<profiles>
|
||||
<!-- java instrumentation profiles to build jars -->
|
||||
<profile>
|
||||
@ -181,4 +174,12 @@
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
<javaassist.version>3.27.0-GA</javaassist.version>
|
||||
<sun.tools.version>1.8.0</sun.tools.version>
|
||||
<jol-core.version>0.10</jol-core.version>
|
||||
<asm.version>8.0.1</asm.version>
|
||||
<bcel.version>6.5.0</bcel.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -64,7 +64,6 @@
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -54,4 +54,5 @@
|
||||
<validator.version>1.7</validator.version>
|
||||
<apache-commons-lang3.version>3.12.0</apache-commons-lang3.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -69,7 +69,6 @@
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
@ -137,4 +137,4 @@
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung.dddmodules.infrastructure</groupId>
|
||||
<artifactId>infrastructure</artifactId>
|
||||
<version>1.0</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -13,7 +12,6 @@
|
||||
<groupId>com.baeldung.dddmodules</groupId>
|
||||
<artifactId>ddd-modules</artifactId>
|
||||
<version>1.0</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -14,7 +13,6 @@
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
@ -70,10 +68,8 @@
|
||||
<properties>
|
||||
<source.version>9</source.version>
|
||||
<target.version>9</target.version>
|
||||
|
||||
<compiler.plugin.version>3.8.1</compiler.plugin.version>
|
||||
|
||||
<appmodules.version>1.0</appmodules.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -13,7 +12,6 @@
|
||||
<groupId>com.baeldung.dddmodules</groupId>
|
||||
<artifactId>ddd-modules</artifactId>
|
||||
<version>1.0</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@ -13,7 +12,6 @@
|
||||
<groupId>com.baeldung.dddmodules</groupId>
|
||||
<artifactId>ddd-modules</artifactId>
|
||||
<version>1.0</version>
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@ -15,6 +15,14 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>osgeo-release</id>
|
||||
<name>OSGeo Repository</name>
|
||||
<url>https://repo.osgeo.org/repository/release/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.geotools</groupId>
|
||||
@ -33,14 +41,6 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>osgeo-release</id>
|
||||
<name>OSGeo Repository</name>
|
||||
<url>https://repo.osgeo.org/repository/release/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<geotools.version>15.2</geotools.version>
|
||||
<geotools-swing.version>15.2</geotools-swing.version>
|
||||
|
@ -33,26 +33,22 @@
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
<version>2.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.netflix.graphql.dgs.codegen</groupId>
|
||||
<artifactId>graphql-dgs-codegen-client-core</artifactId>
|
||||
<version>5.1.14</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.netflix.graphql.dgs</groupId>
|
||||
<artifactId>graphql-dgs-spring-boot-starter</artifactId>
|
||||
@ -88,4 +84,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>httpclient-2</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
|
@ -22,7 +22,6 @@
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>5.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
|
@ -57,4 +57,5 @@
|
||||
<org.apache.httpcomponents.version>4.5.13</org.apache.httpcomponents.version>
|
||||
<javax.servlet-api.version>4.0.1</javax.servlet-api.version>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
</project>
|
@ -37,35 +37,13 @@
|
||||
</dependencies>
|
||||
|
||||
<!-- uncomment in order to enable Hibernate Validator Anotation Processor -->
|
||||
<!--
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven.compiler.version}</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
<fork>true</fork>
|
||||
<compilerArgs>
|
||||
<arg>-Averbose=true</arg>
|
||||
<arg>-AmethodConstraintsSupported=true</arg>
|
||||
<arg>-AdiagnosticKind=ERROR</arg>
|
||||
</compilerArgs>
|
||||
<annotationProcessorPaths>
|
||||
<path>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator-annotation-processor</artifactId>
|
||||
<version>${hibernate-validator.ap.version}</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
-->
|
||||
<!-- <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven.compiler.version}</version> <configuration> <source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target> <fork>true</fork> <compilerArgs> <arg>-Averbose=true</arg>
|
||||
<arg>-AmethodConstraintsSupported=true</arg> <arg>-AdiagnosticKind=ERROR</arg> </compilerArgs> <annotationProcessorPaths>
|
||||
<path> <groupId>org.hibernate.validator</groupId> <artifactId>hibernate-validator-annotation-processor</artifactId>
|
||||
<version>${hibernate-validator.ap.version}</version> </path> </annotationProcessorPaths> </configuration>
|
||||
</plugin> </plugins> </build> -->
|
||||
|
||||
<properties>
|
||||
<hibernate-validator.version>6.0.13.Final</hibernate-validator.version>
|
||||
@ -77,4 +55,4 @@
|
||||
<org.springframework.version>5.0.2.RELEASE</org.springframework.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -15,7 +15,7 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -11,7 +11,6 @@
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<repositories>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>libraries-concurrency</artifactId>
|
||||
<name>libraries-concurrency</name>
|
||||
@ -78,5 +78,5 @@
|
||||
<properties>
|
||||
<quasar.version>0.8.0</quasar.version>
|
||||
</properties>
|
||||
|
||||
|
||||
</project>
|
@ -22,4 +22,4 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -62,18 +62,9 @@
|
||||
<verbose>false</verbose>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- This is for delomboking also your tests sources.
|
||||
<execution>
|
||||
<id>test-delombok</id>
|
||||
<phase>generate-test-sources</phase>
|
||||
<goals>
|
||||
<goal>testDelombok</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<verbose>false</verbose>
|
||||
</configuration>
|
||||
</execution>
|
||||
-->
|
||||
<!-- This is for delomboking also your tests sources. <execution> <id>test-delombok</id>
|
||||
<phase>generate-test-sources</phase> <goals> <goal>testDelombok</goal> </goals> <configuration> <verbose>false</verbose>
|
||||
</configuration> </execution> -->
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -1,22 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>maven-classifier-example-consumer</artifactId>
|
||||
|
||||
<parent>
|
||||
<artifactId>maven-classifier</artifactId>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>maven-classifier-example-consumer</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.baeldung</groupId>
|
||||
@ -29,13 +23,14 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<classifier>arbitrary</classifier>
|
||||
</dependency>
|
||||
<!-- For example purpose not building as it requires both JDK 8 and 11 executables on the build machine -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.baeldung</groupId>-->
|
||||
<!-- <artifactId>maven-classifier-example-provider</artifactId>-->
|
||||
<!-- <version>0.0.1-SNAPSHOT</version>-->
|
||||
<!-- <classifier>jdk11</classifier>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- For example purpose not building as it requires both JDK 8 and 11 executables on the build
|
||||
machine -->
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>com.baeldung</groupId> -->
|
||||
<!-- <artifactId>maven-classifier-example-provider</artifactId> -->
|
||||
<!-- <version>0.0.1-SNAPSHOT</version> -->
|
||||
<!-- <classifier>jdk11</classifier> -->
|
||||
<!-- </dependency> -->
|
||||
<dependency>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>maven-classifier-example-provider</artifactId>
|
||||
@ -50,4 +45,9 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -1,9 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>maven-classifier-example-provider</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<artifactId>maven-classifier</artifactId>
|
||||
@ -11,15 +12,6 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-classifier-example-provider</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<!-- <jdk.11.executable.path></jdk.11.executable.path>-->
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@ -39,21 +31,22 @@
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
</execution>
|
||||
<!-- For example purpose not building as it requires both JDK 8 and 11 executables on the build machine -->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>JDK 11</id>-->
|
||||
<!-- <phase>compile</phase>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>compile</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <fork>true</fork>-->
|
||||
<!-- <outputDirectory>${project.build.outputDirectory}_jdk11</outputDirectory>-->
|
||||
<!-- <executable>${jdk.11.executable.path}</executable>-->
|
||||
<!-- <source>8</source>-->
|
||||
<!-- <target>11</target>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </execution>-->
|
||||
<!-- For example purpose not building as it requires both JDK 8 and 11 executables
|
||||
on the build machine -->
|
||||
<!-- <execution> -->
|
||||
<!-- <id>JDK 11</id> -->
|
||||
<!-- <phase>compile</phase> -->
|
||||
<!-- <goals> -->
|
||||
<!-- <goal>compile</goal> -->
|
||||
<!-- </goals> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <fork>true</fork> -->
|
||||
<!-- <outputDirectory>${project.build.outputDirectory}_jdk11</outputDirectory> -->
|
||||
<!-- <executable>${jdk.11.executable.path}</executable> -->
|
||||
<!-- <source>8</source> -->
|
||||
<!-- <target>11</target> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- </execution> -->
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -76,18 +69,19 @@
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<!-- For example purpose not building as it requires both JDK 8 and 11 executables on the build machine -->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>default-package-jdk11</id>-->
|
||||
<!-- <phase>package</phase>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>jar</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <classesDirectory>${project.build.outputDirectory}_jdk11</classesDirectory>-->
|
||||
<!-- <classifier>jdk11</classifier>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </execution>-->
|
||||
<!-- For example purpose not building as it requires both JDK 8 and 11 executables
|
||||
on the build machine -->
|
||||
<!-- <execution> -->
|
||||
<!-- <id>default-package-jdk11</id> -->
|
||||
<!-- <phase>package</phase> -->
|
||||
<!-- <goals> -->
|
||||
<!-- <goal>jar</goal> -->
|
||||
<!-- </goals> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <classesDirectory>${project.build.outputDirectory}_jdk11</classesDirectory> -->
|
||||
<!-- <classifier>jdk11</classifier> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- </execution> -->
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -119,4 +113,11 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<!-- <jdk.11.executable.path></jdk.11.executable.path> -->
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>maven-classifier</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
@ -24,4 +23,4 @@
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -6,8 +6,8 @@
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>maven-generate-war</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>war</packaging>
|
||||
<name>maven-generate-war</name>
|
||||
<packaging>war</packaging>
|
||||
<description>Spring boot project to demonstrate war file generation</description>
|
||||
|
||||
<parent>
|
||||
|
@ -13,4 +13,4 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -18,4 +18,5 @@
|
||||
<module>service</module>
|
||||
<module>webapp</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
||||
</project>
|
@ -13,4 +13,4 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -13,4 +13,4 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -92,4 +92,4 @@
|
||||
<metrics-aspectj.version>1.1.0</metrics-aspectj.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>netty</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
@ -11,20 +12,18 @@
|
||||
<artifactId>parent-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>${netty.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<dependency>
|
||||
<groupId>org.conscrypt</groupId>
|
||||
<artifactId>conscrypt-openjdk-uber</artifactId>
|
||||
<version>${conscrypt-openjdk-uber.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
@ -16,6 +16,25 @@
|
||||
<module>wire-tap</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel.springboot</groupId>
|
||||
<artifactId>camel-spring-boot-dependencies</artifactId>
|
||||
<version>${camel.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-bom</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel.springboot</groupId>
|
||||
@ -39,25 +58,6 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel.springboot</groupId>
|
||||
<artifactId>camel-spring-boot-dependencies</artifactId>
|
||||
<version>${camel.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-bom</artifactId>
|
||||
<version>${log4j2.version}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@ -70,7 +70,7 @@
|
||||
<properties>
|
||||
<camel.version>3.7.4</camel.version>
|
||||
<spring-boot.version>2.2.2.RELEASE</spring-boot.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -54,22 +54,22 @@
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>${h2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>${javax.xml.bind.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>${javax.xml.bind.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
@ -77,4 +77,4 @@
|
||||
<netty-transport-version>4.1.71.Final</netty-transport-version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
5
persistence-modules/java-mongodb-2/.gitignore
vendored
Normal file
5
persistence-modules/java-mongodb-2/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
target
|
||||
build
|
5
persistence-modules/java-mongodb-2/README.md
Normal file
5
persistence-modules/java-mongodb-2/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
## MongoDB
|
||||
|
||||
This module contains articles about MongoDB in Java.
|
||||
|
||||
|
53
persistence-modules/java-mongodb-2/pom.xml
Normal file
53
persistence-modules/java-mongodb-2/pom.xml
Normal file
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>java-mongodb-2</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-mongodb-2</name>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>persistence-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>de.flapdoodle.embedmongo</groupId>
|
||||
<artifactId>de.flapdoodle.embedmongo</artifactId>
|
||||
<version>${flapdoodle.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mongodb</groupId>
|
||||
<artifactId>mongo-java-driver</artifactId>
|
||||
<version>${mongo.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.morphia.morphia</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>${morphia.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>mongodb</artifactId>
|
||||
<version>1.16.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>1.16.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<mongo.version>3.12.1</mongo.version>
|
||||
<flapdoodle.version>1.11</flapdoodle.version>
|
||||
<morphia.version>1.5.3</morphia.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -0,0 +1,54 @@
|
||||
package com.baeldung.mongo.update;
|
||||
|
||||
import org.bson.Document;
|
||||
|
||||
import com.mongodb.MongoClient;
|
||||
import com.mongodb.client.MongoCollection;
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import com.mongodb.client.model.Filters;
|
||||
import com.mongodb.client.model.Updates;
|
||||
import com.mongodb.client.result.UpdateResult;
|
||||
|
||||
public class PustSetOperation {
|
||||
|
||||
private static MongoClient mongoClient;
|
||||
|
||||
private static String testCollectionName;
|
||||
private static String databaseName;
|
||||
|
||||
public static void setUp() {
|
||||
if (mongoClient == null) {
|
||||
mongoClient = new MongoClient("localhost", 27017);
|
||||
}
|
||||
databaseName = "baeldung";
|
||||
testCollectionName = "marks";
|
||||
}
|
||||
|
||||
public static void pushSetSolution() {
|
||||
|
||||
MongoDatabase database = mongoClient.getDatabase(databaseName);
|
||||
MongoCollection<Document> collection = database.getCollection(testCollectionName);
|
||||
|
||||
Document subjectData = new Document().append("subjectId", 126)
|
||||
.append("subjectName", "Java Programming")
|
||||
.append("marks", 70);
|
||||
UpdateResult updateQueryResult = collection.updateOne(Filters.eq("studentId", 1023), Updates.combine(Updates.set("totalMarks", 170), Updates.push("subjectDetails", subjectData)));
|
||||
System.out.println("updateQueryResult:- " + updateQueryResult);
|
||||
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
//
|
||||
// Connect to cluster (default is localhost:27017)
|
||||
//
|
||||
setUp();
|
||||
|
||||
//
|
||||
// Push document into the array and set a field
|
||||
//
|
||||
pushSetSolution();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
@ -0,0 +1,53 @@
|
||||
package com.baeldung.update;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
import org.bson.Document;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mongodb.MongoClient;
|
||||
import com.mongodb.client.MongoCollection;
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import com.mongodb.client.model.Filters;
|
||||
import com.mongodb.client.model.Updates;
|
||||
import com.mongodb.client.result.UpdateResult;
|
||||
|
||||
public class PustSetOperationLiveTest {
|
||||
|
||||
private static MongoClient mongoClient;
|
||||
private static MongoDatabase db;
|
||||
private static MongoCollection<Document> collection;
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() {
|
||||
if (mongoClient == null) {
|
||||
mongoClient = new MongoClient("localhost", 27017);
|
||||
db = mongoClient.getDatabase("baeldung");
|
||||
collection = db.getCollection("marks");
|
||||
|
||||
collection.insertOne(Document.parse("{\n" + " \"studentId\": 1023,\n" + " \"studentName\":\"James Broad\",\n" + " \"joiningYear\":\"2018\",\n" + " \"totalMarks\":100,\n" + " \"subjectDetails\":[\n"
|
||||
+ " {\n" + " \"subjectId\":123,\n" + " \"subjectName\":\"Operating Systems Concepts\",\n" + " \"marks\":4,\n" + " },\n" + " {\n"
|
||||
+ " \"subjectId\":124,\n" + " \"subjectName\":\"Numerical Analysis\",\n" + " \"marks\":60\n" + " }\n" + " ]\n" + " }"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenMarksCollection_whenPushSetOperation_thenCheckingForDocument() {
|
||||
|
||||
Document subjectData = new Document().append("subjectId", 126)
|
||||
.append("subjectName", "Java Programming")
|
||||
.append("marks", 70);
|
||||
UpdateResult updateQueryResult = collection.updateOne(Filters.eq("studentId", 1023), Updates.combine(Updates.set("totalMarks", 170), Updates.push("subjectDetails", subjectData)));
|
||||
|
||||
Document studentDetail = collection.find(Filters.eq("studentId", 1023))
|
||||
.first();
|
||||
assertNotNull(studentDetail);
|
||||
assertFalse(studentDetail.isEmpty());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,6 +30,18 @@
|
||||
<artifactId>core</artifactId>
|
||||
<version>${morphia.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>mongodb</artifactId>
|
||||
<version>1.16.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>1.16.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
@ -0,0 +1,108 @@
|
||||
package com.baeldung.ordering.caseinsensitive;
|
||||
|
||||
import com.mongodb.MongoClient;
|
||||
import com.mongodb.client.*;
|
||||
import com.mongodb.client.model.Collation;
|
||||
import com.mongodb.client.model.Projections;
|
||||
import com.mongodb.client.model.Sorts;
|
||||
import org.bson.Document;
|
||||
import org.bson.conversions.Bson;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.MongoDBContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mongodb.client.model.Aggregates.project;
|
||||
import static com.mongodb.client.model.Aggregates.sort;
|
||||
import static com.mongodb.client.model.Sorts.ascending;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@Testcontainers
|
||||
class CaseInsensitiveOrderingLiveTest {
|
||||
|
||||
private static MongoCollection<Document> userCollections;
|
||||
|
||||
@Container
|
||||
private static final MongoDBContainer mongoDBContainer = new MongoDBContainer(DockerImageName.parse("mongo:4.0.10"));
|
||||
|
||||
@BeforeAll
|
||||
private static void setup() {
|
||||
|
||||
MongoClient mongoClient = new MongoClient(mongoDBContainer.getContainerIpAddress(), mongoDBContainer.getMappedPort(27017));
|
||||
MongoDatabase database = mongoClient.getDatabase("test");
|
||||
userCollections = database.getCollection("users");
|
||||
|
||||
List<Document> list = new ArrayList<>();
|
||||
list.add(Document.parse("{'name': 'ben', surname: 'ThisField' }"));
|
||||
list.add(Document.parse("{'name': 'aen', surname: 'Does' }"));
|
||||
list.add(Document.parse("{'name': 'Ben', surname: 'Not' }"));
|
||||
list.add(Document.parse("{'name': 'cen', surname: 'Matter' }"));
|
||||
list.add(Document.parse("{'name': 'Aen', surname: 'Really' }"));
|
||||
list.add(Document.parse("{'name': 'Cen', surname: 'TrustMe' }"));
|
||||
|
||||
userCollections.insertMany(list);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenMongoCollection_whenUsingFindWithSort_caseIsConsideredByDefault() {
|
||||
FindIterable<Document> nameDoc = userCollections.find().sort(ascending("name"));
|
||||
MongoCursor<Document> cursor = nameDoc.cursor();
|
||||
|
||||
List<String> expectedNamesOrdering = Arrays.asList("Aen", "Ben", "Cen", "aen", "ben", "cen");
|
||||
List<String> actualNamesOrdering = new ArrayList<>();
|
||||
while (cursor.hasNext()) {
|
||||
Document document = cursor.next();
|
||||
actualNamesOrdering.add(document.get("name").toString());
|
||||
}
|
||||
|
||||
assertEquals(expectedNamesOrdering, actualNamesOrdering);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenMongoCollection_whenUsingFindWithSortAndCollation_caseIsNotConsidered() {
|
||||
FindIterable<Document> nameDoc = userCollections.find().sort(ascending("name"))
|
||||
.collation(Collation.builder().locale("en").build());
|
||||
MongoCursor<Document> cursor = nameDoc.cursor();
|
||||
List<String> expectedNamesOrdering = Arrays.asList("aen", "Aen", "ben", "Ben", "cen", "Cen");
|
||||
List<String> actualNamesOrdering = new ArrayList<>();
|
||||
while (cursor.hasNext()) {
|
||||
Document document = cursor.next();
|
||||
actualNamesOrdering.add(document.get("name").toString());
|
||||
}
|
||||
|
||||
assertEquals(expectedNamesOrdering, actualNamesOrdering);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenMongoCollection_whenUsingFindWithSortAndAggregate_caseIsNotConsidered() {
|
||||
|
||||
Bson projectBson = project(
|
||||
Projections.fields(
|
||||
Projections.include("name", "surname"),
|
||||
Projections.computed("lowerName", Projections.computed("$toLower", "$name"))));
|
||||
|
||||
AggregateIterable<Document> nameDoc = userCollections.aggregate(
|
||||
Arrays.asList(projectBson,
|
||||
sort(Sorts.ascending("lowerName"))));
|
||||
|
||||
MongoCursor<Document> cursor = nameDoc.cursor();
|
||||
|
||||
List<String> expectedNamesOrdering = Arrays.asList("aen", "Aen", "ben", "Ben", "cen", "Cen");
|
||||
List<String> actualNamesOrdering = new ArrayList<>();
|
||||
while (cursor.hasNext()) {
|
||||
Document document = cursor.next();
|
||||
actualNamesOrdering.add(document.get("name").toString());
|
||||
}
|
||||
|
||||
assertEquals(expectedNamesOrdering, actualNamesOrdering);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -43,6 +43,7 @@
|
||||
<module>java-jpa-2</module> <!-- long running -->
|
||||
<module>java-jpa-3</module>
|
||||
<module>java-mongodb</module> <!-- long running -->
|
||||
<module>java-mongodb-2</module> <!-- long running -->
|
||||
<module>jnosql</module> <!-- long running -->
|
||||
<module>jooq</module>
|
||||
<module>jpa-hibernate-cascade-type</module>
|
||||
@ -104,4 +105,4 @@
|
||||
<postgresql.version>42.2.20</postgresql.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
@ -36,4 +36,4 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -19,6 +19,7 @@ public class TodoDatasourceConfiguration {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties("spring.datasource.todos.hikari")
|
||||
public DataSource todosDataSource() {
|
||||
return todosDataSourceProperties()
|
||||
.initializeDataSourceBuilder()
|
||||
|
@ -3,6 +3,7 @@ spring.datasource.todos.url=jdbc:h2:mem:todos
|
||||
spring.datasource.todos.username=sa
|
||||
spring.datasource.todos.password=null
|
||||
spring.datasource.todos.driverClassName=org.h2.Driver
|
||||
spring.datasource.todos.hikari.connectionTimeout=44444
|
||||
spring.datasource.topics.url=jdbc:h2:mem:topics
|
||||
spring.datasource.topics.username=sa
|
||||
spring.datasource.topics.password=null
|
||||
|
@ -29,4 +29,4 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -107,22 +107,22 @@
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>${h2.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>${javax.xml.bind.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>${javax.xml.bind.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>${com.sun.xml.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
1
pom.xml
1
pom.xml
@ -1206,6 +1206,7 @@
|
||||
<module>wicket</module>
|
||||
<module>wildfly</module>
|
||||
<module>xml</module>
|
||||
<module>xml-2</module>
|
||||
<module>xstream</module>
|
||||
</modules>
|
||||
|
||||
|
@ -23,4 +23,4 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -13,7 +13,7 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -41,4 +41,5 @@
|
||||
<properties>
|
||||
<reactor-spring.version>1.0.1.RELEASE</reactor-spring.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -16,7 +16,7 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../parent-boot-1</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
1
spring-boot-modules/spring-boot-camel/.gitignore
vendored
Normal file
1
spring-boot-modules/spring-boot-camel/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/output/
|
@ -44,6 +44,12 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-test-spring-junit5</artifactId>
|
||||
<version>${camel.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@ -57,6 +63,9 @@
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<mainClass>com.baeldung.camel.boot.testing.GreetingsFileSpringApplication</mainClass>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.baeldung.camel.boot.testing;
|
||||
|
||||
import org.apache.camel.builder.RouteBuilder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class GreetingsFileRouter extends RouteBuilder {
|
||||
|
||||
@Override
|
||||
public void configure() throws Exception {
|
||||
|
||||
from("direct:start")
|
||||
.routeId("greetings-route")
|
||||
.setBody(constant("Hello Baeldung Readers!"))
|
||||
.to("file:output");
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.baeldung.camel.boot.testing;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class GreetingsFileSpringApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GreetingsFileSpringApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.baeldung.camel.boot.testing;
|
||||
|
||||
import org.apache.camel.EndpointInject;
|
||||
import org.apache.camel.ProducerTemplate;
|
||||
import org.apache.camel.component.mock.MockEndpoint;
|
||||
import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
|
||||
import org.apache.camel.test.spring.junit5.MockEndpoints;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
@CamelSpringBootTest
|
||||
@MockEndpoints("file:output")
|
||||
class GreetingsFileRouterUnitTest {
|
||||
|
||||
@Autowired
|
||||
private ProducerTemplate template;
|
||||
|
||||
@EndpointInject("mock:file:output")
|
||||
private MockEndpoint mock;
|
||||
|
||||
@Test
|
||||
void whenSendBody_thenGreetingReceivedSuccessfully() throws InterruptedException {
|
||||
mock.expectedBodiesReceived("Hello Baeldung Readers!");
|
||||
|
||||
template.sendBody("direct:start", null);
|
||||
|
||||
mock.assertIsSatisfied();
|
||||
}
|
||||
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>spring-boot-multiple-datasources</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
@ -55,4 +55,4 @@
|
||||
<spring-boot.version>2.6.3</spring-boot.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -0,0 +1,13 @@
|
||||
package com.baeldung.swaggerresponseapi;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class SwaggerResponseApiApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SwaggerResponseApiApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.baeldung.swaggerresponseapi.controller;
|
||||
|
||||
import com.baeldung.swaggerresponseapi.model.Product;
|
||||
import com.baeldung.swaggerresponseapi.service.ProductService;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class ProductController {
|
||||
private final ProductService productService;
|
||||
|
||||
public ProductController(ProductService productService) {
|
||||
this.productService = productService;
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
public Product addProduct(@RequestBody Product product) {
|
||||
return productService.addProducts(product);
|
||||
}
|
||||
|
||||
@ApiResponses(value = { @ApiResponse(content = { @Content(mediaType = "application/json",
|
||||
array = @ArraySchema(schema = @Schema(implementation = Product.class))) }) })
|
||||
@GetMapping("/products")
|
||||
public List<Product> getProductsList() {
|
||||
return productService.getProductsList();
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.baeldung.swaggerresponseapi.model;
|
||||
|
||||
public class Product {
|
||||
String code;
|
||||
String name;
|
||||
|
||||
public Product(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.baeldung.swaggerresponseapi.service;
|
||||
|
||||
import com.baeldung.swaggerresponseapi.model.Product;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ProductService {
|
||||
List<Product> productsList = new ArrayList<>();
|
||||
|
||||
public Product addProducts(Product product) {
|
||||
productsList.add(product);
|
||||
return product;
|
||||
}
|
||||
|
||||
public List<Product> getProductsList() {
|
||||
return productsList;
|
||||
}
|
||||
}
|
@ -72,4 +72,4 @@
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -84,4 +84,4 @@
|
||||
<swagger-maven-plugin.version>3.1.1</swagger-maven-plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -45,7 +45,7 @@
|
||||
<properties>
|
||||
<cloud.zookeeper.version>2.0.0.RELEASE</cloud.zookeeper.version>
|
||||
<zookeeper.version>3.4.13</zookeeper.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -14,7 +14,12 @@
|
||||
<artifactId>spring-cloud</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<modules>
|
||||
<module>spring-cloud-eureka-server</module>
|
||||
<module>spring-cloud-eureka-client</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -27,11 +32,6 @@
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<modules>
|
||||
<module>spring-cloud-eureka-server</module>
|
||||
<module>spring-cloud-eureka-client</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -14,7 +14,14 @@
|
||||
<artifactId>spring-cloud</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<modules>
|
||||
<module>spring-cloud-eureka-server</module>
|
||||
<module>spring-cloud-eureka-client</module>
|
||||
<module>spring-cloud-eureka-feign-client</module>
|
||||
<module>spring-cloud-eureka-feign-client-integration-test</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -27,13 +34,6 @@
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<modules>
|
||||
<module>spring-cloud-eureka-server</module>
|
||||
<module>spring-cloud-eureka-client</module>
|
||||
<module>spring-cloud-eureka-feign-client</module>
|
||||
<module>spring-cloud-eureka-feign-client-integration-test</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<packaging>jar</packaging>
|
||||
<description>Demo project for Spring Cloud Function</description>
|
||||
|
||||
<parent>
|
||||
<parent>
|
||||
<groupId>com.baeldung.spring.cloud</groupId>
|
||||
<artifactId>spring-cloud</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
|
@ -83,31 +83,28 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring security -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-oauth2-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
@ -123,15 +120,6 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<!-- <spring-cloud-dependencies.version>Hoxton.SR3</spring-cloud-dependencies.version> -->
|
||||
<!-- <spring-boot.version>2.2.6.RELEASE</spring-boot.version> -->
|
||||
<hibernate-validator.version>6.0.2.Final</hibernate-validator.version>
|
||||
<redis.version>0.7.2</redis.version>
|
||||
<oauth2-oidc-sdk.version>9.19</oauth2-oidc-sdk.version>
|
||||
<!-- <junit-bom.version>5.5.2</junit-bom.version> -->
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>quotes-application</id>
|
||||
@ -177,7 +165,6 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>gateway-url-rewrite</id>
|
||||
<build>
|
||||
@ -192,6 +179,16 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
<!-- <spring-cloud-dependencies.version>Hoxton.SR3</spring-cloud-dependencies.version> -->
|
||||
<!-- <spring-boot.version>2.2.6.RELEASE</spring-boot.version> -->
|
||||
<hibernate-validator.version>6.0.2.Final</hibernate-validator.version>
|
||||
<redis.version>0.7.2</redis.version>
|
||||
<oauth2-oidc-sdk.version>9.19</oauth2-oidc-sdk.version>
|
||||
<!-- <junit-bom.version>5.5.2</junit-bom.version> -->
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -15,6 +15,15 @@
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
<module>kubernetes-minikube/demo-frontend</module>
|
||||
<module>kubernetes-minikube/demo-backend</module>
|
||||
<module>kubernetes-selfhealing/liveness-example</module>
|
||||
<module>kubernetes-selfhealing/readiness-example</module>
|
||||
<module>kubernetes-guide/client-service</module>
|
||||
<module>kubernetes-guide/travel-agency-service</module>
|
||||
</modules>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -27,15 +36,6 @@
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<modules>
|
||||
<module>kubernetes-minikube/demo-frontend</module>
|
||||
<module>kubernetes-minikube/demo-backend</module>
|
||||
<module>kubernetes-selfhealing/liveness-example</module>
|
||||
<module>kubernetes-selfhealing/readiness-example</module>
|
||||
<module>kubernetes-guide/client-service</module>
|
||||
<module>kubernetes-guide/travel-agency-service</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-dependencies.version>2021.0.0</spring-cloud-dependencies.version>
|
||||
</properties>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<module>spring-cloud-loadbalancer-server</module>
|
||||
<module>spring-cloud-loadbalancer-client</module>
|
||||
</modules>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -44,7 +44,7 @@
|
||||
<properties>
|
||||
<spring-boot.version>2.6.1</spring-boot.version>
|
||||
<spring-cloud.version>2021.0.0</spring-cloud.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -3,17 +3,30 @@
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.baeldung.springcloud.loadbalancer</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer-client</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>spring-cloud-loadbalancer-client</name>
|
||||
<description>Spring Cloud Load Balancer Demo - Client</description>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.spring.cloud</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.baeldung.springcloud.loadbalancer</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer-client</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>spring-cloud-loadbalancer-client</name>
|
||||
<description>Spring Cloud Load Balancer Demo - Client</description>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@ -30,17 +43,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
@ -51,4 +53,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -3,24 +3,23 @@
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.baeldung.spring.cloud</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.baeldung.spring.cloud.loadbalancer</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer-server</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>spring-cloud-loadbalancer-server</name>
|
||||
<description>Spring Cloud Load Balancer Demo - Server</description>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung.spring.cloud</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
@ -37,4 +36,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -52,7 +52,7 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<properties>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
@ -52,7 +52,7 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<properties>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
@ -60,8 +60,8 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
|
||||
<properties>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
<artifactId>spring-cloud-zuul</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -38,7 +38,6 @@
|
||||
<artifactId>tomee-embedded</artifactId>
|
||||
<version>${tomee-embedded.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
|
@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>spring-reactive</artifactId>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
@ -11,8 +12,6 @@
|
||||
<relativePath>../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-reactive</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -15,8 +15,8 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
@ -27,7 +27,6 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
@ -85,7 +84,7 @@
|
||||
is available -->
|
||||
<spring-boot.version>2.5.2</spring-boot.version>
|
||||
<start-class>com.baeldung.oauth2.SpringOAuthApplication</start-class>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -14,8 +14,8 @@
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-boot-2</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencyManagement>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
@ -62,7 +62,7 @@
|
||||
<spring-security-jwt.version>1.0.9.RELEASE</spring-security-jwt.version>
|
||||
<jwks-rsa.version>0.3.0</jwks-rsa.version>
|
||||
<spring-boot.version>2.4.7</spring-boot.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
<log4j2.version>2.17.1</log4j2.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -179,7 +179,6 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>entryPoints</id>
|
||||
<build>
|
||||
|
@ -50,4 +50,4 @@
|
||||
<module>spring-web-url</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
</project>
|
@ -41,7 +41,7 @@
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>spring-mvc-basics</finalName>
|
||||
<finalName>spring-mvc-basics-5</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -12,7 +12,6 @@
|
||||
<artifactId>parent-boot-2</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<relativePath>../../parent-boot-2</relativePath>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
1
xml-2/.gitignore
vendored
Normal file
1
xml-2/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
xml/.idea
|
5
xml-2/README.md
Normal file
5
xml-2/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
## XML
|
||||
|
||||
This module contains articles about eXtensible Markup Language (XML)
|
||||
|
||||
### Relevant Articles:
|
50
xml-2/pom.xml
Normal file
50
xml-2/pom.xml
Normal file
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>xml-2</artifactId>
|
||||
<version>0.1-SNAPSHOT</version>
|
||||
<name>xml-2</name>
|
||||
|
||||
<parent>
|
||||
<groupId>com.baeldung</groupId>
|
||||
<artifactId>parent-modules</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!-- xml libraries -->
|
||||
<dependency>
|
||||
<groupId>org.dom4j</groupId>
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>${dom4j.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>xml-2</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
<properties>
|
||||
<dom4j.version>2.1.3</dom4j.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
@ -0,0 +1,91 @@
|
||||
package com.baeldung.xml.prettyprint;
|
||||
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.io.OutputFormat;
|
||||
import org.dom4j.io.XMLWriter;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.OutputKeys;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import java.io.*;
|
||||
|
||||
public class XmlPrettyPrinter {
|
||||
|
||||
public static String prettyPrintByTransformer(String xmlString, int indent, boolean ignoreDeclaration) {
|
||||
|
||||
try {
|
||||
final InputSource src = new InputSource(new StringReader(xmlString));
|
||||
final Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(src);
|
||||
|
||||
TransformerFactory transformerFactory = TransformerFactory.newInstance();
|
||||
transformerFactory.setAttribute("indent-number", indent);
|
||||
Transformer transformer = transformerFactory.newTransformer(new StreamSource(new StringReader(readPrettyPrintXslt())));
|
||||
// Using the default transformer will create empty lines in Java9+
|
||||
// Transformer transformer = transformerFactory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
|
||||
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, ignoreDeclaration ? "yes" : "no");
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
// Alternatively, we can set indent-size on the transformer object
|
||||
// transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent));
|
||||
Writer out = new StringWriter();
|
||||
transformer.transform(new DOMSource(document), new StreamResult(out));
|
||||
return out.toString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error occurs when pretty-printing xml:\n" + xmlString, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String prettyPrintByDom4j(String xmlString, int indent, boolean skipDeclaration) {
|
||||
try {
|
||||
final OutputFormat format = OutputFormat.createPrettyPrint();
|
||||
format.setEncoding("UTF-8");
|
||||
format.setIndentSize(indent);
|
||||
format.setSuppressDeclaration(skipDeclaration);
|
||||
|
||||
final org.dom4j.Document document = DocumentHelper.parseText(xmlString);
|
||||
final StringWriter sw = new StringWriter();
|
||||
final XMLWriter writer = new XMLWriter(sw, format);
|
||||
writer.write(document);
|
||||
return sw.toString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Error occurs when pretty-printing xml:\n" + xmlString, e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
InputStream inputStream = XmlPrettyPrinter.class.getResourceAsStream("/xml/emails.xml");
|
||||
String xmlString = readFromInputStream(inputStream);
|
||||
System.out.println("Pretty printing by Transformer");
|
||||
System.out.println("=============================================");
|
||||
System.out.println(prettyPrintByTransformer(xmlString, 2, true));
|
||||
System.out.println("=============================================");
|
||||
System.out.println("Pretty printing by Dom4j");
|
||||
System.out.println("=============================================");
|
||||
System.out.println(prettyPrintByDom4j(xmlString, 8, false));
|
||||
System.out.println("=============================================");
|
||||
}
|
||||
|
||||
|
||||
private static String readPrettyPrintXslt() throws IOException {
|
||||
InputStream inputStream = XmlPrettyPrinter.class.getResourceAsStream("/xml/prettyprint.xsl");
|
||||
return readFromInputStream(inputStream);
|
||||
}
|
||||
|
||||
private static String readFromInputStream(InputStream inputStream) throws IOException {
|
||||
StringBuilder resultStringBuilder = new StringBuilder();
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
resultStringBuilder.append(line).append("\n");
|
||||
}
|
||||
}
|
||||
return resultStringBuilder.toString();
|
||||
}
|
||||
}
|
13
xml-2/src/main/resources/logback.xml
Normal file
13
xml-2/src/main/resources/logback.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
4
xml-2/src/main/resources/xml/emails.xml
Normal file
4
xml-2/src/main/resources/xml/emails.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<emails> <email> <from>Kai</from> <to>Amanda</to> <time>2018-03-05</time>
|
||||
<subject>I am flying to you</subject></email> <email>
|
||||
<from>Jerry</from> <to>Tom</to> <time>1992-08-08</time> <subject>Hey Tom, catch me if you can!</subject>
|
||||
</email> </emails>
|
11
xml-2/src/main/resources/xml/prettyprint.xsl
Normal file
11
xml-2/src/main/resources/xml/prettyprint.xsl
Normal file
@ -0,0 +1,11 @@
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:strip-space elements="*"/>
|
||||
<xsl:output method="xml" encoding="UTF-8"/>
|
||||
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
Loading…
x
Reference in New Issue
Block a user