Merge pull request #18 from eugenp/master

update
This commit is contained in:
Maiklins 2020-01-19 15:48:26 +01:00 committed by GitHub
commit 2de345b900
79 changed files with 754 additions and 167 deletions

View File

@ -64,7 +64,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId> <artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version> <version>${cobertura.plugin.version}</version>
<configuration> <configuration>
<instrumentation> <instrumentation>
<ignores> <ignores>
@ -85,6 +85,7 @@
<commons-codec.version>1.11</commons-codec.version> <commons-codec.version>1.11</commons-codec.version>
<guava.version>27.0.1-jre</guava.version> <guava.version>27.0.1-jre</guava.version>
<combinatoricslib3.version>3.3.0</combinatoricslib3.version> <combinatoricslib3.version>3.3.0</combinatoricslib3.version>
<cobertura.plugin.version>2.7</cobertura.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -46,13 +46,13 @@
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.8.1</version> <version>${commons.lang3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>pl.pragmatists</groupId> <groupId>pl.pragmatists</groupId>
<artifactId>JUnitParams</artifactId> <artifactId>JUnitParams</artifactId>
<version>1.1.0</version> <version>${JUnitParams.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -91,6 +91,8 @@
<retrofit.version>2.6.0</retrofit.version> <retrofit.version>2.6.0</retrofit.version>
<jmh-core.version>1.19</jmh-core.version> <jmh-core.version>1.19</jmh-core.version>
<jmh-generator.version>1.19</jmh-generator.version> <jmh-generator.version>1.19</jmh-generator.version>
<commons.lang3.version>3.8.1</commons.lang3.version>
<JUnitParams.version>1.1.0</JUnitParams.version>
</properties> </properties>
</project> </project>

View File

@ -37,7 +37,7 @@
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>28.1-jre</version> <version>${guava.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -65,6 +65,7 @@
<org.assertj.core.version>3.9.0</org.assertj.core.version> <org.assertj.core.version>3.9.0</org.assertj.core.version>
<commons-codec.version>1.11</commons-codec.version> <commons-codec.version>1.11</commons-codec.version>
<commons-math3.version>3.6.1</commons-math3.version> <commons-math3.version>3.6.1</commons-math3.version>
<guava.version>28.1-jre</guava.version>
</properties> </properties>
</project> </project>

View File

@ -18,19 +18,19 @@
<dependency> <dependency>
<groupId>javax.ws.rs</groupId> <groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId> <artifactId>javax.ws.rs-api</artifactId>
<version>2.1</version> <version>${rs-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.enterprise</groupId> <groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId> <artifactId>cdi-api</artifactId>
<version>2.0</version> <version>${cdi-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.json.bind</groupId> <groupId>javax.json.bind</groupId>
<artifactId>javax.json.bind-api</artifactId> <artifactId>javax.json.bind-api</artifactId>
<version>1.0</version> <version>${bind-api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@ -80,6 +80,9 @@
<liberty-maven-plugin.version>2.4.2</liberty-maven-plugin.version> <liberty-maven-plugin.version>2.4.2</liberty-maven-plugin.version>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<openliberty-version>18.0.0.2</openliberty-version> <openliberty-version>18.0.0.2</openliberty-version>
<rs-api.version>2.1</rs-api.version>
<cdi-api.version>2.0</cdi-api.version>
<bind-api.version>1.0</bind-api.version>
</properties> </properties>
</project> </project>

View File

@ -17,11 +17,12 @@
<dependency> <dependency>
<groupId>org.apache.rocketmq</groupId> <groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId> <artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.0.4</version> <version>${rocketmq.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<properties> <properties>
<geode.core>1.6.0</geode.core> <geode.core>1.6.0</geode.core>
<rocketmq.version>2.0.4</rocketmq.version>
</properties> </properties>
</project> </project>

View File

@ -81,10 +81,10 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
<optimize>true</optimize> <optimize>true</optimize>
</configuration> </configuration>
</plugin> </plugin>
@ -92,7 +92,7 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version> <version>${compiler.surefire.version}</version>
<configuration> <configuration>
<systemPropertyVariables> <systemPropertyVariables>
<tapestry.execution-mode>Qa</tapestry.execution-mode> <tapestry.execution-mode>Qa</tapestry.execution-mode>
@ -104,7 +104,7 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
<plugin> <plugin>
<groupId>org.mortbay.jetty</groupId> <groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId> <artifactId>maven-jetty-plugin</artifactId>
<version>6.1.16</version> <version>${compiler.jetty.version}</version>
<configuration> <configuration>
<!-- Log to the console. --> <!-- Log to the console. -->
<requestLog implementation="org.mortbay.jetty.NCSARequestLog"> <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
@ -140,6 +140,11 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's
</repositories> </repositories>
<properties> <properties>
<compiler.jetty.version>6.1.16</compiler.jetty.version>
<compiler.surefire.version>2.7.2</compiler.surefire.version>
<compiler.plugin.version>2.3.2</compiler.plugin.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
<tapestry-release-version>5.4.5</tapestry-release-version> <tapestry-release-version>5.4.5</tapestry-release-version>
<servlet-api-release-version>2.5</servlet-api-release-version> <servlet-api-release-version>2.5</servlet-api-release-version>
<testng-release-version>6.8.21</testng-release-version> <testng-release-version>6.8.21</testng-release-version>

View File

@ -17,6 +17,8 @@
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring.version>2.2.1.RELEASE</spring.version>
<awssdk.version>2.10.27</awssdk.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -26,7 +28,7 @@
<!-- Import dependency management from Spring Boot --> <!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId> <artifactId>spring-boot-dependencies</artifactId>
<version>2.2.1.RELEASE</version> <version>${spring.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
@ -34,7 +36,7 @@
<dependency> <dependency>
<groupId>software.amazon.awssdk</groupId> <groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId> <artifactId>bom</artifactId>
<version>2.10.27</version> <version>${awssdk.version}</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>

View File

@ -124,7 +124,7 @@
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version> <version>${assembly.plugin.version}</version>
<configuration> <configuration>
<finalName>${project.build.finalName}</finalName> <finalName>${project.build.finalName}</finalName>
<appendAssemblyId>false</appendAssemblyId> <appendAssemblyId>false</appendAssemblyId>
@ -161,6 +161,7 @@
<assertj-core.version>3.11.1</assertj-core.version> <assertj-core.version>3.11.1</assertj-core.version>
<maven-failsafe-plugin.version>3.0.0-M3</maven-failsafe-plugin.version> <maven-failsafe-plugin.version>3.0.0-M3</maven-failsafe-plugin.version>
<process-exec-maven-plugin.version>0.7</process-exec-maven-plugin.version> <process-exec-maven-plugin.version>0.7</process-exec-maven-plugin.version>
<assembly.plugin.version>3.1.0</assembly.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -62,12 +62,12 @@
<plugin> <plugin>
<groupId>org.codehaus.groovy</groupId> <groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId> <artifactId>groovy-eclipse-compiler</artifactId>
<version>3.3.0-01</version> <version>${groovy.compiler.version}</version>
<extensions>true</extensions> <extensions>true</extensions>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<compilerId>groovy-eclipse-compiler</compilerId> <compilerId>groovy-eclipse-compiler</compilerId>
<source>${java.version}</source> <source>${java.version}</source>
@ -113,7 +113,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version> <version>${surefire.plugin.version}</version>
<configuration> <configuration>
<useFile>false</useFile> <useFile>false</useFile>
<includes> <includes>
@ -126,7 +126,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version> <version>${assembly.plugin.version}</version>
<configuration> <configuration>
<!-- get all project dependencies --> <!-- get all project dependencies -->
<descriptorRefs> <descriptorRefs>
@ -183,6 +183,10 @@
<groovy-wslite.version>1.1.3</groovy-wslite.version> <groovy-wslite.version>1.1.3</groovy-wslite.version>
<logback.version>1.2.3</logback.version> <logback.version>1.2.3</logback.version>
<groovy.version>2.5.7</groovy.version> <groovy.version>2.5.7</groovy.version>
<assembly.plugin.version>3.1.0</assembly.plugin.version>
<surefire.plugin.version>2.20.1</surefire.plugin.version>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<groovy.compiler.version>3.3.0-01</groovy.compiler.version>
</properties> </properties>
</project> </project>

View File

@ -99,7 +99,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version> <version>${surefire.plugin.version}</version>
<configuration> <configuration>
<useFile>false</useFile> <useFile>false</useFile>
<includes> <includes>
@ -126,6 +126,7 @@
<hsqldb.version>2.4.0</hsqldb.version> <hsqldb.version>2.4.0</hsqldb.version>
<spock-core.version>1.1-groovy-2.4</spock-core.version> <spock-core.version>1.1-groovy-2.4</spock-core.version>
<gmavenplus-plugin.version>1.6</gmavenplus-plugin.version> <gmavenplus-plugin.version>1.6</gmavenplus-plugin.version>
<surefire.plugin.version>2.20.1</surefire.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -42,12 +42,12 @@
<dependency> <dependency>
<groupId>org.eclipse.collections</groupId> <groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections</artifactId> <artifactId>eclipse-collections</artifactId>
<version>10.0.0</version> <version>${eclipse.collections.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.eclipse.collections</groupId> <groupId>org.eclipse.collections</groupId>
<artifactId>eclipse-collections-api</artifactId> <artifactId>eclipse-collections-api</artifactId>
<version>10.0.0</version> <version>${eclipse.collections.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -108,6 +108,7 @@
<assertj.version>3.11.1</assertj.version> <assertj.version>3.11.1</assertj.version>
<uberjar.name>benchmarks</uberjar.name> <uberjar.name>benchmarks</uberjar.name>
<jmh.version>1.22</jmh.version> <jmh.version>1.22</jmh.version>
<eclipse.collections.version>10.0.0</eclipse.collections.version>
</properties> </properties>
</project> </project>

View File

@ -41,7 +41,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version> <version>${surefire.plugin.version}</version>
<configuration> <configuration>
<argLine>--enable-preview</argLine> <argLine>--enable-preview</argLine>
</configuration> </configuration>
@ -53,6 +53,7 @@
<maven.compiler.source.version>13</maven.compiler.source.version> <maven.compiler.source.version>13</maven.compiler.source.version>
<maven.compiler.target.version>13</maven.compiler.target.version> <maven.compiler.target.version>13</maven.compiler.target.version>
<assertj.version>3.6.1</assertj.version> <assertj.version>3.6.1</assertj.version>
<surefire.plugin.version>3.0.0-M3</surefire.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -0,0 +1,27 @@
package com.baeldung.newfeatures;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class SwitchExpressionsWithYieldUnitTest {
@Test
@SuppressWarnings("preview")
public void whenSwitchingOnOperationSquareMe_thenWillReturnSquare() {
var me = 4;
var operation = "squareMe";
var result = switch (operation) {
case "doubleMe" -> {
yield me * 2;
}
case "squareMe" -> {
yield me * me;
}
default -> me;
};
assertEquals(16, result);
}
}

View File

@ -0,0 +1,39 @@
package com.baeldung.newfeatures;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
public class TextBlocksUnitTest {
private static final String JSON_STRING = "{\r\n" + "\"name\" : \"Baeldung\",\r\n" + "\"website\" : \"https://www.%s.com/\"\r\n" + "}";
@SuppressWarnings("preview")
private static final String TEXT_BLOCK_JSON = """
{
"name" : "Baeldung",
"website" : "https://www.%s.com/"
}
""";
@Test
public void whenTextBlocks_thenStringOperationsWork() {
assertThat(TEXT_BLOCK_JSON.contains("Baeldung")).isTrue();
assertThat(TEXT_BLOCK_JSON.indexOf("www")).isGreaterThan(0);
assertThat(TEXT_BLOCK_JSON.length()).isGreaterThan(0);
}
@SuppressWarnings("removal")
@Test
public void whenTextBlocks_thenFormattedWorksAsFormat() {
assertThat(TEXT_BLOCK_JSON.formatted("baeldung")
.contains("www.baeldung.com")).isTrue();
assertThat(String.format(JSON_STRING, "baeldung")
.contains("www.baeldung.com")).isTrue();
}
}

View File

@ -36,7 +36,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version> <version>${surefire.plugin.version}</version>
<configuration> <configuration>
<argLine>--enable-preview</argLine> <argLine>--enable-preview</argLine>
</configuration> </configuration>
@ -47,6 +47,7 @@
<properties> <properties>
<maven.compiler.source.version>14</maven.compiler.source.version> <maven.compiler.source.version>14</maven.compiler.source.version>
<maven.compiler.target.version>14</maven.compiler.target.version> <maven.compiler.target.version>14</maven.compiler.target.version>
<surefire.plugin.version>3.0.0-M3</surefire.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -51,7 +51,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version> <version>${shade.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -79,6 +79,7 @@
<commons-lang3.version>3.9</commons-lang3.version> <commons-lang3.version>3.9</commons-lang3.version>
<!-- testing --> <!-- testing -->
<assertj-core.version>3.10.0</assertj-core.version> <assertj-core.version>3.10.0</assertj-core.version>
<shade.plugin.version>3.2.0</shade.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -183,8 +183,8 @@
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version> <version>${maven-javadoc-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -373,6 +373,8 @@
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version> <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version> <spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version> <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties> </properties>
</project> </project>

View File

@ -207,8 +207,8 @@
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version> <version>${maven-javadoc-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -397,6 +397,8 @@
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version> <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version> <spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version> <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties> </properties>
</project> </project>

View File

@ -19,34 +19,34 @@
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId> <artifactId>junit-jupiter</artifactId>
<version>5.5.1</version> <version>${jupiter.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId> <artifactId>spring-core</artifactId>
<version>5.0.9.RELEASE</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId> <artifactId>spring-context</artifactId>
<version>5.0.9.RELEASE</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId> <artifactId>spring-jdbc</artifactId>
<version>5.0.9.RELEASE</version> <version>${spring.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId> <artifactId>spring-test</artifactId>
<version>5.0.9.RELEASE</version> <version>${spring.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.4.199</version> <version>${h2.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -56,11 +56,19 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<spring.version>5.0.9.RELEASE</spring.version>
<h2.version>1.4.199</h2.version>
<jupiter.version>5.5.1</jupiter.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties>
</project> </project>

View File

@ -16,7 +16,7 @@
<dependency> <dependency>
<groupId>com.baeldung.servicemodule</groupId> <groupId>com.baeldung.servicemodule</groupId>
<artifactId>servicemodule</artifactId> <artifactId>servicemodule</artifactId>
<version>1.0</version> <version>${servicemodule.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -29,4 +29,8 @@
</plugins> </plugins>
</build> </build>
<properties>
<servicemodule.version>1.0</servicemodule.version>
</properties>
</project> </project>

View File

@ -19,10 +19,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>11</source> <source>${source.version}</source>
<target>11</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -31,6 +31,9 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<source.version>11</source.version>
<target.version>11</target.version>
</properties> </properties>
</project> </project>

View File

@ -17,12 +17,12 @@
<dependency> <dependency>
<groupId>com.baeldung.servicemodule</groupId> <groupId>com.baeldung.servicemodule</groupId>
<artifactId>servicemodule</artifactId> <artifactId>servicemodule</artifactId>
<version>1.0</version> <version>${servicemodule.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.baeldung.providermodule</groupId> <groupId>com.baeldung.providermodule</groupId>
<artifactId>providermodule</artifactId> <artifactId>providermodule</artifactId>
<version>1.0</version> <version>${providermodule.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -34,5 +34,10 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<servicemodule.version>1.0</servicemodule.version>
<providermodule.version>1.0</providermodule.version>
</properties>
</project> </project>

View File

@ -20,14 +20,20 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>11</source> <source>${source.version}</source>
<target>11</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
</build> </build>
<properties>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<source.version>11</source.version>
<target.version>11</target.version>
</properties>
</project> </project>

View File

@ -17,7 +17,7 @@
<dependency> <dependency>
<groupId>com.baeldung.servicemodule</groupId> <groupId>com.baeldung.servicemodule</groupId>
<artifactId>servicemodule</artifactId> <artifactId>servicemodule</artifactId>
<version>1.0</version> <version>${servicemodule.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -30,4 +30,9 @@
</plugins> </plugins>
</build> </build>
<properties>
<servicemodule.version>1.0</servicemodule.version>
</properties>
</project> </project>

View File

@ -18,7 +18,7 @@
<dependency> <dependency>
<groupId>commons-beanutils</groupId> <groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId> <artifactId>commons-beanutils</artifactId>
<version>1.9.4</version> <version>${commons.beanutils.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.openjdk.jmh</groupId> <groupId>org.openjdk.jmh</groupId>
@ -57,6 +57,7 @@
<jmh-core.version>1.19</jmh-core.version> <jmh-core.version>1.19</jmh-core.version>
<jmh-generator.version>1.19</jmh-generator.version> <jmh-generator.version>1.19</jmh-generator.version>
<assertj.version>3.12.2</assertj.version> <assertj.version>3.12.2</assertj.version>
<commons.beanutils.version>1.9.4</commons.beanutils.version>
</properties> </properties>
</project> </project>

View File

@ -37,8 +37,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
<compilerArgument>-parameters</compilerArgument> <compilerArgument>-parameters</compilerArgument>
</configuration> </configuration>
</plugin> </plugin>
@ -48,5 +48,7 @@
<properties> <properties>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
<assertj-core.version>3.10.0</assertj-core.version> <assertj-core.version>3.10.0</assertj-core.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties> </properties>
</project> </project>

View File

@ -25,7 +25,7 @@
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<version>28.1-jre</version> <version>${guava.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -62,7 +62,7 @@
<properties> <properties>
<commons-lang3.version>3.8.1</commons-lang3.version> <commons-lang3.version>3.8.1</commons-lang3.version>
<assertj.version>3.6.1</assertj.version> <assertj.version>3.6.1</assertj.version>
<guava.version>27.0.1-jre</guava.version> <guava.version>28.1-jre</guava.version>
<junit-jupiter-api.version>5.3.1</junit-jupiter-api.version> <junit-jupiter-api.version>5.3.1</junit-jupiter-api.version>
</properties> </properties>

View File

@ -0,0 +1,63 @@
package com.baeldung.regex.matcher;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.jupiter.api.Test;
public class MatcherUnitTest {
@Test
public void whenFindFourDigitWorks_thenCorrect() {
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
Matcher m = stringPattern.matcher("goodbye 2019 and welcome 2020");
assertTrue(m.find());
assertEquals(8, m.start());
assertEquals("2019", m.group());
assertEquals(12, m.end());
assertTrue(m.find());
assertEquals(25, m.start());
assertEquals("2020", m.group());
assertEquals(29, m.end());
assertFalse(m.find());
}
@Test
public void givenStartIndex_whenFindFourDigitWorks_thenCorrect() {
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
Matcher m = stringPattern.matcher("goodbye 2019 and welcome 2020");
assertTrue(m.find(20));
assertEquals(25, m.start());
assertEquals("2020", m.group());
assertEquals(29, m.end());
}
@Test
public void whenMatchFourDigitWorks_thenFail() {
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
Matcher m = stringPattern.matcher("goodbye 2019 and welcome 2020");
assertFalse(m.matches());
}
@Test
public void whenMatchFourDigitWorks_thenCorrect() {
Pattern stringPattern = Pattern.compile("\\d\\d\\d\\d");
Matcher m = stringPattern.matcher("2019");
assertTrue(m.matches());
assertEquals(0, m.start());
assertEquals("2019", m.group());
assertEquals(4, m.end());
assertTrue(m.matches());// matches will always return the same return
}
}

View File

@ -207,8 +207,8 @@
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version> <version>${maven-javadoc-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -397,6 +397,8 @@
<maven-shade-plugin.version>3.1.1</maven-shade-plugin.version> <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version>
<spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version> <spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version> <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties> </properties>
</project> </project>

View File

@ -17,17 +17,17 @@
<dependency> <dependency>
<groupId>com.baeldung.entitymodule</groupId> <groupId>com.baeldung.entitymodule</groupId>
<artifactId>entitymodule</artifactId> <artifactId>entitymodule</artifactId>
<version>1.0</version> <version>${entitymodule.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.baeldung.daomodule</groupId> <groupId>com.baeldung.daomodule</groupId>
<artifactId>daomodule</artifactId> <artifactId>daomodule</artifactId>
<version>1.0</version> <version>${daomodule.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.baeldung.userdaomodule</groupId> <groupId>com.baeldung.userdaomodule</groupId>
<artifactId>userdaomodule</artifactId> <artifactId>userdaomodule</artifactId>
<version>1.0</version> <version>${userdaomodule.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -43,6 +43,9 @@
<properties> <properties>
<maven.compiler.source>9</maven.compiler.source> <maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target> <maven.compiler.target>9</maven.compiler.target>
<entitymodule.version>1.0</entitymodule.version>
<daomodule.version>1.0</daomodule.version>
<userdaomodule.version>1.0</userdaomodule.version>
</properties> </properties>
</project> </project>

View File

@ -45,10 +45,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>1.9</source> <source>${source.version}</source>
<target>1.9</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -56,6 +56,9 @@
</build> </build>
<properties> <properties>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<source.version>1.9</source.version>
<target.version>1.9</target.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<assertj-core.version>3.12.2</assertj-core.version> <assertj-core.version>3.12.2</assertj-core.version>
</properties> </properties>

View File

@ -17,12 +17,12 @@
<dependency> <dependency>
<groupId>com.baeldung.entitymodule</groupId> <groupId>com.baeldung.entitymodule</groupId>
<artifactId>entitymodule</artifactId> <artifactId>entitymodule</artifactId>
<version>1.0</version> <version>${entitymodule.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.baeldung.daomodule</groupId> <groupId>com.baeldung.daomodule</groupId>
<artifactId>daomodule</artifactId> <artifactId>daomodule</artifactId>
<version>1.0</version> <version>${daomodule.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -38,6 +38,8 @@
<properties> <properties>
<maven.compiler.source>9</maven.compiler.source> <maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target> <maven.compiler.target>9</maven.compiler.target>
<entitymodule.version>1.0</entitymodule.version>
<daomodule.version>1.0</daomodule.version>
</properties> </properties>
</project> </project>

View File

@ -29,16 +29,16 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version> <version>${dependency.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<id>copy-dependencies</id> <id>copy-dependencies</id>
@ -69,5 +69,12 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<dependency.plugin.version>3.1.1</dependency.plugin.version>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties>
</project> </project>

View File

@ -0,0 +1,54 @@
package com.baeldung.sequeces
import org.junit.Test
import kotlin.test.assertEquals
import java.time.Instant
class SequencesTest {
@Test
fun shouldBuildSequenceWhenUsingFromElements() {
val seqOfElements = sequenceOf("first" ,"second", "third")
.toList()
assertEquals(3, seqOfElements.count())
}
@Test
fun shouldBuildSequenceWhenUsingFromFunction() {
val seqFromFunction = generateSequence(Instant.now()) {it.plusSeconds(1)}
.take(3)
.toList()
assertEquals(3, seqFromFunction.count())
}
@Test
fun shouldBuildSequenceWhenUsingFromChunks() {
val seqFromChunks = sequence {
yield(1)
yieldAll((2..5).toList())
}.toList()
assertEquals(5, seqFromChunks.count())
}
@Test
fun shouldBuildSequenceWhenUsingFromCollection() {
val seqFromIterable = (1..10)
.asSequence()
.toList()
assertEquals(10, seqFromIterable.count())
}
@Test
fun shouldShowNoCountDiffWhenUsingWithAndWithoutSequence() {
val withSequence = (1..10).asSequence()
.filter{it % 2 == 1}
.map { it * 2 }
.toList()
val withoutSequence = (1..10)
.filter{it % 2 == 1}
.map { it * 2 }
.toList()
assertEquals(withSequence.count(), withoutSequence.count())
}
}

View File

@ -28,7 +28,7 @@
<plugin> <plugin>
<groupId>net.alchim31.maven</groupId> <groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId> <artifactId>scala-maven-plugin</artifactId>
<version>3.3.2</version> <version>${scala.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -49,6 +49,7 @@
<properties> <properties>
<scala.version>2.12.7</scala.version> <scala.version>2.12.7</scala.version>
<scala.plugin.version>3.3.2</scala.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -44,12 +44,13 @@
<dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId> <groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.3.5</version> <version>${httpclient.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<properties> <properties>
<dl4j.version>0.9.1</dl4j.version> <!-- Latest non beta version --> <dl4j.version>0.9.1</dl4j.version> <!-- Latest non beta version -->
<httpclient.version>4.3.5</httpclient.version>
</properties> </properties>
</project> </project>

View File

@ -175,10 +175,10 @@
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
@ -215,5 +215,8 @@
<logback.version>1.2.3</logback.version> <logback.version>1.2.3</logback.version>
<slf4j.version>1.7.25</slf4j.version> <slf4j.version>1.7.25</slf4j.version>
<spring-boot-maven-plugin.version>2.0.4.RELEASE</spring-boot-maven-plugin.version> <spring-boot-maven-plugin.version>2.0.4.RELEASE</spring-boot-maven-plugin.version>
<compiler.plugin.version>3.1</compiler.plugin.version>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
</properties> </properties>
</project> </project>

View File

@ -63,7 +63,7 @@
<plugin> <plugin>
<groupId>net.ltgt.gwt.maven</groupId> <groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId> <artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-8</version> <version>${gwt.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -78,7 +78,7 @@
<failOnError>true</failOnError> <failOnError>true</failOnError>
<!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if <!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if
you use a different source language for java compilation --> you use a different source language for java compilation -->
<sourceLevel>1.8</sourceLevel> <sourceLevel>${maven.compiler.source}</sourceLevel>
<!-- Compiler configuration --> <!-- Compiler configuration -->
<compilerArgs> <compilerArgs>
<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) --> <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
@ -98,7 +98,7 @@
<!-- Skip normal test execution, we use gwt:test instead --> <!-- Skip normal test execution, we use gwt:test instead -->
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version> <version>${surefire.plugin.version}</version>
<configuration> <configuration>
<skip>true</skip> <skip>true</skip>
</configuration> </configuration>
@ -119,6 +119,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<gwt.version>2.8.2</gwt.version> <gwt.version>2.8.2</gwt.version>
<gwt.plugin.version>1.0-rc-8</gwt.plugin.version>
<surefire.plugin.version>2.17</surefire.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -46,19 +46,19 @@
<dependency> <dependency>
<groupId>org.jetbrains.spek</groupId> <groupId>org.jetbrains.spek</groupId>
<artifactId>spek-api</artifactId> <artifactId>spek-api</artifactId>
<version>1.1.5</version> <version>${spek.api.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.spek</groupId> <groupId>org.jetbrains.spek</groupId>
<artifactId>spek-subject-extension</artifactId> <artifactId>spek-subject-extension</artifactId>
<version>1.1.5</version> <version>${spek.subject.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.spek</groupId> <groupId>org.jetbrains.spek</groupId>
<artifactId>spek-junit-platform-engine</artifactId> <artifactId>spek-junit-platform-engine</artifactId>
<version>1.1.5</version> <version>${spek.junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -195,6 +195,9 @@
<junit.vintage.version>5.2.0</junit.vintage.version> <junit.vintage.version>5.2.0</junit.vintage.version>
<assertj.version>3.10.0</assertj.version> <assertj.version>3.10.0</assertj.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version> <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<spek.api.version>1.1.5</spek.api.version>
<spek.subject.version>1.1.5</spek.subject.version>
<spek.junit.version>1.1.5</spek.junit.version>
</properties> </properties>
</project> </project>

View File

@ -16,6 +16,7 @@
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<awaitility.version>3.1.2</awaitility.version>
</properties> </properties>
<dependencies> <dependencies>
@ -31,7 +32,7 @@
<dependency> <dependency>
<groupId>org.awaitility</groupId> <groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId> <artifactId>awaitility</artifactId>
<version>3.1.2</version> <version>${awaitility.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -12,12 +12,16 @@
<artifactId>java-ee-8-security-api</artifactId> <artifactId>java-ee-8-security-api</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
</parent> </parent>
<properties>
<unboundid.ldapsdk.version>4.0.4</unboundid.ldapsdk.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.unboundid</groupId> <groupId>com.unboundid</groupId>
<artifactId>unboundid-ldapsdk</artifactId> <artifactId>unboundid-ldapsdk</artifactId>
<version>4.0.4</version> <version>${unboundid.ldapsdk.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -21,6 +21,11 @@
<artifactId>jmh-generator-annprocess</artifactId> <artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh-generator.version}</version> <version>${jmh-generator.version}</version>
</dependency> </dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>dsiutils</artifactId>
<version>${dsiutils.version}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -33,4 +38,8 @@
</resources> </resources>
</build> </build>
<properties>
<dsiutils.version>2.6.0</dsiutils.version>
</properties>
</project> </project>

View File

@ -7,7 +7,7 @@ public class BruteForcePrimeChecker implements PrimeChecker<Integer> {
@Override @Override
public boolean isPrime(Integer number) { public boolean isPrime(Integer number) {
return number > 2 ? IntStream.range(2, number) return number > 1 ? IntStream.range(2, number)
.noneMatch(n -> (number % n == 0)) : false; .noneMatch(n -> (number % n == 0)) : false;
} }

View File

@ -6,7 +6,7 @@ public class OptimisedPrimeChecker implements PrimeChecker<Integer> {
@Override @Override
public boolean isPrime(Integer number) { public boolean isPrime(Integer number) {
return number > 2 ? IntStream.rangeClosed(2, (int) Math.sqrt(number)) return number > 1 ? IntStream.rangeClosed(2, (int) Math.sqrt(number))
.noneMatch(n -> (number % n == 0)) : false; .noneMatch(n -> (number % n == 0)) : false;
} }

View File

@ -11,22 +11,24 @@ public class PrimeCheckerUnitTest {
@Test @Test
public void whenCheckIsPrime_thenTrue() { public void whenCheckIsPrime_thenTrue() {
assertTrue(primeChecker.isPrime(13l)); assertTrue(primeChecker.isPrime(2L));
assertTrue(primeChecker.isPrime(13L));
assertTrue(primeChecker.isPrime(1009L)); assertTrue(primeChecker.isPrime(1009L));
assertTrue(primeChecker.isPrime(74207281L)); assertTrue(primeChecker.isPrime(74207281L));
} }
@Test @Test
public void whenCheckIsPrime_thenFalse() { public void whenCheckIsPrime_thenFalse() {
assertTrue(!primeChecker.isPrime(50L)); assertFalse(primeChecker.isPrime(50L));
assertTrue(!primeChecker.isPrime(1001L)); assertFalse(primeChecker.isPrime(1001L));
assertTrue(!primeChecker.isPrime(74207282L)); assertFalse(primeChecker.isPrime(74207282L));
} }
private final BruteForcePrimeChecker bfPrimeChecker = new BruteForcePrimeChecker(); private final BruteForcePrimeChecker bfPrimeChecker = new BruteForcePrimeChecker();
@Test @Test
public void whenBFCheckIsPrime_thenTrue() { public void whenBFCheckIsPrime_thenTrue() {
assertTrue(bfPrimeChecker.isPrime(2));
assertTrue(bfPrimeChecker.isPrime(13)); assertTrue(bfPrimeChecker.isPrime(13));
assertTrue(bfPrimeChecker.isPrime(1009)); assertTrue(bfPrimeChecker.isPrime(1009));
} }
@ -41,6 +43,7 @@ public class PrimeCheckerUnitTest {
@Test @Test
public void whenOptCheckIsPrime_thenTrue() { public void whenOptCheckIsPrime_thenTrue() {
assertTrue(optimisedPrimeChecker.isPrime(2));
assertTrue(optimisedPrimeChecker.isPrime(13)); assertTrue(optimisedPrimeChecker.isPrime(13));
assertTrue(optimisedPrimeChecker.isPrime(1009)); assertTrue(optimisedPrimeChecker.isPrime(1009));
} }
@ -55,6 +58,7 @@ public class PrimeCheckerUnitTest {
@Test @Test
public void whenPrimesCheckIsPrime_thenTrue() { public void whenPrimesCheckIsPrime_thenTrue() {
assertTrue(primesPrimeChecker.isPrime(2));
assertTrue(primesPrimeChecker.isPrime(13)); assertTrue(primesPrimeChecker.isPrime(13));
assertTrue(primesPrimeChecker.isPrime(1009)); assertTrue(primesPrimeChecker.isPrime(1009));
} }

View File

@ -118,7 +118,7 @@
<dependency> <dependency>
<groupId>javax.mvc</groupId> <groupId>javax.mvc</groupId>
<artifactId>javax.mvc-api</artifactId> <artifactId>javax.mvc-api</artifactId>
<version>20160715</version> <version>${mvc.api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.glassfish.ozark</groupId> <groupId>org.glassfish.ozark</groupId>
@ -215,7 +215,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle.mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>
@ -506,6 +506,8 @@
</repositories> </repositories>
<properties> <properties>
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
<mvc.api.version>20160715</mvc.api.version>
<java.min.version>1.8</java.min.version> <java.min.version>1.8</java.min.version>
<maven.min.version>3.0.0</maven.min.version> <maven.min.version>3.0.0</maven.min.version>
<javaee_api.version>7.0</javaee_api.version> <javaee_api.version>7.0</javaee_api.version>

View File

@ -253,7 +253,7 @@
<dependency> <dependency>
<groupId>org.wildfly.arquillian</groupId> <groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-remote</artifactId> <artifactId>wildfly-arquillian-container-remote</artifactId>
<version>2.2.0.Final</version> <version>${wildfly.arquillian.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -261,6 +261,7 @@
</profiles> </profiles>
<properties> <properties>
<wildfly.arquillian.version>2.2.0.Final</wildfly.arquillian.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<javaee-api.version>8.0</javaee-api.version> <javaee-api.version>8.0</javaee-api.version>

View File

@ -17,6 +17,7 @@
</prerequisites> </prerequisites>
<properties> <properties>
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine> <argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
<assertj.version>3.6.2</assertj.version> <assertj.version>3.6.2</assertj.version>
<awaitility.version>2.0.0</awaitility.version> <awaitility.version>2.0.0</awaitility.version>
@ -433,7 +434,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle.mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>

View File

@ -92,6 +92,7 @@
<undertow.version>1.4.10.Final</undertow.version> <undertow.version>1.4.10.Final</undertow.version>
<validation-api.version>1.1.0.Final</validation-api.version> <validation-api.version>1.1.0.Final</validation-api.version>
<yarn.version>v0.21.3</yarn.version> <yarn.version>v0.21.3</yarn.version>
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -427,7 +428,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle.mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>

View File

@ -96,6 +96,7 @@
<undertow.version>1.4.10.Final</undertow.version> <undertow.version>1.4.10.Final</undertow.version>
<validation-api.version>1.1.0.Final</validation-api.version> <validation-api.version>1.1.0.Final</validation-api.version>
<yarn.version>v0.21.3</yarn.version> <yarn.version>v0.21.3</yarn.version>
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -469,7 +470,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle.mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>

View File

@ -302,7 +302,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle.mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>
@ -398,8 +398,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version> <version>${maven-compiler-plugin.version}</version>
<configuration> <configuration>
<source>1.8</source> <source>${source.version}</source>
<target>1.8</target> <target>${target.version}</target>
<annotationProcessorPaths> <annotationProcessorPaths>
<path> <path>
<groupId>org.mapstruct</groupId> <groupId>org.mapstruct</groupId>
@ -881,6 +881,9 @@
</profiles> </profiles>
<properties> <properties>
<source.version>1.8</source.version>
<target.version>1.8</target.version>
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
<argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine> <argLine>-Djava.security.egd=file:/dev/./urandom -Xmx256m</argLine>
<assertj.version>3.6.2</assertj.version> <assertj.version>3.6.2</assertj.version>
<awaitility.version>2.0.0</awaitility.version> <awaitility.version>2.0.0</awaitility.version>

View File

@ -236,7 +236,7 @@
<dependency> <dependency>
<groupId>org.zalando</groupId> <groupId>org.zalando</groupId>
<artifactId>problem-spring-web</artifactId> <artifactId>problem-spring-web</artifactId>
<version>0.24.0-RC.0</version> <version>${spring.web.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security.oauth</groupId> <groupId>org.springframework.security.oauth</groupId>
@ -559,7 +559,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle.mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>
@ -1012,6 +1012,8 @@
</profiles> </profiles>
<properties> <properties>
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
<spring.web.version>0.24.0-RC.0</spring.web.version>
<!-- Build properties --> <!-- Build properties -->
<maven.version>3.0.0</maven.version> <maven.version>3.0.0</maven.version>
<java.version>1.8</java.version> <java.version>1.8</java.version>

View File

@ -232,7 +232,7 @@
<dependency> <dependency>
<groupId>org.zalando</groupId> <groupId>org.zalando</groupId>
<artifactId>problem-spring-web</artifactId> <artifactId>problem-spring-web</artifactId>
<version>0.24.0-RC.0</version> <version>${spring.web.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.security.oauth</groupId> <groupId>org.springframework.security.oauth</groupId>
@ -543,7 +543,7 @@
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version> <version>${lifecycle.mapping.version}</version>
<configuration> <configuration>
<lifecycleMappingMetadata> <lifecycleMappingMetadata>
<pluginExecutions> <pluginExecutions>
@ -834,6 +834,8 @@
</profiles> </profiles>
<properties> <properties>
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
<spring.web.version>0.24.0-RC.0</spring.web.version>
<!-- Build properties --> <!-- Build properties -->
<maven.version>3.0.0</maven.version> <maven.version>3.0.0</maven.version>
<java.version>1.8</java.version> <java.version>1.8</java.version>

View File

@ -33,19 +33,19 @@
<dependency> <dependency>
<groupId>org.jetbrains.spek</groupId> <groupId>org.jetbrains.spek</groupId>
<artifactId>spek-api</artifactId> <artifactId>spek-api</artifactId>
<version>1.1.5</version> <version>${spek.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.spek</groupId> <groupId>org.jetbrains.spek</groupId>
<artifactId>spek-subject-extension</artifactId> <artifactId>spek-subject-extension</artifactId>
<version>1.1.5</version> <version>${spek.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jetbrains.spek</groupId> <groupId>org.jetbrains.spek</groupId>
<artifactId>spek-junit-platform-engine</artifactId> <artifactId>spek-junit-platform-engine</artifactId>
<version>1.1.5</version> <version>${spek.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -166,6 +166,7 @@
<objenesis.version>2.6</objenesis.version> <objenesis.version>2.6</objenesis.version>
<rxkotlin.version>2.3.0</rxkotlin.version> <rxkotlin.version>2.3.0</rxkotlin.version>
<arrow-core.version>0.7.3</arrow-core.version> <arrow-core.version>0.7.3</arrow-core.version>
<spek.version>1.1.5</spek.version>
</properties> </properties>
</project> </project>

View File

@ -103,7 +103,7 @@
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version> <version>${dependency.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<id>getClasspathFilenames</id> <id>getClasspathFilenames</id>
@ -116,7 +116,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version> <version>${surefire.plugin.version}</version>
<configuration> <configuration>
<argLine>-Dco.paralleluniverse.fibers.verifyInstrumentation=true</argLine> <argLine>-Dco.paralleluniverse.fibers.verifyInstrumentation=true</argLine>
<argLine>-javaagent:${co.paralleluniverse:quasar-core:jar}</argLine> <argLine>-javaagent:${co.paralleluniverse:quasar-core:jar}</argLine>
@ -125,7 +125,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version> <version>${exec.plugin.version}</version>
<configuration> <configuration>
<workingDirectory>target/classes</workingDirectory> <workingDirectory>target/classes</workingDirectory>
<executable>echo</executable> <executable>echo</executable>
@ -145,6 +145,9 @@
<kotlin.version>1.3.31</kotlin.version> <kotlin.version>1.3.31</kotlin.version>
<org.slf4j.version>1.7.21</org.slf4j.version> <org.slf4j.version>1.7.21</org.slf4j.version>
<logback.version>1.1.7</logback.version> <logback.version>1.1.7</logback.version>
<dependency.plugin.version>3.1.1</dependency.plugin.version>
<surefire.plugin.version>2.22.1</surefire.plugin.version>
<exec.plugin.version>1.3.2</exec.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -183,7 +183,7 @@
<plugin> <plugin>
<groupId>io.ebean</groupId> <groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId> <artifactId>ebean-maven-plugin</artifactId>
<version>11.11.2</version> <version>${ebean.plugin.version}</version>
<executions> <executions>
<!-- enhance main classes --> <!-- enhance main classes -->
<execution> <execution>
@ -202,6 +202,7 @@
</build> </build>
<properties> <properties>
<ebean.plugin.version>11.11.2</ebean.plugin.version>
<reladomo.version>16.5.1</reladomo.version> <reladomo.version>16.5.1</reladomo.version>
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version> <build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version> <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>

View File

@ -74,19 +74,19 @@
<dependency> <dependency>
<groupId>commons-cli</groupId> <groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId> <artifactId>commons-cli</artifactId>
<version>1.2</version> <version>${commons.cli.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.1</version> <version>${commons.io.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-httpclient</groupId> <groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId> <artifactId>commons-httpclient</artifactId>
<version>3.0.1</version> <version>${httpclient.version}</version>
<scope>provided</scope> <scope>provided</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -133,7 +133,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version> <version>${assembly.plugin.version}</version>
<configuration> <configuration>
<descriptors> <descriptors>
<descriptor>src/main/resources/assembly/hadoop-job.xml</descriptor> <descriptor>src/main/resources/assembly/hadoop-job.xml</descriptor>
@ -158,6 +158,10 @@
</build> </build>
<properties> <properties>
<assembly.plugin.version>2.3</assembly.plugin.version>
<commons.cli.version>1.2</commons.cli.version>
<commons.io.version>2.1</commons.io.version>
<httpclient.version>3.0.1</httpclient.version>
<storm.version>1.2.2</storm.version> <storm.version>1.2.2</storm.version>
<kafka.version>1.0.0</kafka.version> <kafka.version>1.0.0</kafka.version>
<ignite.version>2.4.0</ignite.version> <ignite.version>2.4.0</ignite.version>

View File

@ -71,7 +71,7 @@
<dependency> <dependency>
<groupId>com.google.code.gson</groupId> <groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId> <artifactId>gson</artifactId>
<version>2.8.5</version> <version>${gson.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -116,6 +116,7 @@
</dependencies> </dependencies>
<properties> <properties>
<gson.version>2.8.5</gson.version>
<httpclient.version>4.5.3</httpclient.version> <httpclient.version>4.5.3</httpclient.version>
<jackson.version>2.9.8</jackson.version> <jackson.version>2.9.8</jackson.version>
<assertj.version>3.6.2</assertj.version> <assertj.version>3.6.2</assertj.version>

View File

@ -127,7 +127,7 @@
<dependency> <dependency>
<groupId>org.asciidoctor</groupId> <groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId> <artifactId>asciidoctor-maven-plugin</artifactId>
<version>1.5.7.1</version> <version>${asciidoctor.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -154,7 +154,8 @@
</build> </build>
<properties> <properties>
<serenity.version>1.9.9</serenity.version> <asciidoctor.version>1.5.7.1</asciidoctor.version>
<serenity.version>1.9.9</serenity.version>
<serenity.jbehave.version>1.9.0</serenity.jbehave.version> <serenity.jbehave.version>1.9.0</serenity.jbehave.version>
<serenity.jira.version>1.9.0</serenity.jira.version> <serenity.jira.version>1.9.0</serenity.jira.version>
<serenity.plugin.version>1.9.27</serenity.plugin.version> <serenity.plugin.version>1.9.27</serenity.plugin.version>

View File

@ -523,7 +523,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>2.2</version> <version>${shade.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -556,6 +556,7 @@
</build> </build>
<properties> <properties>
<shade.plugin.version>2.2</shade.plugin.version>
<multiverse.version>0.7.0</multiverse.version> <multiverse.version>0.7.0</multiverse.version>
<cglib.version>3.2.7</cglib.version> <cglib.version>3.2.7</cglib.version>
<javatuples.version>1.2</javatuples.version> <javatuples.version>1.2</javatuples.version>

View File

@ -0,0 +1,208 @@
#!/bin/bash
# Subsection 2.1
simple_function() {
for ((i=0;i<5;++i)) do
echo -n " "$i" ";
done
}
function simple_function_no_parantheses {
for ((i=0;i<5;++i)) do
echo -n " "$i" ";
done
}
function simple_for_loop()
for ((i=0;i<5;++i)) do
echo -n " "$i" ";
done
function simple_comparison()
if [[ "$1" -lt 5 ]]; then
echo "$1 is smaller than 5"
else
echo "$1 is greater than 5"
fi
# Subsection 2.2
function simple_inputs() {
echo "This is the first argument [$1]"
echo "This is the second argument [$2]"
echo "Calling function with $# aruments"
}
# Subsection 2.3
global_sum=0
function global_sum_outputs() {
global_sum=$(($1+$2))
}
function cs_sum_outputs() {
sum=$(($1+$2))
echo $sum
}
# Subsection 2.4
function arg_ref_sum_outputs() {
declare -n sum_ref=$3
sum_ref=$(($1+$2))
}
# Subsection 3.1
variable="baeldung"
function variable_scope2() {
echo "Variable inside function variable_scope2: [$variable]"
local variable="ipsum"
}
function variable_scope() {
local variable="lorem"
echo "Variable inside function variable_scope: [$variable]"
variable_scope2
}
# Subsection 3.2
subshell_sum=0
function simple_subshell_sum() (
subshell_sum=$(($1+$2))
echo "Value of sum in function with global variables: [$subshell_sum]"
)
function simple_subshell_ref_sum() (
declare -n sum_ref=$3
sum_ref=$(($1+$2))
echo "Value of sum in function with ref arguments: [$sum_ref]"
)
# Subsection 3.3
function redirection_in() {
while read input;
do
echo "$input"
done
} < infile
function redirection_in_ps() {
read
while read -a input;
do
echo "User[${input[2]}]->File[${input[8]}]"
done
} < <(ls -ll /)
function redirection_out_ps() {
declare -a output=("baeldung" "lorem" "ipsum" "caracg")
for element in "${output[@]}"
do
echo "$element"
done
} > >(grep "g")
function redirection_out() {
declare -a output=("baeldung" "lorem" "ipsum")
for element in "${output[@]}"
do
echo "$element"
done
} > outfile
# Subsection 3.4
function fibonnaci_recursion() {
argument=$1
if [[ "$argument" -eq 0 ]] || [[ "$argument" -eq 1 ]]; then
echo $argument
else
first=$(fibonnaci_recursion $(($argument-1)))
second=$(fibonnaci_recursion $(($argument-2)))
echo $(( $first + $second ))
fi
}
# main menu entry point
echo "****Functions samples menu*****"
PS3="Your choice (1,2,3 etc.):"
options=("function_definitions" "function_input_args" "function_outputs" \
"function_variables" "function_subshells" "function_redirections" \
"function_recursion" "quit")
select option in "${options[@]}"
do
case $option in
"function_definitions")
echo -e "\n"
echo "**Different ways to define a function**"
echo -e "No function keyword:"
simple_function
echo -e "\nNo function parantheses:"
simple_function_no_parantheses
echo -e "\nOmitting curly braces:"
simple_for_loop
echo -e "\n"
;;
"function_input_args")
echo -e "\n"
echo "**Passing inputs to a function**"
simple_inputs lorem ipsum
echo -e "\n"
;;
"function_outputs")
echo -e "\n"
echo "**Getting outputs from a function**"
global_sum_outputs 1 2
echo -e ">1+2 using global variables: [$global_sum]"
cs_sum=$(cs_sum_outputs 1 2)
echo -e ">1+2 using command substitution: [$cs_sum]"
arg_ref_sum_outputs 1 2 arg_ref_sum
echo -e ">1+2 using argument references: [$arg_ref_sum]"
echo -e "\n"
;;
"function_variables")
echo -e "\n"
echo "**Overriding variable scopes**"
echo "Global value of variable: [$variable]"
variable_scope
echo -e "\n"
;;
"function_subshells")
echo -e "\n"
echo "**Running function in subshell**"
echo "Global value of sum: [$subshell_sum]"
simple_subshell_sum 1 2
echo "Value of sum after subshell function with \
global variables: [$subshell_sum]"
subshell_sum_arg_ref=0
simple_subshell_ref_sum 1 2 subshell_sum_arg_ref
echo "Value of sum after subshell function with \
ref arguments: [$subshell_sum_arg_ref]"
echo -e "\n"
;;
"function_redirections")
echo -e "\n"
echo "**Function redirections**"
echo -e ">Function input redirection from file:"
redirection_in
echo -e ">Function input redirection from command:"
redirection_in_ps
echo -e ">Function output redirection to file:"
redirection_out
cat outfile
echo -e ">Function output redirection to command:"
red_ps=$(redirection_out_ps)
echo "$red_ps"
echo -e "\n"
;;
"function_recursion")
echo -e "\n"
echo "**Function recursion**"
fibo_res1=$(fibonnaci_recursion 7)
echo "The 7th Fibonnaci number: [$fibo_res1]"
fibo_res2=$(fibonnaci_recursion 15)
echo "The 15th Fibonnaci number: [$fibo_res2]"
echo -e "\n"
;;
"quit")
break
;;
*) echo "Invalid option";;
esac
done

View File

@ -0,0 +1,3 @@
Honda Insight 2010
Honda Element 2006
Chevrolet Avalanche 2002

View File

@ -15,26 +15,26 @@
<dependency> <dependency>
<groupId>com.google.flogger</groupId> <groupId>com.google.flogger</groupId>
<artifactId>flogger</artifactId> <artifactId>flogger</artifactId>
<version>0.4</version> <version>${flogger.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.flogger</groupId> <groupId>com.google.flogger</groupId>
<artifactId>flogger-system-backend</artifactId> <artifactId>flogger-system-backend</artifactId>
<version>0.4</version> <version>${flogger.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.flogger</groupId> <groupId>com.google.flogger</groupId>
<artifactId>flogger-slf4j-backend</artifactId> <artifactId>flogger-slf4j-backend</artifactId>
<version>0.4</version> <version>${flogger.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.google.flogger</groupId> <groupId>com.google.flogger</groupId>
<artifactId>flogger-log4j-backend</artifactId> <artifactId>flogger-log4j-backend</artifactId>
<version>0.4</version> <version>${flogger.version}</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>com.sun.jmx</groupId> <groupId>com.sun.jmx</groupId>
@ -54,13 +54,18 @@
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>log4j</artifactId> <artifactId>log4j</artifactId>
<version>1.2.17</version> <version>${log4j.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>log4j</groupId>
<artifactId>apache-log4j-extras</artifactId> <artifactId>apache-log4j-extras</artifactId>
<version>1.2.17</version> <version>${log4j.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<flogger.version>0.4</flogger.version>
<log4j.version>1.2.17</log4j.version>
</properties>
</project> </project>

View File

@ -19,6 +19,15 @@
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
<kotlin.version>1.3.50</kotlin.version> <kotlin.version>1.3.50</kotlin.version>
<dl4j.version>0.9.1</dl4j.version> <dl4j.version>0.9.1</dl4j.version>
<clean.plugin.version>3.1.0</clean.plugin.version>
<resources.plugin.version>3.0.2</resources.plugin.version>
<jar.plugin.version>3.0.2</jar.plugin.version>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<surefire.plugin.version>2.22.1</surefire.plugin.version>
<install.plugin.version>2.5.2</install.plugin.version>
<deploy.plugin.version>2.8.2</deploy.plugin.version>
<site.plugin.version>3.7.1</site.plugin.version>
<report.plugin.version>3.0.0</report.plugin.version>
</properties> </properties>
<dependencies> <dependencies>
@ -63,41 +72,41 @@
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version> <version>${clean.plugin.version}</version>
</plugin> </plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin> <plugin>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version> <version>${resources.plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version> <version>${surefire.plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version> <version>${jar.plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-install-plugin</artifactId> <artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version> <version>${install.plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version> <version>${deploy.plugin.version}</version>
</plugin> </plugin>
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
<plugin> <plugin>
<artifactId>maven-site-plugin</artifactId> <artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version> <version>${site.plugin.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-project-info-reports-plugin</artifactId> <artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version> <version>${report.plugin.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>

View File

@ -12,13 +12,19 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>9</source> <source>${source.version}</source>
<target>9</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<properties>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<source.version>9</source.version>
<target.version>9</target.version>
</properties>
</project> </project>

View File

@ -8,16 +8,21 @@
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties>
<commons.lang3.version>3.9</commons.lang3.version>
<junit.version>4.12</junit.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.9</version> <version>${commons.lang3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -14,7 +14,7 @@
<plugin> <plugin>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<!-- Update maven war plugin to 3.1.0 or higher --> <!-- Update maven war plugin to 3.1.0 or higher -->
<version>3.1.0</version> <version>${war.plugin.version}</version>
<configuration> <configuration>
<!-- Set failOnMissingWebXml configuration for maven war plugin --> <!-- Set failOnMissingWebXml configuration for maven war plugin -->
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
@ -26,6 +26,7 @@
<!-- Set failOnMissingWebXml as false in properties section --> <!-- Set failOnMissingWebXml as false in properties section -->
<properties> <properties>
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<war.plugin.version>3.1.0</war.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -12,19 +12,19 @@
<dependency> <dependency>
<groupId>commons-io</groupId> <groupId>commons-io</groupId>
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.3</version> <version>${commons.io.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId> <artifactId>commons-collections4</artifactId>
<version>4.0</version> <version>${commons.collections4.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
<version>3.0</version> <version>${commons.lang3.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@ -36,7 +36,7 @@
<dependency> <dependency>
<groupId>commons-beanutils</groupId> <groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId> <artifactId>commons-beanutils</artifactId>
<version>1.9.1</version> <version>${commons.beanutils.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -45,7 +45,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId> <artifactId>versions-maven-plugin</artifactId>
<version>2.7</version> <version>${versions.plugin.version}</version>
<configuration> <configuration>
<excludes> <excludes>
<exclude>org.apache.commons:commons-collections4</exclude> <exclude>org.apache.commons:commons-collections4</exclude>
@ -71,6 +71,11 @@
<properties> <properties>
<commons-compress-version>1.15</commons-compress-version> <commons-compress-version>1.15</commons-compress-version>
<commons.io.version>2.3</commons.io.version>
<versions.plugin.version>2.7</versions.plugin.version>
<commons.beanutils.version>1.9.1</commons.beanutils.version>
<commons.lang3.version>3.0</commons.lang3.version>
<commons.collections4.version>4.0</commons.collections4.version>
</properties> </properties>
</project> </project>

View File

@ -14,6 +14,8 @@
<liberty-maven-plugin.version>${liberty-plugin-version}</liberty-maven-plugin.version> <liberty-maven-plugin.version>${liberty-plugin-version}</liberty-maven-plugin.version>
<defaultHttpPort>9080</defaultHttpPort> <defaultHttpPort>9080</defaultHttpPort>
<defaultHttpsPort>9443</defaultHttpsPort> <defaultHttpsPort>9443</defaultHttpsPort>
<cdi.api.version>2.0</cdi.api.version>
<rsapi.api.version>2.1</rsapi.api.version>
</properties> </properties>
<build> <build>
@ -65,14 +67,14 @@
<dependency> <dependency>
<groupId>javax.enterprise</groupId> <groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId> <artifactId>cdi-api</artifactId>
<version>2.0</version> <version>${cdi.api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.ws.rs</groupId> <groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId> <artifactId>javax.ws.rs-api</artifactId>
<version>2.1</version> <version>${rsapi.api.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

View File

@ -12,23 +12,26 @@
<groupId>com.baeldung.multimodule-maven-project</groupId> <groupId>com.baeldung.multimodule-maven-project</groupId>
<artifactId>multimodule-maven-project</artifactId> <artifactId>multimodule-maven-project</artifactId>
<version>1.0</version> <version>1.0</version>
<entitymodule.version>1.0</entitymodule.version>
<daomodule.version>1.0</daomodule.version>
<userdaomodule.version>1.0</userdaomodule.version>
</parent> </parent>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.baeldung.entitymodule</groupId> <groupId>com.baeldung.entitymodule</groupId>
<artifactId>entitymodule</artifactId> <artifactId>entitymodule</artifactId>
<version>1.0</version> <version>${entitymodule.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.baeldung.daomodule</groupId> <groupId>com.baeldung.daomodule</groupId>
<artifactId>daomodule</artifactId> <artifactId>daomodule</artifactId>
<version>1.0</version> <version>${daomodule.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.baeldung.userdaomodule</groupId> <groupId>com.baeldung.userdaomodule</groupId>
<artifactId>userdaomodule</artifactId> <artifactId>userdaomodule</artifactId>
<version>1.0</version> <version>${userdaomodule.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -26,13 +26,13 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.assertj</groupId> <groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId> <artifactId>assertj-core</artifactId>
<version>3.12.2</version> <version>${assertj.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -44,10 +44,10 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>11</source> <source>${source.version}</source>
<target>11</target> <target>${target.version}</target>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
@ -56,6 +56,11 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.12</junit.version>
<assertj.version>3.12.2</assertj.version>
<compiler.plugin.version>3.8.0</compiler.plugin.version>
<source.version>11</source.version>
<target.version>11</target.version>
</properties> </properties>
</project> </project>

View File

@ -14,16 +14,21 @@
<version>1.0</version> <version>1.0</version>
</parent> </parent>
<properties>
<entitymodule.version>1.0</entitymodule.version>
<daomodule.version>1.0</daomodule.version>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.baeldung.entitymodule</groupId> <groupId>com.baeldung.entitymodule</groupId>
<artifactId>entitymodule</artifactId> <artifactId>entitymodule</artifactId>
<version>1.0</version> <version>${entitymodule.version}1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.baeldung.daomodule</groupId> <groupId>com.baeldung.daomodule</groupId>
<artifactId>daomodule</artifactId> <artifactId>daomodule</artifactId>
<version>1.0</version> <version>${daomodule.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>

View File

@ -34,7 +34,7 @@
<plugin> <plugin>
<groupId>org.codehaus.plexus</groupId> <groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId> <artifactId>plexus-component-metadata</artifactId>
<version>1.7.1</version> <version>${plexus.component.version}</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@ -48,6 +48,7 @@
<properties> <properties>
<maven-core.version>3.5.4</maven-core.version> <maven-core.version>3.5.4</maven-core.version>
<plexus.component.version>1.7.1</plexus.component.version>
</properties> </properties>
</project> </project>

View File

@ -49,7 +49,7 @@
<dependency> <dependency>
<groupId>javax.annotation</groupId> <groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId> <artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version> <version>${annotation.api.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
@ -60,19 +60,19 @@
<dependency> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>1.2.3</version> <version>${lombok.version}</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.12</version> <version>${junit.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>io.projectreactor</groupId> <groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId> <artifactId>reactor-core</artifactId>
<version>3.1.6.RELEASE</version> <version>${reactor.version}</version>
</dependency> </dependency>
</dependencies> </dependencies>
@ -81,7 +81,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version> <version>${shade.plugin.version}</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
@ -102,7 +102,7 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version> <version>${exec.plugin.version}</version>
<configuration> <configuration>
<executable>java</executable> <executable>java</executable>
<arguments> <arguments>
@ -118,7 +118,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version> <version>${compiler.plugin.version}</version>
<configuration> <configuration>
<source>${jdk.version}</source> <source>${jdk.version}</source>
<target>${jdk.version}</target> <target>${jdk.version}</target>
@ -142,6 +142,13 @@
<exec.mainClass>com.baeldung.micronaut.helloworld.server.ServerApplication</exec.mainClass> <exec.mainClass>com.baeldung.micronaut.helloworld.server.ServerApplication</exec.mainClass>
<micronaut.version>1.0.0.RC2</micronaut.version> <micronaut.version>1.0.0.RC2</micronaut.version>
<jdk.version>1.8</jdk.version> <jdk.version>1.8</jdk.version>
<annotation.api.version>1.3.2</annotation.api.version>
<lombok.version>1.2.3</lombok.version>
<junit.version>4.12</junit.version>
<reactor.version>3.1.6.RELEASE</reactor.version>
<compiler.plugin.version>3.7.0</compiler.plugin.version>
<exec.plugin.version>1.6.0</exec.plugin.version>
<shade.plugin.version>3.1.0</shade.plugin.version>
</properties> </properties>
</project> </project>

View File

@ -13,6 +13,9 @@
<properties> <properties>
<ninja.version>6.5.0</ninja.version> <ninja.version>6.5.0</ninja.version>
<jetty.version>9.4.18.v20190429</jetty.version> <jetty.version>9.4.18.v20190429</jetty.version>
<bootstrap.version>3.3.4</bootstrap.version>
<jquery.version>2.1.3</jquery.version>
<h2.version>1.4.186</h2.version>
</properties> </properties>
<build> <build>
@ -156,17 +159,17 @@
<dependency> <dependency>
<groupId>org.webjars</groupId> <groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId> <artifactId>bootstrap</artifactId>
<version>3.3.4</version> <version>${bootstrap.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.webjars</groupId> <groupId>org.webjars</groupId>
<artifactId>jquery</artifactId> <artifactId>jquery</artifactId>
<version>2.1.3</version> <version>${jquery.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.h2database</groupId> <groupId>com.h2database</groupId>
<artifactId>h2</artifactId> <artifactId>h2</artifactId>
<version>1.4.186</version> <version>${h2.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ninjaframework</groupId> <groupId>org.ninjaframework</groupId>

View File

@ -1,4 +1,4 @@
package com.baeldung.hibernatelogging; package com.baeldung.hibernate.logging;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assertions.fail;

View File

@ -814,7 +814,7 @@
<module>spring-rest-shell</module> <module>spring-rest-shell</module>
<module>spring-rest-simple</module> <module>spring-rest-simple</module>
<module>spring-resttemplate</module> <module>spring-resttemplate</module>
<module>spring-roo</module> <!-- <module>spring-roo</module>-->
<module>spring-scheduling</module> <module>spring-scheduling</module>
<module>spring-security-modules/spring-security-acl</module> <module>spring-security-modules/spring-security-acl</module>
<module>spring-security-modules/spring-security-angular/server</module> <module>spring-security-modules/spring-security-angular/server</module>
@ -1416,7 +1416,7 @@
<module>spring-rest-shell</module> <module>spring-rest-shell</module>
<module>spring-rest-simple</module> <module>spring-rest-simple</module>
<module>spring-resttemplate</module> <module>spring-resttemplate</module>
<module>spring-roo</module> <!-- <module>spring-roo</module>-->
<module>spring-scheduling</module> <module>spring-scheduling</module>
<module>spring-security-modules/spring-security-acl</module> <module>spring-security-modules/spring-security-acl</module>

View File

@ -24,3 +24,5 @@ item.size=21
#Additional properties #Additional properties
additional.unit=km additional.unit=km
additional.max=100 additional.max=100
key.something=val

View File

@ -1 +1,2 @@
foo=bar foo=bar
key.something=val