diff --git a/.travis.yml b/.travis.yml index 0393b2304e..4df8a96f6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ before_install: - echo "MAVEN_OPTS='-Xmx2048M -Xss128M -XX:+CMSClassUnloadingEnabled -XX:+UseG1GC -XX:-UseGCOverheadLimit'" > ~/.mavenrc install: skip -script: travis_wait 60 mvn -q test +script: travis_wait 60 mvn -q install sudo: required diff --git a/JGit/pom.xml b/JGit/pom.xml index 6d505afcf3..4feb31b758 100644 --- a/JGit/pom.xml +++ b/JGit/pom.xml @@ -11,41 +11,42 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - - + + + + + jgit-repository + https://repo.eclipse.org/content/groups/releases/ + + + + + + + org.eclipse.jgit + org.eclipse.jgit + ${org.eclipse.jgit.version} + + + org.eclipse.jgit + org.eclipse.jgit.archive + ${org.eclipse.jgit.version} + + + commons-io + commons-io + ${commons-io.version} + + + org.slf4j + slf4j-simple + ${org.slf4j.version} + + + UTF-8 - 1.8 - 1.8 + 4.5.0.201609210915-r - - - jgit-repository - https://repo.eclipse.org/content/groups/releases/ - - - - - - org.eclipse.jgit - org.eclipse.jgit - 4.5.0.201609210915-r - - - org.eclipse.jgit - org.eclipse.jgit.archive - 4.5.0.201609210915-r - - - commons-io - commons-io - 2.5 - - - org.slf4j - slf4j-simple - 1.7.21 - - \ No newline at end of file diff --git a/README.md b/README.md index 271aea0767..8ff04d8fc5 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ This project is **a collection of small and focused tutorials** each covering a Most of the tutorial projects are focused on the `Spring Framework` (and `Spring Security`). In additional to Spring, the following technologies are in focus: `core Java`, `Jackson`, `HttpClient`, `Guava`. +Building the project +==================== +To do the full build, do: `mvn install -Dgib.enabled=false` + Working with the code in Eclipse ================================ @@ -29,3 +33,4 @@ Any IDE can be used to work with the projects, but if you're using Eclipse, cons CI - Jenkins ================================ This tutorials project is being built **[>> HERE](https://rest-security.ci.cloudbees.com/job/tutorials-unit/)** + diff --git a/Twitter4J/pom.xml b/Twitter4J/pom.xml index ae0efb487f..0b581a5d43 100644 --- a/Twitter4J/pom.xml +++ b/Twitter4J/pom.xml @@ -1,52 +1,52 @@ - 4.0.0 - com.mabsisa - Twitter4J - jar - 1.0-SNAPSHOT - Twitter4J - http://maven.apache.org - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.mabsisa + Twitter4J + jar + 1.0-SNAPSHOT + Twitter4J + http://maven.apache.org + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - UTF-8 - UTF-8 - 1.8 - + + + + UTF-8 + UTF-8 + 1.8 + - - org.twitter4j - twitter4j-stream - 4.0.6 - + + org.twitter4j + twitter4j-stream + 4.0.6 + - + - ${project.artifactId} - - - src/main/resources - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - **/ApplicationTest.java - - - - - + ${project.artifactId} + + + src/main/resources + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + **/ApplicationTest.java + + + + + diff --git a/activejdbc/pom.xml b/activejdbc/pom.xml index f288cb7342..f6e21edeb1 100644 --- a/activejdbc/pom.xml +++ b/activejdbc/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung activejdbc @@ -7,25 +7,52 @@ jar activejdbc http://maven.apache.org - - UTF-8 - 1.4.13 - development.test,development - - + + parent-modules com.baeldung 1.0.0-SNAPSHOT + + + + junit + junit + ${junit.version} + test + + + org.javalite + activejdbc + ${activejdbc.version} + + + opensymphony + oscache + + + + + mysql + mysql-connector-java + ${mysql.connector.version} + + + org.slf4j + slf4j-simple + ${org.slf4j.version} + + + org.apache.maven.plugins maven-compiler-plugin - 3.6.0 + ${maven-compiler-plugin.version} - 1.8 - 1.8 + ${java.version} + ${java.version} UTF-8 @@ -54,14 +81,14 @@ mysql mysql-connector-java - 5.1.34 + ${mysql.connector.version} org.apache.maven.plugins maven-surefire-plugin - 2.18.1 + ${maven-surefire-plugin.version} brief true @@ -78,35 +105,7 @@ - - - junit - junit - 4.12 - test - - - org.javalite - activejdbc - ${activejdbc.version} - - - opensymphony - oscache - - - - - mysql - mysql-connector-java - 5.1.34 - - - org.slf4j - slf4j-simple - 1.7.9 - - + snapshots1 @@ -119,6 +118,7 @@ + snapshots2 @@ -131,4 +131,13 @@ - + + + UTF-8 + 1.4.13 + development.test,development + 1.7.9 + 5.1.34 + + + \ No newline at end of file diff --git a/akka-streams/pom.xml b/akka-streams/pom.xml index b1471641f7..3142e4e68a 100644 --- a/akka-streams/pom.xml +++ b/akka-streams/pom.xml @@ -1,15 +1,15 @@ - + 4.0.0 + akka-streams + akka-streams + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - akka-streams - akka-streams @@ -23,6 +23,7 @@ ${akkastreams.version} + 2.5.2 diff --git a/algorithms/README.md b/algorithms/README.md index 23209a5966..b3e11de6c5 100644 --- a/algorithms/README.md +++ b/algorithms/README.md @@ -20,3 +20,4 @@ - [A Maze Solver in Java](http://www.baeldung.com/java-solve-maze) - [Create a Sudoku Solver in Java](http://www.baeldung.com/java-sudoku) - [Displaying Money Amounts in Words](http://www.baeldung.com/java-money-into-words) +- [A Collaborative Filtering Recommendation System in Java](http://www.baeldung.com/java-collaborative-filtering-recommendations) \ No newline at end of file diff --git a/algorithms/pom.xml b/algorithms/pom.xml index 8751cf45c0..fdc8931f04 100644 --- a/algorithms/pom.xml +++ b/algorithms/pom.xml @@ -1,17 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung algorithms 0.0.1-SNAPSHOT - - 1.5.0 - 1.16.12 - 3.6.1 - 1.0.1 - - com.baeldung parent-modules @@ -33,12 +26,12 @@ io.jenetics jenetics - 3.7.0 + ${io.jenetics.version} org.jgrapht jgrapht-core - 1.0.1 + ${org.jgrapht.core.version} pl.allegro.finance @@ -48,10 +41,11 @@ org.assertj assertj-core - 3.9.0 + ${org.assertj.core.version} test + @@ -63,6 +57,7 @@ + @@ -82,4 +77,15 @@ + + + 1.5.0 + 1.16.12 + 3.6.1 + 1.0.1 + 3.7.0 + 1.0.1 + 3.9.0 + + \ No newline at end of file diff --git a/algorithms/src/main/java/com/baeldung/algorithms/RunAlgorithm.java b/algorithms/src/main/java/com/baeldung/algorithms/RunAlgorithm.java index 6ab7dbb4e5..c82883425d 100644 --- a/algorithms/src/main/java/com/baeldung/algorithms/RunAlgorithm.java +++ b/algorithms/src/main/java/com/baeldung/algorithms/RunAlgorithm.java @@ -6,6 +6,7 @@ import com.baeldung.algorithms.ga.annealing.SimulatedAnnealing; import com.baeldung.algorithms.ga.ant_colony.AntColonyOptimization; import com.baeldung.algorithms.ga.binary.SimpleGeneticAlgorithm; import com.baeldung.algorithms.slope_one.SlopeOne; +import com.baeldung.algorithms.pairsaddupnumber.FindPairs; public class RunAlgorithm { @@ -17,6 +18,7 @@ public class RunAlgorithm { System.out.println("3 - Simple Genetic Algorithm"); System.out.println("4 - Ant Colony"); System.out.println("5 - Dijkstra"); + System.out.println("6 - All pairs in an array that add up to a given sum"); int decision = in.nextInt(); switch (decision) { case 1: @@ -37,6 +39,12 @@ public class RunAlgorithm { case 5: System.out.println("Please run the DijkstraAlgorithmTest."); break; + case 6: + final FindPairs findPairs = new FindPairs(); + final int[] input = {1, 4, 3, 2, 1, 4, 4, 3, 3}; + final int sum = 6; + findPairs.execute(input, sum); + break; default: System.out.println("Unknown option"); break; diff --git a/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/DifferentPairs.java b/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/DifferentPairs.java new file mode 100644 index 0000000000..e86e1d5a22 --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/DifferentPairs.java @@ -0,0 +1,72 @@ +package com.baeldung.algorithms.pairsaddupnumber; + + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.IntStream; + +/** + * Find all different pairs of numbers in an array that add up to a given sum - Complexity O(n) + */ +public class DifferentPairs { + + /** + * Show all different pairs using traditional "for" loop + * + * @param input - number's array + * @param sum - given sum + * @return - number's array with all existing pairs. This list will contain just one pair's element because + * the other one can be calculated with SUM - element_1 = element_2 + */ + public static List findPairsWithForLoop(int[] input, int sum) { + final List allDifferentPairs = new ArrayList<>(); + // Aux. hash map + final Map pairs = new HashMap(); + for (int i : input) { + if (pairs.containsKey(i)) { + if (pairs.get(i) != null) { + // Add pair to returned list + allDifferentPairs.add(i); + } + // Mark pair as added to prevent duplicates + pairs.put(sum - i, null); + } else if (!pairs.containsValue(i)) { + // Add pair to aux. hash map + pairs.put(sum - i, i); + } + } + return allDifferentPairs; + } + + /** + * Show all different pairs using Java 8 stream API + * + * @param input - number's array + * @param sum - given sum + * @return - number's array with all existing pairs. This list will contain just one pair's element because + * the other one can be calculated with SUM - element_1 = element_2 + */ + public static List findPairsWithStreamApi(int[] input, int sum) { + final List allDifferentPairs = new ArrayList<>(); + // Aux. hash map + final Map pairs = new HashMap(); + IntStream.range(0, input.length).forEach(i -> { + if (pairs.containsKey(input[i])) { + if (pairs.get(input[i]) != null) { + // Add pair to returned list + allDifferentPairs.add(input[i]); + } + // Mark pair as added to prevent duplicates + pairs.put(sum - input[i], null); + } else if (!pairs.containsValue(input[i])) { + // Add pair to aux. hash map + pairs.put(sum - input[i], input[i]); + } + } + ); + return allDifferentPairs; + } +} + diff --git a/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/ExistingPairs.java b/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/ExistingPairs.java new file mode 100644 index 0000000000..6b10c73bcf --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/ExistingPairs.java @@ -0,0 +1,51 @@ +package com.baeldung.algorithms.pairsaddupnumber; + + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.IntStream; + +/** + * Find all existing pairs of numbers in an array that add up to a given sum - Complexity O(n^2) "Brute force" + */ +public class ExistingPairs { + + /** + * Show all existing pairs using traditional "for" loop + * + * @param input - number's array + * @param sum - given sum + * @return - number's array with all existing pairs. This list will contain just one pair's element because + * the other one can be calculated with SUM - element_1 = element_2 + */ + public static List findPairsWithForLoop(int[] input, int sum) { + final List allExistingPairs = new ArrayList<>(); + for (int i = 0; i < input.length; i++) { + for (int j = 0; j < input.length; j++) { + if (j != i && (input[i] + input[j]) == sum) { + allExistingPairs.add(input[i]); + } + } + } + return allExistingPairs; + } + + /** + * Show all existing pairs using Java 8 stream API + * + * @param input - number's array + * @param sum - given sum + * @return - number's array with all existing pairs. This list will contain just one pair's element because + * the other one can be calculated with SUM - element_1 = element_2 + */ + public static List findPairsWithStreamApi(int[] input, int sum) { + final List allExistingPairs = new ArrayList<>(); + IntStream.range(0, input.length).forEach(i -> + IntStream.range(0, input.length) + .filter(j -> i != j && input[i] + input[j] == sum) + .forEach(j -> allExistingPairs.add(input[i])) + ); + return allExistingPairs; + } +} + diff --git a/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/FindPairs.java b/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/FindPairs.java new file mode 100644 index 0000000000..4b309332ae --- /dev/null +++ b/algorithms/src/main/java/com/baeldung/algorithms/pairsaddupnumber/FindPairs.java @@ -0,0 +1,74 @@ +package com.baeldung.algorithms.pairsaddupnumber; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.IntStream; + + +public class FindPairs { + + public void execute(int[] input, int sum) { + final StringBuilder inputArray = new StringBuilder(); + inputArray.append("{"); + IntStream.range(0, input.length).forEach(i -> inputArray.append(input[i] + ", ")); + inputArray.append("}"); + System.out.println(" Given number array: " + inputArray.toString()); + System.out.println(" Given sum: " + sum); + /* Call services */ + getDifferentPairs(input, sum); + getExistingPairs(input, sum); + } + + /** + * Print all existing pairs for the given inputs: input array & sum number + */ + private static void getExistingPairs(int[] input, int sum) { + List pairs = new ArrayList<>(); + System.out.println("~ All existing pairs ~"); + + /* Traditional FOR loop */ + // Call method + pairs = ExistingPairs.findPairsWithForLoop(input, sum); + // Create a pretty printing + final StringBuilder output1 = new StringBuilder(); + pairs.forEach((pair) -> output1.append("{" + pair + ", " + (sum - pair) + "}, ")); + // Print result + System.out.println("Traditional \"for\" loop: " + output1.toString().substring(0, output1.length() - 2)); + + /* Java 8 stream API */ + // Call the method + pairs = ExistingPairs.findPairsWithStreamApi(input, sum); + // Create a pretty printing + final StringBuilder output2 = new StringBuilder(); + pairs.forEach((pair) -> output2.append("{" + pair + ", " + (sum - pair) + "}, ")); + // Print result + System.out.println("Java 8 streams API: " + output2.toString().substring(0, output2.length() - 2)); + } + + /** + * Print all different pairs for the given inputs: input array & sum number + */ + private static void getDifferentPairs(int[] input, int sum) { + List pairs = new ArrayList<>(); + System.out.println("~ All different pairs ~"); + + /* Traditional FOR loop */ + // Call method + pairs = DifferentPairs.findPairsWithForLoop(input, sum); + // Create a pretty printing + final StringBuilder output3 = new StringBuilder(); + pairs.forEach((pair) -> output3.append("{" + pair + ", " + (sum - pair) + "}, ")); + // Print result + System.out.println("Traditional \"for\" loop: " + output3.toString().substring(0, output3.length() - 2)); + + /* Java 8 stream API */ + // Call method + pairs = DifferentPairs.findPairsWithStreamApi(input, sum); + // Create a pretty printing + final StringBuilder output4 = new StringBuilder(); + pairs.forEach((pair) -> output4.append("{" + pair + ", " + (sum - pair) + "}, ")); + // Print result + System.out.println("Java 8 streams API: " + output4.toString().substring(0, output4.length() - 2)); + } +} + diff --git a/algorithms/src/test/java/com/baeldung/algorithms/pairsaddupnumber/DifferentPairsUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/pairsaddupnumber/DifferentPairsUnitTest.java new file mode 100644 index 0000000000..48fcfb871c --- /dev/null +++ b/algorithms/src/test/java/com/baeldung/algorithms/pairsaddupnumber/DifferentPairsUnitTest.java @@ -0,0 +1,39 @@ +package com.baeldung.algorithms.pairsaddupnumber; + +import org.junit.Test; + +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class DifferentPairsUnitTest { + + /* All different pairs */ + + @Test + public void whenTraditionalLoop_thenReturnAllDifferentPairs() { + /* Data */ + final int[] input = {2, 4, 3, 3, 8}; + final int sum = 6; + /* Call service */ + final List pairs = DifferentPairs.findPairsWithForLoop(input, sum); + /* Check results */ + assertThat(pairs).hasSize(2).contains(4,3).doesNotContain(8); + } + + @Test + public void whenStreamApi_thenReturnAllDifferentPairs() { + /* Data */ + final int[] input = {2, 4, 3, 3, 8}; + final int sum = 6; + /* Call service */ + final List pairs = DifferentPairs.findPairsWithStreamApi(input, sum); + /* Check results */ + assertNotNull(pairs); + assertEquals(pairs.size(),2); + assertEquals(pairs.get(0), new Integer(4)); + assertThat(pairs).hasSize(2).contains(4,3).doesNotContain(8); + } +} diff --git a/algorithms/src/test/java/com/baeldung/algorithms/pairsaddupnumber/ExistingPairsUnitTest.java b/algorithms/src/test/java/com/baeldung/algorithms/pairsaddupnumber/ExistingPairsUnitTest.java new file mode 100644 index 0000000000..ac6d6cc885 --- /dev/null +++ b/algorithms/src/test/java/com/baeldung/algorithms/pairsaddupnumber/ExistingPairsUnitTest.java @@ -0,0 +1,34 @@ +package com.baeldung.algorithms.pairsaddupnumber; + +import org.junit.Test; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; + + +public class ExistingPairsUnitTest { + + /* All existing pairs */ + + @Test + public void whenTraditionalLoop_thenReturnAllExistingPairs() { + /* Data */ + final int[] input = {2, 4, 3, 3, 8}; + final int sum = 6; + /* Call service */ + final List pairs = ExistingPairs.findPairsWithForLoop(input, sum); + /* Check results */ + assertThat(pairs).hasSize(4).contains(2,4,3,3).doesNotContain(8); + } + + @Test + public void whenStreamApi_thenReturnAllExistingPairs() { + /* Data */ + final int[] input = {2, 4, 3, 3, 8}; + final int sum = 6; + /* Call service */ + final List pairs = ExistingPairs.findPairsWithStreamApi(input, sum); + /* Check results */ + assertThat(pairs).hasSize(4).contains(2,4,3,3).doesNotContain(8); + } +} diff --git a/animal-sniffer-mvn-plugin/pom.xml b/animal-sniffer-mvn-plugin/pom.xml index 0fec5d0175..ab7b38f6e0 100644 --- a/animal-sniffer-mvn-plugin/pom.xml +++ b/animal-sniffer-mvn-plugin/pom.xml @@ -1,61 +1,56 @@ - 4.0.0 - com.baeldung - animal-sniffer-mvn-plugin - jar - 1.0-SNAPSHOT - example-animal-sniffer-mvn-plugin - http://maven.apache.org - - - 3.7.0 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung + animal-sniffer-mvn-plugin + jar + 1.0-SNAPSHOT + example-animal-sniffer-mvn-plugin + http://maven.apache.org + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - junit - junit - 3.8.1 - test - - - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.16 - - - org.codehaus.mojo.signature - java16 - 1.0 - - - - - animal-sniffer - verify - - check - - - - - + + + junit + junit + ${junit.version} + test + + + + + + + org.codehaus.mojo + animal-sniffer-maven-plugin + ${animal-sniffer-maven-plugin.version} + + + org.codehaus.mojo.signature + java16 + ${org.codehaus.mojo.signature.java16.version} + + + + + animal-sniffer + verify + + check + + + + + + + + 1.16 + 1.0 + \ No newline at end of file diff --git a/annotations/annotation-processing/pom.xml b/annotations/annotation-processing/pom.xml index b5219d57ba..39a644905d 100644 --- a/annotations/annotation-processing/pom.xml +++ b/annotations/annotation-processing/pom.xml @@ -1,8 +1,9 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + annotation-processing com.baeldung @@ -11,40 +12,17 @@ ../ - annotation-processing - - - 1.0-rc2 - 3.7.0 - - - com.google.auto.service auto-service ${auto-service.version} provided - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - - - + + 1.0-rc2 + \ No newline at end of file diff --git a/annotations/annotation-user/pom.xml b/annotations/annotation-user/pom.xml index eb827b2ea5..5a00951a18 100644 --- a/annotations/annotation-user/pom.xml +++ b/annotations/annotation-user/pom.xml @@ -1,7 +1,8 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + annotation-user annotations @@ -10,16 +11,12 @@ ../ - annotation-user - - com.baeldung annotation-processing ${project.parent.version} - \ No newline at end of file diff --git a/annotations/pom.xml b/annotations/pom.xml index 0ddc17f8a7..52508e5bfc 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -1,15 +1,15 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + annotations + pom + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - annotations - pom annotation-processing diff --git a/apache-bval/pom.xml b/apache-bval/pom.xml index 1cc0a33702..f8a3b8279d 100644 --- a/apache-bval/pom.xml +++ b/apache-bval/pom.xml @@ -1,34 +1,37 @@ - 4.0.0 - apache-bval - apache-bval - 0.0.1-SNAPSHOT + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + apache-bval + apache-bval + 0.0.1-SNAPSHOT - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - org.apache.bval - bval-jsr - ${bval.version} - - - javax.validation - validation-api - 1.1.0.Final - - - org.apache.bval - bval-extras - ${bval.version} - - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + org.apache.bval + bval-jsr + ${bval.version} + + + javax.validation + validation-api + ${javax.validation.validation-api.version} + + + org.apache.bval + bval-extras + ${bval.version} + + + + + 1.1.2 + 1.1.0.Final + - - 1.1.2 - \ No newline at end of file diff --git a/apache-cayenne/pom.xml b/apache-cayenne/pom.xml index 52631e8594..fc16db3c81 100644 --- a/apache-cayenne/pom.xml +++ b/apache-cayenne/pom.xml @@ -1,42 +1,32 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - apache-cayenne - 0.0.1-SNAPSHOT - jar + apache-cayenne + 0.0.1-SNAPSHOT + jar + apache-cayenne + Introduction to Apache Cayenne - apache-cayenne - Introduction to Apache Cayenne + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - UTF-8 - UTF-8 - 1.8 - 5.1.44 - 4.0.M5 - 4.12 - - - - - org.apache.cayenne - cayenne-server - ${cayenne.version} - - - mysql - mysql-connector-java - ${mysql.connector.version} - runtime - + + + org.apache.cayenne + cayenne-server + ${cayenne.version} + + + mysql + mysql-connector-java + ${mysql.connector.version} + runtime + junit @@ -46,14 +36,23 @@ - - + + org.apache.cayenne.plugins cayenne-modeler-maven-plugin ${cayenne.version} - - + + + + + UTF-8 + UTF-8 + 1.8 + 5.1.44 + 4.0.M5 + 4.12 + diff --git a/apache-curator/pom.xml b/apache-curator/pom.xml index 35549861c8..d867d7e74b 100644 --- a/apache-curator/pom.xml +++ b/apache-curator/pom.xml @@ -1,31 +1,18 @@ - 4.0.0 - apache-curator - 0.0.1-SNAPSHOT - jar - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + apache-curator + 0.0.1-SNAPSHOT + jar + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - 4.0.1 - 3.4.11 - 2.9.4 - - 3.6.1 - 1.7.0 - - - - - + - org.apache.curator curator-x-async @@ -37,40 +24,44 @@ - org.apache.curator curator-recipes ${curator.version} - org.apache.zookeeper zookeeper ${zookeeper.version} - com.fasterxml.jackson.core jackson-databind ${jackson-databind.version} - - org.assertj assertj-core ${assertj.version} test - com.jayway.awaitility awaitility ${avaitility.version} test - - + + + + 4.0.1 + 3.4.11 + 2.9.4 + + 3.6.1 + 1.7.0 + + + \ No newline at end of file diff --git a/apache-cxf/cxf-aegis/pom.xml b/apache-cxf/cxf-aegis/pom.xml index 6d8aa85679..338860472c 100644 --- a/apache-cxf/cxf-aegis/pom.xml +++ b/apache-cxf/cxf-aegis/pom.xml @@ -1,15 +1,14 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-aegis + com.baeldung apache-cxf 0.0.1-SNAPSHOT - - 3.1.8 - + org.apache.cxf @@ -17,4 +16,9 @@ ${cxf.version} + + + 3.1.8 + + diff --git a/apache-cxf/cxf-introduction/pom.xml b/apache-cxf/cxf-introduction/pom.xml index 1b9ba22230..3c44734733 100644 --- a/apache-cxf/cxf-introduction/pom.xml +++ b/apache-cxf/cxf-introduction/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-introduction @@ -11,32 +11,6 @@ 0.0.1-SNAPSHOT - - 3.1.8 - 2.19.1 - - - - - - org.codehaus.mojo - exec-maven-plugin - - com.baeldung.cxf.introduction.Server - - - - maven-surefire-plugin - ${surefire.version} - - - **/*LiveTest.java - - - - - - org.apache.cxf @@ -50,4 +24,21 @@ + + + + org.codehaus.mojo + exec-maven-plugin + + com.baeldung.cxf.introduction.Server + + + + + + + 3.1.8 + 2.19.1 + + diff --git a/apache-cxf/cxf-jaxrs-implementation/pom.xml b/apache-cxf/cxf-jaxrs-implementation/pom.xml index 981e0ef7aa..ce35d67948 100644 --- a/apache-cxf/cxf-jaxrs-implementation/pom.xml +++ b/apache-cxf/cxf-jaxrs-implementation/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-jaxrs-implementation @@ -11,34 +11,6 @@ 0.0.1-SNAPSHOT - - UTF-8 - 3.1.8 - 4.5.2 - 2.19.1 - - - - - - org.codehaus.mojo - exec-maven-plugin - - com.baeldung.cxf.jaxrs.implementation.RestfulServer - - - - maven-surefire-plugin - ${surefire.version} - - - **/*LiveTest.java - - - - - - org.apache.cxf @@ -62,4 +34,24 @@ + + + + + org.codehaus.mojo + exec-maven-plugin + + com.baeldung.cxf.jaxrs.implementation.RestfulServer + + + + + + + UTF-8 + 3.1.8 + 4.5.2 + 2.19.1 + + diff --git a/apache-cxf/cxf-spring/pom.xml b/apache-cxf/cxf-spring/pom.xml index 2cd700680b..a06165f4ad 100644 --- a/apache-cxf/cxf-spring/pom.xml +++ b/apache-cxf/cxf-spring/pom.xml @@ -1,8 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-spring war + com.baeldung apache-cxf @@ -52,15 +53,6 @@ false - - maven-surefire-plugin - ${surefire.version} - - - **/*LiveTest.java - - - @@ -102,24 +94,6 @@ - - - maven-surefire-plugin - ${surefire.version} - - - integration-test - - test - - - - none - - - - - @@ -130,7 +104,6 @@ 3.1.8 4.3.4.RELEASE 3.1.0 - 2.6 2.19.1 1.6.1 diff --git a/apache-cxf/pom.xml b/apache-cxf/pom.xml index 3bc3853f2b..5a864b18ef 100644 --- a/apache-cxf/pom.xml +++ b/apache-cxf/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung apache-cxf @@ -19,10 +19,6 @@ cxf-aegis - - 1.5.0 - - install @@ -35,4 +31,9 @@ + + + 1.5.0 + + diff --git a/apache-fop/pom.xml b/apache-fop/pom.xml index f7439dc244..d0c6984757 100644 --- a/apache-fop/pom.xml +++ b/apache-fop/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung apache-fop 0.1-SNAPSHOT - apache-fop @@ -61,7 +60,7 @@ org.dbdoclet herold - 8.0.4 + ${org.dbdoclet.herold.version} @@ -69,7 +68,6 @@ jtidy ${jtidy.version} - @@ -82,47 +80,12 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - - - **/*IntegrationTest.java - **/*LiveTest.java - - - - - - - json - - - - - - - - 1.1 4.3 8.0.2 r938 + 8.0.4 \ No newline at end of file diff --git a/apache-opennlp/README.md b/apache-opennlp/README.md new file mode 100644 index 0000000000..2e9fa0e384 --- /dev/null +++ b/apache-opennlp/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Intro to Apache OpenNLP](http://www.baeldung.com/apache-open-nlp) diff --git a/apache-opennlp/pom.xml b/apache-opennlp/pom.xml index be4d7e3e54..4095207aab 100644 --- a/apache-opennlp/pom.xml +++ b/apache-opennlp/pom.xml @@ -1,32 +1,40 @@ - + 4.0.0 + apache-opennlp + 1.0-SNAPSHOT + jar + com.baeldung parent-modules 1.0.0-SNAPSHOT - apache-opennlp - 1.0-SNAPSHOT - jar - + org.apache.opennlp opennlp-tools - 1.8.4 + ${org.apache.opennlp.opennlp-tools.version} org.assertj assertj-core - 3.9.0 + ${org.assertj.version} test junit junit - 4.12 + ${junit.version} test + + + 3.9.0 + 1.8.4 + + \ No newline at end of file diff --git a/apache-poi/README.md b/apache-poi/README.md index c052bc9bf6..862981991d 100644 --- a/apache-poi/README.md +++ b/apache-poi/README.md @@ -1,4 +1,4 @@ ### Relevant Articles: - [Microsoft Word Processing in Java with Apache POI](http://www.baeldung.com/java-microsoft-word-with-apache-poi) - [Working with Microsoft Excel in Java](http://www.baeldung.com/java-microsoft-excel) -- [Creating a MS PowerPoint Presentation in Java](https://github.com/eugenp/tutorials/tree/master/apache-poi) +- [Creating a MS PowerPoint Presentation in Java](http://www.baeldung.com/apache-poi-slideshow) diff --git a/apache-poi/pom.xml b/apache-poi/pom.xml index 22c0cd156a..4874fe0b3e 100644 --- a/apache-poi/pom.xml +++ b/apache-poi/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung apache-poi @@ -11,11 +11,6 @@ 1.0.0-SNAPSHOT - - 3.15 - 1.0.6 - - org.apache.poi @@ -34,4 +29,10 @@ + + + 3.15 + 1.0.6 + + diff --git a/apache-shiro/pom.xml b/apache-shiro/pom.xml index 2c5ef86837..73fdcab9d2 100644 --- a/apache-shiro/pom.xml +++ b/apache-shiro/pom.xml @@ -3,7 +3,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung apache-shiro 1.0-SNAPSHOT @@ -11,15 +10,9 @@ org.springframework.boot spring-boot-starter-parent - 1.5.2.RELEASE + ${org.springframework.boot.spring-boot-starter-parent.version} - - 1.4.0 - 1.2.17 - 1.7.25 - - org.springframework.boot @@ -57,7 +50,6 @@ ${log4j-version} runtime - @@ -74,5 +66,11 @@ - + + 1.4.0 + 1.2.17 + 1.7.25 + 1.5.2.RELEASE + + \ No newline at end of file diff --git a/apache-solrj/pom.xml b/apache-solrj/pom.xml index ea696b024b..31639c4864 100644 --- a/apache-solrj/pom.xml +++ b/apache-solrj/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung apache-solrj @@ -17,7 +17,12 @@ org.apache.solr solr-solrj - 6.4.0 + ${org.apache.solr.solr-solrj.version} + + + 6.4.0 + + \ No newline at end of file diff --git a/apache-spark/pom.xml b/apache-spark/pom.xml index 2f94987b11..3627f58147 100644 --- a/apache-spark/pom.xml +++ b/apache-spark/pom.xml @@ -1,48 +1,37 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + apache-spark + 1.0-SNAPSHOT + jar + apache-spark + http://maven.apache.org - com.baeldung - apache-spark - 1.0-SNAPSHOT - jar - - apache-spark - http://maven.apache.org - - - UTF-8 - - + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - org.apache.spark - spark-core_2.10 - 2.2.0 - - - junit - junit - 3.8.1 - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - + + + + + org.apache.spark + spark-core_2.10 + ${org.apache.spark.spark-core.version} + + + junit + junit + ${junit.version} + test + + + + + UTF-8 + 2.2.0 + + diff --git a/apache-thrift/pom.xml b/apache-thrift/pom.xml index 91e51a7092..272bbb98d7 100644 --- a/apache-thrift/pom.xml +++ b/apache-thrift/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung apache-thrift @@ -12,12 +12,6 @@ 1.0.0-SNAPSHOT - - 1.8 - 0.10.0 - 0.1.11 - - org.apache.thrift @@ -34,7 +28,7 @@ org.slf4j slf4j-simple - 1.7.12 + ${org.slf4j.slf4j-simple.version} test @@ -61,4 +55,11 @@ + + + 0.10.0 + 0.1.11 + 1.7.12 + + diff --git a/apache-tika/pom.xml b/apache-tika/pom.xml index 34013dee89..27bb851174 100644 --- a/apache-tika/pom.xml +++ b/apache-tika/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung apache-tika @@ -11,10 +11,6 @@ 1.0.0-SNAPSHOT - - 1.17 - - org.apache.tika @@ -22,4 +18,9 @@ ${tika.version} + + + 1.17 + + \ No newline at end of file diff --git a/apache-velocity/pom.xml b/apache-velocity/pom.xml index 69633ebbab..efacdff25a 100644 --- a/apache-velocity/pom.xml +++ b/apache-velocity/pom.xml @@ -1,11 +1,9 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.baeldung 0.1-SNAPSHOT apache-velocity - war apache-velocity @@ -15,15 +13,6 @@ 1.0.0-SNAPSHOT - - 1.8 - 1.2 - 2.6 - 4.5.2 - 1.7 - 2.0 - - org.apache.velocity @@ -48,6 +37,7 @@ + apache-velocity @@ -67,4 +57,13 @@ - + + + 1.2 + 2.6 + 4.5.2 + 1.7 + 2.0 + + + \ No newline at end of file diff --git a/apache-zookeeper/pom.xml b/apache-zookeeper/pom.xml index b08da534a5..7e1960ebb0 100644 --- a/apache-zookeeper/pom.xml +++ b/apache-zookeeper/pom.xml @@ -1,23 +1,28 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + apache-zookeeper + 0.0.1-SNAPSHOT + jar + + com.baeldung - apache-zookeeper - 0.0.1-SNAPSHOT - jar + parent-modules + 1.0.0-SNAPSHOT + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + + org.apache.zookeeper + zookeeper + ${org.apache.zookeeper.version} + + + + + 3.4.11 + - - - org.apache.zookeeper - zookeeper - 3.4.11 - - diff --git a/asciidoctor/pom.xml b/asciidoctor/pom.xml index a602cd11b9..6843b4da42 100644 --- a/asciidoctor/pom.xml +++ b/asciidoctor/pom.xml @@ -1,26 +1,40 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + asciidoctor + asciidoctor + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - asciidoctor - asciidoctor + + + org.asciidoctor + asciidoctorj + ${asciidoctorj.version} + + + org.asciidoctor + asciidoctorj-pdf + ${asciidoctorj-pdf.version} + + + org.asciidoctor asciidoctor-maven-plugin - 1.5.5 + ${asciidoctor-maven-plugin.version} org.asciidoctor asciidoctorj-pdf - 1.5.0-alpha.15 + ${asciidoctorj-pdf.plugin.version} @@ -46,16 +60,11 @@ - - - org.asciidoctor - asciidoctorj - 1.5.4 - - - org.asciidoctor - asciidoctorj-pdf - 1.5.0-alpha.11 - - + + 1.5.5 + 1.5.4 + 1.5.0-alpha.11 + 1.5.0-alpha.15 + + diff --git a/asm/pom.xml b/asm/pom.xml index e82209c5a9..8c3aa379db 100644 --- a/asm/pom.xml +++ b/asm/pom.xml @@ -1,41 +1,37 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.examples asm 1.0 jar + com.baeldung parent-modules 1.0.0-SNAPSHOT + org.ow2.asm asm - 5.2 + ${asm.version} org.ow2.asm asm-util - 5.2 + ${asm.version} - - - UTF-8 - 1.8 - 1.8 - - + org.apache.maven.plugins maven-jar-plugin - 2.4 + ${maven-jar-plugin.version} @@ -49,11 +45,19 @@ org.apache.maven.plugins maven-surefire-plugin - 2.9 + ${maven-surefire-plugin.version} -javaagent:"C:\asm-1.0.jar" + + + UTF-8 + 5.2 + 2.4 + 2.9 + + \ No newline at end of file diff --git a/atomix/pom.xml b/atomix/pom.xml index 80c573dd86..e41e60138d 100644 --- a/atomix/pom.xml +++ b/atomix/pom.xml @@ -15,32 +15,24 @@ io.atomix atomix-all - 1.0.0-rc9 + ${atomix-all.version} junit junit - 4.9 + ${junit.version} test log4j log4j - 1.2.17 + ${log4j.version} - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - + + 1.0.0-rc9 + 1.2.17 + diff --git a/autovalue/pom.xml b/autovalue/pom.xml index 9e6aeff866..e5b0841807 100644 --- a/autovalue/pom.xml +++ b/autovalue/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.baeldung autovalue diff --git a/aws/pom.xml b/aws/pom.xml index 34870bb736..7cd16db802 100644 --- a/aws/pom.xml +++ b/aws/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung aws @@ -13,50 +13,30 @@ 1.0.0-SNAPSHOT - - 2.5 - 1.3.0 - 1.1.0 - 2.8.0 - 1.11.290 - 4.12 - 2.8.9 - 3.8.0 - 1.11.86 - https://s3-us-west-2.amazonaws.com/dynamodb-local/release - 1.10.L001 - 0.9.4.0006L - - - com.amazonaws aws-java-sdk ${aws-java-sdk.version} - junit junit ${junit.version} test - org.mockito mockito-core ${mockito-core.version} test - org.assertj assertj-core ${assertj-core.version} test - com.amazonaws aws-lambda-java-core @@ -68,7 +48,6 @@ - com.amazonaws aws-lambda-java-events @@ -80,26 +59,22 @@ - commons-io commons-io ${commons-io.version} - com.google.code.gson gson ${gson.version} - com.amazonaws DynamoDBLocal ${dynamodblocal.version} test - org.lucee @@ -111,7 +86,6 @@ commons-codec ${commons-codec-version} - @@ -119,7 +93,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.0.0 + ${maven-shade-plugin.version} false @@ -136,7 +110,7 @@ org.apache.maven.plugins maven-dependency-plugin - 2.10 + ${maven-dependency-plugin.version} copy-dependencies @@ -163,4 +137,21 @@ + + 2.5 + 1.3.0 + 1.1.0 + 2.8.0 + 1.11.290 + 4.12 + 2.8.9 + 3.8.0 + 1.11.86 + https://s3-us-west-2.amazonaws.com/dynamodb-local/release + 1.10.L001 + 0.9.4.0006L + 3.0.0 + 2.10 + + \ No newline at end of file diff --git a/aws/src/main/java/com/baeldung/sqs/SQSApplication.java b/aws/src/main/java/com/baeldung/sqs/SQSApplication.java new file mode 100644 index 0000000000..978506a24f --- /dev/null +++ b/aws/src/main/java/com/baeldung/sqs/SQSApplication.java @@ -0,0 +1,146 @@ +package com.baeldung.sqs; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.amazonaws.auth.AWSCredentials; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.regions.Regions; +import com.amazonaws.services.sqs.AmazonSQSClientBuilder; +import com.amazonaws.services.sqs.model.CreateQueueRequest; +import com.amazonaws.services.sqs.model.DeleteMessageRequest; +import com.amazonaws.services.sqs.model.GetQueueAttributesRequest; +import com.amazonaws.services.sqs.model.GetQueueAttributesResult; +import com.amazonaws.services.sqs.model.MessageAttributeValue; +import com.amazonaws.services.sqs.model.ReceiveMessageRequest; +import com.amazonaws.services.sqs.model.SendMessageBatchRequest; +import com.amazonaws.services.sqs.model.SendMessageRequest; +import com.amazonaws.services.sqs.model.SetQueueAttributesRequest; +import com.amazonaws.services.sqs.model.SendMessageBatchRequestEntry; +import com.amazonaws.services.sqs.model.Message; +import com.amazonaws.services.sqs.AmazonSQS; + +public class SQSApplication { + + private static final AWSCredentials credentials; + + static { + // put your accesskey and secretkey here + credentials = new BasicAWSCredentials( + "", + "" + ); + } + + public static void main(String[] args) { + + // Set up the client + AmazonSQS sqs = AmazonSQSClientBuilder.standard() + .withCredentials(new AWSStaticCredentialsProvider(credentials)) + .withRegion(Regions.US_EAST_1) + .build(); + + // Create a standard queue + + CreateQueueRequest createStandardQueueRequest = new CreateQueueRequest("baeldung-queue"); + String standardQueueUrl = sqs.createQueue(createStandardQueueRequest) + .getQueueUrl(); + + System.out.println(standardQueueUrl); + + // Create a fifo queue + + Map queueAttributes = new HashMap(); + queueAttributes.put("FifoQueue", "true"); + queueAttributes.put("ContentBasedDeduplication", "true"); + + CreateQueueRequest createFifoQueueRequest = new CreateQueueRequest("baeldung-queue.fifo").withAttributes(queueAttributes); + String fifoQueueUrl = sqs.createQueue(createFifoQueueRequest) + .getQueueUrl(); + + System.out.println(fifoQueueUrl); + + // Set up a dead letter queue + + String deadLetterQueueUrl = sqs.createQueue("baeldung-dead-letter-queue") + .getQueueUrl(); + + GetQueueAttributesResult deadLetterQueueAttributes = sqs.getQueueAttributes(new GetQueueAttributesRequest(deadLetterQueueUrl).withAttributeNames("QueueArn")); + + String deadLetterQueueARN = deadLetterQueueAttributes.getAttributes() + .get("QueueArn"); + + SetQueueAttributesRequest queueAttributesRequest = new SetQueueAttributesRequest().withQueueUrl(standardQueueUrl) + .addAttributesEntry("RedrivePolicy", "{\"maxReceiveCount\":\"2\", " + "\"deadLetterTargetArn\":\"" + deadLetterQueueARN + "\"}"); + + sqs.setQueueAttributes(queueAttributesRequest); + + // Send a message to a standard queue + + Map messageAttributes = new HashMap<>(); + + messageAttributes.put("AttributeOne", new MessageAttributeValue().withStringValue("This is an attribute") + .withDataType("String")); + + SendMessageRequest sendMessageStandardQueue = new SendMessageRequest().withQueueUrl(standardQueueUrl) + .withMessageBody("A simple message.") + .withDelaySeconds(30) // Message will arrive in the queue after 30 seconds. We can use this only in standard queues + .withMessageAttributes(messageAttributes); + + sqs.sendMessage(sendMessageStandardQueue); + + // Send a message to a fifo queue + + SendMessageRequest sendMessageFifoQueue = new SendMessageRequest().withQueueUrl(fifoQueueUrl) + .withMessageBody("FIFO Queue") + .withMessageGroupId("baeldung-group-1") + .withMessageAttributes(messageAttributes); + + sqs.sendMessage(sendMessageFifoQueue); + + // Send multiple messages + + List messageEntries = new ArrayList<>(); + messageEntries.add(new SendMessageBatchRequestEntry().withId("id-1") + .withMessageBody("batch-1") + .withMessageGroupId("baeldung-group-1")); + messageEntries.add(new SendMessageBatchRequestEntry().withId("id-2") + .withMessageBody("batch-2") + .withMessageGroupId("baeldung-group-1")); + + SendMessageBatchRequest sendMessageBatchRequest = new SendMessageBatchRequest(fifoQueueUrl, messageEntries); + sqs.sendMessageBatch(sendMessageBatchRequest); + + // Read a message from a queue + + ReceiveMessageRequest receiveMessageRequest = new ReceiveMessageRequest(fifoQueueUrl).withWaitTimeSeconds(10) // Long polling; + .withMaxNumberOfMessages(1); // Max is 10 + + List sqsMessages = sqs.receiveMessage(receiveMessageRequest) + .getMessages(); + + sqsMessages.get(0) + .getAttributes(); + sqsMessages.get(0) + .getBody(); + + // Delete a message from a queue + + sqs.deleteMessage(new DeleteMessageRequest().withQueueUrl(fifoQueueUrl) + .withReceiptHandle(sqsMessages.get(0) + .getReceiptHandle())); + + // Monitoring + GetQueueAttributesRequest getQueueAttributesRequest = new GetQueueAttributesRequest(standardQueueUrl).withAttributeNames("All"); + GetQueueAttributesResult getQueueAttributesResult = sqs.getQueueAttributes(getQueueAttributesRequest); + System.out.println(String.format("The number of messages on the queue: %s", getQueueAttributesResult.getAttributes() + .get("ApproximateNumberOfMessages"))); + System.out.println(String.format("The number of messages in flight: %s", getQueueAttributesResult.getAttributes() + .get("ApproximateNumberOfMessagesNotVisible"))); + + } + +} diff --git a/axon/pom.xml b/axon/pom.xml index 97fe607cad..8d5636277a 100644 --- a/axon/pom.xml +++ b/axon/pom.xml @@ -1,14 +1,14 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + axon + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - axon diff --git a/bootique/dependency-reduced-pom.xml b/bootique/dependency-reduced-pom.xml deleted file mode 100644 index ab09cfb7b1..0000000000 --- a/bootique/dependency-reduced-pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - bootique-parent - io.bootique.parent - 0.12 - - 4.0.0 - com.baeldung.bootique - bootique - bootique - 1.0-SNAPSHOT - http://maven.apache.org - - - - maven-shade-plugin - - - - - - io.bootique - bootique-test - 0.23 - test - - - junit - junit - 4.12 - test - - - hamcrest-core - org.hamcrest - - - - - - - - io.bootique.bom - bootique-bom - 0.23 - pom - import - - - - - com.baeldung.bootique.App - - - diff --git a/bootique/pom.xml b/bootique/pom.xml index d2a013c7fd..89ef2b4b5b 100644 --- a/bootique/pom.xml +++ b/bootique/pom.xml @@ -1,66 +1,67 @@ - 4.0.0 - com.baeldung.bootique - bootique - jar - 1.0-SNAPSHOT - bootique - http://maven.apache.org + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung.bootique + bootique + jar + 1.0-SNAPSHOT + bootique + http://maven.apache.org - - com.baeldung.bootique.App - - - + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - io.bootique.bom - bootique-bom - 0.23 - pom - import - - - + + + + io.bootique.bom + bootique-bom + ${bootique-bom.version} + pom + import + + + - - - io.bootique.jersey - bootique-jersey - compile - - - io.bootique.logback - bootique-logback - compile - - - io.bootique - bootique-test - test - - - junit - junit - 4.12 - test - - + + + io.bootique.jersey + bootique-jersey + compile + + + io.bootique.logback + bootique-logback + compile + + + io.bootique + bootique-test + test + + + junit + junit + ${junit.version} + test + + - - - - org.apache.maven.plugins - maven-shade-plugin - - - + + + + org.apache.maven.plugins + maven-shade-plugin + + + + + + com.baeldung.bootique.App + 0.23 + \ No newline at end of file diff --git a/camel-api/pom.xml b/camel-api/pom.xml index 3f96e2209c..86f6713cd6 100644 --- a/camel-api/pom.xml +++ b/camel-api/pom.xml @@ -1,12 +1,12 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.example spring-boot-camel 0.0.1-SNAPSHOT Spring-Boot - Camel API - + com.baeldung parent-modules @@ -45,14 +45,6 @@ spring-boot:run - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - org.springframework.boot spring-boot-maven-plugin @@ -71,7 +63,6 @@ UTF-8 3.7.0 - 2.19.1 2.19.1 1.5.4.RELEASE diff --git a/cas/cas-secured-app/pom.xml b/cas/cas-secured-app/pom.xml index d52597412e..1a9176ff3e 100644 --- a/cas/cas-secured-app/pom.xml +++ b/cas/cas-secured-app/pom.xml @@ -1,113 +1,91 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + cas-secured-app + 0.0.1-SNAPSHOT + jar + cas-secured-app + Demo project for Spring Boot - com.baeldung - cas-secured-app - 0.0.1-SNAPSHOT - jar + + org.springframework.boot + spring-boot-starter-parent + 2.0.0.M7 + + - cas-secured-app - Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-cas + + + org.springframework.boot + spring-boot-starter-freemarker + + + org.springframework.boot + spring-boot-starter-web + - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M7 - - + + org.springframework.boot + spring-boot-devtools + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + - - UTF-8 - UTF-8 - 1.8 - + + + + org.springframework.boot + spring-boot-maven-plugin + + + - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-cas - - - org.springframework.boot - spring-boot-starter-freemarker - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 3 - true - - **/*IntegrationTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - **/JdbcTest.java - **/*LiveTest.java - - - - - - - - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + UTF-8 + UTF-8 + 1.8 + diff --git a/cas/cas-server/pom.xml b/cas/cas-server/pom.xml index dbb3804c47..30e29b155f 100644 --- a/cas/cas-server/pom.xml +++ b/cas/cas-server/pom.xml @@ -7,18 +7,45 @@ cas-server war 1.0 - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M7 - - + + + org.springframework.boot + spring-boot-starter-parent + ${org.springframework.boot.spring-boot-starter-parent.version} + + + + + + org.apereo.cas + cas-server-webapp${app.server} + ${cas.version} + war + runtime + + + org.apereo.cas + cas-server-support-json-service-registry + ${cas.version} + + + org.apereo.cas + cas-server-support-jdbc + ${cas.version} + + + org.apereo.cas + cas-server-support-jdbc-drivers + ${cas.version} + + + com.rimerosolutions.maven.plugins wrapper-maven-plugin - 0.0.4 + ${wrapper-maven-plugin.version} true MD5 @@ -36,7 +63,7 @@ org.apache.maven.plugins maven-war-plugin - 2.6 + ${maven-war-plugin.version} cas false @@ -57,50 +84,47 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + ${maven-compiler-plugin.version} - 1.8 - 1.8 + ${maven.compiler.source} + ${maven.compiler.target} cas - - - org.apereo.cas - cas-server-webapp${app.server} - ${cas.version} - war - runtime - - - org.apereo.cas - cas-server-support-json-service-registry - ${cas.version} - - - org.apereo.cas - cas-server-support-jdbc - ${cas.version} - - - org.apereo.cas - cas-server-support-jdbc-drivers - ${cas.version} - - - - - 5.1.4 - 1.5.3.RELEASE - - -tomcat - 1.8 - 1.8 - UTF-8 - + + + + false + + pgp + + + + com.github.s4u.plugins + pgpverify-maven-plugin + ${pgpverify-maven-plugin.version} + + + + check + + + + + hkp://pool.sks-keyservers.net + ${settings.localRepository}/pgpkeys-cache + test + true + false + + + + + + @@ -133,35 +157,19 @@ - - - - false - - pgp - - - - com.github.s4u.plugins - pgpverify-maven-plugin - 1.1.0 - - - - check - - - - - hkp://pool.sks-keyservers.net - ${settings.localRepository}/pgpkeys-cache - test - true - false - - - - - - - + + 5.1.4 + 1.5.3.RELEASE + + -tomcat + 1.8 + 1.8 + UTF-8 + 2.0.0.M7 + 0.0.4 + 2.6 + 3.7.0 + 1.1.0 + + + \ No newline at end of file diff --git a/cdi/pom.xml b/cdi/pom.xml index da0672afde..74ba52ea8d 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung cdi 1.0-SNAPSHOT @@ -24,7 +23,6 @@ spring-context ${spring.version} - org.aspectj aspectjweaver @@ -35,50 +33,14 @@ weld-se-core ${weld-se-core.version} - org.springframework spring-test ${spring.version} test - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - 4.3.4.RELEASE 1.8.9 diff --git a/checker-plugin/pom.xml b/checker-plugin/pom.xml index 836125ae4a..01d7a30bfd 100644 --- a/checker-plugin/pom.xml +++ b/checker-plugin/pom.xml @@ -7,54 +7,40 @@ 1.0-SNAPSHOT checker-plugin http://maven.apache.org - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - - ${org.checkerframework:jdk8:jar} - - - - - - org.checkerframework checker-qual - 2.3.1 + ${checker-qual.version} org.checkerframework checker - 2.3.1 + ${checker.version} org.checkerframework jdk8 - 2.3.1 + ${jdk8.version} org.checkerframework compiler - 2.3.1 + ${checkerframework.compiler.version} - - org.apache.maven.plugins @@ -78,10 +64,10 @@ maven-compiler-plugin - 3.6.1 + ${maven-compiler-plugin.version} - 1.8 - 1.8 + ${maven.compiler.source} + ${maven.compiler.target} @@ -116,4 +102,19 @@ + + + ${org.checkerframework:jdk8:jar} + + + 2.3.1 + 2.3.1 + 2.3.1 + 2.3.1 + 1.8 + 1.8 + + diff --git a/core-groovy/pom.xml b/core-groovy/pom.xml index 91cbe66e35..0126e96758 100644 --- a/core-groovy/pom.xml +++ b/core-groovy/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 - core-groovy 1.0-SNAPSHOT jar @@ -12,28 +12,21 @@ 1.0.0-SNAPSHOT - - - central - http://jcenter.bintray.com - - - org.codehaus.groovy groovy - 2.4.13 + ${groovy.version} org.codehaus.groovy groovy-all - 2.4.13 + ${groovy-all.version} org.codehaus.groovy groovy-sql - 2.4.13 + ${groovy-sql.version} org.junit.jupiter @@ -50,13 +43,13 @@ org.hsqldb hsqldb - 2.4.0 + ${hsqldb.version} test org.spockframework spock-core - 1.1-groovy-2.4 + ${spock-core.version} test @@ -66,7 +59,7 @@ org.codehaus.gmavenplus gmavenplus-plugin - 1.6 + ${gmavenplus-plugin.version} @@ -78,13 +71,9 @@ - - maven-surefire-plugin - ${maven-surefire-plugin.version} - maven-failsafe-plugin - 2.19.1 + ${maven-failsafe-plugin.version} org.junit.platform @@ -110,6 +99,13 @@ + + + central + http://jcenter.bintray.com + + + UTF-8 1.1.2 @@ -118,11 +114,17 @@ 1.1.2 0.15 1.5.0 - 5.0.0 1.0.0 4.12.0 4.12 + 2.4.13 + 2.4.13 + 2.4.13 + 2.4.0 + 1.1-groovy-2.4 + 1.6 + 2.19.1 diff --git a/core-java-10/pom.xml b/core-java-10/pom.xml new file mode 100644 index 0000000000..8a19893b13 --- /dev/null +++ b/core-java-10/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.baeldung + core-java-10 + jar + 0.1.0-SNAPSHOT + core-java-10 + http://maven.apache.org + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + junit + junit + ${junit.version} + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source.version} + ${maven.compiler.target.version} + + + + + + + 10 + 10 + + + diff --git a/core-java-10/src/main/java/com/baeldung/App.java b/core-java-10/src/main/java/com/baeldung/App.java new file mode 100644 index 0000000000..c56197d7fc --- /dev/null +++ b/core-java-10/src/main/java/com/baeldung/App.java @@ -0,0 +1,13 @@ +package com.baeldung; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/core-java-10/src/test/java/com/baeldung/AppTest.java b/core-java-10/src/test/java/com/baeldung/AppTest.java new file mode 100644 index 0000000000..c9f61455bd --- /dev/null +++ b/core-java-10/src/test/java/com/baeldung/AppTest.java @@ -0,0 +1,38 @@ +package com.baeldung; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/core-java-11/pom.xml b/core-java-11/pom.xml new file mode 100644 index 0000000000..5cdb5c0640 --- /dev/null +++ b/core-java-11/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.baeldung + core-java-11 + jar + 0.1.0-SNAPSHOT + core-java-11 + http://maven.apache.org + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + junit + junit + ${junit.version} + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source.version} + ${maven.compiler.target.version} + + + + + + + 11 + 11 + + + diff --git a/core-java-11/src/main/java/com/baeldung/App.java b/core-java-11/src/main/java/com/baeldung/App.java new file mode 100644 index 0000000000..c56197d7fc --- /dev/null +++ b/core-java-11/src/main/java/com/baeldung/App.java @@ -0,0 +1,13 @@ +package com.baeldung; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/core-java-11/src/test/java/com/baeldung/AppTest.java b/core-java-11/src/test/java/com/baeldung/AppTest.java new file mode 100644 index 0000000000..c9f61455bd --- /dev/null +++ b/core-java-11/src/test/java/com/baeldung/AppTest.java @@ -0,0 +1,38 @@ +package com.baeldung; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/core-java-8/pom.xml b/core-java-8/pom.xml index 924773cd02..7b49772309 100644 --- a/core-java-8/pom.xml +++ b/core-java-8/pom.xml @@ -5,7 +5,6 @@ core-java-8 0.1.0-SNAPSHOT jar - core-java-8 @@ -15,108 +14,91 @@ - com.google.guava guava ${guava.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - commons-io commons-io ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.apache.commons commons-math3 ${commons-math3.version} - - + log4j log4j - 1.2.17 + ${log4j.version} - commons-codec commons-codec ${commons-codec.version} - - + org.projectlombok lombok ${lombok.version} provided - - org.assertj assertj-core ${assertj.version} test - com.jayway.awaitility awaitility ${avaitility.version} test - - org.openjdk.jmh - jmh-core - 1.19 - - - - org.openjdk.jmh - jmh-generator-annprocess - 1.19 - - - - org.openjdk.jmh - jmh-generator-bytecode - 1.19 - - + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + com.codepoetics protonpack ${protonpack.version} - - + io.vavr vavr ${vavr.version} - one.util streamex ${streamex.version} - + @@ -194,7 +176,7 @@ true + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> org.baeldung.executable.ExecutableMavenJar @@ -234,46 +216,9 @@ - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - 21.0 3.5 @@ -286,10 +231,11 @@ 0.9.0 1.13 0.6.5 - 3.6.1 1.7.0 - + 1.19 + 1.19 + \ No newline at end of file diff --git a/core-java-8/src/main/java/com/baeldung/findanelement/Customer.java b/core-java-8/src/main/java/com/baeldung/findanelement/Customer.java new file mode 100644 index 0000000000..6807a6642b --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/findanelement/Customer.java @@ -0,0 +1,37 @@ +package com.baeldung.findanelement; + +public class Customer { + + private int id; + private String name; + + public Customer(int id, String name) { + this.id = id; + this.name = name; + } + + public int getId() { + return id; + } + + public String getName() { + return name; + } + + @Override + public int hashCode() { + return id * 20; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Customer) { + Customer otherCustomer = (Customer) obj; + if (id == otherCustomer.id) + return true; + } + return false; + } + + +} diff --git a/core-java-8/src/main/java/com/baeldung/findanelement/FindACustomerInGivenList.java b/core-java-8/src/main/java/com/baeldung/findanelement/FindACustomerInGivenList.java new file mode 100644 index 0000000000..b2d4250f6b --- /dev/null +++ b/core-java-8/src/main/java/com/baeldung/findanelement/FindACustomerInGivenList.java @@ -0,0 +1,77 @@ +package com.baeldung.findanelement; + +import java.util.Iterator; +import java.util.List; + +import org.apache.commons.collections4.IterableUtils; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; + +public class FindACustomerInGivenList { + + public Customer findUsingGivenIndex(int indexOfCustomer, List customers) { + if (indexOfCustomer >= 0 && indexOfCustomer < customers.size()) + return customers.get(indexOfCustomer); + return null; + } + + public int findUsingIndexOf(Customer customer, List customers) { + return customers.indexOf(customer); + } + + public boolean findUsingContains(Customer customer, List customers) { + return customers.contains(customer); + } + + public Customer findUsingIterator(String name, List customers) { + Iterator iterator = customers.iterator(); + while (iterator.hasNext()) { + Customer customer = iterator.next(); + if (customer.getName().equals(name)) { + return customer; + } + } + return null; + } + + public Customer findUsingEnhancedForLoop(String name, List customers) { + for (Customer customer : customers) { + if (customer.getName().equals(name)) { + return customer; + } + } + return null; + } + + public Customer findUsingStream(String name, List customers) { + return customers.stream() + .filter(customer -> customer.getName().equals(name)) + .findFirst() + .orElse(null); + } + + public Customer findUsingParallelStream(String name, List customers) { + return customers.parallelStream() + .filter(customer -> customer.getName().equals(name)) + .findAny() + .orElse(null); + } + + public Customer findUsingGuava(String name, List customers) { + return Iterables.tryFind(customers, new Predicate() { + public boolean apply(Customer customer) { + return customer.getName().equals(name); + } + }).orNull(); + } + + public Customer findUsingApacheCommon(String name, List customers) { + return IterableUtils.find(customers, new org.apache.commons.collections4.Predicate() { + public boolean evaluate(Customer customer) { + return customer.getName().equals(name); + } + }); + } + +} \ No newline at end of file diff --git a/core-java-8/src/main/java/com/baeldung/findanelement/FindElementInAList.java b/core-java-8/src/main/java/com/baeldung/findanelement/FindElementInAList.java deleted file mode 100644 index 2f402ee72b..0000000000 --- a/core-java-8/src/main/java/com/baeldung/findanelement/FindElementInAList.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.baeldung.findanelement; - -import java.util.List; -import java.util.ListIterator; -import org.apache.commons.collections4.IterableUtils; -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -public class FindElementInAList { - - public T findUsingIndexOf(T element, List list) { - int index = list.indexOf(element); - if (index >= 0) { - return element; - } - return null; - } - - public boolean findUsingListIterator(T element, List list) { - ListIterator listIterator = list.listIterator(); - while (listIterator.hasNext()) { - T elementFromList = listIterator.next(); - if (elementFromList.equals(element)) { - return true; - } - } - return false; - } - - public boolean findUsingEnhancedForLoop(T element, List list) { - for (T elementFromList : list) { - if (element.equals(elementFromList)) { - return true; - } - } - return false; - } - - public T findUsingStream(T element, List list) { - return list.stream() - .filter(integer -> integer.equals(element)) - .findFirst() - .orElse(null); - } - - public T findUsingParallelStream(T element, List list) { - return list.parallelStream() - .filter(integer -> integer.equals(element)) - .findAny() - .orElse(null); - } - - public T findUsingGuava(T element, List list) { - T foundElement = Iterables.tryFind(list, new Predicate() { - public boolean apply(T input) { - return element.equals(input); - } - }).orNull(); - return foundElement; - } - - public T findUsingApacheCommon(T element, List list) { - T foundElement = IterableUtils.find(list, new org.apache.commons.collections4.Predicate() { - public boolean evaluate(T input) { - return element.equals(input); - } - }); - return foundElement; - } - -} \ No newline at end of file diff --git a/core-java-8/src/test/java/com/baeldung/findanelement/FindACustomerInGivenListTest.java b/core-java-8/src/test/java/com/baeldung/findanelement/FindACustomerInGivenListTest.java new file mode 100644 index 0000000000..45ee6eda33 --- /dev/null +++ b/core-java-8/src/test/java/com/baeldung/findanelement/FindACustomerInGivenListTest.java @@ -0,0 +1,158 @@ +package com.baeldung.findanelement; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; + +public class FindACustomerInGivenListTest { + + private static List customers = new ArrayList<>(); + + static { + customers.add(new Customer(1, "Jack")); + customers.add(new Customer(2, "James")); + customers.add(new Customer(3, "Sam")); + } + + private static FindACustomerInGivenList findACustomerInGivenList = new FindACustomerInGivenList(); + + @Test + public void givenAnIndex_whenFoundUsingGivenIndex_thenReturnCustomer() { + Customer customer = findACustomerInGivenList.findUsingGivenIndex(0, customers); + + assertEquals(1, customer.getId()); + } + + @Test + public void givenAnIndex_whenNotFoundUsingGivenIndex_thenReturnNull() { + Customer customer = findACustomerInGivenList.findUsingGivenIndex(5, customers); + + assertNull(customer); + } + + @Test + public void givenACustomer_whenFoundUsingContains_thenReturnTrue() { + Customer james = new Customer(2, "James"); + boolean isJamesPresent = findACustomerInGivenList.findUsingContains(james, customers); + + assertEquals(true, isJamesPresent); + } + + @Test + public void givenACustomer_whenNotFoundUsingContains_thenReturnFalse() { + Customer john = new Customer(5, "John"); + boolean isJohnPresent = findACustomerInGivenList.findUsingContains(john, customers); + + assertEquals(false, isJohnPresent); + } + + @Test + public void givenACustomer_whenFoundUsingIndexOf_thenReturnItsIndex() { + Customer james = new Customer(2, "James"); + int indexOfJames = findACustomerInGivenList.findUsingIndexOf(james, customers); + + assertEquals(1, indexOfJames); + } + + @Test + public void givenACustomer_whenNotFoundUsingIndexOf_thenReturnMinus1() { + Customer john = new Customer(5, "John"); + int indexOfJohn = findACustomerInGivenList.findUsingIndexOf(john, customers); + + assertEquals(-1, indexOfJohn); + } + + @Test + public void givenName_whenCustomerWithNameFoundUsingIterator_thenReturnCustomer() { + Customer james = findACustomerInGivenList.findUsingIterator("James", customers); + + assertEquals("James", james.getName()); + assertEquals(2, james.getId()); + } + + @Test + public void givenName_whenCustomerWithNameNotFoundUsingIterator_thenReturnNull() { + Customer john = findACustomerInGivenList.findUsingIterator("John", customers); + + assertNull(john); + } + + @Test + public void givenName_whenCustomerWithNameFoundUsingEnhancedFor_thenReturnCustomer() { + Customer james = findACustomerInGivenList.findUsingEnhancedForLoop("James", customers); + + assertEquals("James", james.getName()); + assertEquals(2, james.getId()); + } + + @Test + public void givenName_whenCustomerWithNameNotFoundUsingEnhancedFor_thenReturnNull() { + Customer john = findACustomerInGivenList.findUsingEnhancedForLoop("John", customers); + + assertNull(john); + } + + @Test + public void givenName_whenCustomerWithNameFoundUsingStream_thenReturnCustomer() { + Customer james = findACustomerInGivenList.findUsingStream("James", customers); + + assertEquals("James", james.getName()); + assertEquals(2, james.getId()); + } + + @Test + public void givenName_whenCustomerWithNameNotFoundUsingStream_thenReturnNull() { + Customer john = findACustomerInGivenList.findUsingStream("John", customers); + + assertNull(john); + } + + @Test + public void givenName_whenCustomerWithNameFoundUsingParallelStream_thenReturnCustomer() { + Customer james = findACustomerInGivenList.findUsingParallelStream("James", customers); + + assertEquals("James", james.getName()); + assertEquals(2, james.getId()); + } + + @Test + public void givenName_whenCustomerWithNameNotFoundUsingParallelStream_thenReturnNull() { + Customer john = findACustomerInGivenList.findUsingParallelStream("John", customers); + + assertNull(john); + } + + @Test + public void givenName_whenCustomerWithNameFoundUsingApacheCommon_thenReturnCustomer() { + Customer james = findACustomerInGivenList.findUsingApacheCommon("James", customers); + + assertEquals("James", james.getName()); + assertEquals(2, james.getId()); + } + + @Test + public void givenName_whenCustomerWithNameNotFoundUsingApacheCommon_thenReturnNull() { + Customer john = findACustomerInGivenList.findUsingApacheCommon("John", customers); + + assertNull(john); + } + + @Test + public void givenName_whenCustomerWithNameFoundUsingGuava_thenReturnCustomer() { + Customer james = findACustomerInGivenList.findUsingGuava("James", customers); + + assertEquals("James", james.getName()); + assertEquals(2, james.getId()); + } + + @Test + public void givenName_whenCustomerWithNameNotFoundUsingGuava_thenReturnNull() { + Customer john = findACustomerInGivenList.findUsingGuava("John", customers); + + assertNull(john); + } + +} diff --git a/core-java-8/src/test/java/com/baeldung/findanelement/FindAnElementTest.java b/core-java-8/src/test/java/com/baeldung/findanelement/FindAnElementTest.java deleted file mode 100644 index 1fef2d98e7..0000000000 --- a/core-java-8/src/test/java/com/baeldung/findanelement/FindAnElementTest.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.baeldung.findanelement; - -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import java.util.ArrayList; -import java.util.List; -import org.junit.Test; - -public class FindAnElementTest { - - private static List scores = new ArrayList<>(); - static { - scores.add(0); - scores.add(1); - scores.add(2); - } - - private static FindElementInAList findElementInAList = new FindElementInAList<>(); - - @Test - public void givenElement_whenFoundUsingIndexOf_thenReturnElement() { - Integer scoreToFind = 1; - Integer score = findElementInAList.findUsingIndexOf(scoreToFind, scores); - assertTrue(score.equals(scoreToFind)); - } - - @Test - public void givenElement_whenNotFoundUsingListIterator_thenReturnNull() { - boolean found = findElementInAList.findUsingListIterator(5, scores); - assertTrue(!found); - } - - @Test - public void givenElement_whenFoundListIterator_thenReturnElement() { - Integer scoreToFind = 1; - boolean found = findElementInAList.findUsingListIterator(scoreToFind, scores); - assertTrue(found); - } - - @Test - public void givenElement_whenNotFoundUsingIndexOf_thenReturnNull() { - Integer score = findElementInAList.findUsingIndexOf(5, scores); - assertNull(score); - } - - @Test - public void givenElement_whenFoundUsingEnhancedForLoop_thenReturnElement() { - Integer scoreToFind = 1; - boolean found = findElementInAList.findUsingEnhancedForLoop(scoreToFind, scores); - assertTrue(found); - } - - @Test - public void givenElement_whenNotFoundUsingEnhancedForLoop_thenReturnNull() { - Integer scoreToFind = 5; - boolean found = findElementInAList.findUsingEnhancedForLoop(scoreToFind, scores); - assertTrue(!found); - } - - @Test - public void givenElement_whenFoundUsingStream_thenReturnElement() { - Integer scoreToFind = 1; - Integer score = findElementInAList.findUsingStream(scoreToFind, scores); - assertTrue(score.equals(scoreToFind)); - } - - @Test - public void givenElement_whenNotFoundUsingStream_thenReturnNull() { - Integer scoreToFind = 5; - Integer score = findElementInAList.findUsingStream(scoreToFind, scores); - assertNull(score); - } - - @Test - public void givenElement_whenFoundUsingParallelStream_thenReturnElement() { - Integer scoreToFind = 1; - Integer score = findElementInAList.findUsingParallelStream(scoreToFind, scores); - assertTrue(score.equals(scoreToFind)); - } - - @Test - public void givenElement_whenNotFoundUsingParallelStream_thenReturnNull() { - Integer scoreToFind = 5; - Integer score = findElementInAList.findUsingParallelStream(scoreToFind, scores); - assertNull(score); - } - - @Test - public void givenElement_whenFoundUsingGuava_thenReturnElement() { - Integer scoreToFind = 1; - Integer score = findElementInAList.findUsingGuava(scoreToFind, scores); - assertTrue(score.equals(scoreToFind)); - } - - @Test - public void givenElement_whenNotFoundUsingGuava_thenReturnNull() { - Integer scoreToFind = 5; - Integer score = findElementInAList.findUsingGuava(scoreToFind, scores); - assertNull(score); - } - - @Test - public void givenElement_whenFoundUsingApacheCommons_thenReturnElement() { - Integer scoreToFind = 1; - Integer score = findElementInAList.findUsingApacheCommon(scoreToFind, scores); - assertTrue(score.equals(scoreToFind)); - } - - @Test - public void givenElement_whenNotFoundUsingApacheCommons_thenReturnNull() { - Integer scoreToFind = 5; - Integer score = findElementInAList.findUsingApacheCommon(scoreToFind, scores); - assertNull(score); - } - -} \ No newline at end of file diff --git a/core-java-9/README.md b/core-java-9/README.md index 152b9f8841..d0758d585b 100644 --- a/core-java-9/README.md +++ b/core-java-9/README.md @@ -22,3 +22,4 @@ - [Java 9 Variable Handles Demistyfied](http://www.baeldung.com/java-variable-handles) - [Exploring the New HTTP Client in Java 9](http://www.baeldung.com/java-9-http-client) - [Method Handles in Java](http://www.baeldung.com/java-method-handles) +- [Introduction to Chronicle Queue](http://www.baeldung.com/java-chronicle-queue) diff --git a/core-java-9/pom.xml b/core-java-9/pom.xml index 40e29af35f..1f92ee71f8 100644 --- a/core-java-9/pom.xml +++ b/core-java-9/pom.xml @@ -1,25 +1,18 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung core-java-9 0.2-SNAPSHOT - core-java-9 - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - apache.snapshots - http://repository.apache.org/snapshots/ - - - org.slf4j slf4j-api @@ -30,21 +23,18 @@ logback-classic ${ch.qos.logback.version} - org.hamcrest hamcrest-library ${org.hamcrest.version} test - junit junit ${junit.version} test - org.mockito mockito-core @@ -57,39 +47,34 @@ ${awaitility.version} test - - core-java-9 - - org.apache.maven.plugins maven-compiler-plugin ${maven-compiler-plugin.version} - 1.9 - 1.9 + ${maven.compiler.source} + ${maven.compiler.target} - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - + + + apache.snapshots + http://repository.apache.org/snapshots/ + + + UTF-8 - + 1.7.21 1.2.1 @@ -102,6 +87,8 @@ 4.12 1.10.19 1.7.0 + 1.9 + 1.9 diff --git a/core-java-collections/README.md b/core-java-collections/README.md new file mode 100644 index 0000000000..e0cea14b20 --- /dev/null +++ b/core-java-collections/README.md @@ -0,0 +1,30 @@ +========= + +## Core Java Collections Cookbooks and Examples + +### Relevant Articles: +- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list) +- [Converting between an Array and a List in Java](http://www.baeldung.com/convert-array-to-list-and-list-to-array) +- [Converting between an Array and a Set in Java](http://www.baeldung.com/convert-array-to-set-and-set-to-array) +- [Converting between a List and a Set in Java](http://www.baeldung.com/convert-list-to-set-and-set-to-list) +- [Convert a Map to an Array, List or Set in Java](http://www.baeldung.com/convert-map-values-to-array-list-set) +- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist) +- [Random List Element](http://www.baeldung.com/java-random-list-element) +- [Java - Combine Multiple Collections](http://www.baeldung.com/java-combine-multiple-collections) +- [Guide to WeakHashMap in Java](http://www.baeldung.com/java-weakhashmap) +- [Guide to the Guava BiMap](http://www.baeldung.com/guava-bimap) +- [The Java HashMap Under the Hood](http://www.baeldung.com/java-hashmap) +- [A Guide to LinkedHashMap in Java](http://www.baeldung.com/java-linked-hashmap) +- [A Guide to TreeMap in Java](http://www.baeldung.com/java-treemap) +- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list) +- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list) +- [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections) +- [HashSet and TreeSet Comparison](http://www.baeldung.com/java-hashset-vs-treeset) +- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map) +- [Collect a Java Stream to an Immutable Collection](http://www.baeldung.com/java-stream-immutable-collection) +- [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) +- [Introduction to the Java ArrayDeque](http://www.baeldung.com/java-array-deque) +- [A Guide to HashSet in Java](http://www.baeldung.com/java-hashset) +- [A Guide to TreeSet in Java](http://www.baeldung.com/java-tree-set) +- [Java TreeMap vs HashMap](http://www.baeldung.com/java-treemap-vs-hashmap) +- [How to TDD a List Implementation in Java](http://www.baeldung.com/java-test-driven-list) diff --git a/core-java-collections/pom.xml b/core-java-collections/pom.xml new file mode 100644 index 0000000000..4973b8e837 --- /dev/null +++ b/core-java-collections/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.baeldung + core-java-collections + 0.1.0-SNAPSHOT + jar + core-java-collections + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + junit + junit + ${junit.version} + test + + + net.sourceforge.collections + collections-generic + ${collections-generic.version} + + + com.google.guava + guava + ${guava.version} + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + + + com.jayway.awaitility + awaitility + ${avaitility.version} + test + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + 22.0 + 3.5 + 4.1 + 4.01 + 1.7.0 + 3.6.1 + + diff --git a/core-java/src/main/java/com/baeldung/java/list/CustomList.java b/core-java-collections/src/main/java/com/baeldung/java/list/CustomList.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/list/CustomList.java rename to core-java-collections/src/main/java/com/baeldung/java/list/CustomList.java diff --git a/core-java/src/main/java/com/baeldung/java/map/MyKey.java b/core-java-collections/src/main/java/com/baeldung/java/map/MyKey.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/map/MyKey.java rename to core-java-collections/src/main/java/com/baeldung/java/map/MyKey.java diff --git a/core-java/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java b/core-java-collections/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java similarity index 100% rename from core-java/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java rename to core-java-collections/src/main/java/com/baeldung/java/map/MyLinkedHashMap.java diff --git a/core-java/src/main/java/com/baeldung/list/listoflist/Pen.java b/core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Pen.java similarity index 100% rename from core-java/src/main/java/com/baeldung/list/listoflist/Pen.java rename to core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Pen.java diff --git a/core-java/src/main/java/com/baeldung/list/listoflist/Pencil.java b/core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Pencil.java similarity index 100% rename from core-java/src/main/java/com/baeldung/list/listoflist/Pencil.java rename to core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Pencil.java diff --git a/core-java/src/main/java/com/baeldung/list/listoflist/Rubber.java b/core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Rubber.java similarity index 100% rename from core-java/src/main/java/com/baeldung/list/listoflist/Rubber.java rename to core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Rubber.java diff --git a/core-java/src/main/java/com/baeldung/list/listoflist/Stationery.java b/core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Stationery.java similarity index 100% rename from core-java/src/main/java/com/baeldung/list/listoflist/Stationery.java rename to core-java-collections/src/main/java/com/baeldung/list/list/listoflist/Stationery.java diff --git a/core-java/src/main/java/com/baeldung/map/iteration/MapIteration.java b/core-java-collections/src/main/java/com/baeldung/map/iteration/MapIteration.java similarity index 100% rename from core-java/src/main/java/com/baeldung/map/iteration/MapIteration.java rename to core-java-collections/src/main/java/com/baeldung/map/iteration/MapIteration.java diff --git a/core-java/src/test/java/com/baeldung/array/converter/ArrayConvertToListTest.java b/core-java-collections/src/test/java/com/baeldung/array/converter/ArrayConvertToListTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/array/converter/ArrayConvertToListTest.java rename to core-java-collections/src/test/java/com/baeldung/array/converter/ArrayConvertToListTest.java diff --git a/core-java/src/test/java/com/baeldung/arraydeque/ArrayDequeTest.java b/core-java-collections/src/test/java/com/baeldung/arraydeque/ArrayDequeTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/arraydeque/ArrayDequeTest.java rename to core-java-collections/src/test/java/com/baeldung/arraydeque/ArrayDequeTest.java diff --git a/core-java/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java b/core-java-collections/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java similarity index 100% rename from core-java/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java rename to core-java-collections/src/test/java/com/baeldung/collection/WhenComparingTreeMapVsHashMap.java diff --git a/core-java/src/test/java/com/baeldung/collection/WhenUsingHashSet.java b/core-java-collections/src/test/java/com/baeldung/collection/WhenUsingHashSet.java similarity index 100% rename from core-java/src/test/java/com/baeldung/collection/WhenUsingHashSet.java rename to core-java-collections/src/test/java/com/baeldung/collection/WhenUsingHashSet.java diff --git a/core-java/src/test/java/com/baeldung/collection/WhenUsingTreeSet.java b/core-java-collections/src/test/java/com/baeldung/collection/WhenUsingTreeSet.java similarity index 100% rename from core-java/src/test/java/com/baeldung/collection/WhenUsingTreeSet.java rename to core-java-collections/src/test/java/com/baeldung/collection/WhenUsingTreeSet.java diff --git a/core-java/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java b/core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java rename to core-java-collections/src/test/java/com/baeldung/java/collections/ConcurrentModificationExceptionUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/java/list/CustomListUnitTest.java b/core-java-collections/src/test/java/com/baeldung/java/list/CustomListUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/list/CustomListUnitTest.java rename to core-java-collections/src/test/java/com/baeldung/java/list/CustomListUnitTest.java diff --git a/core-java-collections/src/test/java/com/baeldung/java/map/MapMultipleValuesTest.java b/core-java-collections/src/test/java/com/baeldung/java/map/MapMultipleValuesTest.java new file mode 100644 index 0000000000..88f97f6c19 --- /dev/null +++ b/core-java-collections/src/test/java/com/baeldung/java/map/MapMultipleValuesTest.java @@ -0,0 +1,124 @@ +package com.baeldung.java.map; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.MultiMapUtils; +import org.apache.commons.collections4.MultiValuedMap; +import org.apache.commons.collections4.map.MultiValueMap; +import org.apache.commons.collections4.multimap.ArrayListValuedHashMap; +import org.apache.commons.collections4.multimap.HashSetValuedHashMap; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Multimap; +import com.google.common.collect.TreeMultimap; + +public class MapMultipleValuesTest { + private static final Logger LOG = LoggerFactory.getLogger(MapMultipleValuesTest.class); + + @Test + public void givenHashMap_whenPuttingTwice_thenReturningFirstValue() { + Map map = new HashMap<>(); + assertThat(map.put("key1", "value1")).isEqualTo(null); + assertThat(map.put("key1", "value2")).isEqualTo("value1"); + assertThat(map.get("key1")).isEqualTo("value2"); + } + + @Test + public void givenCollectionAsValue_whenPuttingTwice_thenReturningCollection() { + Map> map = new HashMap<>(); + List list = new ArrayList<>(); + map.put("key1", list); + map.get("key1").add("value1"); + map.get("key1").add("value2"); + assertThat(map.get("key1").get(0)).isEqualTo("value1"); + assertThat(map.get("key1").get(1)).isEqualTo("value2"); + } + + @Test + public void givenCollectionAsValueAndJava8_whenPuttingTwice_thenReturningCollection() { + Map> map = new HashMap<>(); + map.computeIfAbsent("key1", k -> new ArrayList<>()).add("value1"); + map.computeIfAbsent("key1", k -> new ArrayList<>()).add("value2"); + assertThat(map.get("key1").get(0)).isEqualTo("value1"); + assertThat(map.get("key1").get(1)).isEqualTo("value2"); + } + + @Test + public void givenMultiValueMap_whenPuttingTwice_thenReturningValues() { + MultiMap map = new MultiValueMap<>(); + map.put("key1", "value1"); + map.put("key1", "value2"); + assertThat((Collection) map.get("key1")) + .contains("value1", "value2"); + } + + @Test + public void givenArrayListValuedHashMap_whenPuttingDoubleValues_thenReturningAllValues() { + MultiValuedMap map = new ArrayListValuedHashMap<>(); + map.put("key1", "value1"); + map.put("key1", "value2"); + map.put("key1", "value2"); + assertThat((Collection) map.get("key1")) + .containsExactly("value1", "value2", "value2"); + } + + @Test + public void givenHashSetValuedHashMap_whenPuttingTwiceTheSame_thenReturningOneValue() { + MultiValuedMap map = new HashSetValuedHashMap<>(); + map.put("key1", "value1"); + map.put("key1", "value1"); + assertThat((Collection) map.get("key1")) + .containsExactly("value1"); + } + + @Test(expected = UnsupportedOperationException.class) + public void givenUnmodifiableMultiValuedMap_whenInserting_thenThrowingException() { + MultiValuedMap map = new ArrayListValuedHashMap<>(); + map.put("key1", "value1"); + map.put("key1", "value2"); + MultiValuedMap immutableMap = + MultiMapUtils.unmodifiableMultiValuedMap(map); + immutableMap.put("key1", "value3"); + } + + @Test + public void givenArrayListMultiMap_whenInserting_thenCorrectOutput() { + Multimap map = ArrayListMultimap.create(); + map.put("key1", "value2"); + map.put("key1", "value1"); + assertThat((Collection) map.get("key1")) + .containsExactly("value2", "value1"); + } + + @Test + public void givenLinkedHashMultiMap_whenInserting_thenReturningValuesInInsertionOrder() { + Multimap map = LinkedHashMultimap.create(); + map.put("key1", "value3"); + map.put("key1", "value1"); + map.put("key1", "value2"); + assertThat((Collection) map.get("key1")) + .containsExactly("value3", "value1", "value2"); + } + + @Test + public void givenTreeMultimap_whenInserting_thenReturningValuesInNaturalOrder() { + Multimap map = TreeMultimap.create(); + map.put("key1", "value3"); + map.put("key1", "value1"); + map.put("key1", "value2"); + assertThat((Collection) map.get("key1")) + .containsExactly("value1", "value2", "value3"); + } + +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/java/map/MapUnitTest.java b/core-java-collections/src/test/java/com/baeldung/java/map/MapUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/java/map/MapUnitTest.java rename to core-java-collections/src/test/java/com/baeldung/java/map/MapUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java b/core-java-collections/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java rename to core-java-collections/src/test/java/com/baeldung/list/flattennestedlist/FlattenNestedListUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java b/core-java-collections/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java rename to core-java-collections/src/test/java/com/baeldung/list/listoflist/ListOfListsUnitTest.java diff --git a/core-java/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java b/core-java-collections/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java similarity index 100% rename from core-java/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java rename to core-java-collections/src/test/java/com/baeldung/weakhashmap/WeakHashMapUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/ArrayListUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/collections/ArrayListUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/ArrayListUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/collections/ArrayListUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsConcatenateUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/collections/CollectionsJoinAndSplitJUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/CoreJavaCollectionsUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/collections/CoreJavaCollectionsUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/CoreJavaCollectionsUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/collections/CoreJavaCollectionsUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/JavaCollectionCleanupUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/collections/JavaCollectionCleanupUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/JavaCollectionCleanupUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/collections/JavaCollectionCleanupUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/JavaCollectionConversionUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/collections/JavaCollectionConversionUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/JavaCollectionConversionUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/collections/JavaCollectionConversionUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/collections/JoinSplitCollectionsUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/collections/README.md b/core-java-collections/src/test/java/org/baeldung/java/collections/README.md similarity index 100% rename from core-java/src/test/java/org/baeldung/java/collections/README.md rename to core-java-collections/src/test/java/org/baeldung/java/collections/README.md diff --git a/core-java/src/test/java/org/baeldung/java/lists/ListAssertJUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/lists/ListAssertJUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/lists/ListAssertJUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/lists/ListAssertJUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/lists/ListJUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/lists/ListJUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/lists/ListJUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/lists/ListJUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/lists/ListTestNgUnitTest.java b/core-java-collections/src/test/java/org/baeldung/java/lists/ListTestNgUnitTest.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/lists/ListTestNgUnitTest.java rename to core-java-collections/src/test/java/org/baeldung/java/lists/ListTestNgUnitTest.java diff --git a/core-java/src/test/java/org/baeldung/java/lists/ListToSTring.java b/core-java-collections/src/test/java/org/baeldung/java/lists/ListToSTring.java similarity index 100% rename from core-java/src/test/java/org/baeldung/java/lists/ListToSTring.java rename to core-java-collections/src/test/java/org/baeldung/java/lists/ListToSTring.java diff --git a/core-java/src/test/java/org/baeldung/java/lists/README.md b/core-java-collections/src/test/java/org/baeldung/java/lists/README.md similarity index 100% rename from core-java/src/test/java/org/baeldung/java/lists/README.md rename to core-java-collections/src/test/java/org/baeldung/java/lists/README.md diff --git a/core-java-concurrency/pom.xml b/core-java-concurrency/pom.xml index bf858047e9..829c511143 100644 --- a/core-java-concurrency/pom.xml +++ b/core-java-concurrency/pom.xml @@ -5,7 +5,6 @@ core-java-concurrency 0.1.0-SNAPSHOT jar - core-java-concurrency @@ -15,57 +14,46 @@ - com.google.guava guava ${guava.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - commons-io commons-io ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.apache.commons commons-math3 ${commons-math3.version} - - - - org.assertj assertj-core ${assertj.version} test - com.jayway.awaitility awaitility ${avaitility.version} test - - + core-java-concurrency @@ -92,7 +80,6 @@ - org.apache.maven.plugins maven-jar-plugin @@ -141,7 +128,7 @@ true + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> org.baeldung.executable.ExecutableMavenJar @@ -181,46 +168,9 @@ - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - 21.0 3.5 @@ -228,10 +178,9 @@ 2.5 4.1 4.01 - 3.6.1 1.7.0 - + diff --git a/core-java-io/README.md b/core-java-io/README.md index 52485acfd5..84720e7b77 100644 --- a/core-java-io/README.md +++ b/core-java-io/README.md @@ -22,4 +22,6 @@ - [A Guide To NIO2 FileVisitor](http://www.baeldung.com/java-nio2-file-visitor) - [A Guide To NIO2 File Attribute APIs](http://www.baeldung.com/java-nio2-file-attribute) - [Introduction to the Java NIO2 File API](http://www.baeldung.com/java-nio-2-file-api) -- [Zipping and Unzipping in Java](http://www.baeldung.com/java-compress-and-uncompress) \ No newline at end of file +- [Zipping and Unzipping in Java](http://www.baeldung.com/java-compress-and-uncompress) +- [Java NIO2 Path API](http://www.baeldung.com/java-nio-2-path) +- [A Guide to WatchService in Java NIO2](http://www.baeldung.com/java-nio2-watchservice) diff --git a/core-java-io/pom.xml b/core-java-io/pom.xml index 1c2a9b1249..9fcca6c590 100644 --- a/core-java-io/pom.xml +++ b/core-java-io/pom.xml @@ -1,18 +1,19 @@ - + 4.0.0 com.baeldung core-java-io 0.1.0-SNAPSHOT jar - core-java-io - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - + net.sourceforge.collections @@ -24,69 +25,58 @@ guava ${guava.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - commons-io commons-io ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.apache.commons commons-math3 ${commons-math3.version} - org.decimal4j decimal4j ${decimal4j.version} - org.bouncycastle bcprov-jdk15on ${bouncycastle.version} - org.unix4j unix4j-command ${unix4j.version} - com.googlecode.grep4j grep4j ${grep4j.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - log4j log4j - 1.2.17 + ${log4j.version} org.slf4j @@ -116,23 +106,19 @@ ${lombok.version} provided - - org.hamcrest hamcrest-all - 1.3 + ${hamcrest-all.version} test - junit junit ${junit.version} test - org.hamcrest hamcrest-core @@ -145,14 +131,12 @@ ${org.hamcrest.version} test - org.assertj assertj-core ${assertj.version} test - org.mockito mockito-core @@ -165,25 +149,21 @@ ${avaitility.version} test - commons-codec commons-codec ${commons-codec.version} - org.javamoney moneta - 1.1 + ${moneta.version} - org.owasp.esapi esapi - 2.1.0.1 + ${esapi.version} - com.sun.messaging.mq fscontext @@ -207,17 +187,17 @@ org.openjdk.jmh jmh-core - 1.19 + ${jmh-core.version} org.openjdk.jmh jmh-generator-annprocess - 1.19 + ${jmh-generator-annprocess.version} org.hsqldb hsqldb - 2.4.0 + ${hsqldb.version} runtime @@ -230,19 +210,7 @@ true - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - org.apache.maven.plugins maven-surefire-plugin @@ -256,7 +224,6 @@ true - org.springframework.boot spring-boot-maven-plugin @@ -272,11 +239,10 @@ - org.codehaus.mojo exec-maven-plugin - 1.6.0 + ${exec-maven-plugin.version} java com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed @@ -284,25 +250,21 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - org.apache.maven.plugins maven-javadoc-plugin - 3.0.0-M1 + ${maven-javadoc-plugin.version} - 1.8 - 1.8 + ${maven.compiler.source} + ${maven.compiler.target} - - - @@ -352,7 +314,7 @@ java -classpath - + org.openjdk.jmh.Main .* @@ -401,5 +363,12 @@ 3.7.0 2.19.1 + 1.8 + 1.8 + 3.0.0-M1 + 2.4.0 + 2.1.0.1 + 1.19 + \ No newline at end of file diff --git a/core-java-sun/pom.xml b/core-java-sun/pom.xml index 2b654fa3a5..aaffac5e38 100644 --- a/core-java-sun/pom.xml +++ b/core-java-sun/pom.xml @@ -4,15 +4,15 @@ core-java-sun 0.1.0-SNAPSHOT jar - core-java-sun - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - + net.sourceforge.collections @@ -24,69 +24,58 @@ guava ${guava.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - commons-io commons-io ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.apache.commons commons-math3 ${commons-math3.version} - org.decimal4j decimal4j ${decimal4j.version} - org.bouncycastle bcprov-jdk15on ${bouncycastle.version} - org.unix4j unix4j-command ${unix4j.version} - com.googlecode.grep4j grep4j ${grep4j.version} - - com.fasterxml.jackson.core jackson-databind ${jackson.version} - log4j log4j - 1.2.17 + ${log4j.version} org.slf4j @@ -116,23 +105,19 @@ ${lombok.version} provided - - org.hamcrest hamcrest-all - 1.3 + ${hamcrest-all.version} test - junit junit ${junit.version} test - org.hamcrest hamcrest-core @@ -145,14 +130,12 @@ ${org.hamcrest.version} test - org.assertj assertj-core ${assertj.version} test - org.mockito mockito-core @@ -165,25 +148,21 @@ ${avaitility.version} test - commons-codec commons-codec ${commons-codec.version} - org.javamoney moneta - 1.1 + ${moneta.version} - org.owasp.esapi esapi - 2.1.0.1 + ${esapi.version} - com.sun.messaging.mq fscontext @@ -207,22 +186,22 @@ org.openjdk.jmh jmh-core - 1.19 + ${jmh-core.version} org.openjdk.jmh jmh-generator-annprocess - 1.19 + ${jmh-generator.version} org.springframework spring-web - 4.3.4.RELEASE + ${spring-web.version} com.sun tools - 1.8.0 + ${sun-tools.version} system ${java.home}/../lib/tools.jar @@ -236,33 +215,7 @@ true - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - - - - - org.apache.maven.plugins maven-dependency-plugin @@ -279,7 +232,6 @@ - org.apache.maven.plugins maven-jar-plugin @@ -293,7 +245,6 @@ - org.apache.maven.plugins maven-assembly-plugin @@ -317,7 +268,6 @@ - org.apache.maven.plugins maven-shade-plugin @@ -337,7 +287,6 @@ - com.jolira onejar-maven-plugin @@ -354,7 +303,6 @@ - org.springframework.boot spring-boot-maven-plugin @@ -370,11 +318,10 @@ - org.codehaus.mojo exec-maven-plugin - 1.6.0 + ${exec-maven-plugin.version} java com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed @@ -382,15 +329,12 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - - - @@ -440,7 +384,7 @@ java -classpath - + org.openjdk.jmh.Main .* @@ -481,7 +425,6 @@ 1.3 - 4.12 2.8.9 3.6.1 1.7.0 @@ -489,5 +432,8 @@ 3.7.0 2.19.1 + 1.8.0 + 4.3.4.RELEASE + \ No newline at end of file diff --git a/core-java/README.md b/core-java/README.md index b9d87be785..c1fef3e4f2 100644 --- a/core-java/README.md +++ b/core-java/README.md @@ -3,21 +3,14 @@ ## Core Java Cookbooks and Examples ### Relevant Articles: -- [Immutable ArrayList in Java](http://www.baeldung.com/java-immutable-list) -- [Converting between an Array and a List in Java](http://www.baeldung.com/convert-array-to-list-and-list-to-array) -- [Converting between an Array and a Set in Java](http://www.baeldung.com/convert-array-to-set-and-set-to-array) -- [Converting between a List and a Set in Java](http://www.baeldung.com/convert-list-to-set-and-set-to-list) -- [Convert a Map to an Array, List or Set in Java](http://www.baeldung.com/convert-map-values-to-array-list-set) - [Java – Random Long, Float, Integer and Double](http://www.baeldung.com/java-generate-random-long-float-integer-double) - [Java – Generate Random String](http://www.baeldung.com/java-random-string) - [Java Timer](http://www.baeldung.com/java-timer-and-timertask) - [How to Run a Shell Command in Java](http://www.baeldung.com/run-shell-command-in-java) - [MD5 Hashing in Java](http://www.baeldung.com/java-md5) -- [Guide to the Java ArrayList](http://www.baeldung.com/java-arraylist) - [Guide to Java Reflection](http://www.baeldung.com/java-reflection) - [A Guide to Java Sockets](http://www.baeldung.com/a-guide-to-java-sockets) - [Convert char to String in Java](http://www.baeldung.com/java-convert-char-to-string) -- [Random List Element](http://www.baeldung.com/java-random-list-element) - [Convert String to int or Integer in Java](http://www.baeldung.com/java-convert-string-to-int-or-integer) - [Java – Try with Resources](http://www.baeldung.com/java-try-with-resources) - [Guide to the Fork/Join Framework in Java](http://www.baeldung.com/java-fork-join) @@ -29,7 +22,6 @@ - [Sorting in Java](http://www.baeldung.com/java-sorting) - [Getting Started with Java Properties](http://www.baeldung.com/java-properties) - [Grep in Java](http://www.baeldung.com/grep-in-java) -- [Java - Combine Multiple Collections](http://www.baeldung.com/java-combine-multiple-collections) - [Simulated Annealing for Travelling Salesman Problem](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) - [Slope One Algorithm: Collaborative Filtering Recommendation Systems](http://www.baeldung.com/java-collaborative-filtering-recommendations) - [Pattern Search with Grep in Java](http://www.baeldung.com/grep-in-java) @@ -38,28 +30,19 @@ - [The Traveling Salesman Problem in Java](http://www.baeldung.com/java-simulated-annealing-for-traveling-salesman) - [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) - [How to Design a Genetic Algorithm in Java](http://www.baeldung.com/java-genetic-algorithm) -- [Guide to WeakHashMap in Java](http://www.baeldung.com/java-weakhashmap) - [Spring Security – Cache Control Headers](http://www.baeldung.com/spring-security-cache-control-headers) - [Basic Introduction to JMX](http://www.baeldung.com/java-management-extensions) - [AWS Lambda With Java](http://www.baeldung.com/java-aws-lambda) - [Introduction to Nashorn](http://www.baeldung.com/java-nashorn) -- [Guide to the Guava BiMap](http://www.baeldung.com/guava-bimap) - [Chained Exceptions in Java](http://www.baeldung.com/java-chained-exceptions) -- [The Java HashMap Under the Hood](http://www.baeldung.com/java-hashmap) -- [A Guide to LinkedHashMap in Java](http://www.baeldung.com/java-linked-hashmap) -- [A Guide to TreeMap in Java](http://www.baeldung.com/java-treemap) - [A Quick JUnit vs TestNG Comparison](http://www.baeldung.com/junit-vs-testng) - [Java Primitive Conversions](http://www.baeldung.com/java-primitive-conversions) - [Java Money and the Currency API](http://www.baeldung.com/java-money-and-currency) -- [Removing all nulls from a List in Java](http://www.baeldung.com/java-remove-nulls-from-list) -- [Removing all duplicates from a List in Java](http://www.baeldung.com/java-remove-duplicates-from-list) - [Using Math.pow in Java](http://www.baeldung.com/java-math-pow) - [Converting Strings to Enums in Java](http://www.baeldung.com/java-string-to-enum) -- [Flattening Nested Collections in Java](http://www.baeldung.com/java-flatten-nested-collections) - [Quick Guide to the Java StringTokenizer](http://www.baeldung.com/java-stringtokenizer) - [JVM Log Forging](http://www.baeldung.com/jvm-log-forging) - [Guide to sun.misc.Unsafe](http://www.baeldung.com/java-unsafe) -- [HashSet and TreeSet Comparison](http://www.baeldung.com/java-hashset-vs-treeset) - [How to Perform a Simple HTTP Request in Java](http://www.baeldung.com/java-http-request) - [Call Methods at Runtime Using Java Reflection](http://www.baeldung.com/java-method-reflection) - [Guide to UUID in JAVA](http://www.baeldung.com/guide-to-uuid-in-java) @@ -71,7 +54,6 @@ - [How to Find all Getters Returning Null](http://www.baeldung.com/java-getters-returning-null) - [Changing the Order in a Sum Operation Can Produce Different Results?](http://www.baeldung.com/java-floating-point-sum-order) - [How to Get a Name of a Method Being Executed?](http://www.baeldung.com/java-name-of-executing-method) -- [Iterate over a Map in Java](http://www.baeldung.com/java-iterate-map) - [Dynamic Proxies in Java](http://www.baeldung.com/java-dynamic-proxies) - [How to Copy an Array in Java](http://www.baeldung.com/java-array-copy) - [Introduction to JDBC](http://www.baeldung.com/java-jdbc) @@ -87,10 +69,8 @@ - [Guide to UUID in Java](http://www.baeldung.com/java-uuid) - [Guide to Escaping Characters in Java RegExps](http://www.baeldung.com/java-regexp-escape-char) - [Guide to hashCode() in Java](http://www.baeldung.com/java-hashcode) -- [Collect a Java Stream to an Immutable Collection](http://www.baeldung.com/java-stream-immutable-collection) - [Difference between URL and URI](http://www.baeldung.com/java-url-vs-uri) - [Broadcasting and Multicasting in Java](http://www.baeldung.com/java-broadcast-multicast) -- [Converting a List to String in Java](http://www.baeldung.com/java-list-to-string) - [CharSequence vs. String in Java](http://www.baeldung.com/java-char-sequence-string) - [Period and Duration in Java](http://www.baeldung.com/java-period-duration) - [Guide to the Diamond Operator in Java](http://www.baeldung.com/java-diamond-operator) @@ -108,7 +88,6 @@ - [Quick Example - Comparator vs Comparable in Java](http://www.baeldung.com/java-comparator-comparable) - [Quick Guide to Java Stack](http://www.baeldung.com/java-stack) - [The Java continue and break Keywords](http://www.baeldung.com/java-continue-and-break) -- [Introduction to the Java ArrayDeque](http://www.baeldung.com/java-array-deque) - [Guide to java.util.Formatter](http://www.baeldung.com/java-string-formatter) - [Batch Processing in JDBC](http://www.baeldung.com/jdbc-batch-processing) - [Check if a Java Array Contains a Value](http://www.baeldung.com/java-array-contains-value) @@ -122,20 +101,16 @@ - [Nested Classes in Java](http://www.baeldung.com/java-nested-classes) - [A Guide to Java Loops](http://www.baeldung.com/java-loops) - [Varargs in Java](http://www.baeldung.com/java-varargs) -- [A Guide to HashSet in Java](http://www.baeldung.com/java-hashset) - [A Guide to Inner Interfaces in Java](http://www.baeldung.com/java-inner-interfaces) - [Polymorphism in Java](http://www.baeldung.com/java-polymorphism) - [Recursion In Java](http://www.baeldung.com/java-recursion) - [A Guide to the finalize Method in Java](http://www.baeldung.com/java-finalize) - [Compiling Java *.class Files with javac](http://www.baeldung.com/javac) - [Method Overloading and Overriding in Java](http://www.baeldung.com/java-method-overload-override) -- [A Guide to TreeSet in Java](http://www.baeldung.com/java-tree-set) - [Guide to ThreadLocalRandom in Java](http://www.baeldung.com/java-thread-local-random) -- [Java TreeMap vs HashMap](http://www.baeldung.com/java-treemap-vs-hashmap) - [A Guide to Iterator in Java](http://www.baeldung.com/java-iterator) - [The Trie Data Structure in Java](http://www.baeldung.com/trie-java) - [Introduction to Javadoc](http://www.baeldung.com/javadoc) -- [How to TDD a List Implementation](http://jira.baeldung.com/browse/BAEL-1537) - [How to Make a Deep Copy of an Object in Java](http://www.baeldung.com/java-deep-copy) - [Check if a String is a Palindrome](http://www.baeldung.com/java-palindrome) - [Comparing Strings in Java](http://www.baeldung.com/java-compare-strings) @@ -146,9 +121,10 @@ - [Object Type Casting in Java](http://www.baeldung.com/java-type-casting) - [A Practical Guide to DecimalFormat](http://www.baeldung.com/java-decimalformat) - [How to Detect the OS Using Java](http://www.baeldung.com/java-detect-os) -- [How to TDD a List Implementation in Java](http://www.baeldung.com/java-test-driven-list) - [ASCII Art in Java](http://www.baeldung.com/ascii-art-in-java) - [An Advanced Tagging Implementation with JPA](http://www.baeldung.com/jpa-tagging-advanced) - [Handling Daylight Savings Time in Java](http://www.baeldung.com/java-daylight-savings) - [Inheritance and Composition (Is-a vs Has-a relationship) in Java](http://www.baeldung.com/java-inheritance-composition) - +- [Finding Max/Min of a List or Collection](http://www.baeldung.com/java-collection-min-max) +- [The "final" Keyword in Java](http://www.baeldung.com/java-final) +- [Service Locator Pattern](http://www.baeldung.com/java-service-locator-pattern) diff --git a/core-java/externalizable.txt b/core-java/externalizable.txt new file mode 100644 index 0000000000..ddd3e143a8 Binary files /dev/null and b/core-java/externalizable.txt differ diff --git a/core-java/pom.xml b/core-java/pom.xml index b7760dc250..74a4fa1f75 100644 --- a/core-java/pom.xml +++ b/core-java/pom.xml @@ -5,78 +5,58 @@ core-java 0.1.0-SNAPSHOT jar - core-java - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - + - - net.sourceforge.collections - collections-generic - ${collections-generic.version} - com.google.guava guava ${guava.version} - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - - commons-io commons-io ${commons-io.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - org.apache.commons commons-math3 ${commons-math3.version} - org.decimal4j decimal4j ${decimal4j.version} - org.bouncycastle bcprov-jdk15on ${bouncycastle.version} - org.unix4j unix4j-command ${unix4j.version} - com.googlecode.grep4j grep4j ${grep4j.version} - - com.fasterxml.jackson.core jackson-databind @@ -87,12 +67,11 @@ gson ${gson.version} - log4j log4j - 1.2.17 + ${log4j.version} org.slf4j @@ -122,23 +101,19 @@ ${lombok.version} provided - - org.hamcrest hamcrest-all - 1.3 + ${hamcrest-all.version} test - junit junit ${junit.version} test - org.hamcrest hamcrest-core @@ -151,45 +126,33 @@ ${org.hamcrest.version} test - org.assertj assertj-core ${assertj.version} test - org.mockito mockito-core ${mockito.version} test - - com.jayway.awaitility - awaitility - ${avaitility.version} - test - - commons-codec commons-codec ${commons-codec.version} - org.javamoney moneta - 1.1 + ${javamoney.moneta.version} - org.owasp.esapi esapi - 2.1.0.1 + ${esapi.version} - com.sun.messaging.mq fscontext @@ -213,27 +176,32 @@ org.openjdk.jmh jmh-core - 1.19 + ${jmh-core.version} org.openjdk.jmh jmh-generator-annprocess - 1.19 + ${jmh-generator-annprocess.version} - - org.springframework - spring-web - 4.3.4.RELEASE - - - org.springframework.boot - spring-boot-starter - 1.5.8.RELEASE - - com.h2database - h2 - 1.4.197 + org.springframework + spring-web + ${springframework.spring-web.version} + + + org.springframework.boot + spring-boot-starter + ${springframework.boot.spring-boot-starter.version} + + + com.h2database + h2 + ${h2database.version} + + + javax.mail + mail + ${javax.mail.version} @@ -247,17 +215,6 @@ - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - org.apache.maven.plugins maven-surefire-plugin @@ -384,7 +341,7 @@ org.codehaus.mojo exec-maven-plugin - 1.6.0 + ${exec-maven-plugin.version} java com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed @@ -397,20 +354,17 @@ - + org.apache.maven.plugins maven-javadoc-plugin - 3.0.0-M1 + ${maven-javadoc-plugin.version} 1.8 - 1.8 + 1.8 - - - @@ -450,7 +404,7 @@ run-benchmarks - + none exec @@ -481,6 +435,7 @@ 1.7.21 1.1.7 + 1.2.17 22.0 @@ -490,8 +445,6 @@ 3.6.1 1.0.3 2.5 - 4.1 - 4.01 0.4 1.8.7 1.16.12 @@ -499,16 +452,26 @@ 1.13 0.6.5 0.9.0 - + 1.3 - 4.12 2.8.9 3.6.1 - 1.7.0 3.7.0 2.19.1 + 4.3.4.RELEASE + 1.5.8.RELEASE + 1.1 + 1.3 + 1.4.197 + 2.1.0.1 + 1.19 + 1.19 + 3.0.0-M1 + 1.6.0 + 1.5.0-b01 + \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/assertion/Assertion.java b/core-java/src/main/java/com/baeldung/assertion/Assertion.java new file mode 100644 index 0000000000..795728757c --- /dev/null +++ b/core-java/src/main/java/com/baeldung/assertion/Assertion.java @@ -0,0 +1,26 @@ +package com.baeldung.assertion; + +/** + * Simple demonstration of using Java assert keyword. + */ +public class Assertion { + + public static void main(String[] args) { + Assertion assertion = new Assertion(); + assertion.setup(); + } + + public void setup() { + Object conn = getConnection(); + assert conn != null : "Connection is null"; + + // continue with other setup ... + } + + // Simulate failure to get a connection; using Object + // to avoid dependencies on JDBC or some other heavy + // 3rd party library + public Object getConnection() { + return null; + } +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/service/locator/Cache.java b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/Cache.java new file mode 100644 index 0000000000..847d8a71e0 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/Cache.java @@ -0,0 +1,39 @@ +package com.baeldung.designpatterns.service.locator; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Gebruiker on 4/20/2018. + */ +public class Cache { + private List services; + + public Cache(){ + services = new ArrayList(); + } + + public MessagingService getService(String serviceName){ + + for (MessagingService service : services) { + if(service.getServiceName().equalsIgnoreCase(serviceName)){ + System.out.println("Returning cached " + serviceName + " object"); + return service; + } + } + return null; + } + + public void addService(MessagingService newService){ + boolean exists = false; + + for (MessagingService service : services) { + if(service.getServiceName().equalsIgnoreCase(newService.getServiceName())){ + exists = true; + } + } + if(!exists){ + services.add(newService); + } + } +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/service/locator/EmailService.java b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/EmailService.java new file mode 100644 index 0000000000..7ac7e05790 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/EmailService.java @@ -0,0 +1,15 @@ +package com.baeldung.designpatterns.service.locator; + +/** + * Created by Gebruiker on 4/20/2018. + */ +public class EmailService implements MessagingService { + + public String getMessageBody() { + return "email message"; + } + + public String getServiceName() { + return "EmailService"; + } +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/service/locator/InitialContext.java b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/InitialContext.java new file mode 100644 index 0000000000..d5234b39cd --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/InitialContext.java @@ -0,0 +1,17 @@ +package com.baeldung.designpatterns.service.locator; + +/** + * Created by Gebruiker on 4/20/2018. + */ +public class InitialContext { + + public Object lookup(String serviceName) { + + if (serviceName.equalsIgnoreCase("EmailService")) { + return new EmailService(); + } else if (serviceName.equalsIgnoreCase("SMSService")) { + return new SMSService(); + } + return null; + } +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/service/locator/Main.java b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/Main.java new file mode 100644 index 0000000000..787f7e708c --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/Main.java @@ -0,0 +1,22 @@ +package com.baeldung.designpatterns.service.locator; + +/** + * Created by Gebruiker on 4/20/2018. + */ +public class Main { + + public static void main(String[] args) { + + MessagingService service = ServiceLocator.getService("EmailService"); + String email = service.getMessageBody(); + System.out.println(email); + + service = ServiceLocator.getService("SMSService"); + String sms = service.getMessageBody(); + System.out.println(sms); + + service = ServiceLocator.getService("EmailService"); + String newEmail = service.getMessageBody(); + System.out.println(newEmail); + } +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/service/locator/MessagingService.java b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/MessagingService.java new file mode 100644 index 0000000000..5853dfd7f7 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/MessagingService.java @@ -0,0 +1,8 @@ +package com.baeldung.designpatterns.service.locator; + +public interface MessagingService { + + String getMessageBody(); + + String getServiceName(); +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/service/locator/SMSService.java b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/SMSService.java new file mode 100644 index 0000000000..87255ef658 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/SMSService.java @@ -0,0 +1,15 @@ +package com.baeldung.designpatterns.service.locator; + +/** + * Created by Gebruiker on 4/20/2018. + */ +public class SMSService implements MessagingService { + + public String getMessageBody() { + return "sms message"; + } + + public String getServiceName() { + return "SMSService"; + } +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/service/locator/ServiceLocator.java b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/ServiceLocator.java new file mode 100644 index 0000000000..7e1a2349a1 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/service/locator/ServiceLocator.java @@ -0,0 +1,27 @@ +package com.baeldung.designpatterns.service.locator; + +/** + * Created by Gebruiker on 4/20/2018. + */ +public class ServiceLocator { + + private static Cache cache; + + static { + cache = new Cache(); + } + + public static MessagingService getService(String serviceName){ + + MessagingService service = cache.getService(serviceName); + + if(service != null){ + return service; + } + + InitialContext context = new InitialContext(); + MessagingService service1 = (MessagingService)context.lookup(serviceName); + cache.addService(service1); + return service1; + } +} diff --git a/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/DclSingleton.java b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/DclSingleton.java new file mode 100644 index 0000000000..e10f111a56 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/DclSingleton.java @@ -0,0 +1,38 @@ +package com.baeldung.designpatterns.singleton.synchronization; + +/** + * Double-checked locking design pattern applied to a singleton. + * + * @author Donato Rimenti + * + */ +public class DclSingleton { + + /** + * Current instance of the singleton. + */ + private static volatile DclSingleton instance; + + /** + * Private constructor to avoid instantiation. + */ + private DclSingleton() { + } + + /** + * Returns the current instance of the singleton. + * + * @return the current instance of the singleton + */ + public static DclSingleton getInstance() { + if (instance == null) { + synchronized (DclSingleton.class) { + if (instance == null) { + instance = new DclSingleton(); + } + } + } + return instance; + } + +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/DraconianSingleton.java b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/DraconianSingleton.java new file mode 100644 index 0000000000..1d01c49b13 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/DraconianSingleton.java @@ -0,0 +1,34 @@ +package com.baeldung.designpatterns.singleton.synchronization; + +/** + * Draconian singleton. The method to get the instance is synchronized. + * + * @author Donato Rimenti + * + */ +public class DraconianSingleton { + + /** + * Current instance of the singleton. + */ + private static DraconianSingleton instance; + + /** + * Private constructor to avoid instantiation. + */ + private DraconianSingleton() { + } + + /** + * Returns the current instance of the singleton. + * + * @return the current instance of the singleton + */ + public static synchronized DraconianSingleton getInstance() { + if (instance == null) { + instance = new DraconianSingleton(); + } + return instance; + } + +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/EarlyInitSingleton.java b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/EarlyInitSingleton.java new file mode 100644 index 0000000000..18c4b7cdce --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/EarlyInitSingleton.java @@ -0,0 +1,31 @@ +package com.baeldung.designpatterns.singleton.synchronization; + +/** + * Singleton with early initialization. Inlines the singleton instance + * initialization. + * + * @author Donato Rimenti + * + */ +public class EarlyInitSingleton { + + /** + * Current instance of the singleton. + */ + private static final EarlyInitSingleton INSTANCE = new EarlyInitSingleton(); + + /** + * Private constructor to avoid instantiation. + */ + private EarlyInitSingleton() { + } + + /** + * Returns the current instance of the singleton. + * + * @return the current instance of the singleton + */ + public static EarlyInitSingleton getInstance() { + return INSTANCE; + } +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/EnumSingleton.java b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/EnumSingleton.java new file mode 100644 index 0000000000..b7ff7f50b1 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/EnumSingleton.java @@ -0,0 +1,16 @@ +package com.baeldung.designpatterns.singleton.synchronization; + +/** + * Enum singleton pattern. Uses an enum to hold a reference to the singleton + * instance. + * + * @author Donato Rimenti + * + */ +public enum EnumSingleton { + + /** + * Current instance of the singleton. + */ + INSTANCE; +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/InitOnDemandSingleton.java b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/InitOnDemandSingleton.java new file mode 100644 index 0000000000..d76bada786 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/designpatterns/singleton/synchronization/InitOnDemandSingleton.java @@ -0,0 +1,41 @@ +package com.baeldung.designpatterns.singleton.synchronization; + +/** + * Initialization on demand singleton pattern. Uses a nested static class to + * hold a reference to the singleton instance. + * + * @author Donato Rimenti + * + */ +public class InitOnDemandSingleton { + + /** + * Holder for a singleton instance. + * + * @author Donato Rimenti + * + */ + private static class InstanceHolder { + + /** + * Current instance of the singleton. + */ + private static final InitOnDemandSingleton INSTANCE = new InitOnDemandSingleton(); + } + + /** + * Private constructor to avoid instantiation. + */ + private InitOnDemandSingleton() { + } + + /** + * Returns the current instance of the singleton. + * + * @return the current instance of the singleton + */ + public static InitOnDemandSingleton getInstance() { + return InstanceHolder.INSTANCE; + } + +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/keystore/JavaKeyStore.java b/core-java/src/main/java/com/baeldung/keystore/JavaKeyStore.java new file mode 100644 index 0000000000..29cba37d43 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/keystore/JavaKeyStore.java @@ -0,0 +1,92 @@ +package com.baeldung.keystore; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.UnrecoverableEntryException; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.util.Enumeration; + +/** + * Created by adi on 3/7/18. + */ +public class JavaKeyStore { + + private KeyStore keyStore; + + private String keyStoreName; + private String keyStoreType; + private String keyStorePassword; + + JavaKeyStore(String keyStoreType, String keyStorePassword, String keyStoreName) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { + this.keyStoreName = keyStoreName; + this.keyStoreType = keyStoreType; + this.keyStorePassword = keyStorePassword; + } + + void createEmptyKeyStore() throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { + if(keyStoreType ==null || keyStoreType.isEmpty()){ + keyStoreType = KeyStore.getDefaultType(); + } + keyStore = KeyStore.getInstance(keyStoreType); + //load + char[] pwdArray = keyStorePassword.toCharArray(); + keyStore.load(null, pwdArray); + + // Save the keyStore + FileOutputStream fos = new FileOutputStream(keyStoreName); + keyStore.store(fos, pwdArray); + fos.close(); + } + + void loadKeyStore() throws IOException, KeyStoreException, CertificateException, NoSuchAlgorithmException { + char[] pwdArray = keyStorePassword.toCharArray(); + keyStore.load(new FileInputStream(keyStoreName), pwdArray); + } + + void setEntry(String alias, KeyStore.SecretKeyEntry secretKeyEntry, KeyStore.ProtectionParameter protectionParameter) throws KeyStoreException { + keyStore.setEntry(alias, secretKeyEntry, protectionParameter); + } + + KeyStore.Entry getEntry(String alias) throws UnrecoverableEntryException, NoSuchAlgorithmException, KeyStoreException { + KeyStore.ProtectionParameter protParam = new KeyStore.PasswordProtection(keyStorePassword.toCharArray()); + return keyStore.getEntry(alias, protParam); + } + + void setKeyEntry(String alias, PrivateKey privateKey, String keyPassword, Certificate[] certificateChain) throws KeyStoreException { + keyStore.setKeyEntry(alias, privateKey, keyPassword.toCharArray(), certificateChain); + } + + void setCertificateEntry(String alias, Certificate certificate) throws KeyStoreException { + keyStore.setCertificateEntry(alias, certificate); + } + + Certificate getCertificate(String alias) throws KeyStoreException { + return keyStore.getCertificate(alias); + } + + void deleteEntry(String alias) throws KeyStoreException { + keyStore.deleteEntry(alias); + } + + void deleteKeyStore() throws KeyStoreException, IOException { + Enumeration aliases = keyStore.aliases(); + while (aliases.hasMoreElements()) { + String alias = aliases.nextElement(); + keyStore.deleteEntry(alias); + } + keyStore = null; + Files.delete(Paths.get(keyStoreName)); + } + + KeyStore getKeyStore() { + return this.keyStore; + } +} diff --git a/core-java/src/main/java/com/baeldung/mail/EmailService.java b/core-java/src/main/java/com/baeldung/mail/EmailService.java new file mode 100644 index 0000000000..e775b9f708 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/mail/EmailService.java @@ -0,0 +1,80 @@ +package com.baeldung.mail; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Properties; +import javax.mail.*; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeBodyPart; +import javax.mail.internet.MimeMessage; +import javax.mail.internet.MimeMultipart; + +public class EmailService { + + private String host = ""; + private int port = 0; + private String username = ""; + private String password = ""; + + + public EmailService(String host, int port, String username, String password) { + + this.host = host; + this.port = port; + this.username = username; + this.password = password; + + sendMail(); + } + + private void sendMail() { + + Properties prop = new Properties(); + prop.put("mail.smtp.auth", true); + prop.put("mail.smtp.starttls.enable", "true"); + prop.put("mail.smtp.host", host); + prop.put("mail.smtp.port", port); + prop.put("mail.smtp.ssl.trust", host); + + Session session = Session.getInstance(prop, new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(username, password); + } + }); + + try { + + Message message = new MimeMessage(session); + message.setFrom(new InternetAddress("from@gmail.com")); + message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("to@gmail.com")); + message.setSubject("Mail Subject"); + + String msg = "This is my first email using JavaMailer"; + + MimeBodyPart mimeBodyPart = new MimeBodyPart(); + mimeBodyPart.setContent(msg, "text/html"); + + MimeBodyPart attachmentBodyPart = new MimeBodyPart(); + attachmentBodyPart.attachFile(new File("pom.xml")); + + Multipart multipart = new MimeMultipart(); + multipart.addBodyPart(mimeBodyPart); + multipart.addBodyPart(attachmentBodyPart); + + message.setContent(multipart); + + Transport.send(message); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main(String ... args) { + new EmailService("smtp.mailtrap.io", 25, "87ba3d9555fae8", "91cb4379af43ed"); + } + +} diff --git a/core-java/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java b/core-java/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java new file mode 100644 index 0000000000..0e1746fc38 --- /dev/null +++ b/core-java/src/main/java/com/baeldung/parameterpassing/NonPrimitives.java @@ -0,0 +1,27 @@ +package com.baeldung.parameterpassing; + +public class NonPrimitives { + public static void main(String[] args) { + FooClass a = new FooClass(1); + FooClass b = new FooClass(1); + + System.out.printf("Before Modification: a = %d and b = %d ", a.num, b.num); + modify(a, b); + System.out.printf("\nAfter Modification: a = %d and b = %d ", a.num, b.num); + } + + public static void modify(FooClass a1, FooClass b1) { + a1.num++; + + b1 = new FooClass(1); + b1.num++; + } +} + +class FooClass { + public int num; + + public FooClass(int num) { + this.num = num; + } +} \ No newline at end of file diff --git a/core-java/src/main/java/com/baeldung/parameterpassing/Primitives.java b/core-java/src/main/java/com/baeldung/parameterpassing/Primitives.java new file mode 100644 index 0000000000..f63229d7de --- /dev/null +++ b/core-java/src/main/java/com/baeldung/parameterpassing/Primitives.java @@ -0,0 +1,17 @@ +package com.baeldung.parameterpassing; + +public class Primitives { + public static void main(String[] args) { + int x = 1; + int y = 2; + + System.out.printf("Before Modification: x = %d and y = %d ", x, y); + modify(x, y); + System.out.printf("\nAfter Modification: x = %d and y = %d ", x, y); + } + + public static void modify(int x1, int y1) { + x1 = 5; + y1 = 10; + } +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/designpatterns/singleton/synchronization/SingletonSynchronizationUnitTest.java b/core-java/src/test/java/com/baeldung/designpatterns/singleton/synchronization/SingletonSynchronizationUnitTest.java new file mode 100644 index 0000000000..2c1a3fe093 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/designpatterns/singleton/synchronization/SingletonSynchronizationUnitTest.java @@ -0,0 +1,119 @@ +package com.baeldung.designpatterns.singleton.synchronization; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +import org.junit.Assert; +import org.junit.Test; + +/** + * Unit tests for the singleton synchronization package with the same name. + * + * @author Donato Rimenti + * + */ +public class SingletonSynchronizationUnitTest { + + /** + * Size of the thread pools used. + */ + private static final int POOL_SIZE = 1_000; + + /** + * Number of tasks to submit. + */ + private static final int TASKS_TO_SUBMIT = 1_000_000; + + /** + * Tests the thread-safety of {@link DraconianSingleton}. + */ + @Test + public void givenDraconianSingleton_whenMultithreadInstancesEquals_thenTrue() { + ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE); + Set resultSet = Collections.synchronizedSet(new HashSet()); + + // Submits the instantiation tasks. + for (int i = 0; i < TASKS_TO_SUBMIT; i++) { + executor.submit(() -> resultSet.add(DraconianSingleton.getInstance())); + } + + // Since the instance of the object we inserted into the set is always + // the same, the size should be one. + Assert.assertEquals(1, resultSet.size()); + } + + /** + * Tests the thread-safety of {@link DclSingleton}. + */ + @Test + public void givenDclSingleton_whenMultithreadInstancesEquals_thenTrue() { + ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE); + Set resultSet = Collections.synchronizedSet(new HashSet()); + + // Submits the instantiation tasks. + for (int i = 0; i < TASKS_TO_SUBMIT; i++) { + executor.submit(() -> resultSet.add(DclSingleton.getInstance())); + } + + // Since the instance of the object we inserted into the set is always + // the same, the size should be one. + Assert.assertEquals(1, resultSet.size()); + } + + /** + * Tests the thread-safety of {@link EarlyInitSingleton}. + */ + @Test + public void givenEarlyInitSingleton_whenMultithreadInstancesEquals_thenTrue() { + ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE); + Set resultSet = Collections.synchronizedSet(new HashSet()); + + // Submits the instantiation tasks. + for (int i = 0; i < TASKS_TO_SUBMIT; i++) { + executor.submit(() -> resultSet.add(EarlyInitSingleton.getInstance())); + } + + // Since the instance of the object we inserted into the set is always + // the same, the size should be one. + Assert.assertEquals(1, resultSet.size()); + } + + /** + * Tests the thread-safety of {@link InitOnDemandSingleton}. + */ + @Test + public void givenInitOnDemandSingleton_whenMultithreadInstancesEquals_thenTrue() { + ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE); + Set resultSet = Collections.synchronizedSet(new HashSet()); + + // Submits the instantiation tasks. + for (int i = 0; i < TASKS_TO_SUBMIT; i++) { + executor.submit(() -> resultSet.add(InitOnDemandSingleton.getInstance())); + } + + // Since the instance of the object we inserted into the set is always + // the same, the size should be one. + Assert.assertEquals(1, resultSet.size()); + } + + /** + * Tests the thread-safety of {@link EnumSingleton}. + */ + @Test + public void givenEnumSingleton_whenMultithreadInstancesEquals_thenTrue() { + ExecutorService executor = Executors.newFixedThreadPool(POOL_SIZE); + Set resultSet = Collections.synchronizedSet(new HashSet()); + + // Submits the instantiation tasks. + for (int i = 0; i < TASKS_TO_SUBMIT; i++) { + executor.submit(() -> resultSet.add(EnumSingleton.INSTANCE)); + } + + // Since the instance of the object we inserted into the set is always + // the same, the size should be one. + Assert.assertEquals(1, resultSet.size()); + } +} diff --git a/core-java/src/test/java/com/baeldung/java/clock/ClockUnitTest.java b/core-java/src/test/java/com/baeldung/java/clock/ClockUnitTest.java new file mode 100644 index 0000000000..e83ba7afc8 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/java/clock/ClockUnitTest.java @@ -0,0 +1,159 @@ +package com.baeldung.java.clock; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.time.Clock; +import java.time.Duration; +import java.time.ZoneId; +import java.time.ZoneOffset; + +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ClockUnitTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(ClockUnitTest.class); + + @Test + public void givenClock_withSytemUTC_retrievesInstant() { + + Clock clockUTC = Clock.systemUTC(); + + assertEquals(clockUTC.getZone(), ZoneOffset.UTC); + assertEquals(clockUTC.instant().equals(null), false); + + LOGGER.debug("UTC instant :: " + clockUTC.instant()); + } + + @Test + public void givenClock_withSytem_retrievesInstant() { + + Clock clockSystem = Clock.system(ZoneId.of("Asia/Calcutta")); + + assertEquals(clockSystem.getZone(), ZoneId.of("Asia/Calcutta")); + assertEquals(clockSystem.instant().equals(null), false); + + LOGGER.debug("System zone :: " + clockSystem.getZone()); + } + + @Test + public void givenClock_withSytemDefaultZone_retrievesInstant() { + + Clock clockSystemDefault = Clock.systemDefaultZone(); + + assertEquals(clockSystemDefault.getZone().equals(null), false); + assertEquals(clockSystemDefault.instant().equals(null), false); + + LOGGER.debug("System Default instant :: " + clockSystemDefault.instant()); + } + + @Test + public void givenClock_withSytemUTC_retrievesTimeInMillis() { + + Clock clockMillis = Clock.systemDefaultZone(); + + assertEquals(clockMillis.instant().equals(null), false); + assertTrue(clockMillis.millis() > 0); + + LOGGER.debug("System Default millis :: " + clockMillis.millis()); + } + + @Test + public void givenClock_usingOffset_retrievesFutureDate() { + + Clock baseClock = Clock.systemDefaultZone(); + + // result clock will be later than baseClock + Clock futureClock = Clock.offset(baseClock, Duration.ofHours(72)); + + assertEquals(futureClock.instant().equals(null), false); + assertTrue(futureClock.millis() > baseClock.millis()); + + LOGGER.debug("Future Clock instant :: " + futureClock.instant()); + } + + @Test + public void givenClock_usingOffset_retrievesPastDate() { + Clock baseClock = Clock.systemDefaultZone(); + + // result clock will be later than baseClock + Clock pastClock = Clock.offset(baseClock, Duration.ofHours(-72)); + + assertEquals(pastClock.instant().equals(null), false); + assertTrue(pastClock.millis() < baseClock.millis()); + + LOGGER.debug("Past Clock instant :: " + pastClock.instant()); + } + + @Test + public void givenClock_usingTick_retrievesInstant() { + Clock clockDefaultZone = Clock.systemDefaultZone(); + Clock clocktick = Clock.tick(clockDefaultZone, Duration.ofSeconds(300)); + + assertEquals(clockDefaultZone.instant().equals(null), false); + assertEquals(clocktick.instant().equals(null), false); + assertTrue(clockDefaultZone.millis() > clocktick.millis()); + + LOGGER.debug("Clock Default Zone instant : " + clockDefaultZone.instant()); + LOGGER.debug("Clock tick instant: " + clocktick.instant()); + } + + @Test(expected=IllegalArgumentException.class) + public void givenClock_usingTickDurationNegative_throwsException() { + + Clock clockDefaultZone = Clock.systemDefaultZone(); + Clock.tick(clockDefaultZone, Duration.ofSeconds(-300)); + + } + + @Test + public void givenClock_usingTickSeconds_retrievesInstant() { + ZoneId zoneId = ZoneId.of("Asia/Calcutta"); + Clock tickSeconds = Clock.tickSeconds(zoneId); + + assertEquals(tickSeconds.instant().equals(null), false); + LOGGER.debug("Clock tick seconds instant :: " + tickSeconds.instant()); + + tickSeconds = Clock.tick(Clock.system(ZoneId.of("Asia/Calcutta")), Duration.ofSeconds(100)); + assertEquals(tickSeconds.instant().equals(null), false); + } + + @Test + public void givenClock_usingTickMinutes_retrievesInstant() { + + Clock tickMinutes = Clock.tickMinutes(ZoneId.of("Asia/Calcutta")); + + assertEquals(tickMinutes.instant().equals(null), false); + LOGGER.debug("Clock tick seconds instant :: " + tickMinutes.instant()); + + tickMinutes = Clock.tick(Clock.system(ZoneId.of("Asia/Calcutta")), Duration.ofMinutes(5)); + assertEquals(tickMinutes.instant().equals(null), false); + } + + @Test + public void givenClock_usingWithZone_retrievesInstant() { + + ZoneId zoneSingapore = ZoneId.of("Asia/Singapore"); + Clock clockSingapore = Clock.system(zoneSingapore); + + assertEquals(clockSingapore.instant().equals(null), false); + LOGGER.debug("clockSingapore instant : " + clockSingapore.instant()); + + ZoneId zoneCalcutta = ZoneId.of("Asia/Calcutta"); + Clock clockCalcutta = clockSingapore.withZone(zoneCalcutta); + assertEquals(clockCalcutta.instant().equals(null), false); + LOGGER.debug("clockCalcutta instant : " + clockSingapore.instant()); + } + + @Test + public void givenClock_usingGetZone_retrievesZoneId() { + + Clock clockDefaultZone = Clock.systemDefaultZone(); + ZoneId zone = clockDefaultZone.getZone(); + + assertEquals(zone.getId().equals(null), false); + LOGGER.debug("Default zone instant : " + clockDefaultZone.instant()); + } +} diff --git a/core-java/src/test/java/com/baeldung/keystore/JavaKeyStoreTest.java b/core-java/src/test/java/com/baeldung/keystore/JavaKeyStoreTest.java new file mode 100644 index 0000000000..ff1d337597 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/keystore/JavaKeyStoreTest.java @@ -0,0 +1,205 @@ +package com.baeldung.keystore; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import sun.security.x509.AlgorithmId; +import sun.security.x509.CertificateAlgorithmId; +import sun.security.x509.CertificateSerialNumber; +import sun.security.x509.CertificateValidity; +import sun.security.x509.CertificateVersion; +import sun.security.x509.CertificateX509Key; +import sun.security.x509.X500Name; +import sun.security.x509.X509CertImpl; +import sun.security.x509.X509CertInfo; + +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import java.io.IOException; +import java.math.BigInteger; +import java.security.InvalidKeyException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.security.NoSuchProviderException; +import java.security.SecureRandom; +import java.security.SignatureException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.Date; + +/** + * Created by adi on 4/14/18. + */ +public class JavaKeyStoreTest { + + private JavaKeyStore keyStore; + + private static final String KEYSTORE_PWD = "abc123"; + private static final String KEYSTORE_NAME = "myKeyStore"; + private static final String KEY_STORE_TYPE = "JCEKS"; + + private static final String MY_SECRET_ENTRY = "mySecretEntry"; + private static final String DN_NAME = "CN=test, OU=test, O=test, L=test, ST=test, C=CY"; + private static final String SHA1WITHRSA = "SHA1withRSA"; + private static final String MY_PRIVATE_KEY = "myPrivateKey"; + private static final String MY_CERTIFICATE = "myCertificate"; + + @Before + public void setUp() throws Exception { + //using java cryptography extension keyStore instead of Keystore.getDefaultType + keyStore = new JavaKeyStore(KEY_STORE_TYPE, KEYSTORE_PWD, KEYSTORE_NAME); + } + + @After + public void tearDown() throws Exception { + if (keyStore.getKeyStore() != null) { + keyStore.deleteKeyStore(); + } + } + + @Test + public void givenNoKeyStore_whenCreateEmptyKeyStore_thenGetKeyStoreNotNull() throws Exception { + keyStore.createEmptyKeyStore(); + KeyStore result = keyStore.getKeyStore(); + Assert.assertNotNull(result); + } + + @Test + public void givenEmptyKeystore_whenLoadKeyStore_thenKeyStoreLoadedAndSizeZero() throws Exception { + keyStore.createEmptyKeyStore(); + keyStore.loadKeyStore(); + KeyStore result = keyStore.getKeyStore(); + Assert.assertNotNull(result); + Assert.assertTrue(result.size() == 0); + } + + @Test + public void givenLoadedKeyStore_whenSetEntry_thenSizeIsOneAndGetKeyNotNull() throws Exception { + keyStore.createEmptyKeyStore(); + keyStore.loadKeyStore(); + + KeyGenerator keygen = KeyGenerator.getInstance("HmacSHA256"); + SecretKey secretKey = keygen.generateKey(); + //ideally, password should be different for every key + KeyStore.ProtectionParameter protParam = new KeyStore.PasswordProtection(KEYSTORE_PWD.toCharArray()); + KeyStore.SecretKeyEntry secretKeyEntry = new KeyStore.SecretKeyEntry(secretKey); + keyStore.setEntry(MY_SECRET_ENTRY, secretKeyEntry, protParam); + + KeyStore result = keyStore.getKeyStore(); + Assert.assertTrue(result.size() == 1); + KeyStore.Entry entry = keyStore.getEntry(MY_SECRET_ENTRY); + Assert.assertTrue(entry != null); + } + + @Test + public void givenLoadedKeyStore_whenSetKeyEntry_thenSizeIsOneAndGetEntryNotNull() throws Exception { + keyStore.createEmptyKeyStore(); + keyStore.loadKeyStore(); + + // Generate the key pair + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(1024); + KeyPair keyPair = keyPairGenerator.generateKeyPair(); + + // Generate a self signed certificate + X509Certificate certificate = generateSelfSignedCertificate(keyPair); + + X509Certificate[] certificateChain = new X509Certificate[1]; + certificateChain[0] = certificate; + keyStore.setKeyEntry(MY_PRIVATE_KEY, keyPair.getPrivate(), KEYSTORE_PWD, certificateChain); + + KeyStore result = keyStore.getKeyStore(); + Assert.assertTrue(result.size() == 1); + KeyStore.Entry entry = keyStore.getEntry(MY_PRIVATE_KEY); + Assert.assertTrue(entry != null); + } + + @Test + public void givenLoadedKeyStore_whenSetCertificateEntry_thenSizeIsOneAndGetCertificateEntryNotNull() throws Exception { + keyStore.createEmptyKeyStore(); + keyStore.loadKeyStore(); + + // Generate the key pair + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(1024); + KeyPair keyPair = keyPairGenerator.generateKeyPair(); + + // Generate a self signed certificate + X509Certificate certificate = generateSelfSignedCertificate(keyPair); + + keyStore.setCertificateEntry(MY_CERTIFICATE, certificate); + + KeyStore result = this.keyStore.getKeyStore(); + Assert.assertTrue(result.size() == 1); + java.security.cert.Certificate resultCertificate = keyStore.getCertificate(MY_CERTIFICATE); + Assert.assertNotNull(resultCertificate); + } + + @Test + public void givenLoadedKeyStoreWithOneEntry_whenDeleteEntry_thenKeyStoreSizeIsZero() throws Exception { + keyStore.createEmptyKeyStore(); + keyStore.loadKeyStore(); + + KeyGenerator keygen = KeyGenerator.getInstance("HmacSHA256"); + SecretKey secretKey = keygen.generateKey(); + //ideally, password should be different for every key + KeyStore.ProtectionParameter protParam = new KeyStore.PasswordProtection(KEYSTORE_PWD.toCharArray()); + KeyStore.SecretKeyEntry secretKeyEntry = new KeyStore.SecretKeyEntry(secretKey); + keyStore.setEntry(MY_SECRET_ENTRY, secretKeyEntry, protParam); + + keyStore.deleteEntry(MY_SECRET_ENTRY); + + KeyStore result = this.keyStore.getKeyStore(); + Assert.assertTrue(result.size() == 0); + } + + @Test + public void givenLoadedKeystore_whenDeleteKeyStore_thenKeyStoreIsNull() throws Exception { + keyStore.createEmptyKeyStore(); + keyStore.loadKeyStore(); + + keyStore.deleteKeyStore(); + + KeyStore result = this.keyStore.getKeyStore(); + Assert.assertTrue(result == null); + } + + private X509Certificate generateSelfSignedCertificate(KeyPair keyPair) throws CertificateException, IOException, NoSuchProviderException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { + X509CertInfo certInfo = new X509CertInfo(); + // Serial number and version + certInfo.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(64, new SecureRandom()))); + certInfo.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3)); + + // Subject & Issuer + X500Name owner = new X500Name(DN_NAME); + certInfo.set(X509CertInfo.SUBJECT, owner); + certInfo.set(X509CertInfo.ISSUER, owner); + + // Key and algorithm + certInfo.set(X509CertInfo.KEY, new CertificateX509Key(keyPair.getPublic())); + AlgorithmId algorithm = new AlgorithmId(AlgorithmId.sha1WithRSAEncryption_oid); + certInfo.set(X509CertInfo.ALGORITHM_ID, new CertificateAlgorithmId(algorithm)); + + // Validity + Date validFrom = new Date(); + Date validTo = new Date(validFrom.getTime() + 50L * 365L * 24L * 60L * 60L * 1000L); //50 years + CertificateValidity validity = new CertificateValidity(validFrom, validTo); + certInfo.set(X509CertInfo.VALIDITY, validity); + + // Create certificate and sign it + X509CertImpl cert = new X509CertImpl(certInfo); + cert.sign(keyPair.getPrivate(), SHA1WITHRSA); + + // Since the SHA1withRSA provider may have a different algorithm ID to what we think it should be, + // we need to reset the algorithm ID, and resign the certificate + AlgorithmId actualAlgorithm = (AlgorithmId) cert.get(X509CertImpl.SIG_ALG); + certInfo.set(CertificateAlgorithmId.NAME + "." + CertificateAlgorithmId.ALGORITHM, actualAlgorithm); + X509CertImpl newCert = new X509CertImpl(certInfo); + newCert.sign(keyPair.getPrivate(), SHA1WITHRSA); + + return newCert; + } +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java b/core-java/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java new file mode 100644 index 0000000000..62f891d11b --- /dev/null +++ b/core-java/src/test/java/com/baeldung/parameterpassing/NonPrimitivesUnitTest.java @@ -0,0 +1,37 @@ +package com.baeldung.parameterpassing; + +import org.junit.Assert; +import org.junit.Test; + +public class NonPrimitivesUnitTest { + @Test + public void whenModifyingObjects_thenOriginalObjectChanged() { + Foo a = new Foo(1); + Foo b = new Foo(1); + + // Before Modification + Assert.assertEquals(a.num, 1); + Assert.assertEquals(b.num, 1); + + modify(a, b); + + // After Modification + Assert.assertEquals(a.num, 2); + Assert.assertEquals(b.num, 1); + } + + public static void modify(Foo a1, Foo b1) { + a1.num++; + + b1 = new Foo(1); + b1.num++; + } +} + +class Foo { + public int num; + + public Foo(int num) { + this.num = num; + } +} \ No newline at end of file diff --git a/core-java/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java b/core-java/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java new file mode 100644 index 0000000000..496cd1d205 --- /dev/null +++ b/core-java/src/test/java/com/baeldung/parameterpassing/PrimitivesUnitTest.java @@ -0,0 +1,28 @@ +package com.baeldung.parameterpassing; + +import org.junit.Assert; +import org.junit.Test; + +public class PrimitivesUnitTest { + @Test + public void whenModifyingPrimitives_thenOriginalValuesNotModified() { + + int x = 1; + int y = 2; + + // Before Modification + Assert.assertEquals(x, 1); + Assert.assertEquals(y, 2); + + modify(x, y); + + // After Modification + Assert.assertEquals(x, 1); + Assert.assertEquals(y, 2); + } + + public static void modify(int x1, int y1) { + x1 = 5; + y1 = 10; + } +} diff --git a/core-java/yofile.txt b/core-java/yofile.txt new file mode 100644 index 0000000000..ad56bf35f7 Binary files /dev/null and b/core-java/yofile.txt differ diff --git a/core-java/yofile2.txt b/core-java/yofile2.txt new file mode 100644 index 0000000000..8393b6e98b Binary files /dev/null and b/core-java/yofile2.txt differ diff --git a/core-kotlin/README.md b/core-kotlin/README.md index d6bd41a111..630d4c7436 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -24,3 +24,4 @@ - [Regular Expressions in Kotlin](http://www.baeldung.com/kotlin-regular-expressions) - [Objects in Kotlin](http://www.baeldung.com/kotlin-objects) - [Reading from a File in Kotlin](http://www.baeldung.com/kotlin-read-file) +- [Guide to Kotlin @JvmField](http://www.baeldung.com/kotlin-jvm-field-annotation) diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml index 6c729d5688..d923ec698c 100644 --- a/core-kotlin/pom.xml +++ b/core-kotlin/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - core-kotlin 1.0-SNAPSHOT jar @@ -51,7 +50,7 @@ khttp khttp - 0.1.0 + ${khttp.version} org.jetbrains.kotlin @@ -125,11 +124,11 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + ${maven-compiler-plugin.version} - 1.8 - 1.8 - + ${maven.compiler.source} + ${maven.compiler.target} + @@ -159,13 +158,9 @@ - - maven-surefire-plugin - ${maven-surefire-plugin.version} - maven-failsafe-plugin - 2.19.1 + ${maven-failsafe-plugin.version} org.junit.platform @@ -200,14 +195,15 @@ 0.15 1.5.0 4.1.0 - + 0.1.0 3.6.1 - 5.0.0 1.0.0 4.12.0 4.12 3.9.1 + 1.8 + 1.8 diff --git a/couchbase/README.md b/couchbase/README.md index f124a0192c..9b76609593 100644 --- a/couchbase/README.md +++ b/couchbase/README.md @@ -5,6 +5,7 @@ - [Using Couchbase in a Spring Application](http://www.baeldung.com/couchbase-sdk-spring) - [Asynchronous Batch Opereations in Couchbase](http://www.baeldung.com/async-batch-operations-in-couchbase) - [Querying Couchbase with MapReduce Views](http://www.baeldung.com/couchbase-query-mapreduce-view) +- [Querying Couchbase with N1QL](http://www.baeldung.com/n1ql-couchbase) ### Overview This Maven project contains the Java code for the Couchbase entities and Spring services diff --git a/couchbase/pom.xml b/couchbase/pom.xml index c79ce853d0..c369a9e598 100644 --- a/couchbase/pom.xml +++ b/couchbase/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung couchbase-sdk @@ -22,13 +22,11 @@ java-client ${couchbase.client.version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} - org.springframework @@ -52,7 +50,6 @@ - org.springframework @@ -60,7 +57,6 @@ ${spring-framework.version} test - org.apache.commons diff --git a/custom-pmd/pom.xml b/custom-pmd/pom.xml index f9ae961f3a..dcd068089b 100644 --- a/custom-pmd/pom.xml +++ b/custom-pmd/pom.xml @@ -1,43 +1,46 @@ - 4.0.0 - org.baeldung.pmd - custom-pmd - 0.0.1 - jar - custom-pmd - http://maven.apache.org + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + org.baeldung.pmd + custom-pmd + 0.0.1 + jar + custom-pmd + http://maven.apache.org - - UTF-8 - 3.7.0 - 6.0.1 - - - - - net.sourceforge.pmd - pmd-core - ${pmdVersion} + + + net.sourceforge.pmd + pmd-core + ${pmdVersion} - - net.sourceforge.pmd - pmd-java - ${pmdVersion} - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - + + net.sourceforge.pmd + pmd-java + ${pmdVersion} + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + UTF-8 + 3.7.0 + 6.0.1 + 1.8 + 1.8 + + diff --git a/data-structures/pom.xml b/data-structures/pom.xml index 68174a41df..287e9f38aa 100644 --- a/data-structures/pom.xml +++ b/data-structures/pom.xml @@ -1,24 +1,26 @@ - 4.0.0 - com.baeldung - data-structures - 0.0.1-SNAPSHOT + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + data-structures + 0.0.1-SNAPSHOT + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - - - diff --git a/deeplearning4j/pom.xml b/deeplearning4j/pom.xml index 8ab7b1e4e4..8d9e8c6475 100644 --- a/deeplearning4j/pom.xml +++ b/deeplearning4j/pom.xml @@ -6,32 +6,29 @@ jar 1.0-SNAPSHOT deeplearning4j - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - UTF-8 - 1.8 - 1.8 - 0.9.1 - - org.nd4j nd4j-native-platform ${dl4j.version} - org.deeplearning4j deeplearning4j-core ${dl4j.version} - + + UTF-8 + 0.9.1 + + \ No newline at end of file diff --git a/deltaspike/pom.xml b/deltaspike/pom.xml index e81ad49a6d..87f532c3f3 100644 --- a/deltaspike/pom.xml +++ b/deltaspike/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.baeldung deltaspike @@ -8,7 +8,6 @@ war deltaspike A starter Java EE 7 webapp which uses DeltaSpike - http://wildfly.org @@ -24,38 +23,15 @@ 1.0.0-SNAPSHOT - - - - UTF-8 - - 3.7.4 - 1.7.2 - - - 1.0.2.Final - - - 8.2.2.Final - - - 2.6 - 1.1.3 - - - - org.wildfly.bom @@ -76,26 +52,26 @@ - + - + javax.enterprise cdi-api provided - + org.jboss.spec.javax.annotation jboss-annotations-api_1.2_spec provided - org.jboss.resteasy @@ -103,16 +79,16 @@ provided - + org.hibernate.javax.persistence hibernate-jpa-2.1-api provided - + org.jboss.spec.javax.ejb jboss-ejb-api_3.2_spec @@ -134,8 +110,8 @@ - + org.jboss.spec.javax.faces jboss-jsf-api_2.2_spec @@ -144,16 +120,16 @@ - + org.hibernate hibernate-jpamodelgen provided - + org.hibernate hibernate-validator-annotation-processor @@ -161,8 +137,8 @@ - + org.jboss.arquillian.junit arquillian-junit-container @@ -211,16 +187,15 @@ - + ${project.artifactId} maven-war-plugin ${war.plugin.version} - + false @@ -252,10 +227,10 @@ - - + + default true @@ -275,10 +250,10 @@ - - + + arq-wildfly-managed @@ -290,4 +265,23 @@ + + + + + UTF-8 + 3.7.4 + 1.7.2 + + 1.0.2.Final + + 8.2.2.Final + + 2.6 + 1.1.3 + + diff --git a/disruptor/pom.xml b/disruptor/pom.xml index 33eb7bb50a..cc914cff7e 100644 --- a/disruptor/pom.xml +++ b/disruptor/pom.xml @@ -1,11 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung disruptor 0.1.0-SNAPSHOT jar - disruptor @@ -15,20 +14,17 @@ - org.apache.commons commons-lang3 ${commons-lang3.version} - com.lmax disruptor ${disruptor.version} - @@ -39,9 +35,7 @@ true - - org.apache.maven.plugins maven-dependency-plugin @@ -58,7 +52,6 @@ - org.apache.maven.plugins maven-jar-plugin @@ -72,7 +65,6 @@ - org.apache.maven.plugins maven-assembly-plugin @@ -96,7 +88,6 @@ - org.apache.maven.plugins maven-shade-plugin @@ -109,7 +100,7 @@ true + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> org.baeldung.executable.ExecutableMavenJar @@ -117,7 +108,6 @@ - com.jolira onejar-maven-plugin @@ -134,43 +124,13 @@ - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - - - json - - - - - - - - 3.5 3.3.6 - 6.10 3.6.1 diff --git a/dozer/pom.xml b/dozer/pom.xml index 00ac2d5675..0b7f85ddb4 100644 --- a/dozer/pom.xml +++ b/dozer/pom.xml @@ -1,11 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - com.baeldung dozer 1.0 - dozer @@ -15,19 +13,16 @@ - org.apache.commons commons-lang3 ${commons-lang3.version} - net.sf.dozer dozer ${dozer.version} - diff --git a/drools/pom.xml b/drools/pom.xml index 5f228802fa..c1e8b34b06 100644 --- a/drools/pom.xml +++ b/drools/pom.xml @@ -2,18 +2,13 @@ 4.0.0 - drools + com.baeldung parent-modules 1.0.0-SNAPSHOT - - 4.4.6 - 7.4.1.Final - 3.13 - @@ -32,7 +27,6 @@ drools-decisiontables ${drools-version} - org.drools drools-core @@ -48,40 +42,23 @@ poi ${apache-poi-version} - org.apache.poi poi-ooxml ${apache-poi-version} - org.springframework spring-core - 4.3.6.RELEASE + ${spring-core.version} - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 3 - true - - **/*IntegrationTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - **/JdbcTest.java - **/*LiveTest.java - - - - - + + 4.4.6 + 7.4.1.Final + 3.13 + 4.3.6.RELEASE + diff --git a/dubbo/pom.xml b/dubbo/pom.xml index af242e5905..81ff921f2a 100644 --- a/dubbo/pom.xml +++ b/dubbo/pom.xml @@ -1,6 +1,7 @@ 4.0.0 + dubbo parent-modules @@ -8,7 +9,29 @@ 1.0.0-SNAPSHOT - dubbo + + + com.alibaba + dubbo + ${dubbo.version} + + + junit + junit + ${junit.version} + test + + + org.apache.zookeeper + zookeeper + ${zookeeper.version} + + + com.101tec + zkclient + ${zkclient.version} + + UTF-8 @@ -20,54 +43,4 @@ 2.19.1 - - - com.alibaba - dubbo - ${dubbo.version} - - - junit - junit - 4.12 - test - - - - org.apache.zookeeper - zookeeper - ${zookeeper.version} - - - - com.101tec - zkclient - ${zkclient.version} - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - maven-surefire-plugin - ${surefire.version} - - - **/*LiveTest.java - - - - - - diff --git a/ejb/ejb-client/pom.xml b/ejb/ejb-client/pom.xml index ca8ec55f12..83dd0aef30 100755 --- a/ejb/ejb-client/pom.xml +++ b/ejb/ejb-client/pom.xml @@ -1,7 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 + ejb-client + EJB3 Client Maven + EJB3 Client Maven com.baeldung.ejb @@ -9,10 +12,6 @@ 1.0-SNAPSHOT - ejb-client - EJB3 Client Maven - EJB3 Client Maven - org.wildfly @@ -25,7 +24,6 @@ ejb-remote ejb - @@ -42,5 +40,5 @@ - + \ No newline at end of file diff --git a/ejb/ejb-remote/pom.xml b/ejb/ejb-remote/pom.xml index beb182ff8b..b8f1f0dcc0 100755 --- a/ejb/ejb-remote/pom.xml +++ b/ejb/ejb-remote/pom.xml @@ -2,6 +2,8 @@ 4.0.0 + ejb-remote + ejb com.baeldung.ejb @@ -9,9 +11,6 @@ 1.0-SNAPSHOT - ejb-remote - ejb - javax @@ -21,7 +20,6 @@ - @@ -70,7 +68,7 @@ org.wildfly.plugins wildfly-maven-plugin - 1.1.0.Alpha5 + ${wildfly-maven-plugin.version} 127.0.0.1 9990 @@ -82,14 +80,12 @@ - 7.0 1.6.1 + 1.1.0.Alpha5 - - - + \ No newline at end of file diff --git a/ejb/ejb-session-beans/pom.xml b/ejb/ejb-session-beans/pom.xml index b89ff6ed15..6afd7f2c6d 100644 --- a/ejb/ejb-session-beans/pom.xml +++ b/ejb/ejb-session-beans/pom.xml @@ -1,21 +1,12 @@ - 4.0.0 - - com.baeldung.ejb - ejb - 1.0-SNAPSHOT - - ejb-session-beans - - - UTF-8 - 1.1.12.Final - 2.2.6 - 1.1.12.Final - 1.0.0.Final - 4.12 - 7.0 - + 4.0.0 + ejb-session-beans + + + com.baeldung.ejb + ejb + 1.0-SNAPSHOT + @@ -30,29 +21,23 @@ - javax javaee-api ${javaee-api.version} provided - - junit junit - 4.12 + ${junit.version} test - - org.jboss.arquillian.junit arquillian-junit-container test - @@ -65,7 +50,7 @@ org.jboss.arquillian.container arquillian-glassfish-embedded-3.1 - 1.0.0.CR4 + ${arquillian-glassfish-embedded-3.1.version} test @@ -80,14 +65,6 @@ - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - maven-war-plugin 2.4 @@ -95,12 +72,18 @@ false - - maven-surefire-plugin - 2.17 - - - + + + UTF-8 + 1.1.12.Final + 2.2.6 + 1.1.12.Final + 1.0.0.Final + 4.12 + 7.0 + 1.0.0.CR4 + + \ No newline at end of file diff --git a/ejb/pom.xml b/ejb/pom.xml index 78e40a7b7c..e61c2a0b7b 100755 --- a/ejb/pom.xml +++ b/ejb/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.ejb ejb @@ -15,6 +15,56 @@ 1.0.0-SNAPSHOT + + ejb-remote + ejb-client + ejb-session-beans + + + + + + com.baeldung.ejb + ejb-remote + ${ejb-remote.version} + ejb + + + com.baeldung.ejb + ejb-session-beans + ${ejb-session-beans.version} + ejb + + + javax + javaee-api + ${javaee-api.version} + provided + + + org.wildfly + wildfly-ejb-client-bom + ${wildfly-ejb-client-bom.version} + pom + import + + + + + + + + + maven-ejb-plugin + ${maven-ejb-plugin.version} + + ${ejbVersion} + + + + + + jboss-public-repository-group @@ -32,54 +82,20 @@ - - - - com.baeldung.ejb - ejb-remote - 1.0-SNAPSHOT - ejb - - - com.baeldung.ejb - ejb-session-beans - 1.0-SNAPSHOT - ejb - - - javax - javaee-api - 7.0 - provided - + + UTF-8 + UTF-8 + 1.8 + 2.5.7 + 3.4.11 + 0.10 + 2.19.1 + 1.0-SNAPSHOT + 1.0-SNAPSHOT + 7.0 + 2.4 + 3.2 + 10.1.0.Final + - - org.wildfly - wildfly-ejb-client-bom - 10.1.0.Final - pom - import - - - - - - - - - maven-ejb-plugin - 2.4 - - 3.2 - - - - - - - - ejb-remote - ejb-client - ejb-session-beans - \ No newline at end of file diff --git a/ejb/wildfly/pom.xml b/ejb/wildfly/pom.xml index 83dbacfa3d..ad73f4817e 100644 --- a/ejb/wildfly/pom.xml +++ b/ejb/wildfly/pom.xml @@ -1,85 +1,93 @@ - 4.0.0 - com.baeldung.wildfly - wildfly-example - 0.0.1-SNAPSHOT - pom - - com.baeldung.ejb - ejb - 1.0-SNAPSHOT - - - 1.8 - 1.8 - UTF-8 - - - widlfly-web - wildfly-ear - wildfly-jpa - wildfly-ejb-interfaces - wildfly-ejb - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.wildfly + wildfly-example + 0.0.1-SNAPSHOT + pom + + + com.baeldung.ejb + ejb + 1.0-SNAPSHOT + + + + widlfly-web + wildfly-ear + wildfly-jpa + wildfly-ejb-interfaces + wildfly-ejb + + + + + + + + javax + javaee-api + ${javaee-api.version} + provided + + + + org.wildfly.bom + wildfly-javaee7 + ${wildfly-javaee7.version} + import + pom + + + + org.hibernate + hibernate-core + ${hibernate-core.version} + provided + + + + com.baeldung.wildfly + wildlfy-ear + ${wildlfy.version} + ear + + + + com.baeldung.wildfly + wildlfy-web + ${wildlfy.version} + war + + + + com.baeldung.wildfly + wildlfy-jpa + ${wildlfy.version} + + + + com.baeldung.wildfly + wildfly-ejb + ${wildlfy.version} + + + + com.baeldung.wildfly + wildfly-ejb-interfaces + ${wildlfy.version} + + + + + + 1.8 + 1.8 + UTF-8 + 7.0 + 10.1.0.Final + 5.2.3.Final + 0.0.1-SNAPSHOT + - - - - - - javax - javaee-api - 7.0 - provided - - - - org.wildfly.bom - wildfly-javaee7 - 10.1.0.Final - import - pom - - - - org.hibernate - hibernate-core - 5.2.3.Final - provided - - - - com.baeldung.wildfly - wildlfy-ear - 0.0.1-SNAPSHOT - ear - - - - com.baeldung.wildfly - wildlfy-web - 0.0.1-SNAPSHOT - war - - - - com.baeldung.wildfly - wildlfy-jpa - 0.0.1-SNAPSHOT - - - - com.baeldung.wildfly - wildfly-ejb - 0.0.1-SNAPSHOT - - - - com.baeldung.wildfly - wildfly-ejb-interfaces - 0.0.1-SNAPSHOT - - - \ No newline at end of file diff --git a/ejb/wildfly/widlfly-web/pom.xml b/ejb/wildfly/widlfly-web/pom.xml index 2e316dedd9..a337e8ef60 100644 --- a/ejb/wildfly/widlfly-web/pom.xml +++ b/ejb/wildfly/widlfly-web/pom.xml @@ -1,39 +1,40 @@ - 4.0.0 - - com.baeldung.wildfly - wildfly-example - 0.0.1-SNAPSHOT - - widlfly-web - war + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + widlfly-web + war - - - - javax - javaee-api - 7.0 - provided - - - - com.baeldung.wildfly - wildfly-jpa - 0.0.1-SNAPSHOT - - - - com.baeldung.wildfly - wildfly-ejb-interfaces - 0.0.1-SNAPSHOT - - - - com.baeldung.wildfly - wildfly-ejb - 0.0.1-SNAPSHOT - - + + com.baeldung.wildfly + wildfly-example + 0.0.1-SNAPSHOT + + + + + + javax + javaee-api + ${javaee-api.version} + provided + + + + com.baeldung.wildfly + wildfly-jpa + ${wildlfy.version} + + + + com.baeldung.wildfly + wildfly-ejb-interfaces + ${wildlfy.version} + + + + com.baeldung.wildfly + wildfly-ejb + ${wildlfy.version} + + \ No newline at end of file diff --git a/ejb/wildfly/wildfly-ear/pom.xml b/ejb/wildfly/wildfly-ear/pom.xml index 6beb387227..f264594652 100644 --- a/ejb/wildfly/wildfly-ear/pom.xml +++ b/ejb/wildfly/wildfly-ear/pom.xml @@ -1,62 +1,63 @@ - 4.0.0 - - com.baeldung.wildfly - wildfly-example - 0.0.1-SNAPSHOT - - wildfly-ear - ear + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + wildfly-ear + ear - - - - com.baeldung.wildfly - widlfly-web - 0.0.1-SNAPSHOT - war - - - - com.baeldung.wildfly - wildfly-jpa - 0.0.1-SNAPSHOT - - - - com.baeldung.wildfly - wildfly-ejb - - - - com.baeldung.wildfly - wildfly-ejb-interfaces - - + + com.baeldung.wildfly + wildfly-example + 0.0.1-SNAPSHOT + - - - - maven-ear-plugin - 2.10.1 - - lib/ - 7 - - - com.baeldung.wildfly - widlfly-web - /wildfly - - - - - - org.wildfly.plugins - wildfly-maven-plugin - 1.2.0.Final - - - + + + + com.baeldung.wildfly + widlfly-web + ${wildlfy.version} + war + + + + com.baeldung.wildfly + wildfly-jpa + ${wildlfy.version} + + + + com.baeldung.wildfly + wildfly-ejb + + + + com.baeldung.wildfly + wildfly-ejb-interfaces + + + + + + + maven-ear-plugin + 2.10.1 + + lib/ + 7 + + + com.baeldung.wildfly + widlfly-web + /wildfly + + + + + + org.wildfly.plugins + wildfly-maven-plugin + 1.2.0.Final + + + \ No newline at end of file diff --git a/ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/ejb/wildfly/wildfly-ejb-interfaces/pom.xml index e4d2eee0c6..61a630b899 100644 --- a/ejb/wildfly/wildfly-ejb-interfaces/pom.xml +++ b/ejb/wildfly/wildfly-ejb-interfaces/pom.xml @@ -1,26 +1,32 @@ - 4.0.0 - - com.baeldung.wildfly - wildfly-example - 0.0.1-SNAPSHOT - - wildfly-ejb-interfaces + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + wildfly-ejb-interfaces + + + com.baeldung.wildfly + wildfly-example + 0.0.1-SNAPSHOT + + + + + + javax.ejb + javax.ejb-api + ${javax.ejb-api.version} + provided + + + + com.baeldung.wildfly + wildfly-jpa + ${wildlfy.version} + + + + + 3.2 + - - - - javax.ejb - javax.ejb-api - 3.2 - provided - - - - com.baeldung.wildfly - wildfly-jpa - 0.0.1-SNAPSHOT - - \ No newline at end of file diff --git a/ejb/wildfly/wildfly-ejb/pom.xml b/ejb/wildfly/wildfly-ejb/pom.xml index 9d4464dafa..900f93c0ba 100644 --- a/ejb/wildfly/wildfly-ejb/pom.xml +++ b/ejb/wildfly/wildfly-ejb/pom.xml @@ -1,49 +1,50 @@ - 4.0.0 - - com.baeldung.wildfly - wildfly-example - 0.0.1-SNAPSHOT - - wildfly-ejb - ejb + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + wildfly-ejb + ejb - - - - javax.ejb - javax.ejb-api - 3.2 - provided - - - - javax - javaee-api - provided - - - - org.hibernate - hibernate-core - - - - com.baeldung.wildfly - wildfly-ejb-interfaces - - + + com.baeldung.wildfly + wildfly-example + 0.0.1-SNAPSHOT + - - - - org.apache.maven.plugins - maven-ejb-plugin - - 3.2 - - - - + + + + javax.ejb + javax.ejb-api + 3.2 + provided + + + + javax + javaee-api + provided + + + + org.hibernate + hibernate-core + + + + com.baeldung.wildfly + wildfly-ejb-interfaces + + + + + + + org.apache.maven.plugins + maven-ejb-plugin + + 3.2 + + + + \ No newline at end of file diff --git a/ejb/wildfly/wildfly-jpa/pom.xml b/ejb/wildfly/wildfly-jpa/pom.xml index e6f8b32e17..18e86b1b31 100644 --- a/ejb/wildfly/wildfly-jpa/pom.xml +++ b/ejb/wildfly/wildfly-jpa/pom.xml @@ -1,20 +1,22 @@ - 4.0.0 - - com.baeldung.wildfly - wildfly-example - 0.0.1-SNAPSHOT - - wildfly-jpa + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + wildfly-jpa + + + com.baeldung.wildfly + wildfly-example + 0.0.1-SNAPSHOT + + + + + + + org.hibernate + hibernate-core + provided + + - - - - - org.hibernate - hibernate-core - provided - - \ No newline at end of file diff --git a/enterprise-patterns/pom.xml b/enterprise-patterns/pom.xml index 1c8f5a1b4d..07842b8981 100644 --- a/enterprise-patterns/pom.xml +++ b/enterprise-patterns/pom.xml @@ -1,14 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.enterprise.patterns enterprise-patterns-parent pom - - spring-dispatcher-servlet - com.baeldung @@ -16,4 +12,8 @@ 1.0.0-SNAPSHOT + + spring-dispatcher-servlet + + diff --git a/ethereumj/pom.xml b/ethereumj/pom.xml index 8b6d3677c9..611b7b09eb 100644 --- a/ethereumj/pom.xml +++ b/ethereumj/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 com.baeldung.ethereumj ethereumj @@ -23,7 +25,6 @@ - org.springframework.boot @@ -33,28 +34,24 @@ org.springframework.boot spring-boot-starter-tomcat - org.springframework.boot spring-boot-starter-test test - org.ethereum ethereumj-core - 1.5.0-RELEASE + ${ethereumj-core.version} - org.web3j core - 3.3.1 + ${web3j.core.version} - javax.servlet @@ -63,7 +60,7 @@ com.fasterxml.jackson.core jackson-databind - 2.5.0 + ${jackson-databind.version} @@ -77,40 +74,13 @@ ethereumj - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - none - - - */EthControllerTestOne.java - - - - - - - - - - UTF-8 1.8 8.5.4 + 1.5.0-RELEASE + 3.3.1 + 2.5.0 \ No newline at end of file diff --git a/feign/pom.xml b/feign/pom.xml index 78e1bbcf4c..ffcde60c54 100644 --- a/feign/pom.xml +++ b/feign/pom.xml @@ -1,7 +1,8 @@ - + 4.0.0 - com.baeldung.feign feign-client @@ -12,13 +13,6 @@ .. - - UTF-8 - 9.4.0 - 1.16.12 - 1.4.2.RELEASE - - io.github.openfeign @@ -60,4 +54,11 @@ + + UTF-8 + 9.4.0 + 1.16.12 + 1.4.2.RELEASE + + diff --git a/flips/pom.xml b/flips/pom.xml index 77d1df1a8b..be9f584114 100644 --- a/flips/pom.xml +++ b/flips/pom.xml @@ -1,55 +1,42 @@ 4.0.0 - flips flips 0.0.1-SNAPSHOT jar - flips - + + parent-boot-5 com.baeldung 0.0.1-SNAPSHOT ../parent-boot-5 - - UTF-8 - 1.8 - 1.8 - - org.springframework.boot spring-boot-starter-web - 1.5.10.RELEASE + ${spring-boot-starter-web.version} - org.springframework.boot spring-boot-starter-test - 1.5.9.RELEASE + ${spring-boot-starter-test.version} - com.github.feature-flip flips-web - 1.0.1 + ${flips-web.version} - org.projectlombok lombok - 1.16.18 + ${lombok.version} provided - - - @@ -67,4 +54,15 @@ + + + UTF-8 + 1.8 + 1.8 + 1.5.10.RELEASE + 1.5.9.RELEASE + 1.0.1 + 1.16.18 + + diff --git a/flyway/pom.xml b/flyway/pom.xml index 84009e4579..3637f1de28 100644 --- a/flyway/pom.xml +++ b/flyway/pom.xml @@ -2,10 +2,8 @@ 4.0.0 - flyway jar - flyway Flyway Callbacks Demo @@ -16,30 +14,21 @@ ../parent-boot-5 - - UTF-8 - UTF-8 - 1.8 - - org.flywaydb flyway-core - 5.0.2 + ${flyway-core.version} - org.springframework.boot spring-boot-starter-jdbc - mysql mysql-connector-java - 6.0.3 + ${mysql-connector-java.version} - com.h2database h2 @@ -57,7 +46,7 @@ org.flywaydb flyway-maven-plugin - 5.0.2 + ${flyway-maven-plugin.version} com.h2database @@ -73,4 +62,13 @@ + + UTF-8 + UTF-8 + 1.8 + 5.0.2 + 6.0.3 + 5.0.2 + + diff --git a/geotools/pom.xml b/geotools/pom.xml index 01bd6448bb..9347d17fc1 100644 --- a/geotools/pom.xml +++ b/geotools/pom.xml @@ -1,24 +1,24 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung geotools 0.0.1-SNAPSHOT jar - geotools http://maven.apache.org - + + com.baeldung parent-modules 1.0.0-SNAPSHOT + junit junit - 4.12 + ${junit.version} test @@ -37,6 +37,7 @@ ${geotools-swing.version} + maven2-repository.dev.java.net @@ -57,21 +58,8 @@ http://repo.opengeo.org - - - - true - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - - + + 15.2 15.2 15.2 diff --git a/google-cloud/pom.xml b/google-cloud/pom.xml index 0f1eff36f8..b6e54e33c1 100644 --- a/google-cloud/pom.xml +++ b/google-cloud/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 google-cloud 0.1-SNAPSHOT @@ -18,7 +18,7 @@ com.google.cloud google-cloud-storage - 1.16.0 + ${google-cloud-storage.version} org.projectlombok @@ -31,8 +31,8 @@ 1.16.18 - 1.8 UTF-8 + 1.16.0 diff --git a/graphql/graphql-java/pom.xml b/graphql/graphql-java/pom.xml index c031ddc694..27d2cebf26 100644 --- a/graphql/graphql-java/pom.xml +++ b/graphql/graphql-java/pom.xml @@ -1,29 +1,33 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.graphql + graphql-java + 1.0 + graphql-java - com.baeldung.graphql - graphql-java - 1.0 + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - graphql-java + + + com.graphql-java + graphql-java-annotations + ${graphql-java-annotations.version} + + + io.ratpack + ratpack-core + ${ratpack-core.version} + + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + 3.0.3 + 1.4.6 + - - - com.graphql-java - graphql-java-annotations - 3.0.3 - - - io.ratpack - ratpack-core - 1.4.6 - - \ No newline at end of file diff --git a/grpc/pom.xml b/grpc/pom.xml index 99d41172c7..ad563f16fd 100644 --- a/grpc/pom.xml +++ b/grpc/pom.xml @@ -1,23 +1,18 @@ 4.0.0 - grpc grpc-demo 0.0.1-SNAPSHOT jar - grpc-demo http://maven.apache.org - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - UTF-8 - 1.5.0 - @@ -38,23 +33,24 @@ junit junit - 4.12 + ${junit.version} test + kr.motd.maven os-maven-plugin - 1.5.0.Final + ${os-maven-plugin.version} org.xolstice.maven.plugins protobuf-maven-plugin - 0.5.0 + ${protobuf-maven-plugin.version} com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier} @@ -75,4 +71,12 @@ + + + UTF-8 + 1.5.0 + 1.5.0.Final + 0.5.0 + + diff --git a/gson/pom.xml b/gson/pom.xml index 24162bb72b..3e0bafee2c 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung gson 0.1-SNAPSHOT - gson @@ -14,15 +13,12 @@ - - joda-time joda-time ${joda-time.version} - com.google.guava guava @@ -33,27 +29,22 @@ commons-io ${commons-io.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - - com.google.code.gson gson ${gson.version} - @@ -69,14 +60,12 @@ 2.8.0 - 19.0 3.5 4.1 2.5 2.9.6 - \ No newline at end of file diff --git a/guava-modules/guava-18/pom.xml b/guava-modules/guava-18/pom.xml index f8dbf5657e..d2ddcc3fac 100644 --- a/guava-modules/guava-18/pom.xml +++ b/guava-modules/guava-18/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung guava-18 0.1.0-SNAPSHOT @@ -11,7 +10,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ @@ -25,4 +24,5 @@ 18.0 + \ No newline at end of file diff --git a/guava-modules/guava-19/pom.xml b/guava-modules/guava-19/pom.xml index 4a23bf7aec..225dc9e9e3 100644 --- a/guava-modules/guava-19/pom.xml +++ b/guava-modules/guava-19/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung guava-19 0.1.0-SNAPSHOT diff --git a/guava-modules/guava-21/pom.xml b/guava-modules/guava-21/pom.xml index f5432fb7df..42b66d84c8 100644 --- a/guava-modules/guava-21/pom.xml +++ b/guava-modules/guava-21/pom.xml @@ -1,9 +1,7 @@ - 4.0.0 - guava-21 1.0-SNAPSHOT @@ -11,22 +9,26 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ - + ../../ + com.google.guava guava - 21.0 + ${guava.version} org.jooq jool - 0.9.12 + ${jool.version} + + 21.0 + 0.9.12 + \ No newline at end of file diff --git a/guava/README.md b/guava/README.md index 08814fd8b5..bb4e225649 100644 --- a/guava/README.md +++ b/guava/README.md @@ -32,3 +32,4 @@ - [Bloom Filter in Java using Guava](http://www.baeldung.com/guava-bloom-filter) - [Using Guava CountingOutputStream](http://www.baeldung.com/guava-counting-outputstream) - [Hamcrest Text Matchers](http://www.baeldung.com/hamcrest-text-matchers) +- [Quick Guide to the Guava RateLimiter](http://www.baeldung.com/guava-rate-limiter) diff --git a/guava/pom.xml b/guava/pom.xml index e2538d090b..3ad3220f21 100644 --- a/guava/pom.xml +++ b/guava/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung guava 0.1.0-SNAPSHOT - guava @@ -14,37 +13,29 @@ - - com.google.guava guava ${guava.version} - org.apache.commons commons-collections4 ${commons-collections4.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - - org.assertj assertj-core ${assertj.version} test - - diff --git a/guest/core-java-9/pom.xml b/guest/core-java-9/pom.xml index e37f696e33..f8e2dcce85 100644 --- a/guest/core-java-9/pom.xml +++ b/guest/core-java-9/pom.xml @@ -1,32 +1,40 @@ - 4.0.0 - com.stackify - core-java-9 - 0.0.1-SNAPSHOT - + 4.0.0 + com.stackify + core-java-9 + 0.0.1-SNAPSHOT + + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - + + junit junit - 4.12 + ${junit.version} - - - - - maven-compiler-plugin - 3.7.0 - - 1.9 - 1.9 - - - - + + + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + 1.9 + 1.9 + + \ No newline at end of file diff --git a/guest/core-java/pom.xml b/guest/core-java/pom.xml index 35756f784b..b3c6ba9564 100644 --- a/guest/core-java/pom.xml +++ b/guest/core-java/pom.xml @@ -1,26 +1,28 @@ - 4.0.0 - com.stackify - core-java - 0.0.1-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.stackify + core-java + 0.0.1-SNAPSHOT + + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - - junit - junit - 4.12 - - - org.apache.logging.log4j - log4j-core - ${log4j2.version} - + + + + junit + junit + ${junit.version} + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + org.hamcrest hamcrest-core @@ -39,22 +41,18 @@ ${org.hamcrest.version} test - + + org.assertj + assertj-core + ${assertj.version} + test + + + + + 2.8.2 + 1.3 + 3.6.1 + - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - - - 2.8.2 - 1.3 - \ No newline at end of file diff --git a/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitamin.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitamin.java new file mode 100644 index 0000000000..90cb49b321 --- /dev/null +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitamin.java @@ -0,0 +1,50 @@ +package com.stackify.optionalparams; + +public class MultiVitamin { + + private String name; // required + private int vitaminA; // in mcg + private int vitaminC; // in mg + private int calcium; // in mg + private int iron; // in mg + + public MultiVitamin(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public int getVitaminA() { + return vitaminA; + } + + public void setVitaminA(int vitaminA) { + this.vitaminA = vitaminA; + } + + public int getVitaminC() { + return vitaminC; + } + + public void setVitaminC(int vitaminC) { + this.vitaminC = vitaminC; + } + + public int getCalcium() { + return calcium; + } + + public void setCalcium(int calcium) { + this.calcium = calcium; + } + + public int getIron() { + return iron; + } + + public void setIron(int iron) { + this.iron = iron; + } +} \ No newline at end of file diff --git a/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminAllowingNulls.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminAllowingNulls.java new file mode 100644 index 0000000000..1d2a61354d --- /dev/null +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminAllowingNulls.java @@ -0,0 +1,38 @@ +package com.stackify.optionalparams; + +public class MultiVitaminAllowingNulls { + + private String name; // required + private Integer vitaminA; // in mcg + private Integer vitaminC; // in mg + private Integer calcium; // in mg + private Integer iron; // in mg + + public MultiVitaminAllowingNulls(String name, Integer vitaminA, Integer vitaminC, Integer calcium, Integer iron) { + this.name = name; + this.vitaminA = vitaminA; + this.vitaminC = vitaminC; + this.calcium = calcium; + this.iron = iron; + } + + public String getName() { + return name; + } + + public Integer getVitaminA() { + return vitaminA; + } + + public Integer getVitaminC() { + return vitaminC; + } + + public Integer getCalcium() { + return calcium; + } + + public Integer getIron() { + return iron; + } +} \ No newline at end of file diff --git a/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminOverloading.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminOverloading.java new file mode 100644 index 0000000000..e9dcb2509b --- /dev/null +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminOverloading.java @@ -0,0 +1,56 @@ +package com.stackify.optionalparams; + +public class MultiVitaminOverloading { + + static final int DEFAULT_IRON_AMOUNT = 20; + + private final String name; // required + private final int vitaminA; // in mcg + private final int vitaminC; // in mg + private final int calcium; // in mg + private final int iron; // in mg + + public MultiVitaminOverloading(String name) { + this(name, 0); + } + + public MultiVitaminOverloading(String name, int vitaminA) { + this(name, vitaminA, 0); + } + + public MultiVitaminOverloading(String name, int vitaminA, int vitaminC) { + this(name, vitaminA, vitaminC, 0); + } + + public MultiVitaminOverloading(String name, int vitaminA, int vitaminC, int calcium) { + this(name, vitaminA, vitaminC, calcium, DEFAULT_IRON_AMOUNT); + } + + public MultiVitaminOverloading(String name, int vitaminA, int vitaminC, int calcium, int iron) { + this.name = name; + this.vitaminA = vitaminA; + this.vitaminC = vitaminC; + this.calcium = calcium; + this.iron = iron; + } + + public String getName() { + return name; + } + + public int getVitaminA() { + return vitaminA; + } + + public int getVitaminC() { + return vitaminC; + } + + public int getCalcium() { + return calcium; + } + + public int getIron() { + return iron; + } +} \ No newline at end of file diff --git a/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminStaticFactoryMethods.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminStaticFactoryMethods.java new file mode 100644 index 0000000000..229a2f0004 --- /dev/null +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminStaticFactoryMethods.java @@ -0,0 +1,52 @@ +package com.stackify.optionalparams; + +public class MultiVitaminStaticFactoryMethods { + + static final int IRON_AMT_DEF = 20; + static final int IRON_AMT_MEN = 30; + + static final int CALCIUM_AMT_DEF = 100; + static final int CALCIUM_AMT_WOMEN = 120; + + private final String name; // required + private final int vitaminA; // in mcg + private final int vitaminC; // in mg + private final int calcium; // in mg + private final int iron; // in mg + + public static MultiVitaminStaticFactoryMethods forMen(String name) { + return new MultiVitaminStaticFactoryMethods(name, 5000, 60, CALCIUM_AMT_DEF, IRON_AMT_MEN); + } + + public static MultiVitaminStaticFactoryMethods forWomen(String name) { + return new MultiVitaminStaticFactoryMethods(name, 5000, 60, CALCIUM_AMT_WOMEN, IRON_AMT_DEF); + } + + private MultiVitaminStaticFactoryMethods(String name, int vitaminA, int vitaminC, int calcium, int iron) { + this.name = name; + this.vitaminA = vitaminA; + this.vitaminC = vitaminC; + this.calcium = calcium; + this.iron = iron; + } + + public String getName() { + return name; + } + + public int getVitaminA() { + return vitaminA; + } + + public int getVitaminC() { + return vitaminC; + } + + public int getCalcium() { + return calcium; + } + + public int getIron() { + return iron; + } +} \ No newline at end of file diff --git a/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminWithBuilder.java b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminWithBuilder.java new file mode 100644 index 0000000000..8097074b86 --- /dev/null +++ b/guest/core-java/src/main/java/com/stackify/optionalparams/MultiVitaminWithBuilder.java @@ -0,0 +1,77 @@ +package com.stackify.optionalparams; + +public class MultiVitaminWithBuilder { + + private final String name; // required + private final int vitaminA; // in mcg + private final int vitaminC; // in mg + private final int calcium; // in mg + private final int iron; // in mg + + private MultiVitaminWithBuilder(MultiVitaminBuilder builder) { + this.name = builder.name; + this.vitaminA = builder.vitaminA; + this.vitaminC = builder.vitaminC; + this.calcium = builder.calcium; + this.iron = builder.iron; + } + + public String getName() { + return name; + } + + public int getVitaminA() { + return vitaminA; + } + + public int getVitaminC() { + return vitaminC; + } + + public int getCalcium() { + return calcium; + } + + public int getIron() { + return iron; + } + + public static class MultiVitaminBuilder { + + private static final int ZERO = 0; + + private final String name; // required + private int vitaminA = ZERO; + private int vitaminC = ZERO; + private int calcium = ZERO; + private int iron = ZERO; + + public MultiVitaminBuilder(String name) { + this.name = name; + } + + public MultiVitaminBuilder withVitaminA(int vitaminA) { + this.vitaminA = vitaminA; + return this; + } + + public MultiVitaminBuilder withVitaminC(int vitaminC) { + this.vitaminC = vitaminC; + return this; + } + + public MultiVitaminBuilder withCalcium(int calcium) { + this.calcium = calcium; + return this; + } + + public MultiVitaminBuilder withIron(int iron) { + this.iron = iron; + return this; + } + + public MultiVitaminWithBuilder build() { + return new MultiVitaminWithBuilder(this); + } + } +} diff --git a/guest/core-java/src/test/java/com/stackify/optionalparams/OptionalParamsUnitTest.java b/guest/core-java/src/test/java/com/stackify/optionalparams/OptionalParamsUnitTest.java new file mode 100644 index 0000000000..947ce83a90 --- /dev/null +++ b/guest/core-java/src/test/java/com/stackify/optionalparams/OptionalParamsUnitTest.java @@ -0,0 +1,96 @@ +package com.stackify.optionalparams; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.math.BigDecimal; + +import org.assertj.core.util.Arrays; +import org.junit.Test; + +public class OptionalParamsUnitTest { + + @Test + public void whenCreateMultiVitaminWithOverloading_thenOk() { + MultiVitaminOverloading multiVitamin = new MultiVitaminOverloading("Default Multivitamin"); + + assertThat(multiVitamin.getName()).isEqualTo("Default Multivitamin"); + assertThat(multiVitamin.getVitaminA()).isEqualTo(0); + assertThat(multiVitamin.getVitaminC()).isEqualTo(0); + assertThat(multiVitamin.getCalcium()).isEqualTo(0); + assertThat(multiVitamin.getIron()).isEqualTo(MultiVitaminOverloading.DEFAULT_IRON_AMOUNT); + } + + @Test + public void whenCreateMultiVitaminWithStaticFactoryMethods_thenOk() { + MultiVitaminStaticFactoryMethods mensMultiVitamin = MultiVitaminStaticFactoryMethods.forMen("Complete for Men"); + + assertThat(mensMultiVitamin.getName()).isEqualTo("Complete for Men"); + assertThat(mensMultiVitamin.getCalcium()).isEqualTo(MultiVitaminStaticFactoryMethods.CALCIUM_AMT_DEF); + assertThat(mensMultiVitamin.getIron()).isEqualTo(MultiVitaminStaticFactoryMethods.IRON_AMT_MEN); + + MultiVitaminStaticFactoryMethods womensMultiVitamin = MultiVitaminStaticFactoryMethods.forWomen("Complete for Women"); + + assertThat(womensMultiVitamin.getName()).isEqualTo("Complete for Women"); + assertThat(womensMultiVitamin.getCalcium()).isEqualTo(MultiVitaminStaticFactoryMethods.CALCIUM_AMT_WOMEN); + assertThat(womensMultiVitamin.getIron()).isEqualTo(MultiVitaminStaticFactoryMethods.IRON_AMT_DEF); + } + + @Test + public void whenCreateMultiVitaminWithBuilder_thenOk() { + MultiVitaminWithBuilder vitamin = new MultiVitaminWithBuilder.MultiVitaminBuilder("Maximum Strength") + .withCalcium(100) + .withIron(200) + .withVitaminA(50) + .withVitaminC(1000) + .build(); + + assertThat(vitamin.getName()).isEqualTo("Maximum Strength"); + assertThat(vitamin.getCalcium()).isEqualTo(100); + assertThat(vitamin.getIron()).isEqualTo(200); + assertThat(vitamin.getVitaminA()).isEqualTo(50); + assertThat(vitamin.getVitaminC()).isEqualTo(1000); + } + + @Test + public void whenCreateMutliVitaminWithAccessors_thenOk() { + MultiVitamin vitamin = new MultiVitamin("Generic"); + vitamin.setVitaminA(50); + vitamin.setVitaminC(1000); + vitamin.setCalcium(100); + vitamin.setIron(200); + + assertThat(vitamin.getName()).isEqualTo("Generic"); + assertThat(vitamin.getCalcium()).isEqualTo(100); + assertThat(vitamin.getIron()).isEqualTo(200); + assertThat(vitamin.getVitaminA()).isEqualTo(50); + assertThat(vitamin.getVitaminC()).isEqualTo(1000); + } + + @Test + public void whenCreateMultiVitaminWithNulls_thenOk() { + MultiVitamin vitamin = new MultiVitamin(null); + + assertThat(vitamin.getName()).isNull(); + } + + public void varArgsDemo() { + Object[] args = Arrays.array(Long.valueOf(1), Integer.valueOf(2), BigDecimal.valueOf(3)); + + processVarArgsWithCastingAntiPattern(args); + } + + private void processVarArgsWithCastingAntiPattern(Object... args) { + String message = "processing %s as %s"; + + // never do this sort of thing + for (Object arg : args) { + if (arg instanceof Long) { + System.out.println(String.format(message, arg, "Long")); + } else if (arg instanceof Integer) { + System.out.println(String.format(message, arg, "Integer")); + } else if (arg instanceof BigDecimal) { + System.out.println(String.format(message, arg, "BigDecimal")); + } + } + } +} diff --git a/guest/deep-jsf/pom.xml b/guest/deep-jsf/pom.xml index 4697bbf588..bd02b145d0 100644 --- a/guest/deep-jsf/pom.xml +++ b/guest/deep-jsf/pom.xml @@ -6,11 +6,11 @@ deep-jsf 0.0.1-SNAPSHOT war - + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ false @@ -29,17 +29,6 @@ deep-jsf - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - \ No newline at end of file diff --git a/guest/junit5-example/pom.xml b/guest/junit5-example/pom.xml index 0e92060a71..a63ccdee35 100644 --- a/guest/junit5-example/pom.xml +++ b/guest/junit5-example/pom.xml @@ -1,73 +1,65 @@ - 4.0.0 - junit5-example - junit5-example - 0.0.1-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + junit5-example + junit5-example + 0.0.1-SNAPSHOT + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - - org.junit.jupiter - junit-jupiter-engine - 5.0.0-M4 - - - org.junit.jupiter - junit-jupiter-params - 5.0.0-M4 - + + + org.junit.jupiter + junit-jupiter-engine + 5.0.0-M4 + + + org.junit.jupiter + junit-jupiter-params + 5.0.0-M4 + - - org.junit.vintage - junit-vintage-engine - 4.12.0-M4 - + + org.junit.vintage + junit-vintage-engine + 4.12.0-M4 + - - com.h2database - h2 - 1.4.195 - + + com.h2database + h2 + 1.4.195 + - - org.apache.logging.log4j - log4j-core - 2.8.2 - + + org.apache.logging.log4j + log4j-core + 2.8.2 + - + - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - maven-surefire-plugin - 2.19.1 - - - org.junit.platform - junit-platform-surefire-provider - 1.0.0-M4 - - - - - math - - - - - + + + + maven-surefire-plugin + 2.19.1 + + + org.junit.platform + junit-platform-surefire-provider + 1.0.0-M4 + + + + + math + + + + + \ No newline at end of file diff --git a/guest/log4j2-example/pom.xml b/guest/log4j2-example/pom.xml index 594b759538..760af88a06 100644 --- a/guest/log4j2-example/pom.xml +++ b/guest/log4j2-example/pom.xml @@ -1,61 +1,51 @@ - 4.0.0 - log4j2-example - log4j2-example - 0.0.1-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + log4j2-example + log4j2-example + 0.0.1-SNAPSHOT + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - - - org.apache.logging.log4j - log4j-core - ${log4j-core.version} - + + + + org.apache.logging.log4j + log4j-core + ${log4j-core.version} + - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + - - junit - junit - 4.12 - - + + junit + junit + 4.12 + + - - - - src/main/resources/ - - **/*.java - - - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - + + + + src/main/resources/ + + **/*.java + + + + - - 2.8.8.1 - 2.8.2 - + + 2.8.8.1 + 2.8.2 + \ No newline at end of file diff --git a/guest/logback-example/pom.xml b/guest/logback-example/pom.xml index 1f277787d3..d913db26bd 100644 --- a/guest/logback-example/pom.xml +++ b/guest/logback-example/pom.xml @@ -1,46 +1,32 @@ - 4.0.0 - com.stackify - logback-example - 0.0.1-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.stackify + logback-example + 0.0.1-SNAPSHOT + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - - ch.qos.logback - logback-classic - 1.2.3 - + + + ch.qos.logback + logback-classic + 1.2.3 + - - junit - junit - 4.12 - + + junit + junit + 4.12 + - - org.codehaus.janino - janino - 3.0.7 - - - - - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - + + org.codehaus.janino + janino + 3.0.7 + + \ No newline at end of file diff --git a/guest/memory-leaks/pom.xml b/guest/memory-leaks/pom.xml index e0f256b2d5..0bb201dd2f 100644 --- a/guest/memory-leaks/pom.xml +++ b/guest/memory-leaks/pom.xml @@ -1,44 +1,36 @@ - 4.0.0 - com.baeldung - memory-leaks - 0.0.1-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + memory-leaks + 0.0.1-SNAPSHOT + + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - - junit - junit - 4.12 - - - - - - src/main/resources/ - - **/*.java - - - - src/test/resources/ - - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - + + + junit + junit + ${junit.version} + + + + + + + src/main/resources/ + + **/*.java + + + + src/test/resources/ + + + \ No newline at end of file diff --git a/guest/remote-debugging/pom.xml b/guest/remote-debugging/pom.xml index 8540347e40..6e077fce56 100644 --- a/guest/remote-debugging/pom.xml +++ b/guest/remote-debugging/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.stackify java-remote-debugging 0.0.1-SNAPSHOT @@ -11,28 +10,19 @@ org.springframework.boot spring-boot-starter-parent - 1.5.8.RELEASE + ${spring-boot-starter-parent.version} - - UTF-8 - UTF-8 - 1.8 - - - org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-starter-tomcat - @@ -45,4 +35,10 @@ + + UTF-8 + UTF-8 + 1.5.8.RELEASE + + diff --git a/guest/spring-mvc/pom.xml b/guest/spring-mvc/pom.xml index 1f695a75a7..169b216ff9 100644 --- a/guest/spring-mvc/pom.xml +++ b/guest/spring-mvc/pom.xml @@ -2,19 +2,17 @@ 4.0.0 - com.stackify.guest spring-mvc 0.0.1-SNAPSHOT jar - spring-mvc Spring MVC sample project org.springframework.boot spring-boot-starter-parent - 2.0.0.M5 + ${spring-boot-starter-parent.version} @@ -39,6 +37,7 @@ + spring-milestones @@ -53,7 +52,7 @@ UTF-8 UTF-8 - 1.8 + 2.0.0.M5 diff --git a/guest/spring-security/pom.xml b/guest/spring-security/pom.xml index c41637bfc2..16e946d108 100644 --- a/guest/spring-security/pom.xml +++ b/guest/spring-security/pom.xml @@ -3,21 +3,19 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.stackify.guest spring-security 1.0-SNAPSHOT + spring-security + Spring Security Sample Project org.springframework.boot spring-boot-starter-parent - 2.0.0.M6 + ${spring-boot-starter-parent.version} - spring-security - Spring Security Sample Project - org.springframework.boot @@ -30,7 +28,7 @@ org.thymeleaf thymeleaf-spring5 - 3.0.8.RELEASE + ${thymeleaf-spring5.version} org.springframework.boot @@ -57,6 +55,7 @@ + spring-milestones @@ -71,7 +70,8 @@ UTF-8 UTF-8 - 1.8 + 3.0.8.RELEASE + 2.0.0.M6 \ No newline at end of file diff --git a/guest/thread-pools/pom.xml b/guest/thread-pools/pom.xml index 32ae6384e2..56173b1285 100644 --- a/guest/thread-pools/pom.xml +++ b/guest/thread-pools/pom.xml @@ -1,33 +1,27 @@ - 4.0.0 - com.stackify - thread-pools - 0.0.1-SNAPSHOT - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.stackify + thread-pools + 0.0.1-SNAPSHOT + + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - - ch.qos.logback - logback-classic - 1.2.3 - - - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - + + + ch.qos.logback + logback-classic + ${logback-classic.version} + + + + + 1.2.3 + + \ No newline at end of file diff --git a/guest/tomcat-app/pom.xml b/guest/tomcat-app/pom.xml index 02f3abcc32..f3447b08c3 100644 --- a/guest/tomcat-app/pom.xml +++ b/guest/tomcat-app/pom.xml @@ -1,68 +1,58 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.stackify tomcat-app 0.0.1-SNAPSHOT war - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ + org.glassfish.jersey.containers jersey-container-servlet - 2.25.1 + ${jersey-container-servlet.version} org.glassfish.jersey.media jersey-media-moxy - 2.25.1 + ${jersey-media-moxy.version} io.rest-assured rest-assured - 3.0.3 + ${rest-assured.version} junit junit - 4.12 + ${junit.version} - com.h2database h2 - 1.4.195 + ${h2database.version} - org.apache.logging.log4j log4j-core - 2.8.2 + ${log4j-core.version} - net.bull.javamelody javamelody-core - 1.69.0 + ${javamelody-core.version} - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - maven-war-plugin 3.0.0 @@ -72,4 +62,15 @@ + + + 1.2.3 + 2.25.1 + 1.4.195 + 3.0.3 + 2.8.2 + 1.69.0 + 2.25.1 + + \ No newline at end of file diff --git a/guest/webservices/rest-client/pom.xml b/guest/webservices/rest-client/pom.xml index d74d713a29..84f4eaf3c0 100644 --- a/guest/webservices/rest-client/pom.xml +++ b/guest/webservices/rest-client/pom.xml @@ -1,33 +1,32 @@ - 4.0.0 - com.stackify - rest-client - 0.0.1-SNAPSHOT - war - + 4.0.0 + com.stackify + rest-client + 0.0.1-SNAPSHOT + war + + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../../ + ../../../ - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - maven-war-plugin - 2.6 - - WebContent - false - - - - + + + + + maven-war-plugin + ${maven-war-plugin.version} + + WebContent + false + + + + + + + 2.6 + + \ No newline at end of file diff --git a/guest/webservices/rest-server/pom.xml b/guest/webservices/rest-server/pom.xml index be43a85166..955afdd82c 100644 --- a/guest/webservices/rest-server/pom.xml +++ b/guest/webservices/rest-server/pom.xml @@ -1,56 +1,58 @@ - 4.0.0 - com.stackify - rest-server - 0.0.1-SNAPSHOT - war - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.stackify + rest-server + 0.0.1-SNAPSHOT + war + + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../../ + ../../../ - - - org.glassfish.jersey.containers - jersey-container-servlet - 2.25.1 - - - org.glassfish.jersey.media - jersey-media-moxy - 2.25.1 - - - io.rest-assured - rest-assured - 3.0.3 - - - junit - junit - 4.12 - - - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - maven-war-plugin - 3.0.0 - - WebContent - - - - + + + org.glassfish.jersey.containers + jersey-container-servlet + ${jersey-container-servlet.version} + + + org.glassfish.jersey.media + jersey-media-moxy + ${jersey-media-moxy.version} + + + io.rest-assured + rest-assured + ${rest-assured.version} + + + junit + junit + ${junit.version} + + + + + + + maven-war-plugin + ${maven-war-plugin.version} + + WebContent + + + + + + + 3.0.0 + 2.25.1 + 3.0.3 + 2.25.1 + + \ No newline at end of file diff --git a/guest/webservices/spring-rest-service/pom.xml b/guest/webservices/spring-rest-service/pom.xml index 11082cf17b..74b76ee725 100644 --- a/guest/webservices/spring-rest-service/pom.xml +++ b/guest/webservices/spring-rest-service/pom.xml @@ -1,48 +1,59 @@ - 4.0.0 - com.stackify - spring-rest-service - 0.0.1-SNAPSHOT - war + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.stackify + spring-rest-service + 0.0.1-SNAPSHOT + war - - org.springframework.boot - spring-boot-starter-parent - 1.5.4.RELEASE - + + org.springframework.boot + spring-boot-starter-parent + ${spring-boot-starter-parent.version} + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-hateoas - - - io.springfox - springfox-swagger2 - 2.7.0 - - - io.springfox - springfox-swagger-ui - 2.7.0 - - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-hateoas + + + io.springfox + springfox-swagger2 + ${springfox-swagger2.version} + + + io.springfox + springfox-swagger-ui + ${springfox-swagger-ui.version} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + ${maven.compiler.source} + ${maven.compiler.target} + + + + + + + UTF-8 + UTF-8 + 1.5.4.RELEASE + 2.7.0 + 2.7.0 + 1.8 + 1.8 + - - - - org.springframework.boot - spring-boot-maven-plugin - - 1.8 - 1.8 - - - - \ No newline at end of file diff --git a/guice/pom.xml b/guice/pom.xml index 17b599a379..ba0ed39c4a 100644 --- a/guice/pom.xml +++ b/guice/pom.xml @@ -1,11 +1,12 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.examples.guice guice 1.0-SNAPSHOT jar + guice com.baeldung @@ -20,9 +21,10 @@ ${guice.version} + UTF-8 4.1.0 - guice + diff --git a/handling-spring-static-resources/pom.xml b/handling-spring-static-resources/pom.xml index 65a6e120a0..a3c714514e 100644 --- a/handling-spring-static-resources/pom.xml +++ b/handling-spring-static-resources/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - com.baeldung spring-static-resources 0.1.0-SNAPSHOT war - spring-static-resources @@ -18,7 +16,6 @@ - org.springframework.security spring-security-web diff --git a/hazelcast/pom.xml b/hazelcast/pom.xml index 2811bf8b12..aa7faa07cf 100644 --- a/hazelcast/pom.xml +++ b/hazelcast/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung hazelcast @@ -18,13 +18,11 @@ hazelcast ${hazelcast.version} - com.hazelcast hazelcast-client ${hazelcast.version} - diff --git a/hbase/pom.xml b/hbase/pom.xml index 5fe47fcdc7..ff4aa15130 100644 --- a/hbase/pom.xml +++ b/hbase/pom.xml @@ -1,14 +1,14 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + hbase + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - hbase @@ -34,5 +34,4 @@ 1.3.1 - \ No newline at end of file diff --git a/hibernate5/pom.xml b/hibernate5/pom.xml index 31fe10ee97..6ed13b8ae4 100644 --- a/hibernate5/pom.xml +++ b/hibernate5/pom.xml @@ -1,27 +1,21 @@ - 4.0.0 - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - com.baeldung - hibernate5 - 0.0.1-SNAPSHOT - hibernate5 - http://maven.apache.org - - UTF-8 - - 3.7.0 - 5.2.12.Final - 6.0.6 - 2.2.3 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + 4.0.0 + com.baeldung + hibernate5 + 0.0.1-SNAPSHOT + hibernate5 + http://maven.apache.org + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + org.hibernate hibernate-core @@ -30,18 +24,18 @@ junit junit - 4.12 + ${junit.version} org.assertj assertj-core - 3.8.0 + ${assertj-core.version} test com.h2database h2 - 1.4.196 + ${h2database.version} org.hibernate @@ -58,8 +52,9 @@ mariaDB4j ${mariaDB4j.version} - - + + + hibernate5 @@ -67,33 +62,17 @@ true - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - - org.apache.maven.plugins - maven-surefire-plugin - - 3 - true - - **/*IntegrationTest.java - **/*LiveTest.java - - - - - - - + + + UTF-8 + + 3.7.0 + 5.2.12.Final + 6.0.6 + 2.2.3 + 1.4.196 + 3.8.0 + + diff --git a/httpclient/pom.xml b/httpclient/pom.xml index b7567e0c4b..af50f38ebe 100644 --- a/httpclient/pom.xml +++ b/httpclient/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung httpclient 0.1-SNAPSHOT - httpclient @@ -14,23 +13,18 @@ - - com.google.guava guava ${guava.version} - org.apache.commons commons-lang3 ${commons-lang3.version} - - org.apache.httpcomponents httpclient @@ -42,7 +36,6 @@ - org.apache.httpcomponents fluent-hc @@ -54,19 +47,16 @@ - org.apache.httpcomponents httpmime ${httpclient.version} - commons-codec commons-codec ${commons-codec.version} - org.apache.httpcomponents httpasyncclient @@ -78,15 +68,12 @@ - com.github.tomakehurst wiremock ${wiremock.version} test - - @@ -97,7 +84,6 @@ true - @@ -136,22 +122,17 @@ - 19.0 3.5 1.10 4.1.2 - 2.5.1 - 4.4.5 4.5.3 - 1.6.1 - \ No newline at end of file diff --git a/hystrix/pom.xml b/hystrix/pom.xml index 19da678eb7..8e4a9b28b7 100644 --- a/hystrix/pom.xml +++ b/hystrix/pom.xml @@ -1,6 +1,5 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 hystrix 1.0 @@ -13,23 +12,6 @@ ../parent-boot-5 - - - - - 1.5.8 - 0.20.7 - - - 1.3 - - - 2.6 - 2.7 - 1.5.8 - 1.5.8 - - org.springframework.boot @@ -59,7 +41,7 @@ hystrix-metrics-event-stream ${hystrix-metrics-event-stream.version} - com.netflix.rxjava @@ -79,39 +61,17 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + + + 1.5.8 + 0.20.7 + + 1.3 + + 2.6 + 2.7 + 1.5.8 + 1.5.8 + diff --git a/image-processing/pom.xml b/image-processing/pom.xml index 2e4063964e..51444a7812 100644 --- a/image-processing/pom.xml +++ b/image-processing/pom.xml @@ -1,17 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung image-processing 1.0-SNAPSHOT - - 1.3.5 - 1.51h - - com.baeldung parent-modules @@ -40,17 +34,23 @@ commons-logging - + com.twelvemonkeys.imageio imageio-core - 3.3.2 - + ${imageio.version} + com.twelvemonkeys.imageio imageio-bmp - 3.3.2 + ${imageio.version} + + 1.3.5 + 1.51h + 3.3.2 + + \ No newline at end of file diff --git a/immutables/pom.xml b/immutables/pom.xml index 884ebc0c61..987dce934d 100644 --- a/immutables/pom.xml +++ b/immutables/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - immutables 1.0.0-SNAPSHOT @@ -37,4 +36,5 @@ 3.6.1 0.9.6 + \ No newline at end of file diff --git a/influxdb/pom.xml b/influxdb/pom.xml index 05a8e00fa0..92c47d2082 100644 --- a/influxdb/pom.xml +++ b/influxdb/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 influxdb 0.1-SNAPSHOT @@ -28,17 +28,12 @@ ${lombok.version} provided - - - - 1.8 UTF-8 2.8 1.16.18 - diff --git a/jackson/pom.xml b/jackson/pom.xml index 2587e61ac1..fb2d48d4af 100644 --- a/jackson/pom.xml +++ b/jackson/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung jackson 0.1-SNAPSHOT - jackson @@ -14,9 +13,7 @@ - - com.google.guava guava @@ -113,7 +110,6 @@ ${assertj.version} test - @@ -124,13 +120,11 @@ true - 2.9.4 - 19.0 3.5 @@ -142,7 +136,6 @@ 3.0.1 3.6.1 - diff --git a/java-difference-date/pom.xml b/java-difference-date/pom.xml index ac3f0fa3b5..ad66623581 100644 --- a/java-difference-date/pom.xml +++ b/java-difference-date/pom.xml @@ -1,21 +1,19 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + java-difference-date + 0.0.1-SNAPSHOT + jar + java-difference-date + Difference between two dates in java - com.baeldung - java-difference-date - 0.0.1-SNAPSHOT - jar - - java-difference-date - Difference between two dates in java - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + @@ -36,24 +34,10 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - - - 1.8 4.12 2.9.9 1.5.1 + diff --git a/java-lite/pom.xml b/java-lite/pom.xml index d7950487ca..7c0ed1c780 100644 --- a/java-lite/pom.xml +++ b/java-lite/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung java-lite 1.0-SNAPSHOT @@ -14,15 +13,40 @@ 1.0.0-SNAPSHOT - - 9.4.8.v20171121 - 1.4.13 - 1.15 - 5.1.45 - 1.7.0 - 1.8.2 - 4.12 - + + + org.javalite + activeweb + ${activeweb.version} + + + + mysql + mysql-connector-java + ${mysql.connector.java.version} + + + + com.sun + tools + ${sun.tools.version} + system + ${java.home}/../lib/tools.jar + + + + org.javalite + activeweb-testing + ${activeweb-testing.version} + test + + + + junit + junit + ${junit.version} + + @@ -69,39 +93,14 @@ - - - org.javalite - activeweb - ${activeweb.version} - - - - mysql - mysql-connector-java - ${mysql.connector.java.version} - - - - com.sun - tools - ${sun.tools.version} - system - ${java.home}/../lib/tools.jar - - - - org.javalite - activeweb-testing - 1.15 - test - - - - junit - junit - ${junit.version} - - + + 9.4.8.v20171121 + 1.4.13 + 1.15 + 5.1.45 + 1.7.0 + 1.8.2 + 1.15 + \ No newline at end of file diff --git a/java-rmi/pom.xml b/java-rmi/pom.xml index 7c08968cbf..1543e24fbd 100644 --- a/java-rmi/pom.xml +++ b/java-rmi/pom.xml @@ -1,20 +1,19 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.rmi + java-rmi + 1.0-SNAPSHOT + jar - com.baeldung.rmi - java-rmi - 1.0-SNAPSHOT - jar - - + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - UTF-8 - - + + + + UTF-8 + + diff --git a/java-spi/exchange-rate-api/pom.xml b/java-spi/exchange-rate-api/pom.xml index 27651533a9..2de650d1af 100644 --- a/java-spi/exchange-rate-api/pom.xml +++ b/java-spi/exchange-rate-api/pom.xml @@ -1,14 +1,16 @@ 4.0.0 - exchange-rate-api jar - + com.baeldung java-spi 1.0.0-SNAPSHOT + + + diff --git a/java-spi/exchange-rate-app/pom.xml b/java-spi/exchange-rate-app/pom.xml index 7e64cf7438..b223cf7d95 100644 --- a/java-spi/exchange-rate-app/pom.xml +++ b/java-spi/exchange-rate-app/pom.xml @@ -1,14 +1,13 @@ 4.0.0 - exchange-rate-app jar com.baeldung java-spi - 1.0.0-SNAPSHOT + 1.0.0-SNAPSHOT @@ -17,11 +16,6 @@ exchange-rate-api 1.0.0-SNAPSHOT - - com.baeldung - exchange-rate-impl - 1.0.0-SNAPSHOT - diff --git a/java-spi/exchange-rate-impl/pom.xml b/java-spi/exchange-rate-impl/pom.xml index ec22791351..435f40619e 100644 --- a/java-spi/exchange-rate-impl/pom.xml +++ b/java-spi/exchange-rate-impl/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - exchange-rate-impl jar @@ -11,6 +10,27 @@ 1.0.0-SNAPSHOT + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.0 + + + copy-dependencies + package + + copy-dependencies + + + ${project.build.directory}/depends + + + + + + com.baeldung diff --git a/java-spi/pom.xml b/java-spi/pom.xml index 9bcf6ab174..4b9500ffcd 100644 --- a/java-spi/pom.xml +++ b/java-spi/pom.xml @@ -1,7 +1,6 @@ 4.0.0 - java-spi pom diff --git a/java-vavr-stream/pom.xml b/java-vavr-stream/pom.xml index 25f0254626..093d8763e3 100644 --- a/java-vavr-stream/pom.xml +++ b/java-vavr-stream/pom.xml @@ -1,25 +1,29 @@ - + 4.0.0 com.baeldung.samples java-vavr-stream 1.0 jar - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - UTF-8 - 1.8 - 1.8 - + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + io.vavr vavr - 0.9.2 + ${io.vavr.version} + + + UTF-8 + 0.9.2 + + \ No newline at end of file diff --git a/java-websocket/pom.xml b/java-websocket/pom.xml index 402e3057c6..461182e504 100644 --- a/java-websocket/pom.xml +++ b/java-websocket/pom.xml @@ -1,35 +1,37 @@ - 4.0.0 - com.baeldung - java-websocket - war - 0.0.1-SNAPSHOT - java-websocket Maven Webapp - http://maven.apache.org + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung + java-websocket + war + 0.0.1-SNAPSHOT + java-websocket Maven Webapp + http://maven.apache.org - - UTF-8 - - com.baeldung parent-modules 1.0.0-SNAPSHOT - + - - - javax.websocket - javax.websocket-api - 1.1 - provided - - - com.google.code.gson - gson - 2.8.0 - - + + + javax.websocket + javax.websocket-api + ${javax.websocket-api.version} + provided + + + com.google.code.gson + gson + ${gson.version} + + + + + UTF-8 + 1.1 + 2.8.0 + diff --git a/javafx/pom.xml b/javafx/pom.xml index bcad64aca5..b2de708be1 100644 --- a/javafx/pom.xml +++ b/javafx/pom.xml @@ -1,15 +1,13 @@ - + 4.0.0 + javafx + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - javafx - \ No newline at end of file diff --git a/javax-servlets/pom.xml b/javax-servlets/pom.xml index a75af414cd..69d952da9c 100644 --- a/javax-servlets/pom.xml +++ b/javax-servlets/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - javax-servlets 1.0-SNAPSHOT @@ -13,7 +12,6 @@ - javax.servlet javax.servlet-api @@ -31,11 +29,10 @@ - org.springframework spring-test - 5.0.5.RELEASE + ${spring-test.version} test @@ -43,6 +40,7 @@ 3.1.0 4.5.3 + 5.0.5.RELEASE \ No newline at end of file diff --git a/javaxval/bin/pom.xml b/javaxval/bin/pom.xml index 68e65e4d02..a16072bb1a 100644 --- a/javaxval/bin/pom.xml +++ b/javaxval/bin/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung javaxval @@ -7,7 +7,7 @@ - + javax.validation validation-api diff --git a/javaxval/pom.xml b/javaxval/pom.xml index a05ee43aaf..5de77ed26b 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -1,19 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung javaxval 0.1-SNAPSHOT - - 2.0.1.Final - 6.0.7.Final - 3.0.0 - 2.2.6 - 5.0.2.RELEASE - - - com.baeldung parent-modules @@ -21,25 +12,21 @@ - org.hibernate hibernate-validator ${hibernate-validator.version} - org.hibernate hibernate-validator-annotation-processor ${hibernate-validator.version} - javax.el javax.el-api ${javax.el-api.version} - org.glassfish.web javax.el @@ -55,7 +42,14 @@ spring-test ${org.springframework.version} - + + 2.0.1.Final + 6.0.7.Final + 3.0.0 + 2.2.6 + 5.0.2.RELEASE + + \ No newline at end of file diff --git a/jaxb/pom.xml b/jaxb/pom.xml index 8c9a430929..26d7c8d362 100644 --- a/jaxb/pom.xml +++ b/jaxb/pom.xml @@ -1,12 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung jaxb 0.0.1-SNAPSHOT jaxb - com.baeldung parent-modules @@ -19,30 +18,26 @@ jaxb-runtime ${jaxb.version} - org.glassfish.jaxb jaxb-core ${jaxb.version} - com.sun.istack istack-commons-runtime - 3.0.2 + ${istack-commons-runtime.version} - commons-io commons-io - 2.5 + ${commons-io.version} - org.apache.commons commons-lang3 - 3.5 + ${commons-lang3.version} @@ -60,7 +55,7 @@ org.eclipse.m2e lifecycle-mapping - 1.0.0 + ${lifecycle-mapping-plugin.version} @@ -75,7 +70,7 @@ - + @@ -116,13 +111,13 @@ - @@ -133,6 +128,10 @@ 2.3 + 3.0.2 + 2.5 + 3.5 + 1.0.0 \ No newline at end of file diff --git a/jee-7/pom.xml b/jee-7/pom.xml index f1d50f55c6..62e2132de5 100644 --- a/jee-7/pom.xml +++ b/jee-7/pom.xml @@ -1,427 +1,435 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + jee-7 + 1.0-SNAPSHOT + war + JavaEE 7 Arquillian Archetype Sample - com.baeldung - jee-7 - 1.0-SNAPSHOT - war - JavaEE 7 Arquillian Archetype Sample + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + ${maven.min.version} + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + + + org.jboss.arquillian + arquillian-bom + ${arquillian_core.version} + import + pom + + + org.jboss.arquillian.extension + arquillian-drone-bom + ${arquillian-drone-bom.version} + pom + import + + + - - 1.8 - 3.0.0 + + + javax + javaee-api + ${javaee_api.version} + provided + - 7.0 - 1.1.11.Final - 8.2.1.Final - 1.7.0 - 1.4.6.Final - 3.0.19.Final - 4.1.1 - 1.0.4 - 1.13 - 2.25 - 1.0.0.Final + + org.jboss.arquillian.junit + arquillian-junit-container + test + + + org.jboss.arquillian.graphene + graphene-webdriver + ${graphene-webdriver.version} + pom + test + + + com.jayway.awaitility + awaitility + ${awaitility.version} + test + - 2.6 - 4.2.3.RELEASE - + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + test + jar + - - ${maven.min.version} - + + org.jboss.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven-archive + test + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + commons-io + commons-io + ${commons-io.version} + + + com.sun.faces + jsf-api + ${com.sun.faces.jsf.version} + + + com.sun.faces + jsf-impl + ${com.sun.faces.jsf.version} + + + javax.servlet + jstl + ${jstl.version} + + + javax.servlet + javax.servlet-api + ${javax.servlet-api.version} + + + javax.servlet.jsp + jsp-api + ${jsp-api.version} + provided + + + taglibs + standard + ${taglibs.standard.version} + - - - - org.jboss.arquillian - arquillian-bom - ${arquillian_core.version} - import - pom - - - org.jboss.arquillian.extension - arquillian-drone-bom - 2.0.1.Final - pom - import - - - + + javax.mvc + javax.mvc-api + 20160715 + + + org.glassfish.ozark + ozark + ${ozark.version} + - - - javax - javaee-api - ${javaee_api.version} - provided - + + org.springframework.security + spring-security-web + ${org.springframework.security.version} + - - org.jboss.arquillian.junit - arquillian-junit-container - test - - - org.jboss.arquillian.graphene - graphene-webdriver - 2.1.0.Final - pom - test - - - com.jayway.awaitility - awaitility - ${awaitility.version} - test - + + org.springframework.security + spring-security-config + ${org.springframework.security.version} + + + org.springframework.security + spring-security-taglibs + ${org.springframework.security.version} + + - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven - test - jar - + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + webapp + false + + + + - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven-archive - test - - - org.apache.httpcomponents - httpclient - 4.5 - - - commons-io - commons-io - 2.4 - - - com.sun.faces - jsf-api - 2.2.14 - - - com.sun.faces - jsf-impl - 2.2.14 - - - javax.servlet - jstl - 1.2 - - - javax.servlet - javax.servlet-api - 3.1.0 - - - javax.servlet.jsp - jsp-api - 2.2 - provided - - - taglibs - standard - 1.1.2 - + + + wildfly-managed-arquillian + + true + + + standalone-full.xml + ${project.build.directory}/wildfly-${version.wildfly} + + + + io.undertow + undertow-websockets-jsr + ${undertow-websockets-jsr.version} + test + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-jaxb-provider + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-json-p-provider + ${resteasy.version} + test + + + org.wildfly + wildfly-arquillian-container-managed + ${wildfly.version} + test + + - - javax.mvc - javax.mvc-api - 20160715 - - - org.glassfish.ozark - ozark - 20160715 - + + + + + maven-dependency-plugin + ${maven-dependency-plugin.version} + + ${maven.test.skip} + + + + unpack + process-test-classes + + unpack + + + + + org.wildfly + wildfly-dist + ${wildfly.version} + zip + false + ${project.build.directory} + + + + + + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + ${project.build.directory}/wildfly-${wildfly.version} + + + + + + + + + wildfly-remote-arquillian + + + io.undertow + undertow-websockets-jsr + ${undertow-websockets-jsr.version} + test + + + org.jboss.resteasy + resteasy-client + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-jaxb-provider + ${resteasy.version} + test + + + org.jboss.resteasy + resteasy-json-p-provider + ${resteasy.version} + test + + + org.wildfly + wildfly-arquillian-container-remote + ${wildfly.version} + test + + + + + glassfish-embedded-arquillian + + + org.glassfish.main.extras + glassfish-embedded-all + ${glassfish-embedded-all.version} + test + + + org.glassfish + javax.json + ${javax.json.version} + test + + + org.glassfish.tyrus + tyrus-client + ${tyrus.version} + test + + + org.glassfish.tyrus + tyrus-container-grizzly-client + ${tyrus.version} + test + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + test + + + org.jboss.arquillian.container + arquillian-glassfish-embedded-3.1 + ${arquillian-glassfish.version} + test + + + + + glassfish-remote-arquillian + + + org.glassfish + javax.json + ${javax.json.version} + test + + + org.glassfish.tyrus + tyrus-client + ${tyrus.version} + test + + + org.glassfish.tyrus + tyrus-container-grizzly-client + ${tyrus.version} + test + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + test + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey.version} + test + + + org.glassfish.jersey.media + jersey-media-json-processing + ${jersey.version} + test + + + org.jboss.arquillian.container + arquillian-glassfish-remote-3.1 + ${arquillian-glassfish.version} + test + + + + + webdriver-chrome + + true + + + chrome + + + + webdriver-firefox + + firefox + + + - - org.springframework.security - spring-security-web - ${org.springframework.security.version} - + + + bintray-mvc-spec-maven + bintray + http://dl.bintray.com/mvc-spec/maven + + true + + + false + + + - - org.springframework.security - spring-security-config - ${org.springframework.security.version} - - - org.springframework.security - spring-security-taglibs - ${org.springframework.security.version} - - + + 1.8 + 3.0.0 + 7.0 + 1.1.11.Final + 8.2.1.Final + 1.7.0 + 1.4.6.Final + 3.0.19.Final + 4.1.1 + 1.0.4 + 1.13 + 2.25 + 1.0.0.Final + 2.6 + 4.2.3.RELEASE + 2.17 + 1.1.2 + 2.4 + 2.2.14 + 4.5 + 2.0.1.Final + 3.1.0 + 2.1.0.Final + 2.8 + 1.2 + 2.2 + 20160715 + - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - webapp - false - - - - - - - - - wildfly-managed-arquillian - - true - - - standalone-full.xml - ${project.build.directory}/wildfly-${version.wildfly} - - - - io.undertow - undertow-websockets-jsr - ${undertow-websockets-jsr.version} - test - - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-jaxb-provider - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-json-p-provider - ${resteasy.version} - test - - - org.wildfly - wildfly-arquillian-container-managed - ${wildfly.version} - test - - - - - - - maven-dependency-plugin - 2.8 - - ${maven.test.skip} - - - - unpack - process-test-classes - - unpack - - - - - org.wildfly - wildfly-dist - ${wildfly.version} - zip - false - ${project.build.directory} - - - - - - - - maven-surefire-plugin - 2.17 - - - ${project.build.directory}/wildfly-${wildfly.version} - - - - - - - - - wildfly-remote-arquillian - - - io.undertow - undertow-websockets-jsr - ${undertow-websockets-jsr.version} - test - - - org.jboss.resteasy - resteasy-client - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-jaxb-provider - ${resteasy.version} - test - - - org.jboss.resteasy - resteasy-json-p-provider - ${resteasy.version} - test - - - org.wildfly - wildfly-arquillian-container-remote - ${wildfly.version} - test - - - - - glassfish-embedded-arquillian - - - org.glassfish.main.extras - glassfish-embedded-all - ${glassfish-embedded-all.version} - test - - - org.glassfish - javax.json - ${javax.json.version} - test - - - org.glassfish.tyrus - tyrus-client - ${tyrus.version} - test - - - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus.version} - test - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - test - - - org.jboss.arquillian.container - arquillian-glassfish-embedded-3.1 - ${arquillian-glassfish.version} - test - - - - - glassfish-remote-arquillian - - - org.glassfish - javax.json - ${javax.json.version} - test - - - org.glassfish.tyrus - tyrus-client - ${tyrus.version} - test - - - org.glassfish.tyrus - tyrus-container-grizzly-client - ${tyrus.version} - test - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - test - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey.version} - test - - - org.glassfish.jersey.media - jersey-media-json-processing - ${jersey.version} - test - - - org.jboss.arquillian.container - arquillian-glassfish-remote-3.1 - ${arquillian-glassfish.version} - test - - - - - webdriver-chrome - - true - - - chrome - - - - - webdriver-firefox - - firefox - - - - - - - bintray-mvc-spec-maven - bintray - http://dl.bintray.com/mvc-spec/maven - - true - - - false - - - diff --git a/jee-7/src/main/java/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml b/jee-7/src/main/java/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml index de69efa43a..6a0dd05180 100644 --- a/jee-7/src/main/java/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml +++ b/jee-7/src/main/java/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml @@ -1,57 +1,52 @@ - 4.0.0 - com.baeldung.javaeeannotations - JavaEEAnnotationsSample - 0.0.1-SNAPSHOT - war - JavaEEAnnotationsSample - JavaEEAnnotationsSample - - - - - javax.annotation - javax.annotation-api - 1.3 - - - - javax.servlet - javax.servlet-api - 3.1.0 - - - - javax.servlet.jsp - jsp-api - 2.1 - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-war-plugin - 2.4 - - src/main/webapp - SpringFieldConstructorInjection - false - - - - - JavaEEAnnotationsSample - + 4.0.0 + com.baeldung.javaeeannotations + JavaEEAnnotationsSample + 0.0.1-SNAPSHOT + war + JavaEEAnnotationsSample + JavaEEAnnotationsSample + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + javax.annotation + javax.annotation-api + 1.3 + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + + javax.servlet.jsp + jsp-api + 2.1 + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.4 + + src/main/webapp + SpringFieldConstructorInjection + false + + + + + JavaEEAnnotationsSample + \ No newline at end of file diff --git a/jenkins/hello-world/pom.xml b/jenkins/hello-world/pom.xml index 15cf2f8e34..8c6d691b29 100644 --- a/jenkins/hello-world/pom.xml +++ b/jenkins/hello-world/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin 2.33 - + jenkins-hello-world 1.0-SNAPSHOT diff --git a/jersey/pom.xml b/jersey/pom.xml index 0c8b6b9281..b41ea1f340 100644 --- a/jersey/pom.xml +++ b/jersey/pom.xml @@ -1,63 +1,59 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + 4.0.0 + com.baeldung + jersey + 0.0.1-SNAPSHOT + war - com.baeldung - jersey - 0.0.1-SNAPSHOT - war + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + + org.glassfish.jersey.core + jersey-server + ${jersey.version} + + + org.glassfish.jersey.core + jersey-client + ${jersey.version} + + + org.glassfish.jersey.bundles + jaxrs-ri + ${jersey.version} + + + org.slf4j + slf4j-api + ${slf4j.version} + + - - 2.26 - 1.7.25 - 3.2.0 - + + jersey + + + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + - - jersey - - - maven-war-plugin - ${maven-war-plugin.version} - - false - - - - - - - - org.glassfish.jersey.core - jersey-server - ${jersey.version} - - - org.glassfish.jersey.core - jersey-client - ${jersey.version} - - - org.glassfish.jersey.bundles - jaxrs-ri - ${jersey.version} - - - org.slf4j - slf4j-api - ${slf4j.version} - - - - - + + 2.26 + 1.7.25 + 3.2.0 + diff --git a/jgroups/pom.xml b/jgroups/pom.xml index 0e5971875e..6340e41565 100644 --- a/jgroups/pom.xml +++ b/jgroups/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jgroups 0.1-SNAPSHOT @@ -18,19 +18,18 @@ org.jgroups jgroups - 4.0.10.Final + ${jgroups.version} - commons-cli commons-cli - 1.4 + ${commons-cli.version} - 1.8 UTF-8 + 4.0.10.Final diff --git a/jhipster/jhipster-microservice/car-app/pom.xml b/jhipster/jhipster-microservice/car-app/pom.xml index 5fd7febd07..77e214234e 100644 --- a/jhipster/jhipster-microservice/car-app/pom.xml +++ b/jhipster/jhipster-microservice/car-app/pom.xml @@ -47,8 +47,8 @@ 3.1.3 v6.10.0 - - + + ${project.build.directory}/test-results 0.0.20 @@ -454,7 +454,7 @@ - + @@ -657,9 +657,9 @@ src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml org.h2.Driver jdbc:h2:file:./target/h2db/db/carapp - + carapp - + hibernate:spring:com.car.app.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy true debug @@ -708,7 +708,7 @@ org.apache.maven.plugins maven-war-plugin - + @@ -747,7 +747,7 @@ org.apache.maven.plugins maven-war-plugin - + org.springframework.boot diff --git a/jhipster/jhipster-microservice/dealer-app/pom.xml b/jhipster/jhipster-microservice/dealer-app/pom.xml index 359783ef81..beada8f064 100644 --- a/jhipster/jhipster-microservice/dealer-app/pom.xml +++ b/jhipster/jhipster-microservice/dealer-app/pom.xml @@ -47,8 +47,8 @@ 3.1.3 v6.10.0 - - + + 0.0.20 ${project.build.directory}/test-results @@ -679,7 +679,7 @@ - + diff --git a/jhipster/jhipster-microservice/gateway-app/pom.xml b/jhipster/jhipster-microservice/gateway-app/pom.xml index 32aa432279..d90addf51b 100644 --- a/jhipster/jhipster-microservice/gateway-app/pom.xml +++ b/jhipster/jhipster-microservice/gateway-app/pom.xml @@ -49,8 +49,8 @@ 3.1.3 v6.10.0 - - + + 0.0.20 ${project.build.directory}/test-results @@ -736,7 +736,7 @@ - + diff --git a/jhipster/jhipster-monolithic/pom.xml b/jhipster/jhipster-monolithic/pom.xml index eb4c2ca2d3..fc8e8353b4 100644 --- a/jhipster/jhipster-monolithic/pom.xml +++ b/jhipster/jhipster-monolithic/pom.xml @@ -51,8 +51,8 @@ v6.10.0 4.3.0 - - + + ${project.build.directory}/test-results 0.0.20 @@ -63,21 +63,22 @@ src/main/webapp/content/**/*.*, src/main/webapp/bower_components/**/*.*, - src/main/webapp/i18n/*.js, target/www/**/*.* + src/main/webapp/i18n/*.js, target/www/**/*.* + S3437,UndocumentedApi,BoldAndItalicTagsCheck - src/main/webapp/app/**/*.* Web:BoldAndItalicTagsCheck - src/main/java/**/* squid:S3437 - src/main/java/**/* squid:UndocumentedApi @@ -128,7 +129,7 @@ com.jayway.jsonpath json-path test - @@ -392,8 +393,8 @@ spring-boot:run - org.eclipse.m2e @@ -412,7 +413,7 @@ - + @@ -426,7 +427,7 @@ - + @@ -483,11 +484,11 @@ target/gatling/results src/test/gatling/bodies src/test/gatling/simulations - true - @@ -533,13 +534,15 @@ You are running an older version of Maven. JHipster requires at least Maven - ${maven.version} + ${maven.version} + [${maven.version},) You are running an older version of Java. JHipster requires at least JDK - ${java.version} + ${java.version} + [${java.version}.0,) @@ -588,7 +591,7 @@ org.apache.maven.plugins maven-surefire-plugin - alphabetical @@ -608,12 +611,12 @@ prepare-agent - ${project.testresult.directory}/coverage/jacoco/jacoco.exec - post-unit-test @@ -659,9 +662,9 @@ src/main/resources/config/liquibase/changelog/${maven.build.timestamp}_changelog.xml org.h2.Driver jdbc:h2:file:./target/h2db/db/baeldung - + baeldung - + hibernate:spring:com.baeldung.domain?dialect=org.hibernate.dialect.H2Dialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy true debug @@ -678,7 +681,7 @@ true true - @@ -862,11 +865,11 @@ - cc @@ -927,7 +930,7 @@ true true true - @@ -983,7 +986,7 @@ - IDE @@ -994,32 +997,5 @@ - - integration - - true - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*IntTest.java - - - - - - - - diff --git a/jjwt/pom.xml b/jjwt/pom.xml index cd2dd9f97e..51d4dcf1c0 100644 --- a/jjwt/pom.xml +++ b/jjwt/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - io.jsonwebtoken jjwtfun 0.0.1-SNAPSHOT jar - jjwtfun Exercising the JJWT @@ -18,10 +16,6 @@ ../parent-boot-5 - - 0.7.0 - - org.springframework.boot @@ -45,39 +39,8 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - + + 0.7.0 + + diff --git a/jmeter/pom.xml b/jmeter/pom.xml index 977e3bbc94..bb5769ef57 100644 --- a/jmeter/pom.xml +++ b/jmeter/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - jmeter 0.0.1-SNAPSHOT jar - jmeter Intro to Performance testing using JMeter @@ -17,13 +15,6 @@ ../parent-boot-5 - - UTF-8 - UTF-8 - 1.8 - 2.6.0 - - org.springframework.boot @@ -66,4 +57,12 @@ + + + UTF-8 + UTF-8 + 1.8 + 2.6.0 + + diff --git a/jmh/pom.xml b/jmh/pom.xml index cc3869cca1..2b82b7a9d5 100644 --- a/jmh/pom.xml +++ b/jmh/pom.xml @@ -7,41 +7,34 @@ 1.0-SNAPSHOT jmh http://maven.apache.org - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - UTF-8 - UTF-8 - 1.8 - 1.6 - 1.6 - org.openjdk.jmh jmh-core - 1.19 + ${openjdk.jmh.version} org.openjdk.jmh jmh-generator-annprocess - 1.19 + ${openjdk.jmh.version} junit junit - 3.8.1 + ${junit.version} test - com.google.guava guava - 21.0 + ${guava.version} @@ -61,4 +54,11 @@ + + UTF-8 + UTF-8 + 21.0 + 1.19 + + \ No newline at end of file diff --git a/jooby/pom.xml b/jooby/pom.xml index 1935c646ee..8d4ed186aa 100644 --- a/jooby/pom.xml +++ b/jooby/pom.xml @@ -1,56 +1,58 @@ - 4.0.0 - jooby - com.baeldung.jooby - 1.0 - jooby + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + jooby + com.baeldung.jooby + 1.0 + jooby - - org.jooby - modules - 1.1.3 - + + org.jooby + modules + ${jooby.modules.version} + - - 1.1.3 - com.baeldung.jooby.App - + + + org.jooby + jooby-netty + + + org.jooby + jooby-jedis + ${jooby-jedis.version} + + + ch.qos.logback + logback-classic + + + junit + junit + test + + + io.rest-assured + rest-assured + test + + - - - org.jooby - jooby-netty - - - org.jooby - jooby-jedis - 1.1.3 - - - ch.qos.logback - logback-classic - - - junit - junit - test - - - io.rest-assured - rest-assured - test - - + + + + org.apache.maven.plugins + maven-shade-plugin + + + - - - - org.apache.maven.plugins - maven-shade-plugin - - - + + 1.1.3 + com.baeldung.jooby.App + 1.1.3 + 1.1.3 + diff --git a/jpa-storedprocedure/pom.xml b/jpa-storedprocedure/pom.xml index cbda37a7b3..e6cfe153d5 100644 --- a/jpa-storedprocedure/pom.xml +++ b/jpa-storedprocedure/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung jpa-storedprocedure 1.0 @@ -14,14 +13,6 @@ 1.0.0-SNAPSHOT - - 7.0 - 5.2.5.Final - 6.0.5 - 2.5 - 2.19.1 - - JpaStoredProcedure @@ -29,7 +20,7 @@ maven-assembly-plugin ${project.basedir} - jar-with-dependencies @@ -40,36 +31,36 @@ - - javax javaee-api ${jee.version} provided - org.hibernate hibernate-entitymanager ${hibernate.version} - - mysql mysql-connector-java ${mysql.version} - commons-io commons-io ${commons-io.version} - + + 7.0 + 5.2.5.Final + 6.0.5 + 2.5 + + \ No newline at end of file diff --git a/jsf/pom.xml b/jsf/pom.xml index 5f4e2c69c1..ae97a71244 100644 --- a/jsf/pom.xml +++ b/jsf/pom.xml @@ -1,19 +1,19 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + jsf + 0.1-SNAPSHOT + war + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - jsf - 0.1-SNAPSHOT - war - com.sun.faces jsf-api @@ -29,17 +29,13 @@ javax.el-api ${javax.el.version} - - javax.servlet jstl ${jstl.version} - - org.springframework spring-web @@ -78,6 +74,7 @@ ${javax.servlet.version} + @@ -106,6 +103,6 @@ 2.6 - + \ No newline at end of file diff --git a/json-path/pom.xml b/json-path/pom.xml index 0f8ff3bd31..18bbb5af33 100644 --- a/json-path/pom.xml +++ b/json-path/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 json-path 0.0.1-SNAPSHOT diff --git a/json/pom.xml b/json/pom.xml index 7c74d425af..5d05b73489 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung json @@ -12,7 +12,6 @@ - org.everit.json org.everit.json.schema @@ -24,13 +23,11 @@ - com.alibaba fastjson ${fastjson.version} - org.json json @@ -42,4 +39,5 @@ 1.4.1 1.2.21 + diff --git a/jsonb/pom.xml b/jsonb/pom.xml index 03f4f227b1..f9db831fe3 100644 --- a/jsonb/pom.xml +++ b/jsonb/pom.xml @@ -1,111 +1,110 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + json-b + 0.0.1-SNAPSHOT + jar + json-b + json-b sample project - com.baeldung - json-b - 0.0.1-SNAPSHOT - jar - - json-b - json-b sample project - + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - yasson - - true - - - - - org.eclipse - yasson - ${yasson.version} - - - org.glassfish - javax.json - ${javax.json.version} - - - - - johnzon - - - - org.apache.geronimo.specs - geronimo-json_1.1_spec - ${geronimo-json_1.1_spec.version} - - - org.apache.johnzon - johnzon-jsonb - ${johnzon.version} - - - - - - - javax.json.bind - javax.json.bind-api - ${jsonb-api.version} - - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - test - - - org.junit.jupiter - junit-jupiter-api - ${junit.jupiter.version} - - - org.junit.jupiter - junit-jupiter-engine - ${junit.jupiter.version} - test - - - org.junit.platform - junit-platform-surefire-provider - ${junit.platform.version} - test - - - org.junit.platform - junit-platform-runner - ${junit.platform.version} - test - + + + javax.json.bind + javax.json.bind-api + ${jsonb-api.version} + + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + test + - + + org.junit.jupiter + junit-jupiter-api + ${junit.jupiter.version} + + + org.junit.jupiter + junit-jupiter-engine + ${junit.jupiter.version} + test + + + org.junit.platform + junit-platform-surefire-provider + ${junit.platform.version} + test + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + + - - UTF-8 - UTF-8 - 1.8 - 1.8 - 1.0.0 - 5.0.0 - 2.20 - 1.0 - 1.1.3 - 1.0 - 1.0.1 - 1.1.2 - 4.1 - + + + yasson + + true + + + + + org.eclipse + yasson + ${yasson.version} + + + org.glassfish + javax.json + ${javax.json.version} + + + + + johnzon + + + + org.apache.geronimo.specs + geronimo-json_1.1_spec + ${geronimo-json_1.1_spec.version} + + + org.apache.johnzon + johnzon-jsonb + ${johnzon.version} + + + + + + + UTF-8 + UTF-8 + 1.8 + 1.8 + 1.0.0 + 5.0.0 + 1.0 + 1.1.3 + 1.0 + 1.0.1 + 1.1.2 + 4.1 + \ No newline at end of file diff --git a/jsoup/pom.xml b/jsoup/pom.xml index 8bbb4a46dc..a914b7c6ba 100644 --- a/jsoup/pom.xml +++ b/jsoup/pom.xml @@ -1,14 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + jsoup + jar + com.baeldung parent-modules 1.0.0-SNAPSHOT - jsoup - jar + org.jsoup @@ -16,7 +18,9 @@ ${jsoup.version} + 1.10.2 + diff --git a/jws/pom.xml b/jws/pom.xml index 6b15e2dc14..4199021060 100644 --- a/jws/pom.xml +++ b/jws/pom.xml @@ -1,12 +1,10 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.example jws war 0.0.1-SNAPSHOT - jws-example @@ -15,13 +13,6 @@ 1.0.0-SNAPSHOT - - 3.0.2 - 3.0.0 - 7.0 - 7.0 - - javax.jnlp @@ -37,7 +28,6 @@ system ${project.basedir}/java-core-samples-lib/jardiff.jar - @@ -63,7 +53,6 @@ - org.apache.maven.plugins maven-war-plugin @@ -89,4 +78,11 @@ ${project.artifactId} + + 3.0.2 + 3.0.0 + 7.0 + 7.0 + + diff --git a/libraries-data/README.md b/libraries-data/README.md index afca20eb2a..bcba775650 100644 --- a/libraries-data/README.md +++ b/libraries-data/README.md @@ -7,3 +7,4 @@ - [Intro to JDO Queries 2/2](http://www.baeldung.com/jdo-queries) - [Introduction to HikariCP](http://www.baeldung.com/hikaricp) - [Introduction to JCache](http://www.baeldung.com/jcache) +- [Apache Ignite with Spring Data](http://www.baeldung.com/apache-ignite-spring-data) \ No newline at end of file diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index 6ea80f1c1f..c9d240beb4 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/pom.xml @@ -2,14 +2,16 @@ 4.0.0 + libraries-data + libraries-data + jar + com.baeldung parent-modules 1.0.0-SNAPSHOT - libraries-data - libraries-data - jar + com.esotericsoftware @@ -72,7 +74,7 @@ org.apache.ignite - ignite-spring + ignite-spring-data ${ignite.version} @@ -138,20 +140,11 @@ - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - maven-antrun-plugin - 1.8 + ${maven-antrun-plugin.version} generateMithra @@ -197,11 +190,10 @@ - org.codehaus.mojo build-helper-maven-plugin - 3.0.0 + ${build-helper-maven-plugin.version} add-source @@ -231,7 +223,7 @@ - + @@ -265,6 +257,7 @@ https://repository.apache.org/content/groups/staging + 4.0.1 1.4.196 @@ -273,8 +266,11 @@ 3.7.0 5.0 1.0.0 - 2.3.0 + 2.4.0 2.8.2 1.0.0 + 1.8 + 3.0.0 + \ No newline at end of file diff --git a/libraries-data/src/main/java/com/baeldung/ignite/spring/IgniteApp.java b/libraries-data/src/main/java/com/baeldung/ignite/spring/IgniteApp.java new file mode 100644 index 0000000000..c181cdbb3c --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/ignite/spring/IgniteApp.java @@ -0,0 +1,53 @@ +package com.baeldung.ignite.spring; + +import com.baeldung.ignite.spring.config.SpringDataConfig; +import com.baeldung.ignite.spring.dto.EmployeeDTO; +import com.baeldung.ignite.spring.repository.EmployeeRepository; +import org.apache.ignite.Ignite; +import org.apache.ignite.IgniteCache; +import org.apache.ignite.Ignition; +import org.apache.ignite.cache.query.QueryCursor; +import org.apache.ignite.cache.query.SqlFieldsQuery; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +import java.util.List; + +/** + * Created by Gebruiker on 4/12/2018. + */ +public class IgniteApp { + + public static void main (String[] args) { + AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); + context.register(SpringDataConfig.class); + context.refresh(); + + EmployeeRepository repository = context.getBean(EmployeeRepository.class); + + EmployeeDTO employeeDTO = new EmployeeDTO(); + employeeDTO.setId(1); + employeeDTO.setName("John"); + employeeDTO.setEmployed(true); + + repository.save(employeeDTO.getId(), employeeDTO); + + EmployeeDTO employee = repository.getEmployeeDTOById(employeeDTO.getId()); + System.out.println(employee); + } + + private void getUsingTheCache(Integer employeeId) { + + Ignite ignite = Ignition.ignite(); + + IgniteCache cache = ignite.cache("baeldungCache"); + + EmployeeDTO employeeDTO = cache.get(employeeId); + + System.out.println(employeeDTO); + + SqlFieldsQuery sql = new SqlFieldsQuery( + "select * from EmployeeDTO where isEmployed = 'true'"); + + QueryCursor> cursor = cache.query(sql); + } +} diff --git a/libraries-data/src/main/java/com/baeldung/ignite/spring/config/SpringDataConfig.java b/libraries-data/src/main/java/com/baeldung/ignite/spring/config/SpringDataConfig.java new file mode 100644 index 0000000000..7627c91bc6 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/ignite/spring/config/SpringDataConfig.java @@ -0,0 +1,29 @@ +package com.baeldung.ignite.spring.config; + +import com.baeldung.ignite.spring.dto.EmployeeDTO; +import com.baeldung.ignite.spring.repository.EmployeeRepository; +import org.apache.ignite.Ignite; +import org.apache.ignite.Ignition; +import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.IgniteConfiguration; +import org.apache.ignite.springdata.repository.config.EnableIgniteRepositories; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@EnableIgniteRepositories(basePackageClasses = EmployeeRepository.class) +@ComponentScan(basePackages = "com.baeldung.ignite.spring.repository") +public class SpringDataConfig { + + @Bean + public Ignite igniteInstance() { + IgniteConfiguration config = new IgniteConfiguration(); + + CacheConfiguration cache = new CacheConfiguration("baeldungCache"); + + cache.setIndexedTypes(Integer.class, EmployeeDTO.class); + config.setCacheConfiguration(cache); + return Ignition.start(config); + } +} diff --git a/libraries-data/src/main/java/com/baeldung/ignite/spring/dto/EmployeeDTO.java b/libraries-data/src/main/java/com/baeldung/ignite/spring/dto/EmployeeDTO.java new file mode 100644 index 0000000000..5dbf860fe7 --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/ignite/spring/dto/EmployeeDTO.java @@ -0,0 +1,48 @@ +package com.baeldung.ignite.spring.dto; + +import org.apache.ignite.cache.query.annotations.QuerySqlField; + +import java.io.Serializable; + +public class EmployeeDTO implements Serializable { + + @QuerySqlField(index = true) + private Integer id; + @QuerySqlField(index = true) + private String name; + @QuerySqlField(index = true) + private boolean isEmployed; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isEmployed() { + return isEmployed; + } + + public void setEmployed(boolean employed) { + isEmployed = employed; + } + + @Override + public String toString() { + return "EmployeeDTO{" + + "id=" + id + + ", name='" + name + '\'' + + ", isEmployed=" + isEmployed + + '}'; + } +} diff --git a/libraries-data/src/main/java/com/baeldung/ignite/spring/repository/EmployeeRepository.java b/libraries-data/src/main/java/com/baeldung/ignite/spring/repository/EmployeeRepository.java new file mode 100644 index 0000000000..cdcd23a58a --- /dev/null +++ b/libraries-data/src/main/java/com/baeldung/ignite/spring/repository/EmployeeRepository.java @@ -0,0 +1,13 @@ +package com.baeldung.ignite.spring.repository; + +import com.baeldung.ignite.spring.dto.EmployeeDTO; +import org.apache.ignite.springdata.repository.IgniteRepository; +import org.apache.ignite.springdata.repository.config.RepositoryConfig; +import org.springframework.stereotype.Repository; + +@Repository +@RepositoryConfig(cacheName = "baeldungCache") +public interface EmployeeRepository extends IgniteRepository { + + EmployeeDTO getEmployeeDTOById(Integer id); +} diff --git a/libraries-data/src/main/java/com/baeldung/ignite/stream/IgniteStream.java b/libraries-data/src/main/java/com/baeldung/ignite/stream/IgniteStream.java index 839da36c22..c72a4b1f02 100644 --- a/libraries-data/src/main/java/com/baeldung/ignite/stream/IgniteStream.java +++ b/libraries-data/src/main/java/com/baeldung/ignite/stream/IgniteStream.java @@ -14,6 +14,8 @@ import java.nio.file.Paths; public class IgniteStream { + private static final Gson GSON = new Gson(); + public static void main(String[] args) throws Exception { Ignition.setClientMode(true); @@ -29,16 +31,16 @@ public class IgniteStream { employee.setEmployed(true); e.setValue(employee); - return null; + return employee; })); Path path = Paths.get(IgniteStream.class.getResource("employees.txt").toURI()); Files.lines(path) - .forEach(line -> { - Employee employee = new Gson().fromJson(line, Employee.class); - streamer.addData(employee.getId(), employee); - }); - - } + .forEach(line -> { + Employee employee = GSON.fromJson(line, Employee.class); + streamer.addData(employee.getId(), employee); + }); + } + } diff --git a/libraries/README.md b/libraries/README.md index ace2000d8d..651de5b223 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -55,12 +55,12 @@ - [Introduction to BouncyCastle with Java](http://www.baeldung.com/java-bouncy-castle) - [Guide to google-http-client](http://www.baeldung.com/google-http-client) - [Interact with Google Sheets from Java](http://www.baeldung.com/google-sheets-java-client) -- [Programatically Create, Configure, and Run a Tomcat Server] (http://www.baeldung.com/tomcat-programmatic-setup) +- [Programatically Create, Configure, and Run a Tomcat Server](http://www.baeldung.com/tomcat-programmatic-setup) - [A Docker Guide for Java](http://www.baeldung.com/docker-java-api) - [Exceptions in Netty](http://www.baeldung.com/netty-exception-handling) - [Creating and Configuring Jetty 9 Server in Java](http://www.baeldung.com/jetty-java-programmatic) - [Introduction To OpenCSV](http://www.baeldung.com/opencsv) -- [Introduction to Akka Actors in Java] (http://www.baeldung.com/akka-actors-java) +- [Introduction to Akka Actors in Java](http://www.baeldung.com/akka-actors-java) - [Asynchronous HTTP with async-http-client in Java](https://github.com/eugenp/tutorials/tree/master/libraries) - [Introduction to Smooks](http://www.baeldung.com/smooks) - [WebSockets with AsyncHttpClient](http://www.baeldung.com/async-http-client-websockets) @@ -68,6 +68,9 @@ - [Introduction to OpenCSV](http://www.baeldung.com/opencsv) - [A Guide to Unirest](http://www.baeldung.com/unirest) - [Introduction to Akka Actors in Java](http://www.baeldung.com/akka-actors-java) +- [A Guide to Apache Commons Collections CollectionUtils](http://www.baeldung.com/apache-commons-collection-utils) +- [A Guide to Byte Buddy](http://www.baeldung.com/byte-buddy) +- [Java Concurrency Utility with JCTools](http://www.baeldung.com/java-concurrency-jc-tools) The libraries module contains examples related to small libraries that are relatively easy to use and does not require any separate module of its own. diff --git a/libraries/pom.xml b/libraries/pom.xml index be2876ec3b..f4bf994a58 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -11,20 +11,20 @@ - + com.typesafe.akka akka-actor_2.12 - 2.5.11 + ${typesafe-akka.version} com.typesafe.akka akka-testkit_2.12 - 2.5.11 + ${typesafe-akka.version} test - + org.asynchttpclient @@ -674,7 +674,7 @@ milyn-smooks-all ${smooks.version} - + com.mashape.unirest unirest-java ${unirest.version} @@ -686,8 +686,14 @@ fugue 4.5.1 + + + org.jctools + jctools-core + ${jctools.version} + - + maven2-repository.dev.java.net @@ -726,7 +732,7 @@ maven-failsafe-plugin - 2.20 + ${maven-failsafe-plugin.version} chromedriver @@ -786,14 +792,41 @@ - + - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - + org.apache.maven.plugins + maven-shade-plugin + 2.2 + + + package + + shade + + + benchmarks + + + org.openjdk.jmh.Main + + + + + + *:* + + META-INF/*.SF + META-INF/*.DSA + META-INF/*.RSA + + + + + + @@ -866,7 +899,11 @@ 9.1.5.Final 4.1 1.4.9 + 2.1.2 1.10.L001 0.9.4.0006L + 2.1.2 + 2.5.11 + \ No newline at end of file diff --git a/libraries/src/main/java/com/baeldung/jctools/MpmcBenchmark.java b/libraries/src/main/java/com/baeldung/jctools/MpmcBenchmark.java new file mode 100644 index 0000000000..7b754bf709 --- /dev/null +++ b/libraries/src/main/java/com/baeldung/jctools/MpmcBenchmark.java @@ -0,0 +1,73 @@ +package com.baeldung.jctools; + +import org.jctools.queues.MpmcArrayQueue; +import org.jctools.queues.atomic.MpmcAtomicArrayQueue; +import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.infra.Control; + +import java.util.Queue; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.TimeUnit; + +@BenchmarkMode(Mode.SampleTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Fork(1) +@Warmup(iterations = 1) +@Measurement(iterations = 3) +@State(Scope.Group) +public class MpmcBenchmark { + + public static final String PARAM_UNSAFE = "MpmcArrayQueue"; + public static final String PARAM_AFU = "MpmcAtomicArrayQueue"; + public static final String PARAM_JDK = "ArrayBlockingQueue"; + + public static final int PRODUCER_THREADS_NUMBER = 32; + public static final int CONSUMER_THREADS_NUMBER = 32; + + public static final String GROUP_NAME = "MyGroup"; + + public static final int CAPACITY = 128; + + @Param({PARAM_UNSAFE, PARAM_AFU, PARAM_JDK}) + public volatile String implementation; + + public volatile Queue queue; + + @Setup(Level.Trial) + public void setUp() { + switch (implementation) { + case PARAM_UNSAFE: + queue = new MpmcArrayQueue<>(CAPACITY); + break; + case PARAM_AFU: + queue = new MpmcAtomicArrayQueue<>(CAPACITY); + break; + case PARAM_JDK: + queue = new ArrayBlockingQueue<>(CAPACITY); + break; + default: + throw new UnsupportedOperationException("Unsupported implementation " + implementation); + } + } + + + @Benchmark + @Group(GROUP_NAME) + @GroupThreads(PRODUCER_THREADS_NUMBER) + public void write(Control control) { + //noinspection StatementWithEmptyBody + while (!control.stopMeasurement && !queue.offer(1L)) { + // Is intentionally left blank + } + } + + @Benchmark + @Group(GROUP_NAME) + @GroupThreads(CONSUMER_THREADS_NUMBER) + public void read(Control control) { + //noinspection StatementWithEmptyBody + while (!control.stopMeasurement && queue.poll() == null) { + // Is intentionally left blank + } + } +} diff --git a/libraries/src/main/java/com/baeldung/jctools/README.md b/libraries/src/main/java/com/baeldung/jctools/README.md new file mode 100644 index 0000000000..3c1b3c1c1e --- /dev/null +++ b/libraries/src/main/java/com/baeldung/jctools/README.md @@ -0,0 +1,7 @@ +## How to build and run the JMH benchmark + +Execute the following from the project's root: +```bash +mvn clean install +java -jar ./target/benchmarks.jar MpmcBenchmark -si true +``` \ No newline at end of file diff --git a/libraries/src/test/java/com/baeldung/jctools/JCToolsUnitTest.java b/libraries/src/test/java/com/baeldung/jctools/JCToolsUnitTest.java new file mode 100644 index 0000000000..4a9d0fadb2 --- /dev/null +++ b/libraries/src/test/java/com/baeldung/jctools/JCToolsUnitTest.java @@ -0,0 +1,86 @@ +package com.baeldung.jctools; + +import org.jctools.queues.SpscArrayQueue; +import org.jctools.queues.SpscChunkedArrayQueue; +import org.junit.Test; + +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.IntConsumer; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.fail; + +public class JCToolsUnitTest { + + @Test + public void givenMultipleProducers_whenSpscQueueUsed_thenNoWarningOccurs() throws InterruptedException { + SpscArrayQueue queue = new SpscArrayQueue(2); + + Thread producer1 = new Thread(() -> { + queue.offer(1); + }); + producer1.start(); + producer1.join(); + + Thread producer2 = new Thread(() -> { + queue.offer(2); + }); + producer2.start(); + producer2.join(); + + Set fromQueue = new HashSet<>(); + Thread consumer = new Thread(() -> queue.drain(fromQueue::add)); + consumer.start(); + consumer.join(); + + assertThat(fromQueue).containsOnly(1, 2); + } + + @Test + public void whenQueueIsFull_thenNoMoreElementsCanBeAdded() throws InterruptedException { + SpscChunkedArrayQueue queue = new SpscChunkedArrayQueue<>(8, 16); + assertThat(queue.capacity()).isEqualTo(16); + + CountDownLatch startConsuming = new CountDownLatch(1); + CountDownLatch awakeProducer = new CountDownLatch(1); + AtomicReference error = new AtomicReference<>(); + Thread producer = new Thread(() -> { + IntStream.range(0, queue.capacity()).forEach(i -> { + assertThat(queue.offer(i)).isTrue(); + }); + assertThat(queue.offer(queue.capacity())).isFalse(); + startConsuming.countDown(); + try { + awakeProducer.await(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + + assertThat(queue.offer(queue.capacity())).isTrue(); + }); + producer.setUncaughtExceptionHandler((t, e) -> { + error.set(e); + startConsuming.countDown(); + }); + producer.start(); + + startConsuming.await(); + + if (error.get() != null) { + fail("Producer's assertion failed", error.get()); + } + + Set fromQueue = new HashSet<>(); + queue.drain(fromQueue::add); + awakeProducer.countDown(); + producer.join(); + queue.drain(fromQueue::add); + + assertThat(fromQueue).containsAll(IntStream.range(0, 17).boxed().collect(Collectors.toSet())); + } +} diff --git a/libraries/src/test/java/com/baeldung/netty/EmbeddedChannelUnitTest.java b/libraries/src/test/java/com/baeldung/netty/EmbeddedChannelUnitTest.java index ca723a7b7f..2818bb96a2 100644 --- a/libraries/src/test/java/com/baeldung/netty/EmbeddedChannelUnitTest.java +++ b/libraries/src/test/java/com/baeldung/netty/EmbeddedChannelUnitTest.java @@ -52,16 +52,12 @@ public class EmbeddedChannelUnitTest { "/calculate?a=10&b=5"); wrongHttpRequest.headers().add("Operator", "Add"); - Throwable thrownException = catchThrowable(() -> { - // send invalid HTTP request to server and expect and error - channel.pipeline().fireChannelRead(wrongHttpRequest); - channel.checkException(); - Assertions.failBecauseExceptionWasNotThrown(UnsupportedOperationException.class); - }); - - assertThat(thrownException) - .isInstanceOf(UnsupportedOperationException.class) - .hasMessage("HTTP method not supported"); + assertThatThrownBy(() -> { + // send invalid HTTP request to server and expect and error + channel.pipeline().fireChannelRead(wrongHttpRequest); + channel.checkException(); + }).isInstanceOf(UnsupportedOperationException.class) + .hasMessage("HTTP method not supported"); FullHttpResponse errorHttpResponse = channel.readOutbound(); String errorHttpResponseContent = errorHttpResponse.content().toString(Charset.defaultCharset()); @@ -77,15 +73,11 @@ public class EmbeddedChannelUnitTest { "/calculate?a=10&b=5"); wrongHttpRequest.headers().add("Operator", "Invalid_operation"); - Throwable thrownException = catchThrowable(() -> { - // send invalid HTTP request to server and expect and error - channel.writeInbound(wrongHttpRequest); - Assertions.failBecauseExceptionWasNotThrown(IllegalArgumentException.class); - }); - - // the HttpMessageHandler does not handle the exception and throws it down the - // pipeline - assertThat(thrownException).isInstanceOf(IllegalArgumentException.class).hasMessage("Operation not defined"); + // the HttpMessageHandler does not handle the exception and throws it down the pipeline + assertThatThrownBy(() -> { + channel.writeInbound(wrongHttpRequest); + }).isInstanceOf(IllegalArgumentException.class) + .hasMessage("Operation not defined"); // the outbound message is a HTTP response with the status code 500 FullHttpResponse errorHttpResponse = channel.readOutbound(); diff --git a/linkrest/pom.xml b/linkrest/pom.xml index 819436236f..5a8b39e7df 100644 --- a/linkrest/pom.xml +++ b/linkrest/pom.xml @@ -1,85 +1,80 @@ - 4.0.0 - com.baeldung - linkrest - 0.0.1-SNAPSHOT - war - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + linkrest + 0.0.1-SNAPSHOT + war + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - com.nhl.link.rest - link-rest - ${linkrest.version} - - - org.glassfish.jersey.containers - jersey-container-servlet - ${jersey.version} - - + + + + com.nhl.link.rest + link-rest + ${linkrest.version} + + + org.glassfish.jersey.containers + jersey-container-servlet + ${jersey.version} + + org.glassfish.jersey.media jersey-media-moxy ${jersey.version} - + com.h2database h2 ${h2.version} - + - - - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - maven-war-plugin - 2.6 - - WebContent - false - - - - org.apache.cayenne.plugins - cayenne-maven-plugin - ${cayenne.version} + + + + maven-war-plugin + ${maven-war-plugin.version} + + WebContent + false + + + + org.apache.cayenne.plugins + cayenne-maven-plugin + ${cayenne.version} - - ${project.basedir}/src/main/resources/linkrest.map.xml - + + ${project.basedir}/src/main/resources/linkrest.map.xml + - - - - cgen - - - - - - org.apache.cayenne.plugins - cayenne-modeler-maven-plugin - ${cayenne.version} - + + + + cgen + + + + + + org.apache.cayenne.plugins + cayenne-modeler-maven-plugin + ${cayenne.version} + + + + + + 2.9 + 4.0.B1 + 1.4.196 + 2.25.1 + - - - - 2.9 - 4.0.B1 - 1.4.196 - 2.25.1 - \ No newline at end of file diff --git a/logging-modules/log-mdc/pom.xml b/logging-modules/log-mdc/pom.xml index 5551585372..16eeff43cf 100644 --- a/logging-modules/log-mdc/pom.xml +++ b/logging-modules/log-mdc/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung log-mdc @@ -12,7 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index 6a3fbde393..5e2f413e09 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung log4j 1.0-SNAPSHOT @@ -11,7 +10,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ diff --git a/logging-modules/log4j2/pom.xml b/logging-modules/log4j2/pom.xml index 46b8b80597..651e1e7d1f 100644 --- a/logging-modules/log4j2/pom.xml +++ b/logging-modules/log4j2/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - log4j2 @@ -56,8 +55,6 @@ - - 2.9.3 1.4.193 diff --git a/logging-modules/logback/pom.xml b/logging-modules/logback/pom.xml index cd0d3758cc..2ffcd0dbf8 100644 --- a/logging-modules/logback/pom.xml +++ b/logging-modules/logback/pom.xml @@ -1,21 +1,13 @@ 4.0.0 - logback logback 0.1-SNAPSHOT - - UTF-8 - 1.2.3 - 0.1.5 - 2.9.3 - - com.baeldung parent-modules @@ -47,5 +39,11 @@ + + UTF-8 + 1.2.3 + 0.1.5 + 2.9.3 + diff --git a/lombok/pom.xml b/lombok/pom.xml index bea05b38f3..d11cffb34b 100644 --- a/lombok/pom.xml +++ b/lombok/pom.xml @@ -1,10 +1,9 @@ 4.0.0 - lombok lombok 0.1-SNAPSHOT @@ -16,7 +15,6 @@ - org.projectlombok lombok @@ -24,17 +22,14 @@ ${lombok.version} provided - org.hibernate.javax.persistence hibernate-jpa-2.1-api ${hibernate-jpa-2.1-api.version} - - lombok @@ -65,25 +60,20 @@ false - + - - UTF-8 1.16.18 - 1.0.0.Final - 1.16.10.0 diff --git a/lucene/pom.xml b/lucene/pom.xml index 6659d9ac32..b8786fadc7 100644 --- a/lucene/pom.xml +++ b/lucene/pom.xml @@ -1,35 +1,46 @@ - 4.0.0 - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - lucene - 0.0.1-SNAPSHOT - lucene - An Apache Lucene demo application + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + lucene + 0.0.1-SNAPSHOT + lucene + An Apache Lucene demo application - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - org.apache.lucene - lucene-core - 7.1.0 - + + + org.apache.lucene + lucene-core + ${lucene.version} + + + org.apache.lucene + lucene-queryparser + ${lucene.version} + + + + junit + junit + ${junit.version} + test + + + + + UTF-8 + + 1.16.18 + + 1.0.0.Final + + 1.16.10.0 + 7.1.0 + - - org.apache.lucene - lucene-queryparser - 7.1.0 - - - - junit - junit - 4.12 - test - - \ No newline at end of file diff --git a/mapstruct/pom.xml b/mapstruct/pom.xml index ba67ccc2df..be105b8aa8 100644 --- a/mapstruct/pom.xml +++ b/mapstruct/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 mapstruct mapstruct @@ -14,10 +14,6 @@ 1.0.0-SNAPSHOT - - 1.1.0.Final - 4.3.4.RELEASE - org.mapstruct @@ -36,6 +32,7 @@ test + mapstruct @@ -44,8 +41,8 @@ maven-compiler-plugin ${maven-compiler-plugin.version} - 1.8 - 1.8 + ${maven.compiler.source} + ${maven.compiler.target} org.mapstruct @@ -58,39 +55,11 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + + 1.1.0.Final + 4.3.4.RELEASE + 1.8 + 1.8 + diff --git a/maven/README.md b/maven/README.md new file mode 100644 index 0000000000..7c3779143a --- /dev/null +++ b/maven/README.md @@ -0,0 +1,9 @@ +### Relevant Articles + +- [Guide to the Core Maven Plugins](http://www.baeldung.com/core-maven-plugins) +- [Maven Resources Plugin](http://www.baeldung.com/maven-resources-plugin) +- [Maven Compiler Plugin](http://www.baeldung.com/maven-compiler-plugin) +- [Quick Guide to the Maven Surefire Plugin](http://www.baeldung.com/maven-surefire-plugin) +- [The Maven Failsafe Plugin](http://www.baeldung.com/maven-failsafe-plugin) +- [The Maven Verifier Plugin](http://www.baeldung.com/maven-verifier-plugin) +- [The Maven Clean Plugin](http://www.baeldung.com/maven-clean-plugin) diff --git a/maven/pom.xml b/maven/pom.xml index d21b138762..fb7233e7e9 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung maven @@ -11,21 +11,11 @@ 1.0.0-SNAPSHOT - - 3.0.2 - 3.7.0 - 2.21.0 - 2.21.0 - 1.1 - 3.0.0 - Baeldung - - junit junit - 4.12 + ${junit.version} test @@ -52,8 +42,8 @@ maven-compiler-plugin ${maven.compiler.version} - 1.8 - 1.8 + ${maven.compiler.source} + ${maven.compiler.target} -Xlint:unchecked @@ -113,4 +103,17 @@ + + + 3.0.2 + 3.7.0 + 2.21.0 + 2.21.0 + 1.1 + 3.0.0 + Baeldung + 1.8 + 1.8 + + \ No newline at end of file diff --git a/mesos-marathon/pom.xml b/mesos-marathon/pom.xml index b0060a260e..2b7a238ee8 100644 --- a/mesos-marathon/pom.xml +++ b/mesos-marathon/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung mesos-marathon 0.0.1-SNAPSHOT diff --git a/metrics/pom.xml b/metrics/pom.xml index 25ce452d7a..e3868eddef 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -2,6 +2,7 @@ 4.0.0 + metrics parent-modules @@ -9,17 +10,6 @@ 1.0.0-SNAPSHOT - metrics - - - - 3.1.2 - 3.1.0 - 0.12.17 - 0.12.0.RELEASE - 2.0.0.M5 - - io.dropwizard.metrics @@ -81,18 +71,18 @@ com.fasterxml.jackson.core jackson-databind - 2.9.1 + ${fasterxml.jackson.version} com.fasterxml.jackson.dataformat jackson-dataformat-smile - 2.9.1 + ${fasterxml.jackson.version} com.netflix.spectator spectator-api - 0.57.1 + ${spectator-api.version} @@ -119,4 +109,14 @@ + + 3.1.2 + 3.1.0 + 0.12.17 + 0.12.0.RELEASE + 2.0.0.M5 + 2.9.1 + 0.57.1 + + diff --git a/microprofile/pom.xml b/microprofile/pom.xml index 8da7bbe40c..27d234b73a 100644 --- a/microprofile/pom.xml +++ b/microprofile/pom.xml @@ -3,31 +3,22 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung microprofile 1.0-SNAPSHOT war - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - UTF-8 - UTF-8 - 1.8 - 1.8 - library - ${project.build.directory}/${app.name}-service.jar - runnable - org.eclipse.microprofile microprofile - 1.2 + ${microprofile.version} provided pom @@ -45,12 +36,12 @@ net.wasdev.wlp.maven.plugins liberty-maven-plugin - 2.1.2 + ${liberty-maven-plugin.version} io.openliberty openliberty-runtime - 17.0.0.4 + ${openliberty-runtime.version} zip ${basedir}/src/main/liberty/config/server.xml @@ -88,4 +79,15 @@ + + UTF-8 + UTF-8 + library + ${project.build.directory}/${app.name}-service.jar + runnable + 1.2 + 2.1.2 + 17.0.0.4 + + diff --git a/muleesb/pom.xml b/muleesb/pom.xml index 139745262c..a3b9869eb4 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -1,83 +1,75 @@ - 4.0.0 - com.mycompany - muleesb - 1.0.0-SNAPSHOT - mule - Mule muleesb Application - + 4.0.0 + com.mycompany + muleesb + 1.0.0-SNAPSHOT + mule + Mule muleesb Application + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - UTF-8 - UTF-8 - 3.8.1 - 1.2 - 1.3.6 - 3.9.0 - - - - - - org.mule.tools.maven - mule-app-maven-plugin - ${mule.tools.version} - true - - true - - - - org.mule.tools - muleesb-maven-plugin - 1.0 - - 3.7.0 - /home/abir/AnypointStudio/workspace/variablescopetest - - - - deploy - - start - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.7 - - - add-resource - generate-resources - - add-resource - - - - - src/main/app/ - - - mappings/ - - - src/main/api/ - - - - - - - + + + + org.mule.tools.maven + mule-app-maven-plugin + ${mule.tools.version} + true + + true + + + + org.mule.tools + muleesb-maven-plugin + 1.0 + + 3.7.0 + /home/abir/AnypointStudio/workspace/variablescopetest + + + + deploy + + start + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.7 + + + add-resource + generate-resources + + add-resource + + + + + src/main/app/ + + + mappings/ + + + src/main/api/ + + + + + + + com.mulesoft.munit.tools munit-maven-plugin ${munit.version} @@ -100,89 +92,89 @@ - + src/test/munit - + src/test/resources - - - - - org.mule.modules - mule-module-spring-config - ${mule.version} - provided - - - - org.mule.transports - mule-transport-file - ${mule.version} - provided - - - org.mule.transports - mule-transport-http - ${mule.version} - provided - - - org.mule.transports - mule-transport-jdbc - ${mule.version} - provided - - - org.mule.transports - mule-transport-jms - ${mule.version} - provided - - - org.mule.transports - mule-transport-vm - ${mule.version} - provided - - - - org.mule.modules - mule-module-scripting - ${mule.version} - provided - - - org.mule.modules - mule-module-xml - ${mule.version} - provided - - - - org.mule.tests - mule-tests-functional - ${mule.version} - test - - - org.mule.modules - mule-module-apikit - ${mule.version} - provided - - + + + + + org.mule.modules + mule-module-spring-config + ${mule.version} + provided + + + + org.mule.transports + mule-transport-file + ${mule.version} + provided + + + org.mule.transports + mule-transport-http + ${mule.version} + provided + + + org.mule.transports + mule-transport-jdbc + ${mule.version} + provided + + + org.mule.transports + mule-transport-jms + ${mule.version} + provided + + + org.mule.transports + mule-transport-vm + ${mule.version} + provided + + + + org.mule.modules + mule-module-scripting + ${mule.version} + provided + + + org.mule.modules + mule-module-xml + ${mule.version} + provided + + + + org.mule.tests + mule-tests-functional + ${mule.version} + test + + + org.mule.modules + mule-module-apikit + ${mule.version} + provided + + com.mulesoft.munit mule-munit-support ${mule.munit.support.version} test - + com.mulesoft.munit munit-runner ${munit.version} @@ -190,29 +182,40 @@ - - - Central - Central - http://repo1.maven.org/maven2/ - default - - - mulesoft-releases - MuleSoft Releases Repository - http://repository.mulesoft.org/releases/ - default - - - - - mulesoft-release - mulesoft release repository - default - http://repository.mulesoft.org/releases/ - - false - - - + + + Central + Central + http://repo1.maven.org/maven2/ + default + + + mulesoft-releases + MuleSoft Releases Repository + http://repository.mulesoft.org/releases/ + default + + + + + + mulesoft-release + mulesoft release repository + default + http://repository.mulesoft.org/releases/ + + false + + + + + + UTF-8 + UTF-8 + 3.8.1 + 1.2 + 1.3.6 + 3.9.0 + + diff --git a/mustache/pom.xml b/mustache/pom.xml index 1c64dbdb0b..88d87758cd 100644 --- a/mustache/pom.xml +++ b/mustache/pom.xml @@ -1,178 +1,161 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.0 - mustache - 0.0.1-SNAPSHOT - jar - mustache + 4.0.0 + mustache + 0.0.1-SNAPSHOT + jar + mustache - - org.springframework.boot - spring-boot-starter-parent - 1.5.4.RELEASE - - - + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + + + - - - com.github.spullara.mustache.java - compiler - ${mustache.compiler.api.version} - + + + com.github.spullara.mustache.java + compiler + ${mustache.compiler.api.version} + - - org.assertj - assertj-core - ${assertj.version} - + + org.assertj + assertj-core + ${assertj.version} + - - log4j - log4j - ${log4j.version} - + + log4j + log4j + ${log4j.version} + - - org.springframework.boot - spring-boot-starter-mustache - + + org.springframework.boot + spring-boot-starter-mustache + - - org.springframework.boot - spring-boot-starter-test - test - - - org.webjars - bootstrap - 3.3.7 - - - org.fluttercode.datafactory - datafactory - 0.8 - + + org.springframework.boot + spring-boot-starter-test + test + + + org.webjars + bootstrap + ${webjars.bootstrap.version} + + + org.fluttercode.datafactory + datafactory + ${datafactory.version} + - - junit - junit - ${junit.version} - test - + + junit + junit + ${junit.version} + test + - + - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 3 - true - - **/*IntegrationTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - **/JdbcTest.java - **/*LiveTest.java - - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + - + + + integration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/AutoconfigurationTest.java + + + **/*IntegrationTest.java + + + + + + + json + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/AutoconfigurationTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - autoconfiguration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/*IntegrationTest.java - - - **/AutoconfigurationTest.java - - - - - - - json - - - - - - - + + 0.9.2 + 3.7.0 + 1.2.16 + 4.12 + UTF-8 - - 0.9.2 - 3.7.0 - 1.2.16 - 4.12 - - UTF-8 - - + 3.7.0 2.19.1 - - 1.8 - + 0.8 + 3.3.7 + 1.8 + \ No newline at end of file diff --git a/mvn-wrapper/pom.xml b/mvn-wrapper/pom.xml index 209c4b9403..6fb9bfeffc 100644 --- a/mvn-wrapper/pom.xml +++ b/mvn-wrapper/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - mvn-wrapper 0.0.1-SNAPSHOT jar - mvn-wrapper Setting up the Maven Wrapper @@ -17,12 +15,6 @@ ../parent-boot-5 - - UTF-8 - UTF-8 - 1.8 - - org.springframework.boot @@ -42,4 +34,10 @@ + + + UTF-8 + UTF-8 + + diff --git a/mybatis/pom.xml b/mybatis/pom.xml index 32039b01e6..b167d94ed8 100644 --- a/mybatis/pom.xml +++ b/mybatis/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung mybatis 1.0.0-SNAPSHOT @@ -13,10 +12,6 @@ 1.0.0-SNAPSHOT - - 10.13.1.1 - 3.2.2 - org.apache.derby @@ -30,4 +25,9 @@ + + 10.13.1.1 + 3.2.2 + + \ No newline at end of file diff --git a/noexception/pom.xml b/noexception/pom.xml index 64c0591fda..c825449452 100644 --- a/noexception/pom.xml +++ b/noexception/pom.xml @@ -1,7 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - com.baeldung noexception 1.0 @@ -17,7 +16,12 @@ com.machinezoo.noexception noexception - 1.1.0 + ${noexception.version} + + + 1.1.0 + + diff --git a/orientdb/pom.xml b/orientdb/pom.xml index 3d3cb36a91..317c469005 100644 --- a/orientdb/pom.xml +++ b/orientdb/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - orientdb 0.0.1-SNAPSHOT jar - intro-orientdb introduction to the OrientDB Java APIs @@ -16,15 +14,6 @@ 1.0.0-SNAPSHOT - - UTF-8 - UTF-8 - 1.8 - 2.2.31 - 2.6.0 - 4.12 - - com.orientechnologies @@ -54,4 +43,15 @@ test + + + + UTF-8 + UTF-8 + 1.8 + 2.2.31 + 2.6.0 + 4.12 + + diff --git a/orika/pom.xml b/orika/pom.xml index d1f38a6016..1a54440ffe 100644 --- a/orika/pom.xml +++ b/orika/pom.xml @@ -1,9 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.baeldung orika 1.0 + orika com.baeldung @@ -11,20 +12,16 @@ 1.0.0-SNAPSHOT - - 1.5.0 - - - orika - - ma.glasnost.orika orika-core ${orika-core.version} - + + 1.5.0 + + diff --git a/osgi/pom.xml b/osgi/pom.xml index e6ef9c3192..704a738d24 100644 --- a/osgi/pom.xml +++ b/osgi/pom.xml @@ -3,15 +3,9 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - osgi-intro pom 1.0-SNAPSHOT - - osgi-intro-sample-activator - osgi-intro-sample-service - osgi-intro-sample-client - com.baeldung @@ -20,33 +14,34 @@ .. + + osgi-intro-sample-activator + osgi-intro-sample-service + osgi-intro-sample-client + + - ${project.groupId} osgi-intro-client ${project.version} - ${project.groupId} osgi-intro-service ${project.version} - ${project.groupId} osgi-intro-gxyz ${project.version} - ${project.groupId} osgi-intro-mapquest ${project.version} - com.squareup.okhttp3 okhttp diff --git a/out/production/main180/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml b/out/production/main180/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml index de69efa43a..2835f6f416 100644 --- a/out/production/main180/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml +++ b/out/production/main180/com/baeldung/javaeeannotations/JavaEEAnnotationsSample/pom.xml @@ -1,57 +1,48 @@ - 4.0.0 - com.baeldung.javaeeannotations - JavaEEAnnotationsSample - 0.0.1-SNAPSHOT - war - JavaEEAnnotationsSample - JavaEEAnnotationsSample - - - - - javax.annotation - javax.annotation-api - 1.3 - - - - javax.servlet - javax.servlet-api - 3.1.0 - - - - javax.servlet.jsp - jsp-api - 2.1 - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-war-plugin - 2.4 - - src/main/webapp - SpringFieldConstructorInjection - false - - - - - JavaEEAnnotationsSample - + 4.0.0 + com.baeldung.javaeeannotations + JavaEEAnnotationsSample + 0.0.1-SNAPSHOT + war + JavaEEAnnotationsSample + JavaEEAnnotationsSample + + + + + javax.annotation + javax.annotation-api + 1.3 + + + + javax.servlet + javax.servlet-api + 3.1.0 + + + + javax.servlet.jsp + jsp-api + 2.1 + + + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.4 + + src/main/webapp + SpringFieldConstructorInjection + false + + + + + JavaEEAnnotationsSample + \ No newline at end of file diff --git a/parent-boot-5/pom.xml b/parent-boot-5/pom.xml index 0e3936a73a..32bb2eab04 100644 --- a/parent-boot-5/pom.xml +++ b/parent-boot-5/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung parent-boot-5 @@ -8,21 +8,11 @@ Parent Boot 5 Parent for all spring boot 1.5 modules - - UTF-8 - UTF-8 - 1.8 - 3.0.6 - - 2.20.1 - 3.7.0 - - - spring-boot-starter-parent org.springframework.boot + spring-boot-starter-parent 1.5.10.RELEASE - + @@ -30,7 +20,7 @@ junit junit test - + io.rest-assured rest-assured @@ -52,7 +42,7 @@ org.apache.maven.plugins maven-surefire-plugin - ${maven-surefire-plugin.version} + ${maven-surefire-plugin.version} 3 true @@ -67,13 +57,66 @@ org.apache.maven.plugins maven-compiler-plugin - ${maven-compiler-plugin.version} + ${maven-compiler-plugin.version} - 1.8 - 1.8 + ${maven.compiler.source} + ${maven.compiler.target} - + + + + integration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*ManualTest.java + **/*LiveTest.java + **/AutoconfigurationTest.java + **/*UnitTest.java + + + **/*IntegrationTest.java + */EthControllerTestOne.java + **/*IntTest.java + **/*EntryPointsTest.java + + + + + + + json + + + + + + + + + + UTF-8 + UTF-8 + 1.8 + 3.0.6 + + 2.20.1 + 3.7.0 + 1.8 + 1.8 + + \ No newline at end of file diff --git a/patterns/behavioral-patterns/pom.xml b/patterns/behavioral-patterns/pom.xml index 3c40520ce1..03b138dfc4 100644 --- a/patterns/behavioral-patterns/pom.xml +++ b/patterns/behavioral-patterns/pom.xml @@ -7,11 +7,11 @@ jar com.baeldung.patterns - patterns-parent - 1.0.0-SNAPSHOT - .. - - + patterns-parent + 1.0.0-SNAPSHOT + .. + + junit @@ -20,18 +20,9 @@ test - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - - UTF-8 1.8 1.8 - + \ No newline at end of file diff --git a/patterns/facade/pom.xml b/patterns/facade/pom.xml index ee46a2a80d..573e557eb6 100644 --- a/patterns/facade/pom.xml +++ b/patterns/facade/pom.xml @@ -7,11 +7,11 @@ jar com.baeldung.patterns - patterns-parent - 1.0.0-SNAPSHOT - .. - - + patterns-parent + 1.0.0-SNAPSHOT + .. + + junit @@ -20,18 +20,9 @@ test - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - - UTF-8 1.8 1.8 - + \ No newline at end of file diff --git a/patterns/front-controller/pom.xml b/patterns/front-controller/pom.xml index b746d5dc6c..877277a062 100644 --- a/patterns/front-controller/pom.xml +++ b/patterns/front-controller/pom.xml @@ -1,49 +1,39 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + front-controller + war - front-controller - war + + patterns-parent + com.baeldung.patterns + 1.0.0-SNAPSHOT + .. + - - patterns-parent - com.baeldung.patterns - 1.0.0-SNAPSHOT - .. - + + + javax.servlet + javax.servlet-api + + - - - javax.servlet - javax.servlet-api - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-war-plugin - - - org.eclipse.jetty - jetty-maven-plugin - - - /front-controller - - - - - + + + + org.apache.maven.plugins + maven-war-plugin + + + org.eclipse.jetty + jetty-maven-plugin + + + /front-controller + + + + + diff --git a/patterns/intercepting-filter/pom.xml b/patterns/intercepting-filter/pom.xml index b26b993d69..b9916d9157 100644 --- a/patterns/intercepting-filter/pom.xml +++ b/patterns/intercepting-filter/pom.xml @@ -1,61 +1,61 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - intercepting-filter - war + intercepting-filter + war - - com.baeldung.patterns - patterns-parent - 1.0.0-SNAPSHOT - .. - + + com.baeldung.patterns + patterns-parent + 1.0.0-SNAPSHOT + .. + - - - javax.servlet - javax.servlet-api - - - org.slf4j - slf4j-api - ${slf4j.version} - - + + + javax.servlet + javax.servlet-api + + + org.slf4j + slf4j-api + ${slf4j.version} + + - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-war-plugin - - false - - - - org.eclipse.jetty - jetty-maven-plugin - - - / - - - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-war-plugin + + false + + + + org.eclipse.jetty + jetty-maven-plugin + + + / + + + + + - - 1.7.21 - + + 1.7.21 + diff --git a/patterns/pom.xml b/patterns/pom.xml index 1462952e37..7ee2c749be 100644 --- a/patterns/pom.xml +++ b/patterns/pom.xml @@ -1,16 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.patterns patterns-parent pom - - front-controller - intercepting-filter - behavioral-patterns - com.baeldung @@ -19,6 +13,12 @@ .. + + front-controller + intercepting-filter + behavioral-patterns + + @@ -52,4 +52,5 @@ 3.0.0 9.4.0.v20161208 + \ No newline at end of file diff --git a/pdf/pom.xml b/pdf/pom.xml index bd4d35fcbf..01b2e15652 100644 --- a/pdf/pom.xml +++ b/pdf/pom.xml @@ -1,27 +1,17 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 + pdf + pdf + http://maven.apache.org + com.baeldung parent-modules 1.0.0-SNAPSHOT - pdf - pdf - http://maven.apache.org - - - UTF-8 - 2.0.3 - 1.6 - 5.5.10 - 5.5.10 - 3.15 - 1.8 - 3.15 - @@ -82,4 +72,16 @@ + + + UTF-8 + 2.0.3 + 1.6 + 5.5.10 + 5.5.10 + 3.15 + 1.8 + 3.15 + + diff --git a/persistence-modules/java-cassandra/pom.xml b/persistence-modules/java-cassandra/pom.xml index 81e072c3a7..015fdc84de 100644 --- a/persistence-modules/java-cassandra/pom.xml +++ b/persistence-modules/java-cassandra/pom.xml @@ -1,19 +1,18 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung cassandra-java-client 1.0.0-SNAPSHOT - cassandra-java-client com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ - - + ../../ + + @@ -41,48 +40,11 @@ java-cassandra - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + UTF-8 - 19.0 - 3.1.2 3.1.1.0 diff --git a/persistence-modules/java-cockroachdb/pom.xml b/persistence-modules/java-cockroachdb/pom.xml index 2b6f9651bc..a1924b674a 100644 --- a/persistence-modules/java-cockroachdb/pom.xml +++ b/persistence-modules/java-cockroachdb/pom.xml @@ -1,7 +1,10 @@ - + 4.0.0 + com.baeldung + java-cockroachdb + 1.0-SNAPSHOT parent-modules @@ -10,16 +13,6 @@ ../../ - 4.0.0 - - com.baeldung - java-cockroachdb - 1.0-SNAPSHOT - - - 42.1.4 - - org.postgresql @@ -28,41 +21,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - Central @@ -71,4 +29,9 @@ default + + + 42.1.4 + + \ No newline at end of file diff --git a/persistence-modules/java-jdbi/pom.xml b/persistence-modules/java-jdbi/pom.xml index 392f0bdcbf..a823141bc5 100644 --- a/persistence-modules/java-jdbi/pom.xml +++ b/persistence-modules/java-jdbi/pom.xml @@ -1,8 +1,11 @@ - + 4.0.0 + java-jdbi + 1.0-SNAPSHOT + parent-modules com.baeldung @@ -10,21 +13,16 @@ ../../ - 4.0.0 - - java-jdbi - 1.0-SNAPSHOT - org.jdbi jdbi3-core - 3.1.0 + ${jdbi3-core.version} org.hsqldb hsqldb - 2.4.0 + ${hsqldb.version} test @@ -37,4 +35,10 @@ default + + + 3.1.0 + 2.4.0 + + \ No newline at end of file diff --git a/persistence-modules/java-mongodb/pom.xml b/persistence-modules/java-mongodb/pom.xml index 9784b2c5a8..ba8fabb9a5 100644 --- a/persistence-modules/java-mongodb/pom.xml +++ b/persistence-modules/java-mongodb/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung @@ -11,9 +11,9 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ - - + ../../ + + @@ -32,41 +32,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*ManualTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 1.8 1.8 diff --git a/persistence-modules/liquibase/pom.xml b/persistence-modules/liquibase/pom.xml index a70483437f..a18ced0d71 100644 --- a/persistence-modules/liquibase/pom.xml +++ b/persistence-modules/liquibase/pom.xml @@ -1,42 +1,31 @@ - + + 4.0.0 + liquibase + parent-modules com.baeldung 1.0.0-SNAPSHOT - ../../ + ../../ - 4.0.0 - - liquibase mysql mysql-connector-java - 5.1.6 + ${mysql-connector-java.version} baeldung-liquibase-demo - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - org.liquibase liquibase-maven-plugin - 3.4.2 + ${liquibase-maven-plugin.version} liquibase/liquibase.properties liquibase/db-changelog.xml @@ -45,4 +34,9 @@ + + 5.1.6 + 3.4.2 + + \ No newline at end of file diff --git a/persistence-modules/querydsl/pom.xml b/persistence-modules/querydsl/pom.xml index c2943875f1..4c20d673a3 100644 --- a/persistence-modules/querydsl/pom.xml +++ b/persistence-modules/querydsl/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung querydsl 0.1-SNAPSHOT jar - querydsl http://maven.apache.org @@ -15,23 +13,9 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - UTF-8 - 1.8 - 4.3.4.RELEASE - 5.2.5.Final - 1.0.0.Final - 4.1.4 - 2.3.4 - 1.6 - 1.4 - - 1.1.3 - - @@ -128,8 +112,6 @@ - - @@ -164,39 +146,17 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + + UTF-8 + 1.8 + 4.3.4.RELEASE + 5.2.5.Final + 1.0.0.Final + 4.1.4 + 2.3.4 + 1.6 + 1.4 + 1.1.3 + \ No newline at end of file diff --git a/persistence-modules/redis/pom.xml b/persistence-modules/redis/pom.xml index 1f27faa09a..7f7aeda4ad 100644 --- a/persistence-modules/redis/pom.xml +++ b/persistence-modules/redis/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung @@ -15,7 +15,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ diff --git a/persistence-modules/solr/pom.xml b/persistence-modules/solr/pom.xml index 966bd8755b..34a9722af3 100644 --- a/persistence-modules/solr/pom.xml +++ b/persistence-modules/solr/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -12,7 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ diff --git a/persistence-modules/spring-data-cassandra/pom.xml b/persistence-modules/spring-data-cassandra/pom.xml index 1358210a45..540b7ad7b9 100644 --- a/persistence-modules/spring-data-cassandra/pom.xml +++ b/persistence-modules/spring-data-cassandra/pom.xml @@ -1,33 +1,19 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-data-cassandra 0.0.1-SNAPSHOT jar - spring-data-cassandra com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - UTF-8 - - 4.3.4.RELEASE - 1.3.2.RELEASE - 2.1.5 - 2.1.9.2 - 2.1.9.2 - 2.0-0 - 19.0 - - org.springframework.data @@ -88,38 +74,15 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + + UTF-8 + 4.3.4.RELEASE + 1.3.2.RELEASE + 2.1.5 + 2.1.9.2 + 2.1.9.2 + 2.0-0 + 19.0 + + diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index c3ea9abf08..b115c0e087 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-boot-dynamodb @@ -15,20 +15,6 @@ ../../parent-boot-5 - - - com.baeldung.Application - 4.3.4.RELEASE - 4.5.2 - 4.4.1 - 1.11.64 - 3.3.7-1 - 1.0.392 - 1.11.106 - 1.11.86 - https://s3-us-west-2.amazonaws.com/dynamodb-local/release - - @@ -50,22 +36,18 @@ org.springframework.boot spring-boot-starter-actuator - org.springframework.boot spring-boot-starter-security - io.dropwizard.metrics metrics-core - com.h2database h2 - org.springframework.boot spring-boot-starter @@ -79,13 +61,11 @@ org.springframework.boot spring-boot-starter-mail - org.webjars bootstrap ${bootstrap.version} - com.amazonaws aws-java-sdk-dynamodb @@ -108,7 +88,7 @@ ${httpclient.version} - + com.amazonaws @@ -170,7 +150,6 @@ - org.apache.maven.plugins maven-war-plugin @@ -194,9 +173,7 @@ - - @@ -241,4 +218,19 @@ + + + + com.baeldung.Application + 4.3.4.RELEASE + 4.5.2 + 4.4.1 + 1.11.64 + 3.3.7-1 + 1.0.392 + 1.11.106 + 1.11.86 + https://s3-us-west-2.amazonaws.com/dynamodb-local/release + + diff --git a/persistence-modules/spring-data-eclipselink/pom.xml b/persistence-modules/spring-data-eclipselink/pom.xml index 65793fd1e0..524175fcd4 100644 --- a/persistence-modules/spring-data-eclipselink/pom.xml +++ b/persistence-modules/spring-data-eclipselink/pom.xml @@ -1,80 +1,79 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + spring-data-eclipselink + 1.0.0-SNAPSHOT + spring-data-eclipselink - com.baeldung - spring-data-eclipselink - 1.0.0-SNAPSHOT - - spring-data-eclipselink - - + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - UTF-8 - UTF-8 - 1.8 - 1.5.9.RELEASE - 2.7.0 - 1.4.196 - - - - + + org.springframework.boot spring-boot-dependencies ${spring.version} pom import - - org.springframework.boot - spring-boot-starter-data-jpa - ${spring.version} - - - org.hibernate - hibernate-entitymanager - - - org.hibernate - hibernate-core - - - - - org.springframework.boot - spring-boot-starter-test - ${spring.version} - test - - - org.eclipse.persistence - org.eclipse.persistence.jpa - ${eclipselink.version} - - - com.h2database - h2 - runtime - ${h2.version} - - + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring.version} + + + org.hibernate + hibernate-entitymanager + + + org.hibernate + hibernate-core + + + + + org.springframework.boot + spring-boot-starter-test + ${spring.version} + test + + + org.eclipse.persistence + org.eclipse.persistence.jpa + ${eclipselink.version} + + + com.h2database + h2 + runtime + ${h2.version} + + - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring.version} - - - + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring.version} + + + + + + + UTF-8 + UTF-8 + 1.8 + 1.5.9.RELEASE + 2.7.0 + 1.4.196 + diff --git a/persistence-modules/spring-data-gemfire/pom.xml b/persistence-modules/spring-data-gemfire/pom.xml index 3f7fcd03e5..479eb0c55f 100644 --- a/persistence-modules/spring-data-gemfire/pom.xml +++ b/persistence-modules/spring-data-gemfire/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-data-gemfire 1.0.0-SNAPSHOT @@ -12,17 +11,9 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - 1.7.4.RELEASE - 7.0.1 - 1.0 - 4.3.0.RELEASE - 4.3.0.RELEASE - - org.springframework.data @@ -76,4 +67,12 @@ + + 1.7.4.RELEASE + 7.0.1 + 1.0 + 4.3.0.RELEASE + 4.3.0.RELEASE + + \ No newline at end of file diff --git a/persistence-modules/spring-data-neo4j/pom.xml b/persistence-modules/spring-data-neo4j/pom.xml index bdd51e9659..3405e98edb 100644 --- a/persistence-modules/spring-data-neo4j/pom.xml +++ b/persistence-modules/spring-data-neo4j/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -10,7 +10,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ @@ -117,48 +117,9 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - 1.8 - 1.8 - 1.8 UTF-8 UTF-8 - 1.1.1 3.1.0 4.1.6.RELEASE diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index 0b9075147d..55f1124531 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -11,20 +11,9 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - UTF-8 - 5.0.3.RELEASE - 2.0.3.RELEASE - 3.2.4 - 2.9.0 - 0.10.0 - 2.0.3.RELEASE - - - org.springframework.data @@ -75,12 +64,22 @@ nosqlunit-redis ${nosqlunit.version} - + - org.springframework.data - spring-data-commons - ${spring-data-commons.version} - + org.springframework.data + spring-data-commons + ${spring-data-commons.version} + + + UTF-8 + 5.0.3.RELEASE + 2.0.3.RELEASE + 3.2.4 + 2.9.0 + 0.10.0 + 2.0.3.RELEASE + + diff --git a/persistence-modules/spring-data-solr/pom.xml b/persistence-modules/spring-data-solr/pom.xml index e24d8314ba..e687ee5f1f 100644 --- a/persistence-modules/spring-data-solr/pom.xml +++ b/persistence-modules/spring-data-solr/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -12,15 +12,9 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - UTF-8 - 4.3.4.RELEASE - 2.0.5.RELEASE - - org.springframework @@ -51,4 +45,10 @@ + + UTF-8 + 4.3.4.RELEASE + 2.0.5.RELEASE + + \ No newline at end of file diff --git a/persistence-modules/spring-hibernate-3/pom.xml b/persistence-modules/spring-hibernate-3/pom.xml index f1873a84d3..3233dd11fe 100644 --- a/persistence-modules/spring-hibernate-3/pom.xml +++ b/persistence-modules/spring-hibernate-3/pom.xml @@ -1,37 +1,31 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-hibernate-3 0.1-SNAPSHOT - spring-hibernate-3 com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ - - org.springframework spring-context ${org.springframework.version} - - org.springframework spring-orm ${org.springframework.version} - org.hibernate hibernate-core @@ -48,43 +42,35 @@ ${mysql-connector-java.version} runtime - org.apache.tomcat tomcat-dbcp ${tomcat-dbcp.version} - com.h2database h2 ${h2.version} - - com.google.guava guava ${guava.version} - - org.apache.commons commons-lang3 ${commons-lang3.version} test - org.springframework spring-test ${org.springframework.version} test - @@ -95,72 +81,29 @@ true - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 4.3.4.RELEASE 4.2.0.RELEASE 3.21.0-GA - 3.6.10.Final 5.1.40 8.5.8 1.4.193 - 5.3.3.Final - 19.0 3.5 - 4.4.5 4.5.2 - 2.9.0 - 2.7 1.6.1 - diff --git a/persistence-modules/spring-hibernate-5/pom.xml b/persistence-modules/spring-hibernate-5/pom.xml index 86e952c0e4..de66d9e6f7 100644 --- a/persistence-modules/spring-hibernate-5/pom.xml +++ b/persistence-modules/spring-hibernate-5/pom.xml @@ -1,17 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-hibernate-5 0.1-SNAPSHOT - spring-hibernate-5 com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ @@ -126,8 +125,8 @@ hsqldb ${hsqldb.version} - - + + mysql mysql-connector-java ${mysql-connector-java.version} @@ -149,58 +148,28 @@ true - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - **/*IntegrationTest.java - - - - - - 5.0.2.RELEASE - - 1.10.6.RELEASE - + 1.10.6.RELEASE 4.2.1.RELEASE 1.10.6.RELEASE - 5.2.10.Final 5.8.2.Final - 8.0.7-dmr + 8.0.7-dmr 9.0.0.M26 1.1 2.3.4 1.4.195 - 1.7.21 1.1.7 - + 5.4.0.Final 2.2.5 @@ -209,14 +178,11 @@ 21.0 3.5 - 1.3 4.12 - 4.4.1 4.5 - 2.9.0 diff --git a/persistence-modules/spring-jpa/pom.xml b/persistence-modules/spring-jpa/pom.xml index bc0b2381f3..065b29b26b 100644 --- a/persistence-modules/spring-jpa/pom.xml +++ b/persistence-modules/spring-jpa/pom.xml @@ -1,203 +1,192 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + spring-jpa + 0.1-SNAPSHOT + war + spring-jpa - com.baeldung - spring-jpa - 0.1-SNAPSHOT - war + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + - spring-jpa + + + + org.springframework + spring-orm + ${org.springframework.version} + + + commons-logging + commons-logging + + + + + org.springframework + spring-context + ${org.springframework.version} + + + org.springframework + spring-webmvc + ${org.springframework.version} + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - ../../ - + - + + org.hibernate + hibernate-entitymanager + ${hibernate.version} + + + org.hibernate + hibernate-ehcache + ${hibernate.version} + + + xml-apis + xml-apis + ${xml-apis.version} + + + org.javassist + javassist + ${javassist.version} + + + mysql + mysql-connector-java + ${mysql-connector-java.version} + runtime + + + org.springframework.data + spring-data-jpa + ${spring-data-jpa.version} + + + com.h2database + h2 + ${h2.version} + - + - - org.springframework - spring-orm - ${org.springframework.version} - - - commons-logging - commons-logging - - - - - org.springframework - spring-context - ${org.springframework.version} - - - org.springframework - spring-webmvc - ${org.springframework.version} - + + org.hibernate + hibernate-validator + ${hibernate-validator.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + - - - - org.hibernate - hibernate-entitymanager - ${hibernate.version} - - - org.hibernate - hibernate-ehcache - ${hibernate.version} - - - xml-apis - xml-apis - ${xml-apis.version} - - - org.javassist - javassist - ${javassist.version} - - - mysql - mysql-connector-java - ${mysql-connector-java.version} - runtime - - - org.springframework.data - spring-data-jpa - ${spring-data-jpa.version} - - - com.h2database - h2 - ${h2.version} - - - - - - org.hibernate - hibernate-validator - ${hibernate-validator.version} - - - javax.el - javax.el-api - ${javax.el-api.version} - - - - - javax.servlet - jstl - ${javax.servlet.jstl.version} - - - javax.servlet - servlet-api + + + javax.servlet + jstl + ${javax.servlet.jstl.version} + + + javax.servlet + servlet-api provided - ${javax.servlet.servlet-api.version} - + ${javax.servlet.servlet-api.version} + - + - - com.google.guava - guava - ${guava.version} - + + com.google.guava + guava + ${guava.version} + org.assertj assertj-core ${assertj.version} - + - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - test - + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + test + - - org.springframework - spring-test - ${org.springframework.version} - test - + + org.springframework + spring-test + ${org.springframework.version} + test + - + - - spring-jpa - - - src/main/resources - true - - + + spring-jpa + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + src/main/webapp + false + + + + - + + + 4.3.8.RELEASE + 3.21.0-GA - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - src/main/webapp - false - - + + 5.2.10.Final + 6.0.6 + 1.11.3.RELEASE + 1.4.195 - + + 1.2 + 2.5 - + + 5.4.1.Final + 1.4.01 + 2.2.5 - - - 4.3.8.RELEASE - 3.21.0-GA + + 21.0 + 3.5 + 3.8.0 + 4.4.5 + 4.5.2 + 2.9.0 - - 5.2.10.Final - 6.0.6 - 1.11.3.RELEASE - 1.4.195 - - - 1.2 - 2.5 - - - 5.4.1.Final - 1.4.01 - 2.2.5 - - - 21.0 - 3.5 - 3.8.0 - - 4.4.5 - 4.5.2 - - 2.9.0 - - - 2.7 - 1.6.1 - 2.6 - - + + 2.7 + 1.6.1 + 2.6 + \ No newline at end of file diff --git a/pom.xml b/pom.xml index f0cb72e4d0..5c89660e78 100644 --- a/pom.xml +++ b/pom.xml @@ -5,39 +5,9 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - parent-modules pom - - UTF-8 - refs/heads/master - true - false - false - - 4.12 - 1.3 - 2.8.9 - - 1.7.21 - 1.1.7 - - 2.21.0 - 3.7.0 - 1.6.0 - - - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.3 - - - - parent-boot-5 asm @@ -58,30 +28,23 @@ autovalue axon bootique - cdi core-java + core-java-collections core-java-io core-java-8 core-groovy core-java-concurrency - couchbase - deltaspike dozer - ethereumj - - feign flips - - geotools testing-modules/groovy-spock google-cloud @@ -92,18 +55,15 @@ guava-modules/guava-21 guice disruptor - handling-spring-static-resources hazelcast hbase httpclient hystrix - immutables influxdb - jackson vavr @@ -125,7 +85,6 @@ jsoup testing-modules/junit-5 jws - libraries-data linkrest @@ -147,13 +106,10 @@ orientdb osgi orika - patterns pdf protobuffer - persistence-modules/querydsl - reactor-core persistence-modules/redis testing-modules/rest-assured @@ -267,21 +223,15 @@ spring-reactor spring-vertx spring-jinq - spring-rest-embedded-tomcat - - testing-modules/testing testing-modules/testng - video-tutorials - xml xmlunit-2 struts-2 apache-velocity apache-solrj - rabbitmq vertx persistence-modules/spring-data-gemfire @@ -370,7 +320,7 @@ maven - + org.apache.maven.plugins maven-surefire-plugin ${maven-surefire-plugin.version} @@ -449,28 +399,28 @@ - - org.apache.maven.plugins - maven-install-plugin - 2.5.1 - - org.baeldung.pmd - custom-pmd - 0.0.1 - jar - ${tutorialsproject.basedir}/custom-pmd-0.0.1.jar - true - - - - install-jar-lib - - install-file - - validate - - - + + org.apache.maven.plugins + maven-install-plugin + 2.5.1 + + org.baeldung.pmd + custom-pmd + 0.0.1 + jar + ${tutorialsproject.basedir}/custom-pmd-0.0.1.jar + true + + + + install-jar-lib + + install-file + + validate + + + @@ -482,4 +432,89 @@ + + + + integration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*ManualTest.java + **/*LiveTest.java + + + **/*IntegrationTest.java + + + + + + + json + + + + + + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.3 + + + + + + UTF-8 + refs/heads/master + true + false + false + + 4.12 + 1.3 + 2.8.9 + + 1.7.21 + 1.1.7 + + 2.21.0 + 3.7.0 + 1.6.0 + 1.8 + 1.2.17 + 1.1 + 2.1.0.1 + 1.19 + 1.19 + 1.3 + 1.6.0 + 2.19.1 + 2.5 + 1.4 + 2.6 + 3.1.0 + 1.2 + 2.3.1 + 1.9.13 + 1.2 + 2.5.0 + 1.3 + + \ No newline at end of file diff --git a/protobuffer/pom.xml b/protobuffer/pom.xml index 52838f5de9..919a49e67d 100644 --- a/protobuffer/pom.xml +++ b/protobuffer/pom.xml @@ -1,14 +1,14 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + protobuffer + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - protobuffer diff --git a/rabbitmq/pom.xml b/rabbitmq/pom.xml index 151f214a91..391d7933ea 100644 --- a/rabbitmq/pom.xml +++ b/rabbitmq/pom.xml @@ -1,13 +1,12 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung rabbitmq 0.1-SNAPSHOT - rabbitmq http://maven.apache.org @@ -21,12 +20,13 @@ com.rabbitmq amqp-client - 3.6.6 + ${amqp-client.version} UTF-8 + 3.6.6 \ No newline at end of file diff --git a/ratpack/pom.xml b/ratpack/pom.xml index 3f953b3ed0..bf43168b02 100644 --- a/ratpack/pom.xml +++ b/ratpack/pom.xml @@ -8,13 +8,6 @@ ratpack http://maven.apache.org - - UTF-8 - 1.8 - 1.8 - 1.4.6 - - com.baeldung parent-modules @@ -22,14 +15,12 @@ - io.ratpack ratpack-spring-boot-starter ${ratpack.version} pom - io.ratpack ratpack-core @@ -59,18 +50,17 @@ com.h2database h2 - 1.4.193 + ${h2database.version} - org.apache.httpcomponents httpclient - 4.5.3 + ${httpclient.version} org.apache.httpcomponents httpcore - 4.4.6 + ${httpcore.version} @@ -83,4 +73,14 @@ + + UTF-8 + 1.8 + 1.8 + 1.4.6 + 4.5.3 + 4.4.6 + 1.4.193 + + diff --git a/reactor-core/pom.xml b/reactor-core/pom.xml index d387471d56..41c42cac28 100644 --- a/reactor-core/pom.xml +++ b/reactor-core/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung @@ -13,7 +13,6 @@ - io.projectreactor reactor-core @@ -26,13 +25,12 @@ ${assertj.version} test - - + io.projectreactor - reactor-test + reactor-test ${reactor-core.version} - test - + test + diff --git a/rest-with-spark-java/pom.xml b/rest-with-spark-java/pom.xml index 2364154fdc..ffdb86ebca 100644 --- a/rest-with-spark-java/pom.xml +++ b/rest-with-spark-java/pom.xml @@ -1,38 +1,47 @@ - 4.0.0 - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + 4.0.0 com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - com.baeldung - rest-with-spark-java - 1.0-SNAPSHOT - rest-with-spark-java - http://maven.apache.org - - - junit - junit - 3.8.1 - test - - - com.sparkjava - spark-core - 2.5.4 - - - com.fasterxml.jackson.core - jackson-core - 2.8.6 - - - com.fasterxml.jackson.core - jackson-databind - 2.8.6 - - + rest-with-spark-java + 1.0-SNAPSHOT + rest-with-spark-java + http://maven.apache.org + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + junit + junit + ${junit.version} + test + + + com.sparkjava + spark-core + ${spark-core.version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-core.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind.version} + + + + + 2.5.4 + 2.8.6 + 2.8.6 + + diff --git a/resteasy/bin/pom.xml b/resteasy/bin/pom.xml index 2e1f839a55..f8cdc20360 100644 --- a/resteasy/bin/pom.xml +++ b/resteasy/bin/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -14,6 +14,12 @@ 1.6.1 + + com.baeldung + resteasy-tutorial + 1.0 + + RestEasyTutorial @@ -73,66 +79,5 @@ commons-io ${commons-io.version} - - - - - live - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*IntegrationTest.java - - - **/*LiveTest.java - - - - - - - json - - - - - org.codehaus.cargo - cargo-maven2-plugin - ${cargo-maven2-plugin.version} - - false - - - - start-server - pre-integration-test - - start - - - - stop-server - post-integration-test - - stop - - - - - - - - - \ No newline at end of file diff --git a/resteasy/pom.xml b/resteasy/pom.xml index 94be91243a..61c099f110 100644 --- a/resteasy/pom.xml +++ b/resteasy/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -14,12 +14,6 @@ 1.0.0-SNAPSHOT - - 3.0.19.Final - 2.5 - 1.6.1 - - RestEasyTutorial @@ -44,9 +38,7 @@ - - org.jboss.resteasy resteasy-servlet-initializer @@ -93,9 +85,7 @@ live - - org.apache.maven.plugins maven-surefire-plugin @@ -146,9 +136,15 @@ - + + + 3.0.19.Final + 2.5 + 1.6.1 + + \ No newline at end of file diff --git a/rule-engines/easy-rules/pom.xml b/rule-engines/easy-rules/pom.xml index 78edc09d1a..8399eff8a2 100644 --- a/rule-engines/easy-rules/pom.xml +++ b/rule-engines/easy-rules/pom.xml @@ -1,24 +1,24 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.easyrules - easy-rules - 1.0 + com.baeldung.easyrules + easy-rules + 1.0 - easy-rules + easy-rules - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - org.jeasy - easy-rules-core - 3.0.0 - - + + + org.jeasy + easy-rules-core + 3.0.0 + + \ No newline at end of file diff --git a/rule-engines/openl-tablets/pom.xml b/rule-engines/openl-tablets/pom.xml index e983d4e566..8e3f1965b5 100644 --- a/rule-engines/openl-tablets/pom.xml +++ b/rule-engines/openl-tablets/pom.xml @@ -1,29 +1,29 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.openltablets - openl-tablets - 1.0 + com.baeldung.openltablets + openl-tablets + 1.0 - openl-tablets + openl-tablets - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - org.openl - org.openl.core - 5.19.4 - - - org.openl.rules - org.openl.rules - 5.19.4 - - + + + org.openl + org.openl.core + 5.19.4 + + + org.openl.rules + org.openl.rules + 5.19.4 + + \ No newline at end of file diff --git a/rule-engines/rulebook/pom.xml b/rule-engines/rulebook/pom.xml index 711bee8c91..675776eb6f 100644 --- a/rule-engines/rulebook/pom.xml +++ b/rule-engines/rulebook/pom.xml @@ -1,24 +1,24 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.rulebook - rulebook - 1.0 + com.baeldung.rulebook + rulebook + 1.0 - rulebook + rulebook - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - com.deliveredtechnologies - rulebook-core - 0.6.2 - - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + com.deliveredtechnologies + rulebook-core + 0.6.2 + + \ No newline at end of file diff --git a/rxjava/pom.xml b/rxjava/pom.xml index 9a07aba2a3..41f2c3f6f6 100644 --- a/rxjava/pom.xml +++ b/rxjava/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 rxjava @@ -36,7 +36,7 @@ rxjava-string 1.1.1 - + junit junit @@ -50,17 +50,17 @@ 1.7.0 - com.github.davidmoten - rxjava-jdbc - ${rx.java.jdbc.version} - - - com.h2database - h2 - ${h2.version} - runtime - - + com.github.davidmoten + rxjava-jdbc + ${rx.java.jdbc.version} + + + com.h2database + h2 + ${h2.version} + runtime + + org.assertj assertj-core ${assertj.version} @@ -79,7 +79,7 @@ - 3.8.0 + 3.8.0 1.2.5 0.7.11 1.4.196 diff --git a/saas/pom.xml b/saas/pom.xml index b76b27011a..6b34b99a5d 100644 --- a/saas/pom.xml +++ b/saas/pom.xml @@ -1,84 +1,88 @@ - 4.0.0 - com.baeldung - saas - 0.1.0-SNAPSHOT - jar - saas + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + saas + 0.1.0-SNAPSHOT + jar + saas - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - com.atlassian.jira - jira-rest-java-client-core - 4.0.0 - - - com.atlassian.fugue - fugue - 2.6.1 - - - com.google.guava - guava - 19.0 - + + + com.atlassian.jira + jira-rest-java-client-core + ${jira-rest-java-client-core.version} + + + com.atlassian.fugue + fugue + ${atlassian.fugue.version} + + + com.google.guava + guava + ${guava.version} + + - + + saas + + + src/main/resources + true + + - - saas - - - src/main/resources - true - - + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + 1.8 + 1.8 + + - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + java + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + -Xmx300m + -XX:+UseParallelGC + -classpath + + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed + + + + + - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - java - com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - - -Xmx300m - -XX:+UseParallelGC - -classpath - - com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - - - - + + + atlassian-public + https://packages.atlassian.com/maven/repository/public + + + + + + 3.7.0 + 4.0.0 + 2.6.1 + 19.0 + - - - - atlassian-public - https://packages.atlassian.com/maven/repository/public - - - - - 3.7.0 - \ No newline at end of file diff --git a/spark-java/pom.xml b/spark-java/pom.xml index 67f4765f38..d8243345c5 100644 --- a/spark-java/pom.xml +++ b/spark-java/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung spark-java @@ -15,22 +15,24 @@ 1.0.0-SNAPSHOT - - UTF-8 - 1.8 - 1.8 - com.sparkjava spark-core - 2.5.4 + ${sparkjava.spark-core.version} com.google.code.gson gson - 2.8.0 + ${google.code.gson.version} + + + UTF-8 + 2.5.4 + 2.8.0 + + diff --git a/spring-4/pom.xml b/spring-4/pom.xml index f638fc5faa..c81469d3eb 100644 --- a/spring-4/pom.xml +++ b/spring-4/pom.xml @@ -1,50 +1,40 @@ 4.0.0 - spring-4 spring-4 0.0.1-SNAPSHOT jar - spring-4 - - spring-boot-starter-parent + + org.springframework.boot + spring-boot-starter-parent 1.5.10.RELEASE - + - - UTF-8 - 1.8 - 1.8 - - org.springframework.boot spring-boot-starter-web - 1.5.10.RELEASE + ${spring-boot-starter-web.version} - org.springframework.boot spring-boot-starter-test - 1.5.9.RELEASE + ${spring-boot-starter-test.version} - com.github.feature-flip flips-web - 1.0.1 + ${flips-web.version} - org.projectlombok lombok - 1.16.18 + ${lombok.version} provided @@ -64,4 +54,14 @@ + + + UTF-8 + 1.5.10.RELEASE + 1.5.9.RELEASE + 1.0.1 + 1.16.18 + 1.8 + + diff --git a/spring-5-mvc/pom.xml b/spring-5-mvc/pom.xml index 850661836b..06ddfb82d9 100644 --- a/spring-5-mvc/pom.xml +++ b/spring-5-mvc/pom.xml @@ -2,12 +2,10 @@ 4.0.0 - com.baeldung spring-5-mvc 0.0.1-SNAPSHOT jar - spring-5-mvc spring 5 MVC sample project about new features @@ -36,8 +34,6 @@ org.springframework.boot spring-boot-starter-web - - org.apache.commons @@ -51,8 +47,7 @@ org.slf4j jcl-over-slf4j - - + org.jetbrains.kotlin kotlin-stdlib-jre8 @@ -67,9 +62,7 @@ com.fasterxml.jackson.module jackson-module-kotlin - - org.springframework.boot spring-boot-devtools @@ -80,7 +73,6 @@ h2 runtime - org.springframework spring-test @@ -90,20 +82,17 @@ spring-boot-starter-test test - junit junit test - com.jayway.restassured rest-assured ${rest-assured.version} test - @@ -160,7 +149,6 @@ - diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index 8e84c0f364..e9e7c7c3e3 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-client/pom.xml @@ -6,7 +6,6 @@ spring-5-reactive-client 0.0.1-SNAPSHOT jar - spring-5-reactive-client spring 5 sample project about new features @@ -14,7 +13,7 @@ org.springframework.boot spring-boot-starter-parent 2.0.0.M7 - + @@ -43,7 +42,7 @@ javax.json.bind javax.json.bind-api - + @@ -56,7 +55,7 @@ - + org.apache.geronimo.specs geronimo-json_1.1_spec @@ -98,7 +97,7 @@ org.apache.commons commons-collections4 - 4.1 + ${commons-collections4.version} test @@ -196,6 +195,7 @@ 1.1.3 1.0 1.0 + 4.1 diff --git a/spring-5-reactive/README.md b/spring-5-reactive/README.md index 3fb22f5710..7c078a8f92 100644 --- a/spring-5-reactive/README.md +++ b/spring-5-reactive/README.md @@ -15,3 +15,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring 5 Testing with @EnabledIf Annotation](https://github.com/eugenp/tutorials/tree/master/spring-5) - [Reactive WebSockets with Spring 5](http://www.baeldung.com/spring-5-reactive-websockets) - [Spring Boot Actuator](http://www.baeldung.com/spring-boot-actuators) +- [Spring Webflux Filters](http://www.baeldung.com/spring-webflux-filters) diff --git a/spring-5-reactive/pom.xml b/spring-5-reactive/pom.xml index 96378c60de..d17026af47 100644 --- a/spring-5-reactive/pom.xml +++ b/spring-5-reactive/pom.xml @@ -1,12 +1,12 @@ - + 4.0.0 com.baeldung spring-5-reactive 0.0.1-SNAPSHOT jar - spring-5-reactive spring 5 sample project about new features @@ -14,7 +14,7 @@ org.springframework.boot spring-boot-starter-parent 2.0.0.RELEASE - + @@ -47,7 +47,7 @@ org.springframework.boot spring-boot-starter-actuator - + @@ -60,13 +60,13 @@ - - - org.projectlombok - lombok - compile - - + + + org.projectlombok + lombok + compile + + org.apache.geronimo.specs geronimo-json_1.1_spec @@ -108,7 +108,7 @@ org.apache.commons commons-collections4 - 4.1 + ${commons-collections4.version} test @@ -184,7 +184,7 @@ 1.1.3 1.0 1.0 + 4.1 - diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleHandlerFilterFunction.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleHandlerFilterFunction.java similarity index 77% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleHandlerFilterFunction.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleHandlerFilterFunction.java index e55f5ce2fe..36b3c2ff6e 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleHandlerFilterFunction.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleHandlerFilterFunction.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.filter; +package com.baeldung.reactive.filters; import org.springframework.web.reactive.function.server.HandlerFilterFunction; import org.springframework.web.reactive.function.server.HandlerFunction; @@ -8,10 +8,10 @@ import reactor.core.publisher.Mono; import static org.springframework.http.HttpStatus.FORBIDDEN; -public class ExampleHandlerFilterFunction implements HandlerFilterFunction { +public class ExampleHandlerFilterFunction implements HandlerFilterFunction { @Override - public Mono filter(ServerRequest serverRequest, HandlerFunction handlerFunction) { + public Mono filter(ServerRequest serverRequest, HandlerFunction handlerFunction) { if (serverRequest.pathVariable("name").equalsIgnoreCase("test")) { return ServerResponse.status(FORBIDDEN).build(); } diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleWebFilter.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleWebFilter.java similarity index 93% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleWebFilter.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleWebFilter.java index 99bc9f7fc3..8fe3550a7e 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/filter/ExampleWebFilter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/ExampleWebFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.filter; +package com.baeldung.reactive.filters; import org.springframework.stereotype.Component; import org.springframework.web.server.ServerWebExchange; diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/handler/PlayerHandler.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerHandler.java similarity index 77% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/handler/PlayerHandler.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerHandler.java index 51b4e166d1..20a08570ae 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/handler/PlayerHandler.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerHandler.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.handler; +package com.baeldung.reactive.filters; import org.springframework.stereotype.Component; import org.springframework.web.reactive.function.server.ServerRequest; @@ -8,9 +8,9 @@ import reactor.core.publisher.Mono; import static org.springframework.web.reactive.function.server.ServerResponse.ok; @Component -public class PlayerHandler { +class PlayerHandler { - public Mono getName(ServerRequest request) { + Mono getName(ServerRequest request) { Mono name = Mono.just(request.pathVariable("name")); return ok().body(name, String.class); } diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/router/PlayerRouter.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerRouter.java similarity index 74% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/router/PlayerRouter.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerRouter.java index be721964ca..753991782c 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/router/PlayerRouter.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/PlayerRouter.java @@ -1,7 +1,5 @@ -package com.baeldung.reactive.router; +package com.baeldung.reactive.filters; -import com.baeldung.reactive.filter.ExampleHandlerFilterFunction; -import com.baeldung.reactive.handler.PlayerHandler; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.reactive.function.server.RouterFunction; @@ -17,6 +15,6 @@ public class PlayerRouter { public RouterFunction route(PlayerHandler playerHandler) { return RouterFunctions .route(GET("/players/{name}"), playerHandler::getName) - .filter(new ExampleHandlerFilterFunction()::filter); + .filter(new ExampleHandlerFilterFunction()); } } diff --git a/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/UserController.java b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/UserController.java similarity index 90% rename from spring-5-reactive/src/main/java/com/baeldung/reactive/controller/UserController.java rename to spring-5-reactive/src/main/java/com/baeldung/reactive/filters/UserController.java index f51a674fe8..38c9210f88 100644 --- a/spring-5-reactive/src/main/java/com/baeldung/reactive/controller/UserController.java +++ b/spring-5-reactive/src/main/java/com/baeldung/reactive/filters/UserController.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.controller; +package com.baeldung.reactive.filters; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/handler/PlayerHandlerTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/PlayerHandlerTest.java similarity index 97% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/handler/PlayerHandlerTest.java rename to spring-5-reactive/src/test/java/com/baeldung/reactive/filters/PlayerHandlerTest.java index de9b326874..8189802248 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/handler/PlayerHandlerTest.java +++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/PlayerHandlerTest.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.handler; +package com.baeldung.reactive.filters; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-5-reactive/src/test/java/com/baeldung/reactive/controller/UserControllerTest.java b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/UserControllerTest.java similarity index 96% rename from spring-5-reactive/src/test/java/com/baeldung/reactive/controller/UserControllerTest.java rename to spring-5-reactive/src/test/java/com/baeldung/reactive/filters/UserControllerTest.java index 131a3d812b..d32a9d478f 100644 --- a/spring-5-reactive/src/test/java/com/baeldung/reactive/controller/UserControllerTest.java +++ b/spring-5-reactive/src/test/java/com/baeldung/reactive/filters/UserControllerTest.java @@ -1,4 +1,4 @@ -package com.baeldung.reactive.controller; +package com.baeldung.reactive.filters; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-5-security/pom.xml b/spring-5-security/pom.xml index b21f830783..c9b16f8b88 100644 --- a/spring-5-security/pom.xml +++ b/spring-5-security/pom.xml @@ -5,7 +5,6 @@ spring-5-security 0.0.1-SNAPSHOT jar - spring-5-security spring 5 security sample project @@ -18,22 +17,22 @@ - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity4 - + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity4 + @@ -66,10 +65,10 @@ org.springframework.boot spring-boot-maven-plugin - - com.baeldung.passwordstorage.PasswordStorageApplication - JAR - + + com.baeldung.passwordstorage.PasswordStorageApplication + JAR + diff --git a/spring-5/README.md b/spring-5/README.md index 566b905c74..d37927cfc7 100644 --- a/spring-5/README.md +++ b/spring-5/README.md @@ -12,7 +12,7 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring 5 Functional Bean Registration](http://www.baeldung.com/spring-5-functional-beans) - [The SpringJUnitConfig and SpringJUnitWebConfig Annotations in Spring 5](http://www.baeldung.com/spring-5-junit-config) - [Spring Security 5 for Reactive Applications](http://www.baeldung.com/spring-security-5-reactive) -- [Spring 5 Testing with @EnabledIf Annotation](http://www.baeldung.com/sring-5-enabledif) +- [Spring 5 Testing with @EnabledIf Annotation](http://www.baeldung.com/spring-5-enabledIf) - [Introduction to Spring REST Docs](http://www.baeldung.com/spring-rest-docs) - [Spring Security 5 – OAuth2 Login](http://www.baeldung.com/spring-security-5-oauth2-login) - [Spring ResponseStatusException](http://www.baeldung.com/spring-response-status-exception) diff --git a/spring-5/pom.xml b/spring-5/pom.xml index f8bad72c51..67a6930569 100644 --- a/spring-5/pom.xml +++ b/spring-5/pom.xml @@ -1,185 +1,184 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung - spring-5 - 0.0.1-SNAPSHOT - jar + com.baeldung + spring-5 + 0.0.1-SNAPSHOT + jar + spring-5 + spring 5 sample project about new features - spring-5 - spring 5 sample project about new features + + org.springframework.boot + spring-boot-starter-parent + 2.0.0.RELEASE + + - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.RELEASE - - - - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-validation - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-webflux - + - org.springframework.boot - spring-boot-starter-hateoas - - - org.projectreactor - reactor-spring - ${reactor-spring.version} - - - javax.json.bind - javax.json.bind-api - - - - - - - - - - - - - - - org.apache.geronimo.specs - geronimo-json_1.1_spec - ${geronimo-json_1.1_spec.version} - - - org.apache.johnzon - johnzon-jsonb - - - - org.apache.commons - commons-lang3 - + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-webflux + + + org.springframework.boot + spring-boot-starter-hateoas + + + org.projectreactor + reactor-spring + ${reactor-spring.version} + + + javax.json.bind + javax.json.bind-api + + + + + + + + + + + + + + + org.apache.geronimo.specs + geronimo-json_1.1_spec + ${geronimo-json_1.1_spec.version} + + + org.apache.johnzon + johnzon-jsonb + + + + org.apache.commons + commons-lang3 + - + - - org.springframework.boot - spring-boot-devtools - runtime - - - com.h2database - h2 - runtime - + + org.springframework.boot + spring-boot-devtools + runtime + + + com.h2database + h2 + runtime + - - org.springframework - spring-test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - + + org.springframework + spring-test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + - - org.apache.commons - commons-collections4 - 4.1 - test - + + org.apache.commons + commons-collections4 + 4.1 + test + - - org.junit.jupiter - junit-jupiter-api - - - org.junit.jupiter - junit-jupiter-engine - test - - - org.junit.platform - junit-platform-surefire-provider - ${junit.platform.version} - test - - - org.junit.platform - junit-platform-runner - ${junit.platform.version} - test - + + org.junit.jupiter + junit-jupiter-api + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.platform + junit-platform-surefire-provider + ${junit.platform.version} + test + + + org.junit.platform + junit-platform-runner + ${junit.platform.version} + test + org.springframework.restdocs spring-restdocs-mockmvc test - + org.springframework.restdocs spring-restdocs-webtestclient test - + org.springframework.restdocs spring-restdocs-restassured test - - - - - - org.springframework.boot - spring-boot-maven-plugin - - com.baeldung.Spring5Application - JAR - - + - - org.apache.maven.plugins - maven-surefire-plugin - - 3 - true - methods - true - - **/*IntegrationTest.java - **/*LiveTest.java - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + com.baeldung.Spring5Application + JAR + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 3 + true + methods + true + + **/*IntegrationTest.java + **/*LiveTest.java + + + org.asciidoctor asciidoctor-maven-plugin @@ -203,20 +202,20 @@ - - + + - - UTF-8 - UTF-8 - 1.8 - 1.0.0 - 2.20 - 5.0.2.RELEASE - 1.0.1.RELEASE - 1.0 - 1.5.6 - ${project.build.directory}/generated-snippets - + + UTF-8 + UTF-8 + 1.8 + 1.0.0 + 2.20 + 5.0.2.RELEASE + 1.0.1.RELEASE + 1.0 + 1.5.6 + ${project.build.directory}/generated-snippets + diff --git a/spring-activiti/pom.xml b/spring-activiti/pom.xml index 92d9618b65..5b6911a450 100644 --- a/spring-activiti/pom.xml +++ b/spring-activiti/pom.xml @@ -2,12 +2,10 @@ 4.0.0 - com.example spring-activiti 0.0.1-SNAPSHOT jar - spring-activiti Demo project for Spring Boot @@ -15,17 +13,9 @@ org.springframework.boot spring-boot-starter-parent 1.5.4.RELEASE - + - - com.example.activitiwithspring.ActivitiWithSpringApplication - UTF-8 - UTF-8 - 1.8 - 6.0.0 - - org.activiti @@ -80,5 +70,12 @@ + + com.example.activitiwithspring.ActivitiWithSpringApplication + UTF-8 + UTF-8 + 6.0.0 + 1.8 + diff --git a/spring-akka/pom.xml b/spring-akka/pom.xml index 5efd111c35..d68e8c211b 100644 --- a/spring-akka/pom.xml +++ b/spring-akka/pom.xml @@ -1,11 +1,10 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-akka 0.1-SNAPSHOT - spring-akka @@ -15,30 +14,24 @@ - org.springframework spring-context - com.typesafe.akka akka-actor_2.11 ${akka.version} - org.springframework spring-test test - - - org.springframework spring-framework-bom @@ -46,46 +39,9 @@ pom import - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 4.3.4.RELEASE 2.4.14 diff --git a/spring-all/pom.xml b/spring-all/pom.xml index b04ffae9c8..ac66ecdad8 100644 --- a/spring-all/pom.xml +++ b/spring-all/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-all 0.1-SNAPSHOT - spring-all war @@ -20,9 +19,7 @@ com.fasterxml.jackson.core jackson-databind - - org.springframework spring-web @@ -49,17 +46,12 @@ spring-shell ${org.springframework.shell.version} - - - org.springframework spring-aspects - - org.hibernate hibernate-core @@ -78,36 +70,28 @@ org.hsqldb hsqldb - - org.hibernate hibernate-validator - - javax.servlet javax.servlet-api provided - javax.servlet jstl runtime - - com.google.guava guava ${guava.version} - net.sf.jasperreports jasperreports @@ -119,23 +103,18 @@ - - org.springframework spring-test test - - org.assertj assertj-core ${assertj.version} test - org.hamcrest hamcrest-core @@ -146,13 +125,11 @@ hamcrest-library test - org.mockito mockito-core test - org.easymock easymock @@ -164,7 +141,6 @@ ehcache ${ehcache.version} - org.apache.logging.log4j log4j-api @@ -175,13 +151,10 @@ log4j-core ${log4j.version} - - - org.springframework spring-framework-bom @@ -189,19 +162,16 @@ pom import - org.springframework spring-core ${org.springframework.version} - org.springframework.boot spring-boot-starter-thymeleaf - + - @@ -212,9 +182,7 @@ true - - org.apache.maven.plugins maven-war-plugin @@ -222,48 +190,11 @@ false - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - org.baeldung.sample.App + org.baeldung.sample.App 4.3.4.RELEASE 4.2.0.RELEASE diff --git a/spring-amqp-simple/pom.xml b/spring-amqp-simple/pom.xml index 0cf4ad0e47..f3dfbccaec 100644 --- a/spring-amqp-simple/pom.xml +++ b/spring-amqp-simple/pom.xml @@ -1,7 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + com.baeldung + spring-amqp-simple + 1.0.0-SNAPSHOT + Spring AMQP Simple App parent-boot-5 @@ -10,11 +14,6 @@ ../parent-boot-5 - com.baeldung - spring-amqp-simple - 1.0.0-SNAPSHOT - Spring AMQP Simple App - org.springframework.boot diff --git a/spring-amqp/pom.xml b/spring-amqp/pom.xml index 37a1d9e394..a11261084a 100755 --- a/spring-amqp/pom.xml +++ b/spring-amqp/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung springamqp 0.1-SNAPSHOT jar - springamqp Introduction to Spring-AMQP @@ -16,10 +14,6 @@ 1.0.0-SNAPSHOT - - UTF-8 - - org.springframework.amqp @@ -37,4 +31,9 @@ springamqp + + + UTF-8 + + diff --git a/spring-aop/pom.xml b/spring-aop/pom.xml index 0e8dbe46ce..7cdf9bd7cc 100644 --- a/spring-aop/pom.xml +++ b/spring-aop/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-aop diff --git a/spring-apache-camel/pom.xml b/spring-apache-camel/pom.xml index df907a34de..4c963fc32c 100644 --- a/spring-apache-camel/pom.xml +++ b/spring-apache-camel/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.apache.camel spring-apache-camel @@ -14,20 +14,12 @@ 1.0.0-SNAPSHOT - - 2.18.1 - 4.3.4.RELEASE - 1.8 - - - org.apache.camel camel-core ${env.camel.version} - org.apache.camel camel-spring @@ -39,13 +31,11 @@ - org.apache.camel camel-stream ${env.camel.version} - org.springframework spring-context @@ -56,8 +46,13 @@ camel-spring-javaconfig ${env.camel.version} - + + 2.18.1 + 4.3.4.RELEASE + 1.8 + + diff --git a/spring-batch/pom.xml b/spring-batch/pom.xml index f72024d32b..d274c046e2 100644 --- a/spring-batch/pom.xml +++ b/spring-batch/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-batch 0.1-SNAPSHOT jar - spring-batch http://maven.apache.org @@ -16,14 +14,6 @@ 1.0.0-SNAPSHOT - - UTF-8 - 5.0.3.RELEASE - 4.0.0.RELEASE - 3.15.1 - 4.1 - - @@ -64,4 +54,13 @@ + + + UTF-8 + 5.0.3.RELEASE + 4.0.0.RELEASE + 3.15.1 + 4.1 + + diff --git a/spring-bom/README.md b/spring-bom/README.md index 10e3502d11..d056216a2e 100644 --- a/spring-bom/README.md +++ b/spring-bom/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Spring with Maven BOM] +- [Spring with Maven BOM](http://www.baeldung.com/spring-maven-bom) diff --git a/spring-bom/pom.xml b/spring-bom/pom.xml index 306632eb21..ddecb9dc0d 100644 --- a/spring-bom/pom.xml +++ b/spring-bom/pom.xml @@ -1,27 +1,26 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - com.baeldung spring-bom 1.0.0-SNAPSHOT spring-bom http://maven.apache.org - - UTF-8 - + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + org.springframework spring-framework-bom - 4.3.8.RELEASE + ${spring-framework-bom.version} pom import @@ -37,4 +36,10 @@ spring-web + + + UTF-8 + 4.3.8.RELEASE + + diff --git a/spring-boot-admin/pom.xml b/spring-boot-admin/pom.xml index 9c1eeeabff..d285a01ec5 100644 --- a/spring-boot-admin/pom.xml +++ b/spring-boot-admin/pom.xml @@ -11,11 +11,6 @@ 1.0.0-SNAPSHOT - - UTF-8 - 1.5.8.RELEASE - - spring-boot-admin-server spring-boot-admin-client @@ -33,4 +28,9 @@ + + UTF-8 + 1.5.8.RELEASE + + \ No newline at end of file diff --git a/spring-boot-admin/spring-boot-admin-server/pom.xml b/spring-boot-admin/spring-boot-admin-server/pom.xml index f28b7a3dc9..d5c2e19f37 100644 --- a/spring-boot-admin/spring-boot-admin-server/pom.xml +++ b/spring-boot-admin/spring-boot-admin-server/pom.xml @@ -2,11 +2,9 @@ 4.0.0 - spring-boot-admin-server 0.0.1-SNAPSHOT jar - spring-boot-admin-server Spring Boot Admin Server @@ -31,7 +29,7 @@ spring-boot-starter - + de.codecentric spring-boot-admin-server @@ -43,7 +41,7 @@ ${spring-boot-admin-server.version} - + de.codecentric spring-boot-admin-server-ui-login @@ -57,17 +55,17 @@ com.hazelcast hazelcast - + de.codecentric spring-boot-admin-starter-client ${spring-boot-admin-starter-client.version} - - - - - + + + + + org.springframework.boot spring-boot-starter-test diff --git a/spring-boot-bootstrap/pom.xml b/spring-boot-bootstrap/pom.xml index ad2512846b..1ec9af8189 100644 --- a/spring-boot-bootstrap/pom.xml +++ b/spring-boot-bootstrap/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung spring-boot-bootstrap jar - spring-boot-bootstrap Demo project for Spring Boot @@ -16,7 +14,7 @@ 0.0.1-SNAPSHOT ../parent-boot-5 - + - - UTF-8 - UTF-8 - 1.8 - - org.springframework.boot @@ -63,72 +55,25 @@ org.springframework.boot spring-boot-starter-security - - org.springframework.boot spring-boot-starter-test test - io.rest-assured rest-assured 3.0.3 test - javax.servlet javax.servlet-api 4.0.0 - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/AutoconfigurationTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - autoconfiguration @@ -164,5 +109,10 @@ + + UTF-8 + UTF-8 + 1.8 + diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml index 5bb9f8330e..6ae6572ca9 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml @@ -1,11 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung greeter-spring-boot-autoconfigure 0.0.1-SNAPSHOT - + parent-boot-5 com.baeldung 0.0.1-SNAPSHOT @@ -24,13 +24,13 @@ spring-boot ${spring-boot.version} - + org.springframework.boot spring-boot-autoconfigure ${spring-boot.version} - + org.springframework.boot spring-boot-configuration-processor diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml index e90e6ca280..9db76759ec 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-sample-app/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -18,7 +18,7 @@ - + com.baeldung greeter-spring-boot-starter diff --git a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml index d6cbe9fc9f..e771cbaa8d 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml @@ -1,11 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung greeter-spring-boot-starter 0.0.1-SNAPSHOT - + parent-boot-5 com.baeldung 0.0.1-SNAPSHOT diff --git a/spring-boot-custom-starter/greeter/pom.xml b/spring-boot-custom-starter/greeter/pom.xml index a65e71cfe6..6143992088 100644 --- a/spring-boot-custom-starter/greeter/pom.xml +++ b/spring-boot-custom-starter/greeter/pom.xml @@ -1,11 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung greeter 0.0.1-SNAPSHOT - + parent-boot-5 com.baeldung 0.0.1-SNAPSHOT diff --git a/spring-boot-custom-starter/pom.xml b/spring-boot-custom-starter/pom.xml index cc9724bad1..1bc0e14d8e 100644 --- a/spring-boot-custom-starter/pom.xml +++ b/spring-boot-custom-starter/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-boot-custom-starter @@ -10,11 +10,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - UTF-8 - + greeter @@ -23,4 +19,8 @@ greeter-spring-boot-sample-app + + UTF-8 + + \ No newline at end of file diff --git a/spring-boot-gradle/README.md b/spring-boot-gradle/README.md new file mode 100644 index 0000000000..f96aa9ccf8 --- /dev/null +++ b/spring-boot-gradle/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Spring Boot: Configuring a Main Class](http://www.baeldung.com/spring-boot-main-class) diff --git a/spring-boot-keycloak/pom.xml b/spring-boot-keycloak/pom.xml index 741e2313b4..d2df261b2f 100644 --- a/spring-boot-keycloak/pom.xml +++ b/spring-boot-keycloak/pom.xml @@ -1,88 +1,83 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.keycloak + spring-boot-keycloak + 0.0.1 + jar + spring-boot-keycloak + This is a simple application demonstrating integration between Keycloak and Spring Boot. - com.baeldung.keycloak - spring-boot-keycloak - 0.0.1 - jar + + com.baeldung + parent-boot-5 + 0.0.1-SNAPSHOT + ../parent-boot-5 + - spring-boot-keycloak - This is a simple application demonstrating integration between Keycloak and Spring Boot. + + + org.springframework.boot + spring-boot-starter + + + org.keycloak + keycloak-spring-boot-starter + + + org.springframework.boot + spring-boot-starter-data-jpa + - + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + org.hsqldb + hsqldb + runtime + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + + + + org.keycloak.bom + keycloak-adapter-bom + ${keycloak-adapter-bom.version} + pom + import + + + - com.baeldung - parent-boot-5 - 0.0.1-SNAPSHOT - ../parent-boot-5 - - - - - UTF-8 - UTF-8 - 1.8 - - - - - org.springframework.boot - spring-boot-starter - - - org.keycloak - keycloak-spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-jpa - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-web - - - org.hsqldb - hsqldb - runtime - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - - - org.keycloak.bom - keycloak-adapter-bom - 3.3.0.Final - pom - import - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + UTF-8 + UTF-8 + 3.3.0.Final + diff --git a/spring-boot-property-exp/pom.xml b/spring-boot-property-exp/pom.xml index 1a1e31385e..abf9f45d1c 100644 --- a/spring-boot-property-exp/pom.xml +++ b/spring-boot-property-exp/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 spring-boot-property-exp - com.baeldung spring-boot-property-exp 0.0.1-SNAPSHOT @@ -13,13 +13,13 @@ 1.0.0-SNAPSHOT - - UTF-8 - - property-exp-default-config property-exp-custom-config + + UTF-8 + + diff --git a/spring-boot-property-exp/property-exp-default-config/pom.xml b/spring-boot-property-exp/property-exp-default-config/pom.xml index eae15bdbb3..e4cbaebf56 100644 --- a/spring-boot-property-exp/property-exp-default-config/pom.xml +++ b/spring-boot-property-exp/property-exp-default-config/pom.xml @@ -1,7 +1,7 @@ 4.0.0 property-exp-default - + com.baeldung property-exp-default-config 0.0.1-SNAPSHOT diff --git a/spring-boot-security/pom.xml b/spring-boot-security/pom.xml index c1ec14ff64..8763c210c8 100644 --- a/spring-boot-security/pom.xml +++ b/spring-boot-security/pom.xml @@ -1,77 +1,74 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + spring-boot-security + 0.0.1-SNAPSHOT + jar + spring-boot-security + Spring Boot Security Auto-Configuration - com.baeldung - spring-boot-security - 0.0.1-SNAPSHOT - jar + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - spring-boot-security - Spring Boot Security Auto-Configuration + + + + org.springframework.boot + spring-boot-dependencies + 1.5.9.RELEASE + pom + import + + + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.springframework.boot - spring-boot-dependencies - 1.5.9.RELEASE - pom - import - - - + + + + + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security.oauth + spring-security-oauth2 + + + org.springframework.boot + spring-boot-starter-web + - - UTF-8 - UTF-8 - 1.8 - + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + - - - - - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security.oauth - spring-security-oauth2 - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + UTF-8 + UTF-8 + diff --git a/spring-boot/README.MD b/spring-boot/README.MD index 028fde5056..365b120971 100644 --- a/spring-boot/README.MD +++ b/spring-boot/README.MD @@ -1,4 +1,4 @@ -###The Course +### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: @@ -33,4 +33,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [A Quick Guide to Maven Wrapper](http://www.baeldung.com/maven-wrapper) - [An Introduction to Kong](http://www.baeldung.com/kong) - [Spring Boot Customize Whitelabel Error Page](http://www.baeldung.com/spring-boot-custom-error-page) +- [Spring Boot: Configuring a Main Class](http://www.baeldung.com/spring-boot-main-class) +- [A Quick Intro to the SpringBootServletInitializer](http://www.baeldung.com/spring-boot-servlet-initializer) diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index f10fe5a909..127ac455e1 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-boot @@ -58,23 +58,17 @@ org.springframework.boot spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-test - test - - - + org.springframework.boot + spring-boot-starter-test + test + + + io.dropwizard.metrics @@ -134,7 +128,7 @@ mysql mysql-connector-java - 6.0.6 + ${mysql-connector-java.version} @@ -200,39 +194,6 @@ - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/AutoconfigurationTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - autoconfiguration @@ -281,6 +242,7 @@ 1.4.194 2.4.1.Final 1.9.0 + 6.0.6 \ No newline at end of file diff --git a/spring-boot/src/main/java/com/baeldung/servletinitializer/WarInitializerApplication.java b/spring-boot/src/main/java/com/baeldung/servletinitializer/WarInitializerApplication.java new file mode 100644 index 0000000000..237026780c --- /dev/null +++ b/spring-boot/src/main/java/com/baeldung/servletinitializer/WarInitializerApplication.java @@ -0,0 +1,36 @@ +package com.baeldung.servletinitializer; + +import java.time.LocalDateTime; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@SpringBootApplication +public class WarInitializerApplication extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + return builder.sources(WarInitializerApplication.class); + } + + public static void main(String[] args) { + SpringApplication sa = new SpringApplication(WarInitializerApplication.class); + sa.setLogStartupInfo(false); + sa.run(args); + } + + @RestController + public static class WarInitializerController { + + @RequestMapping("/") + public String handler(Model model) { + model.addAttribute("date", LocalDateTime.now()); + return "WarInitializerApplication is up and running!"; + } + } +} diff --git a/spring-boot/src/main/java/org/baeldung/model/User.java b/spring-boot/src/main/java/org/baeldung/model/User.java index 61936584c4..eb886338a0 100644 --- a/spring-boot/src/main/java/org/baeldung/model/User.java +++ b/spring-boot/src/main/java/org/baeldung/model/User.java @@ -15,6 +15,14 @@ public class User { private String name; private Integer status; + public User() { + } + + public User(String name, Integer status) { + this.name = name; + this.status = status; + } + public Integer getId() { return id; } diff --git a/spring-boot/src/main/java/org/baeldung/repository/UserRepository.java b/spring-boot/src/main/java/org/baeldung/repository/UserRepository.java index c9a06b5bab..a5cf6a0c24 100644 --- a/spring-boot/src/main/java/org/baeldung/repository/UserRepository.java +++ b/spring-boot/src/main/java/org/baeldung/repository/UserRepository.java @@ -1,10 +1,20 @@ package org.baeldung.repository; import org.baeldung.model.User; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Modifying; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Repository; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; +import java.util.Collection; +import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; @@ -21,4 +31,54 @@ public interface UserRepository extends JpaRepository { @Async CompletableFuture findOneByStatus(Integer status); + @Query("SELECT u FROM User u WHERE u.status = 1") + Collection findAllActiveUsers(); + + @Query(value = "SELECT * FROM USERS u WHERE u.status = 1", nativeQuery = true) + Collection findAllActiveUsersNative(); + + @Query("SELECT u FROM User u WHERE u.status = ?1") + User findUserByStatus(Integer status); + + @Query(value = "SELECT * FROM Users u WHERE u.status = ?1", nativeQuery = true) + User findUserByStatusNative(Integer status); + + @Query("SELECT u FROM User u WHERE u.status = ?1 and u.name = ?2") + User findUserByStatusAndName(Integer status, String name); + + @Query("SELECT u FROM User u WHERE u.status = :status and u.name = :name") + User findUserByStatusAndNameNamedParams(@Param("status") Integer status, @Param("name") String name); + + @Query(value = "SELECT * FROM Users u WHERE u.status = :status AND u.name = :name", nativeQuery = true) + User findUserByStatusAndNameNamedParamsNative(@Param("status") Integer status, @Param("name") String name); + + @Query("SELECT u FROM User u WHERE u.status = :status and u.name = :name") + User findUserByUserStatusAndUserName(@Param("status") Integer userStatus, @Param("name") String userName); + + @Query("SELECT u FROM User u WHERE u.name like ?1%") + User findUserByNameLike(String name); + + @Query("SELECT u FROM User u WHERE u.name like :name%") + User findUserByNameLikeNamedParam(@Param("name") String name); + + @Query(value = "SELECT * FROM users u WHERE u.name LIKE ?1%", nativeQuery = true) + User findUserByNameLikeNative(String name); + + @Query(value = "SELECT u FROM User u") + List findAllUsers(Sort sort); + + @Query(value = "SELECT u FROM User u ORDER BY id") + Page findAllUsersWithPagination(Pageable pageable); + + @Query(value = "SELECT * FROM Users ORDER BY id \n-- #pageable\n", countQuery = "SELECT count(*) FROM Users", nativeQuery = true) + Page findAllUsersWithPaginationNative(Pageable pageable); + + @Modifying + @Query("update User u set u.status = :status where u.name = :name") + int updateUserSetStatusForName(@Param("status") Integer status, @Param("name") String name); + + @Modifying + @Query(value = "UPDATE Users u SET u.status = ? WHERE u.name = ?", nativeQuery = true) + int updateUserSetStatusForNameNative(Integer status, String name); + } diff --git a/spring-boot/src/test/java/com/baeldung/servletinitializer/WarInitializerApplicationTest.java b/spring-boot/src/test/java/com/baeldung/servletinitializer/WarInitializerApplicationTest.java new file mode 100644 index 0000000000..a3ee30ef49 --- /dev/null +++ b/spring-boot/src/test/java/com/baeldung/servletinitializer/WarInitializerApplicationTest.java @@ -0,0 +1,36 @@ +package com.baeldung.servletinitializer; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; + +import com.baeldung.servletinitializer.WarInitializerApplication.WarInitializerController; + +@RunWith(SpringRunner.class) +@WebMvcTest(controllers = WarInitializerController.class) +public class WarInitializerApplicationTest { + + @Autowired + private MockMvc mockMvc; + + @Test + public void whenContextRootUrlIsAccessed_thenStatusIsOk() throws Exception { + mockMvc.perform(get("/")) + .andExpect(status().is(200)); + } + + @Test + public void whenContextRootUrlIsAccesed_thenCorrectStringIsReturned() throws Exception { + mockMvc.perform(get("/")) + .andExpect(content().string(containsString("WarInitializerApplication is up and running!"))); + } + +} diff --git a/spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java b/spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java index 2b61aa6252..f1e1ecce55 100644 --- a/spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java +++ b/spring-boot/src/test/java/org/baeldung/repository/UserRepositoryIntegrationTest.java @@ -1,58 +1,65 @@ package org.baeldung.repository; -import org.baeldung.boot.Application; +import org.baeldung.boot.config.H2JpaConfig; import org.baeldung.model.User; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.data.jpa.domain.JpaSort; +import org.springframework.data.mapping.PropertyReferenceException; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; +import java.util.Collection; +import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.stream.Stream; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.assertj.core.api.Assertions.assertThat; /** * Created by adam. */ @RunWith(SpringRunner.class) -@SpringBootTest(classes = Application.class) +@SpringBootTest(classes = H2JpaConfig.class) public class UserRepositoryIntegrationTest { private final String USER_NAME_ADAM = "Adam"; + private final String USER_NAME_PETER = "Peter"; + private final Integer INACTIVE_STATUS = 0; private final Integer ACTIVE_STATUS = 1; - @Autowired - private UserRepository userRepository; + @Autowired private UserRepository userRepository; @Test - public void shouldReturnEmptyOptionalWhenSearchByNameInEmptyDB() { + public void givenEmptyDBWhenFindOneByNameThenReturnEmptyOptional() { Optional foundUser = userRepository.findOneByName(USER_NAME_ADAM); - assertThat(foundUser.isPresent(), equalTo(false)); + assertThat(foundUser.isPresent()).isEqualTo(false); } @Test - public void shouldReturnOptionalWithPresentUserWhenExistsWithGivenName() { + public void givenUserInDBWhenFindOneByNameThenReturnOptionalWithUser() { User user = new User(); user.setName(USER_NAME_ADAM); userRepository.save(user); Optional foundUser = userRepository.findOneByName(USER_NAME_ADAM); - assertThat(foundUser.isPresent(), equalTo(true)); - assertThat(foundUser.get().getName(), equalTo(USER_NAME_ADAM)); + assertThat(foundUser.isPresent()).isEqualTo(true); + assertThat(foundUser.get().getName()).isEqualTo(USER_NAME_ADAM); } @Test @Transactional - public void shouldReturnStreamOfUsersWithNameWhenExistWithSameGivenName() { + public void givenUsersWithSameNameInDBWhenFindAllByNameThenReturnStreamOfUsers() { User user1 = new User(); user1.setName(USER_NAME_ADAM); userRepository.save(user1); @@ -70,12 +77,12 @@ public class UserRepositoryIntegrationTest { userRepository.save(user4); try (Stream foundUsersStream = userRepository.findAllByName(USER_NAME_ADAM)) { - assertThat(foundUsersStream.count(), equalTo(3l)); + assertThat(foundUsersStream.count()).isEqualTo(3l); } } @Test - public void shouldReturnUserWithGivenStatusAsync() throws ExecutionException, InterruptedException { + public void givenUserInDBWhenFindOneByStatusAsyncThenReturnCompletableFutureUser() throws ExecutionException, InterruptedException { User user = new User(); user.setName(USER_NAME_ADAM); user.setStatus(ACTIVE_STATUS); @@ -83,8 +90,271 @@ public class UserRepositoryIntegrationTest { CompletableFuture userByStatus = userRepository.findOneByStatus(ACTIVE_STATUS); - assertThat(userByStatus.get().getName(), equalTo(USER_NAME_ADAM)); + assertThat(userByStatus.get().getName()).isEqualTo(USER_NAME_ADAM); + } + @Test + public void givenUsersInDBWhenFindAllWithQueryAnnotationThenReturnCollectionWithActiveUsers() { + User user1 = new User(); + user1.setName(USER_NAME_ADAM); + user1.setStatus(ACTIVE_STATUS); + userRepository.save(user1); + + User user2 = new User(); + user2.setName(USER_NAME_ADAM); + user2.setStatus(ACTIVE_STATUS); + userRepository.save(user2); + + User user3 = new User(); + user3.setName(USER_NAME_ADAM); + user3.setStatus(INACTIVE_STATUS); + userRepository.save(user3); + + Collection allActiveUsers = userRepository.findAllActiveUsers(); + + assertThat(allActiveUsers.size()).isEqualTo(2); + } + + @Test + public void givenUsersInDBWhenFindAllWithQueryAnnotationNativeThenReturnCollectionWithActiveUsers() { + User user1 = new User(); + user1.setName(USER_NAME_ADAM); + user1.setStatus(ACTIVE_STATUS); + userRepository.save(user1); + + User user2 = new User(); + user2.setName(USER_NAME_ADAM); + user2.setStatus(ACTIVE_STATUS); + userRepository.save(user2); + + User user3 = new User(); + user3.setName(USER_NAME_ADAM); + user3.setStatus(INACTIVE_STATUS); + userRepository.save(user3); + + Collection allActiveUsers = userRepository.findAllActiveUsersNative(); + + assertThat(allActiveUsers.size()).isEqualTo(2); + } + + @Test + public void givenUserInDBWhenFindUserByStatusWithQueryAnnotationThenReturnActiveUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User userByStatus = userRepository.findUserByStatus(ACTIVE_STATUS); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUserInDBWhenFindUserByStatusWithQueryAnnotationNativeThenReturnActiveUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User userByStatus = userRepository.findUserByStatusNative(ACTIVE_STATUS); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindUserByStatusAndNameWithQueryAnnotationIndexedParamsThenReturnOneUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User user2 = new User(); + user2.setName(USER_NAME_PETER); + user2.setStatus(ACTIVE_STATUS); + userRepository.save(user2); + + User userByStatus = userRepository.findUserByStatusAndName(ACTIVE_STATUS, USER_NAME_ADAM); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindUserByStatusAndNameWithQueryAnnotationNamedParamsThenReturnOneUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User user2 = new User(); + user2.setName(USER_NAME_PETER); + user2.setStatus(ACTIVE_STATUS); + userRepository.save(user2); + + User userByStatus = userRepository.findUserByStatusAndNameNamedParams(ACTIVE_STATUS, USER_NAME_ADAM); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindUserByStatusAndNameWithQueryAnnotationNativeNamedParamsThenReturnOneUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User user2 = new User(); + user2.setName(USER_NAME_PETER); + user2.setStatus(ACTIVE_STATUS); + userRepository.save(user2); + + User userByStatus = userRepository.findUserByStatusAndNameNamedParamsNative(ACTIVE_STATUS, USER_NAME_ADAM); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindUserByStatusAndNameWithQueryAnnotationNamedParamsCustomNamesThenReturnOneUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User user2 = new User(); + user2.setName(USER_NAME_PETER); + user2.setStatus(ACTIVE_STATUS); + userRepository.save(user2); + + User userByStatus = userRepository.findUserByUserStatusAndUserName(ACTIVE_STATUS, USER_NAME_ADAM); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindUserByNameLikeWithQueryAnnotationIndexedParamsThenReturnUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User userByStatus = userRepository.findUserByNameLike("Ad"); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindUserByNameLikeWithQueryAnnotationNamedParamsThenReturnUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User userByStatus = userRepository.findUserByNameLikeNamedParam("Ad"); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindUserByNameLikeWithQueryAnnotationNativeThenReturnUser() { + User user = new User(); + user.setName(USER_NAME_ADAM); + user.setStatus(ACTIVE_STATUS); + userRepository.save(user); + + User userByStatus = userRepository.findUserByNameLikeNative("Ad"); + + assertThat(userByStatus.getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindAllWithSortByNameThenReturnUsersSorted() { + userRepository.save(new User(USER_NAME_ADAM, ACTIVE_STATUS)); + userRepository.save(new User(USER_NAME_PETER, ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE", INACTIVE_STATUS)); + + List usersSortByName = userRepository.findAll(new Sort(Sort.Direction.ASC, "name")); + + assertThat(usersSortByName.get(0).getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test(expected = PropertyReferenceException.class) + public void givenUsersInDBWhenFindAllSortWithFunctionThenThrowException() { + userRepository.save(new User(USER_NAME_ADAM, ACTIVE_STATUS)); + userRepository.save(new User(USER_NAME_PETER, ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE", INACTIVE_STATUS)); + + userRepository.findAll(new Sort(Sort.Direction.ASC, "name")); + + List usersSortByNameLength = userRepository.findAll(new Sort("LENGTH(name)")); + + assertThat(usersSortByNameLength.get(0).getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindAllSortWithFunctionQueryAnnotationJPQLThenReturnUsersSorted() { + userRepository.save(new User(USER_NAME_ADAM, ACTIVE_STATUS)); + userRepository.save(new User(USER_NAME_PETER, ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE", INACTIVE_STATUS)); + + userRepository.findAllUsers(new Sort("name")); + + List usersSortByNameLength = userRepository.findAllUsers(JpaSort.unsafe("LENGTH(name)")); + + assertThat(usersSortByNameLength.get(0).getName()).isEqualTo(USER_NAME_ADAM); + } + + @Test + public void givenUsersInDBWhenFindAllWithPageRequestQueryAnnotationJPQLThenReturnPageOfUsers() { + userRepository.save(new User(USER_NAME_ADAM, ACTIVE_STATUS)); + userRepository.save(new User(USER_NAME_PETER, ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE", INACTIVE_STATUS)); + userRepository.save(new User("SAMPLE1", INACTIVE_STATUS)); + userRepository.save(new User("SAMPLE2", INACTIVE_STATUS)); + userRepository.save(new User("SAMPLE3", INACTIVE_STATUS)); + + Page usersPage = userRepository.findAllUsersWithPagination(new PageRequest(1, 3)); + + assertThat(usersPage.getContent().get(0).getName()).isEqualTo("SAMPLE1"); + } + + @Test + public void givenUsersInDBWhenFindAllWithPageRequestQueryAnnotationNativeThenReturnPageOfUsers() { + userRepository.save(new User(USER_NAME_ADAM, ACTIVE_STATUS)); + userRepository.save(new User(USER_NAME_PETER, ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE", INACTIVE_STATUS)); + userRepository.save(new User("SAMPLE1", INACTIVE_STATUS)); + userRepository.save(new User("SAMPLE2", INACTIVE_STATUS)); + userRepository.save(new User("SAMPLE3", INACTIVE_STATUS)); + + Page usersSortByNameLength = userRepository.findAllUsersWithPaginationNative(new PageRequest(1, 3)); + + assertThat(usersSortByNameLength.getContent().get(0).getName()).isEqualTo("SAMPLE1"); + } + + @Test + @Transactional + public void givenUsersInDBWhenUpdateStatusForNameModifyingQueryAnnotationJPQLThenModifyMatchingUsers() { + userRepository.save(new User("SAMPLE", ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE1", ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE", ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE3", ACTIVE_STATUS)); + + int updatedUsersSize = userRepository.updateUserSetStatusForName(INACTIVE_STATUS, "SAMPLE"); + + assertThat(updatedUsersSize).isEqualTo(2); + } + + @Test + @Transactional + public void givenUsersInDBWhenUpdateStatusForNameModifyingQueryAnnotationNativeThenModifyMatchingUsers() { + userRepository.save(new User("SAMPLE", ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE1", ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE", ACTIVE_STATUS)); + userRepository.save(new User("SAMPLE3", ACTIVE_STATUS)); + userRepository.flush(); + + int updatedUsersSize = userRepository.updateUserSetStatusForNameNative(INACTIVE_STATUS, "SAMPLE"); + + assertThat(updatedUsersSize).isEqualTo(2); } @After diff --git a/spring-cloud-bus/spring-cloud-config-client/pom.xml b/spring-cloud-bus/spring-cloud-config-client/pom.xml index 977f18b17f..61660b6d8f 100644 --- a/spring-cloud-bus/spring-cloud-config-client/pom.xml +++ b/spring-cloud-bus/spring-cloud-config-client/pom.xml @@ -1,81 +1,81 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.spring.cloud - spring-cloud-config-client - 0.0.1-SNAPSHOT - jar + com.baeldung.spring.cloud + spring-cloud-config-client + 0.0.1-SNAPSHOT + jar - spring-cloud-config-client - Demo Spring Cloud Config Client + spring-cloud-config-client + Demo Spring Cloud Config Client - - org.springframework.boot - spring-boot-starter-parent - 1.5.4.RELEASE - + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + - - UTF-8 - UTF-8 - 1.8 - Dalston.SR1 - + + UTF-8 + UTF-8 + 1.8 + Dalston.SR1 + - - - org.springframework.cloud - spring-cloud-starter-config - 1.3.1.RELEASE - - - org.springframework.boot - spring-boot-starter-web - 1.5.4.RELEASE - + + + org.springframework.cloud + spring-cloud-starter-config + 1.3.1.RELEASE + + + org.springframework.boot + spring-boot-starter-web + 1.5.4.RELEASE + - - org.springframework.boot - spring-boot-starter-test - 1.5.4.RELEASE - test - - - - org.springframework.boot - spring-boot-actuator - 1.5.4.RELEASE - - - - org.springframework.cloud - spring-cloud-starter-bus-amqp - 1.3.1.RELEASE - - + + org.springframework.boot + spring-boot-starter-test + 1.5.4.RELEASE + test + - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - + + org.springframework.boot + spring-boot-actuator + 1.5.4.RELEASE + - - - - org.springframework.boot - spring-boot-maven-plugin - 1.5.4.RELEASE - - - + + org.springframework.cloud + spring-cloud-starter-bus-amqp + 1.3.1.RELEASE + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + 1.5.4.RELEASE + + + diff --git a/spring-cloud-bus/spring-cloud-config-server/pom.xml b/spring-cloud-bus/spring-cloud-config-server/pom.xml index e37f601d2c..2fb6afb5a0 100644 --- a/spring-cloud-bus/spring-cloud-config-server/pom.xml +++ b/spring-cloud-bus/spring-cloud-config-server/pom.xml @@ -1,82 +1,82 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.spring.cloud - spring-cloud-config-server - 0.0.1-SNAPSHOT - jar + com.baeldung.spring.cloud + spring-cloud-config-server + 0.0.1-SNAPSHOT + jar - spring-cloud-config-server - Demo Spring Cloud Config Server + spring-cloud-config-server + Demo Spring Cloud Config Server - - org.springframework.boot - spring-boot-starter-parent - 1.5.4.RELEASE - + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + - - UTF-8 - UTF-8 - 1.8 - Dalston.SR1 - + + UTF-8 + UTF-8 + 1.8 + Dalston.SR1 + - - - org.springframework.cloud - spring-cloud-config-server - 1.3.1.RELEASE - + + + org.springframework.cloud + spring-cloud-config-server + 1.3.1.RELEASE + - - org.springframework.boot - spring-boot-starter-security - 1.5.4.RELEASE - + + org.springframework.boot + spring-boot-starter-security + 1.5.4.RELEASE + - - org.springframework.boot - spring-boot-starter-test - 1.5.4.RELEASE - test - + + org.springframework.boot + spring-boot-starter-test + 1.5.4.RELEASE + test + - - org.springframework.cloud - spring-cloud-config-monitor - 1.3.1.RELEASE - + + org.springframework.cloud + spring-cloud-config-monitor + 1.3.1.RELEASE + - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - 1.2.1.RELEASE - - + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + 1.2.1.RELEASE + + - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + - - - - org.springframework.boot - spring-boot-maven-plugin - 1.5.4.RELEASE - - - + + + + org.springframework.boot + spring-boot-maven-plugin + 1.5.4.RELEASE + + + diff --git a/spring-cloud-data-flow/batch-job/pom.xml b/spring-cloud-data-flow/batch-job/pom.xml index f2e9f35c8e..123c4aeda6 100644 --- a/spring-cloud-data-flow/batch-job/pom.xml +++ b/spring-cloud-data-flow/batch-job/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring.cloud diff --git a/spring-cloud-data-flow/data-flow-server/pom.xml b/spring-cloud-data-flow/data-flow-server/pom.xml index 456a8abf4b..f0d513ce4d 100644 --- a/spring-cloud-data-flow/data-flow-server/pom.xml +++ b/spring-cloud-data-flow/data-flow-server/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring.cloud diff --git a/spring-cloud-data-flow/data-flow-shell/pom.xml b/spring-cloud-data-flow/data-flow-shell/pom.xml index edb300a3b3..debbe44a4a 100644 --- a/spring-cloud-data-flow/data-flow-shell/pom.xml +++ b/spring-cloud-data-flow/data-flow-shell/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring.cloud diff --git a/spring-cloud-data-flow/log-sink/pom.xml b/spring-cloud-data-flow/log-sink/pom.xml index c07380de56..6e541ae3fa 100644 --- a/spring-cloud-data-flow/log-sink/pom.xml +++ b/spring-cloud-data-flow/log-sink/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring.cloud @@ -41,41 +41,4 @@ - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - diff --git a/spring-cloud-data-flow/pom.xml b/spring-cloud-data-flow/pom.xml index 5f24aa2cbd..9ff23305fd 100644 --- a/spring-cloud-data-flow/pom.xml +++ b/spring-cloud-data-flow/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring.cloud spring-cloud-data-flow diff --git a/spring-cloud-data-flow/time-processor/pom.xml b/spring-cloud-data-flow/time-processor/pom.xml index 08d5e2b9be..42d0fa434f 100644 --- a/spring-cloud-data-flow/time-processor/pom.xml +++ b/spring-cloud-data-flow/time-processor/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring.cloud @@ -41,39 +41,4 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - diff --git a/spring-cloud-data-flow/time-source/pom.xml b/spring-cloud-data-flow/time-source/pom.xml index 4d35e30be2..2a50c9b0d0 100644 --- a/spring-cloud-data-flow/time-source/pom.xml +++ b/spring-cloud-data-flow/time-source/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring.cloud @@ -41,39 +41,4 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index c093b87be3..7c739d656e 100644 --- a/spring-cloud/pom.xml +++ b/spring-cloud/pom.xml @@ -3,10 +3,19 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.spring.cloud spring-cloud 1.0.0-SNAPSHOT + pom + spring-cloud + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + .. + + spring-cloud-config spring-cloud-eureka @@ -22,17 +31,8 @@ spring-cloud-consul spring-cloud-zuul-eureka-integration spring-cloud-contract + spring-cloud-kubernetes - pom - - spring-cloud - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - .. - UTF-8 @@ -61,4 +61,5 @@ + diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index b27b6c0d18..2d2c29e53e 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.spring.cloud spring-cloud-aws 0.0.1-SNAPSHOT jar - Spring Cloud AWS Spring Cloud AWS Examples @@ -15,17 +13,9 @@ org.springframework.boot spring-boot-starter-parent 1.5.8.RELEASE - + - - com.baeldung.spring.cloud.aws.SpringCloudAwsApplication - UTF-8 - UTF-8 - 1.8 - Dalston.SR4 - - org.springframework.boot @@ -71,11 +61,6 @@ - - org.springframework.boot - spring-boot-maven-plugin - - maven-surefire-plugin @@ -84,9 +69,16 @@ - + + + com.baeldung.spring.cloud.aws.SpringCloudAwsApplication + UTF-8 + UTF-8 + 1.8 + Dalston.SR4 + diff --git a/spring-cloud/spring-cloud-bootstrap/config/pom.xml b/spring-cloud/spring-cloud-bootstrap/config/pom.xml index f01ab55eb2..ace46395c0 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/config/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - config 1.0.0-SNAPSHOT @@ -43,4 +42,5 @@ Brixton.SR7 + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml index 137e9bebad..7a3ffd81cd 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 discovery diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index f32de88076..5001b35fb5 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - gateway 1.0.0-SNAPSHOT @@ -69,24 +68,6 @@ org.springframework.boot spring-boot-maven-plugin - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*LiveTest.java - - - maven-antrun-plugin @@ -94,12 +75,14 @@ generate-resources - + - + diff --git a/spring-cloud/spring-cloud-bootstrap/pom.xml b/spring-cloud/spring-cloud-bootstrap/pom.xml index f93c285c9f..68606d9058 100644 --- a/spring-cloud/spring-cloud-bootstrap/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/pom.xml @@ -1,26 +1,24 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-cloud-bootstrap + 1.0.0-SNAPSHOT + pom - - com.baeldung.spring.cloud - spring-cloud - 1.0.0-SNAPSHOT - + + com.baeldung.spring.cloud + spring-cloud + 1.0.0-SNAPSHOT + - - config - discovery - gateway - svc-book - svc-rating - zipkin - - - - spring-cloud-bootstrap - 1.0.0-SNAPSHOT - pom + + config + discovery + gateway + svc-book + svc-rating + zipkin + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml index 9cc3cdb516..2552752e29 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.spring.cloud @@ -74,5 +74,5 @@ Brixton.SR7 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index 3aa5cfa250..857ee486c0 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -1,87 +1,87 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.spring.cloud - svc-rating - 1.0.0-SNAPSHOT + com.baeldung.spring.cloud + svc-rating + 1.0.0-SNAPSHOT - - parent-boot-5 - com.baeldung - 0.0.1-SNAPSHOT - ../../../parent-boot-5 - + + parent-boot-5 + com.baeldung + 0.0.1-SNAPSHOT + ../../../parent-boot-5 + - - - org.springframework.cloud - spring-cloud-starter-config - - - org.springframework.cloud - spring-cloud-starter-eureka - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-security - + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.cloud + spring-cloud-starter-eureka + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + - - org.springframework.session - spring-session - - - org.springframework.boot - spring-boot-starter-data-redis - + + org.springframework.session + spring-session + + + org.springframework.boot + spring-boot-starter-data-redis + - - org.springframework.boot - spring-boot-starter-data-jpa - + + org.springframework.boot + spring-boot-starter-data-jpa + - - org.springframework.cloud - spring-cloud-starter-hystrix - - - org.springframework.boot - spring-boot-starter-actuator - + + org.springframework.cloud + spring-cloud-starter-hystrix + + + org.springframework.boot + spring-boot-starter-actuator + - - com.h2database - h2 - runtime - + + com.h2database + h2 + runtime + - - org.springframework.cloud - spring-cloud-starter-zipkin - + + org.springframework.cloud + spring-cloud-starter-zipkin + - + - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} + pom + import + + + - - Brixton.SR7 - + + Brixton.SR7 + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml index 7e0d146f95..743281d346 100644 --- a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - zipkin 1.0.0-SNAPSHOT @@ -51,5 +50,5 @@ Brixton.SR7 - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-config/client/pom.xml b/spring-cloud/spring-cloud-config/client/pom.xml index 667040ed3c..bd8c817256 100644 --- a/spring-cloud/spring-cloud-config/client/pom.xml +++ b/spring-cloud/spring-cloud-config/client/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 diff --git a/spring-cloud/spring-cloud-config/pom.xml b/spring-cloud/spring-cloud-config/pom.xml index a5f3f5271d..100b421a55 100644 --- a/spring-cloud/spring-cloud-config/pom.xml +++ b/spring-cloud/spring-cloud-config/pom.xml @@ -1,19 +1,13 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.spring.cloud spring-cloud-config 1.0-SNAPSHOT pom - - server - client - - parent-boot-5 com.baeldung @@ -21,6 +15,11 @@ ../../parent-boot-5 + + server + client + + @@ -36,5 +35,5 @@ Brixton.SR7 - + diff --git a/spring-cloud/spring-cloud-config/server/pom.xml b/spring-cloud/spring-cloud-config/server/pom.xml index 0157851001..61b27244b6 100644 --- a/spring-cloud/spring-cloud-config/server/pom.xml +++ b/spring-cloud/spring-cloud-config/server/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 diff --git a/spring-cloud/spring-cloud-connectors-heroku/pom.xml b/spring-cloud/spring-cloud-connectors-heroku/pom.xml index 83e8e360c8..9b5d7c91d9 100644 --- a/spring-cloud/spring-cloud-connectors-heroku/pom.xml +++ b/spring-cloud/spring-cloud-connectors-heroku/pom.xml @@ -1,20 +1,18 @@ - 4.0.0 + com.baeldung.spring.cloud + spring-cloud-connectors-heroku + 1.0.0-SNAPSHOT spring-boot-starter-parent org.springframework.boot 1.4.4.RELEASE - + - com.baeldung.spring.cloud - spring-cloud-connectors-heroku - 1.0.0-SNAPSHOT - org.springframework.boot @@ -32,13 +30,11 @@ org.springframework.boot spring-boot-actuator - org.postgresql postgresql - 9.4-1201-jdbc4 + ${postgresql.version} - com.h2database h2 @@ -58,20 +54,12 @@ - - Brixton.SR7 - - - - org.springframework.boot - spring-boot-maven-plugin - org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + ${maven-surefire-plugin.version} 3 true @@ -85,16 +73,13 @@ true - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - + + + Brixton.SR7 + 2.19.1 + 9.4-1201-jdbc4 + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-consul/pom.xml b/spring-cloud/spring-cloud-consul/pom.xml index 7ce570d50d..d440da8e0c 100644 --- a/spring-cloud/spring-cloud-consul/pom.xml +++ b/spring-cloud/spring-cloud-consul/pom.xml @@ -1,13 +1,11 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung spring-cloud-consul jar - spring-cloud-consul @@ -16,18 +14,13 @@ 1.0.0-SNAPSHOT - - UTF-8 - 3.7.0 - - org.springframework.cloud spring-cloud-starter-consul-all 1.3.0.RELEASE - + org.springframework.cloud spring-cloud-starter-consul-config @@ -35,24 +28,9 @@ - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - + + UTF-8 + 3.7.0 + + diff --git a/spring-cloud/spring-cloud-contract/pom.xml b/spring-cloud/spring-cloud-contract/pom.xml index 3981aae2ac..f1d5f6f262 100644 --- a/spring-cloud/spring-cloud-contract/pom.xml +++ b/spring-cloud/spring-cloud-contract/pom.xml @@ -3,21 +3,20 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + pom + com.baeldung.spring.cloud + spring-cloud-contract + 1.0.0-SNAPSHOT com.baeldung.spring.cloud spring-cloud 1.0.0-SNAPSHOT + spring-cloud-contract-producer spring-cloud-contract-consumer - pom - com.baeldung.spring.cloud - spring-cloud-contract - 1.0.0-SNAPSHOT - - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml b/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml index 67fea178eb..fa9bf51bc3 100644 --- a/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml +++ b/spring-cloud/spring-cloud-contract/spring-cloud-contract-consumer/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.spring.cloud @@ -54,15 +54,4 @@ test - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - diff --git a/spring-cloud/spring-cloud-eureka/pom.xml b/spring-cloud/spring-cloud-eureka/pom.xml index e90609c48d..9392f17325 100644 --- a/spring-cloud/spring-cloud-eureka/pom.xml +++ b/spring-cloud/spring-cloud-eureka/pom.xml @@ -1,21 +1,20 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.spring.cloud spring-cloud-eureka 1.0.0-SNAPSHOT + pom + Spring Cloud Eureka + Spring Cloud Eureka Server and Sample Clients + spring-cloud-eureka-server spring-cloud-eureka-client spring-cloud-eureka-feign-client - pom - - Spring Cloud Eureka - Spring Cloud Eureka Server and Sample Clients com.baeldung.spring.cloud @@ -30,24 +29,4 @@ 1.4.2.RELEASE - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml index cd363ffef1..70379fbc65 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-client/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-eureka-client @@ -43,24 +43,6 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - Brixton.SR7 1.2.3.RELEASE diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml index 038a0ab81d..22b0e7b899 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-feign-client/pom.xml @@ -1,13 +1,11 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-cloud-eureka-feign-client 1.0.0-SNAPSHOT jar - Spring Cloud Eureka Feign Client Spring Cloud Eureka - Sample Feign Client @@ -53,24 +51,6 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - Brixton.SR7 1.2.3.RELEASE diff --git a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml index e4bae32011..4ea9748c14 100644 --- a/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka/spring-cloud-eureka-server/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-eureka-server @@ -38,24 +38,6 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - Brixton.SR7 1.2.3.RELEASE diff --git a/spring-cloud/spring-cloud-gateway/pom.xml b/spring-cloud/spring-cloud-gateway/pom.xml index 90737f369d..4cc45cc6b3 100644 --- a/spring-cloud/spring-cloud-gateway/pom.xml +++ b/spring-cloud/spring-cloud-gateway/pom.xml @@ -1,12 +1,10 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-cloud-gateway jar - Spring Cloud Gateway @@ -16,84 +14,64 @@ .. + + + org.springframework.boot + spring-boot-actuator + ${version} + + + org.springframework.boot + spring-boot-starter-webflux + ${version} + + + org.springframework.cloud + spring-cloud-gateway-core + ${version} + + + + org.hibernate + hibernate-validator-cdi + 6.0.2.Final + + + javax.validation + validation-api + 2.0.0.Final + + + io.projectreactor.ipc + reactor-netty + 0.7.0.M1 + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + UTF-8 3.7.0 1.4.2.RELEASE 2.0.0.M6 - - - - org.springframework.boot - spring-boot-actuator - ${version} - - - org.springframework.boot - spring-boot-starter-webflux - ${version} - - - org.springframework.cloud - spring-cloud-gateway-core - ${version} - - - - org.hibernate - hibernate-validator-cdi - 6.0.2.Final - - - javax.validation - validation-api - 2.0.0.Final - - - io.projectreactor.ipc - reactor-netty - 0.7.0.M1 - - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - false - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - diff --git a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml index 5913b60a01..700357d673 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml @@ -1,13 +1,11 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - feign-rest-consumer 1.0.0-SNAPSHOT jar - feign-rest-consumer @@ -67,24 +65,6 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - 1.2.3.RELEASE 1.2.3.RELEASE diff --git a/spring-cloud/spring-cloud-hystrix/pom.xml b/spring-cloud/spring-cloud-hystrix/pom.xml index 9a6af9a790..e7b635a441 100644 --- a/spring-cloud/spring-cloud-hystrix/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/pom.xml @@ -1,19 +1,12 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.spring.cloud spring-cloud-hystrix 1.0.0-SNAPSHOT - - rest-producer - rest-consumer - feign-rest-consumer - pom - spring-cloud-hystrix @@ -23,30 +16,16 @@ .. + + rest-producer + rest-consumer + feign-rest-consumer + + UTF-8 3.7.0 1.4.2.RELEASE - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - diff --git a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml index 46e408d339..81fb442ad7 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 rest-consumer @@ -57,24 +57,6 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - Brixton.SR7 1.2.3.RELEASE diff --git a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml index 804ef2eb29..f96d8e1768 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 rest-producer @@ -25,24 +25,6 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - Brixton.SR7 diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/.gitignore b/spring-cloud/spring-cloud-kubernetes/demo-backend/.gitignore new file mode 100644 index 0000000000..2af7cefb0a --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/.gitignore @@ -0,0 +1,24 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/Dockerfile b/spring-cloud/spring-cloud-kubernetes/demo-backend/Dockerfile new file mode 100644 index 0000000000..a0a9d57662 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:8-jdk-alpine +VOLUME /tmp +COPY target/demo-backend-1.0-SNAPSHOT.jar app.jar +ENV JAVA_OPTS="" +ENTRYPOINT exec java -jar /app.jar --debug \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml b/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml new file mode 100644 index 0000000000..109953ea42 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + + com.baeldung.spring.cloud + spring-cloud-kubernetes + 1.0-SNAPSHOT + + demo-backend + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplication.java b/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplication.java new file mode 100644 index 0000000000..1605d59f28 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplication.java @@ -0,0 +1,24 @@ +package com.baeldung.spring.cloud.kubernetes.backend; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.net.InetAddress; +import java.net.UnknownHostException; + +@SpringBootApplication +@RestController +public class KubernetesBackendApplication { + + public static void main(String[] args) { + SpringApplication.run(KubernetesBackendApplication.class, args); + } + + @GetMapping("") + public String helloWorld() throws UnknownHostException { + + return "Hello from " + InetAddress.getLocalHost().getHostName(); + } +} diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/resources/application.properties b/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/resources/application.properties new file mode 100644 index 0000000000..a3ac65cee5 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/resources/application.properties @@ -0,0 +1 @@ +server.port=8080 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/src/test/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplicationTests.java b/spring-cloud/spring-cloud-kubernetes/demo-backend/src/test/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplicationTests.java new file mode 100644 index 0000000000..5ccc49eaa7 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-backend/src/test/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplicationTests.java @@ -0,0 +1,16 @@ +package com.baeldung.spring.cloud.kubernetes.backend; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class KubernetesBackendApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/.gitignore b/spring-cloud/spring-cloud-kubernetes/demo-frontend/.gitignore new file mode 100644 index 0000000000..2af7cefb0a --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/.gitignore @@ -0,0 +1,24 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/Dockerfile b/spring-cloud/spring-cloud-kubernetes/demo-frontend/Dockerfile new file mode 100644 index 0000000000..69adb03a17 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:8-jdk-alpine +VOLUME /tmp +COPY target/demo-frontend-1.0-SNAPSHOT.jar app.jar +ENV JAVA_OPTS="" +ENTRYPOINT exec java -jar /app.jar \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml b/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml new file mode 100644 index 0000000000..32fa900f39 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + + com.baeldung.spring.cloud + spring-cloud-kubernetes + 1.0-SNAPSHOT + + demo-frontend + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplication.java b/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplication.java new file mode 100644 index 0000000000..635a79e8bb --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplication.java @@ -0,0 +1,30 @@ +package com.baeldung.spring.cloud.kubernetes.frontend; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.RestTemplate; + +import java.net.UnknownHostException; + +@RestController +@SpringBootApplication +public class KubernetesFrontendApplication { + + public static void main(String[] args) { + SpringApplication.run(KubernetesFrontendApplication.class, args); + } + + @GetMapping + public String helloWorld() throws UnknownHostException { + + RestTemplate restTemplate = new RestTemplate(); + String resourceUrl + = "http://demo-backend:8080"; + ResponseEntity response + = restTemplate.getForEntity(resourceUrl, String.class); + return "Message from backend is: " + response.getBody(); + } +} diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/resources/application.properties b/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/resources/application.properties new file mode 100644 index 0000000000..bafddced85 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/resources/application.properties @@ -0,0 +1 @@ +server.port=8081 \ No newline at end of file diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/test/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplicationTests.java b/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/test/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplicationTests.java new file mode 100644 index 0000000000..0e34eb45f8 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/test/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplicationTests.java @@ -0,0 +1,16 @@ +package com.baeldung.spring.cloud.kubernetes.frontend; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class KubernetesFrontendApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/spring-cloud/spring-cloud-kubernetes/object-configurations/backend-deployment.yaml b/spring-cloud/spring-cloud-kubernetes/object-configurations/backend-deployment.yaml new file mode 100644 index 0000000000..a7e26a6ec5 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/object-configurations/backend-deployment.yaml @@ -0,0 +1,36 @@ +kind: Service +apiVersion: v1 +metadata: + name: demo-backend +spec: + selector: + app: demo-backend + tier: backend + ports: + - protocol: TCP + port: 8080 + type: ClusterIP +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: demo-backend +spec: + selector: + matchLabels: + app: demo-backend + tier: backend + replicas: 3 + template: + metadata: + labels: + app: demo-backend + tier: backend + spec: + containers: + - name: demo-backend + image: demo-backend:latest + imagePullPolicy: Never + ports: + - containerPort: 8080 + diff --git a/spring-cloud/spring-cloud-kubernetes/object-configurations/frontend-deployment.yaml b/spring-cloud/spring-cloud-kubernetes/object-configurations/frontend-deployment.yaml new file mode 100644 index 0000000000..bf44dce21c --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/object-configurations/frontend-deployment.yaml @@ -0,0 +1,34 @@ +kind: Service +apiVersion: v1 +metadata: + name: demo-frontend +spec: + selector: + app: demo-frontend + ports: + - protocol: TCP + port: 8081 + nodePort: 30001 + type: NodePort +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: demo-frontend +spec: + selector: + matchLabels: + app: demo-frontend + replicas: 3 + template: + metadata: + labels: + app: demo-frontend + spec: + containers: + - name: demo-frontend + image: demo-frontend:latest + imagePullPolicy: Never + ports: + - containerPort: 8081 + diff --git a/spring-cloud/spring-cloud-kubernetes/pom.xml b/spring-cloud/spring-cloud-kubernetes/pom.xml new file mode 100644 index 0000000000..96388c3672 --- /dev/null +++ b/spring-cloud/spring-cloud-kubernetes/pom.xml @@ -0,0 +1,25 @@ + + + + com.baeldung.spring.cloud + spring-cloud-kubernetes + 1.0-SNAPSHOT + pom + + + demo-frontend + demo-backend + + + + parent-boot-5 + com.baeldung + 0.0.1-SNAPSHOT + ../../parent-boot-5 + + 4.0.0 + + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-rest/pom.xml b/spring-cloud/spring-cloud-rest/pom.xml index 6983ee2c7c..bf0dbd7ee6 100644 --- a/spring-cloud/spring-cloud-rest/pom.xml +++ b/spring-cloud/spring-cloud-rest/pom.xml @@ -1,33 +1,26 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung spring-cloud-rest 1.0.0-SNAPSHOT - - spring-cloud-rest-config-server - spring-cloud-rest-discovery-server - spring-cloud-rest-books-api - spring-cloud-rest-reviews-api - pom - spring-cloud-rest com.baeldung.spring.cloud spring-cloud 1.0.0-SNAPSHOT - - - - UTF-8 - 3.7.0 - 1.4.2.RELEASE - + + + + spring-cloud-rest-config-server + spring-cloud-rest-discovery-server + spring-cloud-rest-books-api + spring-cloud-rest-reviews-api + @@ -37,8 +30,8 @@ maven-compiler-plugin ${maven-compiler-plugin.version} - 1.8 - 1.8 + ${maven.compiler.source} + ${maven.compiler.target} @@ -49,4 +42,13 @@ + + + UTF-8 + 3.7.0 + 1.4.2.RELEASE + 1.8 + 1.8 + + diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml index 07f6ae3b55..8da8ef6141 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-books-api/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung spring-cloud-rest-books-api 0.0.1-SNAPSHOT jar - spring-cloud-rest-books-api Simple books API diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml index 11320107be..e083986890 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-config-server/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml index d8dbc660d0..c7d647a154 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-discovery-server/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung spring-cloud-rest-discovery-server 0.0.1-SNAPSHOT jar - spring-cloud-rest-discovery-server Spring Cloud REST server @@ -18,10 +16,6 @@ ../../../parent-boot-5 - - Camden.SR4 - - org.springframework.cloud @@ -57,4 +51,8 @@ + + Camden.SR4 + + diff --git a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml index 4252947664..d97ab43bfe 100644 --- a/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml +++ b/spring-cloud/spring-cloud-rest/spring-cloud-rest-reviews-api/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung spring-cloud-rest-reviews-api 0.0.1-SNAPSHOT jar - spring-cloud-rest-reviews-api Simple reviews API diff --git a/spring-cloud/spring-cloud-ribbon-client/pom.xml b/spring-cloud/spring-cloud-ribbon-client/pom.xml index 85baff12cd..cada10ec35 100644 --- a/spring-cloud/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-client/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-cloud-ribbon @@ -15,10 +15,6 @@ ../../parent-boot-5 - - Brixton.SR7 - - org.springframework.cloud @@ -61,41 +57,8 @@ - - - integration - + + Brixton.SR7 + - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - \ No newline at end of file diff --git a/spring-cloud/spring-cloud-security/auth-client/pom.xml b/spring-cloud/spring-cloud-security/auth-client/pom.xml index 5213b93f9a..1f6c22e2e1 100644 --- a/spring-cloud/spring-cloud-security/auth-client/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-client/pom.xml @@ -1,102 +1,101 @@ - 4.0.0 - com.baeldung - auth-client - 0.0.1-SNAPSHOT - jar + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + auth-client + 0.0.1-SNAPSHOT + jar - auth-client - Demo project for Spring Boot + auth-client + Demo project for Spring Boot - - org.springframework.boot - spring-boot-starter-parent - 1.5.9.RELEASE - - + + org.springframework.boot + spring-boot-starter-parent + 1.5.9.RELEASE + + - - - - org.springframework.cloud - spring-cloud-dependencies - Dalston.SR4 - pom - import - - - + + + + org.springframework.cloud + spring-cloud-dependencies + Dalston.SR4 + pom + import + + + + + UTF-8 + UTF-8 + 1.8 + - - UTF-8 - UTF-8 - 1.8 - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-oauth2 + + + org.springframework.cloud + spring-cloud-starter-zuul + + + org.springframework.boot + spring-boot-starter-test + test + + + org.webjars + jquery + + + org.webjars + bootstrap + + + org.webjars + webjars-locator + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-oauth2 - - - org.springframework.cloud - spring-cloud-starter-zuul - - - org.springframework.boot - spring-boot-starter-test - test - - - org.webjars - jquery - - - org.webjars - bootstrap - - - org.webjars - webjars-locator - + + org.springframework.boot + spring-boot-starter-security + + + org.webjars + js-cookie + 2.1.0 + - - org.springframework.boot - spring-boot-starter-security - - - org.webjars - js-cookie - 2.1.0 - + + org.springframework.boot + spring-boot-devtools + true + - - org.springframework.boot - spring-boot-devtools - true - + + org.springframework.boot + spring-boot-starter-thymeleaf + - - org.springframework.boot - spring-boot-starter-thymeleaf - + - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/spring-cloud/spring-cloud-security/auth-resource/pom.xml b/spring-cloud/spring-cloud-security/auth-resource/pom.xml index 2c54d24e7d..3813cd3a52 100644 --- a/spring-cloud/spring-cloud-security/auth-resource/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-resource/pom.xml @@ -1,70 +1,70 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung - auth-resource - 0.0.1-SNAPSHOT - jar + com.baeldung + auth-resource + 0.0.1-SNAPSHOT + jar - auth-resource - Demo project for Spring Boot + auth-resource + Demo project for Spring Boot - - org.springframework.boot - spring-boot-starter-parent - 1.5.9.RELEASE - - + + org.springframework.boot + spring-boot-starter-parent + 1.5.9.RELEASE + + - - UTF-8 - UTF-8 - 1.8 - Edgware.RELEASE - + + UTF-8 + UTF-8 + 1.8 + Edgware.RELEASE + - - - org.springframework.security.oauth - spring-security-oauth2 - - - org.springframework.cloud - spring-cloud-starter-security - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-jwt - - + + + org.springframework.security.oauth + spring-security-oauth2 + + + org.springframework.cloud + spring-cloud-starter-security + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-jwt + + - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/spring-cloud/spring-cloud-security/auth-server/pom.xml b/spring-cloud/spring-cloud-security/auth-server/pom.xml index ab30f3f2ec..82141c1015 100644 --- a/spring-cloud/spring-cloud-security/auth-server/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-server/pom.xml @@ -1,42 +1,42 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung - auth-server - 0.0.1-SNAPSHOT + com.baeldung + auth-server + 0.0.1-SNAPSHOT - - org.springframework.boot - spring-boot-starter-parent - 1.5.9.RELEASE - + + org.springframework.boot + spring-boot-starter-parent + 1.5.9.RELEASE + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-devtools - true - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.cloud - spring-cloud-starter-oauth2 - 1.1.2.RELEASE - - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-devtools + true + + + org.springframework.boot + spring-boot-starter-tomcat + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.cloud + spring-cloud-starter-oauth2 + 1.1.2.RELEASE + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-stream/pom.xml b/spring-cloud/spring-cloud-stream/pom.xml index 65a327e664..ef691fbeea 100644 --- a/spring-cloud/spring-cloud-stream/pom.xml +++ b/spring-cloud/spring-cloud-stream/pom.xml @@ -3,11 +3,9 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung spring-cloud-stream pom - spring-cloud-stream @@ -20,11 +18,6 @@ spring-cloud-stream-rabbit - - UTF-8 - 3.7.0 - - @@ -32,13 +25,11 @@ spring-cloud-starter-stream-rabbit ${spring-cloud-stream.version} - org.springframework.cloud spring-cloud-stream ${spring-cloud-stream.version} - org.springframework.cloud spring-cloud-stream-test-support @@ -48,24 +39,9 @@ - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - + + UTF-8 + 3.7.0 + + diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml index a954a7035e..fa14d04087 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-rabbit/pom.xml @@ -1,11 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-cloud-stream-rabbit jar - spring-cloud-stream-rabbit Simple Spring Cloud Stream @@ -21,7 +19,7 @@ org.springframework.cloud spring-cloud-starter-stream-rabbit - + org.springframework.cloud spring-cloud-stream-test-support diff --git a/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml b/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml index 4805f5296c..1bb3d98efb 100644 --- a/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml +++ b/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml @@ -1,81 +1,80 @@ - 4.0.0 - org.baeldung.cloud - springcloudtask - 0.0.1-SNAPSHOT + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + org.baeldung.cloud + springcloudtask + 0.0.1-SNAPSHOT - - org.springframework.boot - spring-boot-starter-parent - 1.5.10.RELEASE - - + + org.springframework.boot + spring-boot-starter-parent + 1.5.10.RELEASE + + - - com.baeldung.TaskDemo - UTF-8 - UTF-8 - 1.8 - 1.2.2.RELEASE - + + com.baeldung.TaskDemo + UTF-8 + UTF-8 + 1.8 + 1.2.2.RELEASE + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-data-jpa + + + mysql + mysql-connector-java + + + org.springframework.cloud + spring-cloud-starter-task + - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-data-jpa - - - mysql - mysql-connector-java - - - org.springframework.cloud - spring-cloud-starter-task - + + org.springframework.cloud + spring-cloud-task-core + - - org.springframework.cloud - spring-cloud-task-core - + + org.springframework.boot + spring-boot-starter-batch + - - org.springframework.boot - spring-boot-starter-batch - + + org.springframework.cloud + spring-cloud-task-batch + + - - org.springframework.cloud - spring-cloud-task-batch - - - - - - - org.springframework.cloud - spring-cloud-task-dependencies - ${spring-cloud-task.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-task-dependencies + ${spring-cloud-task.version} + pom + import + + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml b/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml index b717fffc7c..3aa038b3f3 100644 --- a/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml +++ b/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml @@ -1,88 +1,88 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung - SpringCloudTaskSink - 0.0.1-SNAPSHOT - jar + com.baeldung + SpringCloudTaskSink + 0.0.1-SNAPSHOT + jar - SpringCloudTaskSink - Demo project for Spring Boot + SpringCloudTaskSink + Demo project for Spring Boot - - org.springframework.boot - spring-boot-starter-parent - 1.5.10.RELEASE - - + + org.springframework.boot + spring-boot-starter-parent + 1.5.10.RELEASE + + - - UTF-8 - UTF-8 - 1.8 - 1.2.2.RELEASE - Edgware.SR2 - + + UTF-8 + UTF-8 + 1.8 + 1.2.2.RELEASE + Edgware.SR2 + - - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - - org.springframework.cloud - spring-cloud-starter-task - - - org.springframework.cloud - spring-cloud-stream-test-support - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-test - test - + + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + + + org.springframework.cloud + spring-cloud-starter-task + + + org.springframework.cloud + spring-cloud-stream-test-support + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-test + test + - - org.springframework.cloud - spring-cloud-deployer-local - 1.3.0.RELEASE - - + + org.springframework.cloud + spring-cloud-deployer-local + 1.3.0.RELEASE + + - - - - org.springframework.cloud - spring-cloud-task-dependencies - ${spring-cloud-task.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-task-dependencies + ${spring-cloud-task.version} + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml index c178fbf454..e7fa972f07 100644 --- a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 @@ -65,5 +65,5 @@ Greeting - + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml b/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml index a50662cf9c..a5b7776438 100644 --- a/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-zookeeper/pom.xml b/spring-cloud/spring-cloud-zookeeper/pom.xml index fb58a3fce4..091b8c4987 100644 --- a/spring-cloud/spring-cloud-zookeeper/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/pom.xml @@ -1,16 +1,19 @@ - 4.0.0 - - com.baeldung.spring.cloud - spring-cloud - 1.0.0-SNAPSHOT - - spring-cloud-zookeeper - pom - - Greeting - HelloWorld - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-cloud-zookeeper + pom + + + com.baeldung.spring.cloud + spring-cloud + 1.0.0-SNAPSHOT + + + + Greeting + HelloWorld + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml index a3185a44d4..876279262c 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-client/pom.xml @@ -1,68 +1,50 @@ - 4.0.0 + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - eureka-client - 1.0.0-SNAPSHOT - jar + eureka-client + 1.0.0-SNAPSHOT + jar - Spring Cloud Eureka Client - Spring Cloud Eureka Sample Client + Spring Cloud Eureka Client + Spring Cloud Eureka Sample Client - - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT - + + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT + - - - org.springframework.cloud - spring-cloud-starter-eureka - ${spring-cloud-starter-eureka.version} - - - org.springframework.boot - spring-boot-starter-web - ${spring-boot-starter-web.version} - - + + + org.springframework.cloud + spring-cloud-starter-eureka + ${spring-cloud-starter-eureka.version} + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-starter-web.version} + + - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - Brixton.SR7 - 1.2.3.RELEASE - 1.4.2.RELEASE - + + Brixton.SR7 + 1.2.3.RELEASE + 1.4.2.RELEASE + diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml index d86cfa8589..8bf8a0da46 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/eureka-server/pom.xml @@ -1,68 +1,49 @@ - 4.0.0 + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - eureka-server - 1.0.0-SNAPSHOT - jar + eureka-server + 1.0.0-SNAPSHOT + jar - Spring Cloud Eureka Server - Spring Cloud Eureka Server Demo + Spring Cloud Eureka Server + Spring Cloud Eureka Server Demo - - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT - + + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT + - - - org.springframework.cloud - spring-cloud-starter-eureka-server - ${spring-cloud-starter-eureka.version} - - - commons-configuration - commons-configuration - ${commons-config.version} - + + + org.springframework.cloud + spring-cloud-starter-eureka-server + ${spring-cloud-starter-eureka.version} + + + commons-configuration + commons-configuration + ${commons-config.version} + - + - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - Brixton.SR7 - 1.2.3.RELEASE - + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + + Brixton.SR7 + 1.2.3.RELEASE + diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml index fabad77a77..b8e3c867e3 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml @@ -1,55 +1,35 @@ - 4.0.0 + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT - pom + pom - Spring Cloud Zuul and Eureka Integration - Spring Cloud Zuul and Eureka Integration + Spring Cloud Zuul and Eureka Integration + Spring Cloud Zuul and Eureka Integration - - com.baeldung.spring.cloud - spring-cloud - 1.0.0-SNAPSHOT - .. - + + com.baeldung.spring.cloud + spring-cloud + 1.0.0-SNAPSHOT + .. + - - UTF-8 - 3.7.0 - 1.4.2.RELEASE - 1.10 - + + UTF-8 + 3.7.0 + 1.4.2.RELEASE + 1.10 + - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - - - zuul-server - eureka-server - eureka-client - + + zuul-server + eureka-server + eureka-client + diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml index 2622a3e36b..40462c57f4 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/zuul-server/pom.xml @@ -1,61 +1,44 @@ - 4.0.0 - - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT - - zuul-server - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-zuul - - - org.springframework.cloud - spring-cloud-starter-eureka - - - commons-configuration - commons-configuration - ${commons-config.version} - - - org.springframework.boot - spring-boot-starter-security - - - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT + + zuul-server + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-zuul + + + org.springframework.cloud + spring-cloud-starter-eureka + + + commons-configuration + commons-configuration + ${commons-config.version} + + + org.springframework.boot + spring-boot-starter-security + + + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml index a3185a44d4..3d1bd412c0 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-client/pom.xml @@ -1,68 +1,48 @@ - 4.0.0 + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + eureka-client + 1.0.0-SNAPSHOT + jar + Spring Cloud Eureka Client + Spring Cloud Eureka Sample Client - eureka-client - 1.0.0-SNAPSHOT - jar + + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT + - Spring Cloud Eureka Client - Spring Cloud Eureka Sample Client + + + org.springframework.cloud + spring-cloud-starter-eureka + ${spring-cloud-starter-eureka.version} + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-starter-web.version} + + - - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT - + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + - - - org.springframework.cloud - spring-cloud-starter-eureka - ${spring-cloud-starter-eureka.version} - - - org.springframework.boot - spring-boot-starter-web - ${spring-boot-starter-web.version} - - - - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - Brixton.SR7 - 1.2.3.RELEASE - 1.4.2.RELEASE - + + Brixton.SR7 + 1.2.3.RELEASE + 1.4.2.RELEASE + diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml index d86cfa8589..902232c843 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/eureka-server/pom.xml @@ -1,68 +1,48 @@ - 4.0.0 + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + eureka-server + 1.0.0-SNAPSHOT + jar + Spring Cloud Eureka Server + Spring Cloud Eureka Server Demo - eureka-server - 1.0.0-SNAPSHOT - jar + + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT + - Spring Cloud Eureka Server - Spring Cloud Eureka Server Demo + + + org.springframework.cloud + spring-cloud-starter-eureka-server + ${spring-cloud-starter-eureka.version} + + + commons-configuration + commons-configuration + ${commons-config.version} + - - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT - + - - - org.springframework.cloud - spring-cloud-starter-eureka-server - ${spring-cloud-starter-eureka.version} - - - commons-configuration - commons-configuration - ${commons-config.version} - + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + - - - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - Brixton.SR7 - 1.2.3.RELEASE - + + Brixton.SR7 + 1.2.3.RELEASE + diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml index b4c7188abe..ef16a6a885 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml @@ -1,56 +1,34 @@ - 4.0.0 + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT + pom + Spring Cloud Zuul and Eureka Integration + Spring Cloud Zuul and Eureka Integration - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT + + com.baeldung.spring.cloud + spring-cloud + 1.0.0-SNAPSHOT + .. + - pom + + zuul-server + eureka-server + eureka-client + - Spring Cloud Zuul and Eureka Integration - Spring Cloud Zuul and Eureka Integration + + UTF-8 + 3.7.0 + 1.4.2.RELEASE + 1.10 + 1.2.10 + - - com.baeldung.spring.cloud - spring-cloud - 1.0.0-SNAPSHOT - .. - - - - UTF-8 - 3.7.0 - 1.4.2.RELEASE - 1.10 - 1.2.10 - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - - - zuul-server - eureka-server - eureka-client - diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml index b68fd63155..19cb2ea5b8 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml @@ -1,66 +1,49 @@ - 4.0.0 - - com.baeldung.spring.cloud - spring-cloud-zuul-eureka-integration - 1.0.0-SNAPSHOT - - zuul-server - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.cloud - spring-cloud-starter-zuul - - - org.springframework.cloud - spring-cloud-starter-eureka - - - commons-configuration - commons-configuration - ${commons-config.version} - - - io.reactivex - rxjava - ${rxjava.version} - - - org.springframework.boot - spring-boot-starter-security - - - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.springframework.boot - spring-boot-maven-plugin - - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + com.baeldung.spring.cloud + spring-cloud-zuul-eureka-integration + 1.0.0-SNAPSHOT + + zuul-server + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.cloud + spring-cloud-starter-zuul + + + org.springframework.cloud + spring-cloud-starter-eureka + + + commons-configuration + commons-configuration + ${commons-config.version} + + + io.reactivex + rxjava + ${rxjava.version} + + + org.springframework.boot + spring-boot-starter-security + + + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + \ No newline at end of file diff --git a/spring-core/README.md b/spring-core/README.md index 0d984e87d4..b6804a4ce0 100644 --- a/spring-core/README.md +++ b/spring-core/README.md @@ -10,5 +10,6 @@ - [Using Spring @Value with Defaults](http://www.baeldung.com/spring-value-defaults) - [Groovy Bean Definitions](http://www.baeldung.com/spring-groovy-beans) - [XML-Based Injection in Spring](http://www.baeldung.com/spring-xml-injection) -- [A Quick Guide to the Spring @Lazy Annotation] (http://www.baeldung.com/spring-lazy-annotation) +- [A Quick Guide to the Spring @Lazy Annotation](http://www.baeldung.com/spring-lazy-annotation) - [Injecting Prototype Beans into a Singleton Instance in Spring](http://www.baeldung.com/spring-inject-prototype-bean-into-singleton) +- [How to Inject a Property Value Into a Class Not Managed by Spring?](http://www.baeldung.com/inject-properties-value-non-spring-class) diff --git a/spring-core/pom.xml b/spring-core/pom.xml index deffaf41db..2fa66a7929 100644 --- a/spring-core/pom.xml +++ b/spring-core/pom.xml @@ -1,147 +1,108 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.0 + 4.0.0 + com.baeldung + spring-core + 0.0.1-SNAPSHOT + war + spring-core - com.baeldung - spring-core - 0.0.1-SNAPSHOT - war + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - spring-core + + + org.mockito + mockito-all + ${mockito.version} + + + org.springframework + spring-test + ${spring.version} + + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-beans + ${spring.version} + + + org.springframework + spring-context + ${spring.version} + + + javax.inject + javax.inject + ${javax.inject.version} + + + com.google.guava + guava + ${guava.version} + + + org.projectlombok + lombok + ${lombok.version} + + + org.springframework.boot + spring-boot-starter + 1.5.2.RELEASE + + + org.springframework.boot + spring-boot-test + ${mockito.spring.boot.version} + test + + + commons-io + commons-io + ${commons.io.version} + + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + + + + - - - org.mockito - mockito-all - ${mockito.version} - - - org.springframework - spring-test - ${spring.version} - - - org.springframework - spring-core - ${spring.version} - - - org.springframework - spring-beans - ${spring.version} - - - org.springframework - spring-context - ${spring.version} - - - javax.inject - javax.inject - ${javax.inject.version} - - - com.google.guava - guava - ${guava.version} - - - org.projectlombok - lombok - ${lombok.version} - - - org.springframework.boot - spring-boot-starter - 1.5.2.RELEASE - - - org.springframework.boot - spring-boot-test - ${mockito.spring.boot.version} - test - - - commons-io - commons-io - ${commons.io.version} - - + + 1.10.19 + 1.4.4.RELEASE + 4.3.4.RELEASE + 1 + 20.0 + 2.6 + 1.16.12 + 2.5 + - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - false - - - - - - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - - 1.10.19 - 1.4.4.RELEASE - 4.3.4.RELEASE - 1 - 20.0 - 2.6 - 1.16.12 - 2.5 - - - - - java.net - https://maven.java.net/content/repositories/releases/ - - + + + java.net + https://maven.java.net/content/repositories/releases/ + + \ No newline at end of file diff --git a/spring-cucumber/pom.xml b/spring-cucumber/pom.xml index df4723484d..cabd1a9020 100644 --- a/spring-cucumber/pom.xml +++ b/spring-cucumber/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-cucumber 0.0.1-SNAPSHOT jar - spring-cucumber Demo project for Spring Boot @@ -18,87 +16,46 @@ ../parent-boot-5 - - 1.2.5 - 1.3.2 - - org.springframework.boot spring-boot-starter-web - info.cukes cucumber-core ${cucumber.java.version} test - info.cukes cucumber-java ${cucumber.java.version} test - info.cukes cucumber-junit ${cucumber.java.version} test - info.cukes cucumber-spring ${cucumber.java.version} test - org.apache.commons commons-io ${commons-io.version} - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + + 1.2.5 + 1.3.2 + diff --git a/spring-custom-aop/spring-custom-aop/pom.xml b/spring-custom-aop/spring-custom-aop/pom.xml index 95c1b7419f..a1e498f65d 100644 --- a/spring-custom-aop/spring-custom-aop/pom.xml +++ b/spring-custom-aop/spring-custom-aop/pom.xml @@ -139,42 +139,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - org.baeldung.boot.DemoApplication diff --git a/spring-data-5-reactive/pom.xml b/spring-data-5-reactive/pom.xml index 85d025bd9c..710f6f9d67 100644 --- a/spring-data-5-reactive/pom.xml +++ b/spring-data-5-reactive/pom.xml @@ -2,15 +2,13 @@ 4.0.0 - com.baeldung spring-5-data-reactive 0.0.1-SNAPSHOT jar - Spring-5-data-reactive Spring-5-data-reactive with Springboot 2.0.1 - + org.springframework.boot spring-boot-starter-parent @@ -22,7 +20,7 @@ UTF-8 UTF-8 1.8 - 1.2.20 + 1.2.40 @@ -37,7 +35,7 @@ javax.ws.rs javax.ws.rs-api - 2.1 + ${javax.ws.rs-api.version} com.fasterxml.jackson.module @@ -65,8 +63,24 @@ kotlin-stdlib-jdk8 ${kotlin.version} + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.jetbrains.kotlin + kotlin-test + ${kotlin.version} + test + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + - + spring-libs-snapshot @@ -74,7 +88,7 @@ http://repo.spring.io/libs-snapshot - + src/main/kotlin diff --git a/spring-data-5-reactive/src/main/kotlin/com/baeldung/Application.kt b/spring-data-5-reactive/src/main/kotlin/com/baeldung/Application.kt index b21dd6bfb5..af29a429a4 100644 --- a/spring-data-5-reactive/src/main/kotlin/com/baeldung/Application.kt +++ b/spring-data-5-reactive/src/main/kotlin/com/baeldung/Application.kt @@ -1,4 +1,4 @@ -package org.jetbrains.kotlin.demo +package com.baeldung import org.springframework.boot.SpringApplication import org.springframework.boot.autoconfigure.SpringBootApplication @@ -9,4 +9,3 @@ class Application fun main(args: Array) { SpringApplication.run(Application::class.java, *args) } - diff --git a/spring-data-5-reactive/src/main/kotlin/com/baeldung/EventRepository.kt b/spring-data-5-reactive/src/main/kotlin/com/baeldung/EventRepository.kt index 33d4b85a93..a73ef8c807 100644 --- a/spring-data-5-reactive/src/main/kotlin/com/baeldung/EventRepository.kt +++ b/spring-data-5-reactive/src/main/kotlin/com/baeldung/EventRepository.kt @@ -1,5 +1,9 @@ package com.baeldung +import org.springframework.data.mongodb.core.mapping.Document import org.springframework.data.mongodb.repository.ReactiveMongoRepository interface EventRepository : ReactiveMongoRepository + +@Document +data class Event(val id: String, val name: String) diff --git a/spring-data-5-reactive/src/main/kotlin/com/baeldung/MongoConfig.kt b/spring-data-5-reactive/src/main/kotlin/com/baeldung/MongoConfig.kt index a45a630f38..64d51a176a 100644 --- a/spring-data-5-reactive/src/main/kotlin/com/baeldung/MongoConfig.kt +++ b/spring-data-5-reactive/src/main/kotlin/com/baeldung/MongoConfig.kt @@ -13,21 +13,13 @@ import org.springframework.data.mongodb.repository.config.EnableReactiveMongoRep @EnableReactiveMongoRepositories(basePackageClasses = arrayOf(EventRepository::class)) class MongoConfig : AbstractReactiveMongoConfiguration() { - override fun reactiveMongoClient(): com.mongodb.reactivestreams.client.MongoClient { - return mongoClient() - } + override fun reactiveMongoClient(): MongoClient = mongoClient() @Bean - fun mongoClient(): MongoClient { - return MongoClients.create() - } + fun mongoClient(): MongoClient = MongoClients.create() - override fun getDatabaseName(): String { - return "mongoDatabase" - } + override fun getDatabaseName(): String = "mongoDatabase" @Bean - override fun reactiveMongoTemplate(): ReactiveMongoTemplate { - return ReactiveMongoTemplate(mongoClient(), databaseName) - } + override fun reactiveMongoTemplate(): ReactiveMongoTemplate = ReactiveMongoTemplate(mongoClient(), databaseName) } diff --git a/spring-data-5-reactive/src/main/kotlin/com/baeldung/SendEmitter.kt b/spring-data-5-reactive/src/main/kotlin/com/baeldung/SendEmitter.kt index bc879e10df..6fa3118d8f 100644 --- a/spring-data-5-reactive/src/main/kotlin/com/baeldung/SendEmitter.kt +++ b/spring-data-5-reactive/src/main/kotlin/com/baeldung/SendEmitter.kt @@ -1,43 +1,16 @@ package com.baeldung +import org.springframework.http.MediaType import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController -import org.springframework.web.servlet.mvc.method.annotation.SseEmitter -import reactor.core.publisher.Flux -import reactor.core.publisher.Mono import java.util.* -import javax.ws.rs.core.MediaType @RestController class SendEmitter(val eventRepository: EventRepository) { - private var emitter = SseEmitter() - - /** - * Save and send an SSE to all subscribed clients - */ - @GetMapping("/saveEvent") - fun executeExample(@RequestParam("eventName") eventName: String): Flux { - // Create new event - var event = Event(UUID.randomUUID().toString(), eventName) - // Save event - var stream = eventRepository.saveAll(Mono.just(event)) - // Send event - emitter.send(SseEmitter.event().data(event)) - // Return SSE - return stream - } - - /** - * Receive SSEs - */ - @GetMapping(value = "/receiveChanges") - fun handle(): SseEmitter { - // Create new emitter - this.emitter = SseEmitter() - // Return SSE - return emitter - } + @GetMapping(value = "/save", produces = arrayOf(MediaType.TEXT_EVENT_STREAM_VALUE)) + fun executeExample(@RequestParam("eventName") eventName: String) = + eventRepository.save(Event(UUID.randomUUID().toString(), eventName)).flux() } diff --git a/spring-data-5-reactive/src/main/resources/static/index.html b/spring-data-5-reactive/src/main/resources/static/index.html index 8fbb3b6b05..a0b8f6f884 100644 --- a/spring-data-5-reactive/src/main/resources/static/index.html +++ b/spring-data-5-reactive/src/main/resources/static/index.html @@ -1,33 +1,39 @@ -
+ +
- +
diff --git a/spring-data-couchbase-2/pom.xml b/spring-data-couchbase-2/pom.xml index 70fab436dc..10afff76e7 100644 --- a/spring-data-couchbase-2/pom.xml +++ b/spring-data-couchbase-2/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung spring-data-couchbase-2 diff --git a/spring-data-elasticsearch/pom.xml b/spring-data-elasticsearch/pom.xml index c919705c3c..e314e7870e 100644 --- a/spring-data-elasticsearch/pom.xml +++ b/spring-data-elasticsearch/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-data-elasticsearch 0.0.1-SNAPSHOT jar - spring-data-elasticsearch @@ -15,18 +13,6 @@ 1.0.0-SNAPSHOT - - UTF-8 - 1.8 - 1.8 - - 4.3.4.RELEASE - 2.0.5.RELEASE - 4.2.2 - 2.4.2 - 1.2.21 - - org.springframework @@ -48,13 +34,13 @@ com.spatial4j spatial4j - 0.4.1 + ${spatial4j.version} com.vividsolutions jts - 1.13 + ${jts.version} xerces @@ -87,4 +73,19 @@ ${fastjson.version} + + + + UTF-8 + 1.8 + 1.8 + 4.3.4.RELEASE + 2.0.5.RELEASE + 4.2.2 + 2.4.2 + 1.2.21 + 0.4.1 + 1.13 + + \ No newline at end of file diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index 7060ec5b36..0ff8f3e9fd 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -1,11 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-data-mongodb 0.0.1-SNAPSHOT - spring-data-mongodb @@ -15,13 +13,11 @@ - org.springframework.data spring-data-mongodb ${org.springframework.data.version} - org.springframework spring-core @@ -33,14 +29,12 @@ - org.springframework spring-test ${org.springframework.version} test - com.querydsl querydsl-mongodb @@ -51,7 +45,6 @@ querydsl-apt ${querydsl.version} - @@ -75,48 +68,10 @@
- - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - UTF-8 - 4.3.4.RELEASE - 1.10.4.RELEASE - 2.9.0 4.1.4 1.1.3 diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index 2b621ac3a2..bad7a38281 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-data-rest 1.0 jar - intro-spring-data-rest Intro to Spring Data REST @@ -23,7 +21,6 @@ org.springframework.boot spring-boot-starter
- org.springframework.boot spring-boot-starter-data-rest @@ -36,11 +33,10 @@ com.h2database h2 - - @@ -48,5 +44,4 @@ ${project.artifactId} -
diff --git a/spring-data-spring-security/pom.xml b/spring-data-spring-security/pom.xml index d6b671ee57..afdf3c332c 100644 --- a/spring-data-spring-security/pom.xml +++ b/spring-data-spring-security/pom.xml @@ -1,67 +1,65 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung - spring-data-spring-security - 1.0 - jar + com.baeldung + spring-data-spring-security + 1.0 + jar + intro-spring-data-spring-security + Spring Data with Spring Security - intro-spring-data-spring-security - Spring Data with Spring Security + + parent-boot-5 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-5 + - - parent-boot-5 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-5 - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.security - spring-security-data - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-test - test - - - org.apache.tomcat.embed - tomcat-embed-jasper - - - - com.h2database - h2 - - - javax.servlet - jstl - - - - - ${project.artifactId} - + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.security + spring-security-data + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-test + test + + + org.apache.tomcat.embed + tomcat-embed-jasper + + + + com.h2database + h2 + + + javax.servlet + jstl + + + + ${project.artifactId} + diff --git a/spring-dispatcher-servlet/pom.xml b/spring-dispatcher-servlet/pom.xml index 79cc1e5cd0..1d4d2b0d71 100644 --- a/spring-dispatcher-servlet/pom.xml +++ b/spring-dispatcher-servlet/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung spring-dispatcher-servlet @@ -15,9 +15,6 @@ 1.0.0-SNAPSHOT - - 4.3.7.RELEASE - org.springframework @@ -37,46 +34,48 @@ javax.servlet javax.servlet-api - 3.1.0 + ${javax.servlet-api.version} javax.servlet.jsp.jstl jstl-api - 1.2 + ${jstl-api.version} javax.servlet.jsp javax.servlet.jsp-api - 2.3.1 + ${javax.servlet.jsp-api.version} org.codehaus.jackson jackson-mapper-asl - 1.9.13 + ${jackson-mapper-asl.version} javax.servlet jstl - 1.2 + ${jstl.version} com.fasterxml.jackson.core jackson-databind - 2.5.0 + ${jackson-databind.version} commons-fileupload commons-fileupload - 1.3 + ${commons-fileupload.version} + + spring-dispatcher-servlet org.apache.tomcat.maven tomcat8-maven-plugin - 3.0-r1655215 + ${tomcat8-maven-plugin.version} /springdispatcherservlet @@ -84,7 +83,7 @@ org.apache.maven.plugins maven-war-plugin - 3.0.0 + ${maven-war-plugin.version} src/main/webapp false @@ -92,6 +91,12 @@ - springdispatcherservlet + + + 4.3.7.RELEASE + 3.0-r1655215 + 3.0.0 + + \ No newline at end of file diff --git a/spring-drools/pom.xml b/spring-drools/pom.xml index 239c0c065c..9df43a89ad 100644 --- a/spring-drools/pom.xml +++ b/spring-drools/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-drools 1.0.0-SNAPSHOT @@ -13,10 +12,6 @@ 1.0.0-SNAPSHOT - - 7.0.0.Final - 4.3.3.RELEASE - @@ -39,7 +34,6 @@ drools-compiler ${drools-version} - org.kie @@ -53,4 +47,10 @@ test + + + 7.0.0.Final + 4.3.3.RELEASE + + \ No newline at end of file diff --git a/spring-ejb/ejb-remote-for-spring/pom.xml b/spring-ejb/ejb-remote-for-spring/pom.xml index fd1095420c..9978196725 100755 --- a/spring-ejb/ejb-remote-for-spring/pom.xml +++ b/spring-ejb/ejb-remote-for-spring/pom.xml @@ -2,6 +2,8 @@ 4.0.0 + ejb-remote-for-spring + ejb com.baeldung.spring.ejb @@ -9,9 +11,6 @@ 1.0.1 - ejb-remote-for-spring - ejb - javax @@ -28,7 +27,7 @@ - + wildfly-standalone diff --git a/spring-ejb/pom.xml b/spring-ejb/pom.xml index 6d88099bc5..bd0183d71d 100755 --- a/spring-ejb/pom.xml +++ b/spring-ejb/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.spring.ejb ejb-for-spring diff --git a/spring-ejb/singleton-ejb-bean/pom.xml b/spring-ejb/singleton-ejb-bean/pom.xml index 9090911e3f..0ce390b6ac 100644 --- a/spring-ejb/singleton-ejb-bean/pom.xml +++ b/spring-ejb/singleton-ejb-bean/pom.xml @@ -1,11 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.singletonsession singleton-ejb-bean 1.0.0-SNAPSHOT EJB Singleton Session Bean - + com.baeldung.spring.ejb ejb-for-spring 1.0.1 @@ -21,7 +21,7 @@ javax javaee-api 8.0 - provided + provided diff --git a/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java b/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java index b437dc4d7f..ee2c1f005a 100644 --- a/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java +++ b/spring-ejb/singleton-ejb-bean/src/main/java/com/baeldung/singletonbean/CountryStateBeanManagedBean.java @@ -8,8 +8,6 @@ import java.util.Map; import javax.annotation.PostConstruct; import javax.ejb.ConcurrencyManagement; import javax.ejb.ConcurrencyManagementType; -import javax.ejb.Lock; -import javax.ejb.LockType; import javax.ejb.Singleton; import javax.ejb.Startup; @@ -18,7 +16,7 @@ import javax.ejb.Startup; @ConcurrencyManagement(ConcurrencyManagementType.BEAN) public class CountryStateBeanManagedBean implements CountryState { - private volatile Map> countryStatesMap = new HashMap>(); + private final Map> countryStatesMap = new HashMap>(); @PostConstruct public synchronized void initialize() { diff --git a/spring-ejb/spring-ejb-client/pom.xml b/spring-ejb/spring-ejb-client/pom.xml index c77ce09a2d..f7b42212be 100644 --- a/spring-ejb/spring-ejb-client/pom.xml +++ b/spring-ejb/spring-ejb-client/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-ejb-client @@ -27,14 +27,14 @@ org.springframework.boot spring-boot-starter-web - + org.wildfly wildfly-ejb-client-bom 10.1.0.Final pom - + com.baeldung.spring.ejb ejb-remote-for-spring diff --git a/spring-exceptions/pom.xml b/spring-exceptions/pom.xml index 97dc76058b..a9ea8239f6 100644 --- a/spring-exceptions/pom.xml +++ b/spring-exceptions/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-exceptions 0.1-SNAPSHOT - spring-exceptions war @@ -195,7 +194,7 @@ 19.0 3.5 - + 4.4.5 4.5.2 diff --git a/spring-freemarker/pom.xml b/spring-freemarker/pom.xml index ea9222410e..f2771857c7 100644 --- a/spring-freemarker/pom.xml +++ b/spring-freemarker/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.freemarker.example spring4-freemarker-example diff --git a/spring-groovy/pom.xml b/spring-groovy/pom.xml index 9086369fa4..f36d6cd22a 100644 --- a/spring-groovy/pom.xml +++ b/spring-groovy/pom.xml @@ -1,49 +1,49 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldug - spring-groovy - 0.0.1-SNAPSHOT - jar + com.baeldug + spring-groovy + 0.0.1-SNAPSHOT + jar - spring-groovy - http://maven.apache.org + spring-groovy + http://maven.apache.org com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - UTF-8 - + - - - junit - junit - 3.8.1 - test - - - org.springframework - spring-core - 4.3.6.RELEASE - - - org.springframework.integration - spring-integration-groovy - 4.3.7.RELEASE - - - org.codehaus.groovy - groovy-all - 2.4.12 - - - + + UTF-8 + + + + + junit + junit + 3.8.1 + test + + + org.springframework + spring-core + 4.3.6.RELEASE + + + org.springframework.integration + spring-integration-groovy + 4.3.7.RELEASE + + + org.codehaus.groovy + groovy-all + 2.4.12 + + + maven-compiler-plugin @@ -70,5 +70,5 @@ - + diff --git a/spring-hibernate4/pom.xml b/spring-hibernate4/pom.xml index 0a89819b81..be27ba6f6a 100644 --- a/spring-hibernate4/pom.xml +++ b/spring-hibernate4/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-hibernate4 0.1-SNAPSHOT - spring-hibernate4 diff --git a/spring-integration/pom.xml b/spring-integration/pom.xml index e3dd0d3f9a..7cb2be45e0 100644 --- a/spring-integration/pom.xml +++ b/spring-integration/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.samples.spring.integration spring-integration 1.0.0.BUILD-SNAPSHOT jar - spring-integration http://www.springsource.org/spring-integration @@ -106,18 +104,18 @@ spring-integration-file ${spring.version} - - org.springframework.security - spring-security-config - ${spring.version} - - - org.springframework.integration - spring-integration-security - ${spring.version} - - - + + org.springframework.security + spring-security-config + ${spring.version} + + + org.springframework.integration + spring-integration-security + ${spring.version} + + + org.springframework.security spring-security-test ${spring.version} @@ -131,39 +129,4 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - diff --git a/spring-jenkins-pipeline/pom.xml b/spring-jenkins-pipeline/pom.xml index 071f6e6e36..c43952e277 100644 --- a/spring-jenkins-pipeline/pom.xml +++ b/spring-jenkins-pipeline/pom.xml @@ -1,12 +1,10 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-jenkins-pipeline 0.0.1-SNAPSHOT jar - spring-jenkins-pipeline Intro to Jenkins 2 and the power of pipelines @@ -17,13 +15,6 @@ ../parent-boot-5 - - UTF-8 - UTF-8 - 1.8 - 2.17 - - org.springframework.boot @@ -55,26 +46,6 @@ - - integration - - - - maven-surefire-plugin - - - **/*UnitTest.java - - - - **/*IntegrationTest.java - - - - - - - unit @@ -95,4 +66,12 @@ + + + UTF-8 + UTF-8 + 1.8 + 2.17 + + diff --git a/spring-jersey/pom.xml b/spring-jersey/pom.xml index fc05a6ff16..4a37f4b2ab 100644 --- a/spring-jersey/pom.xml +++ b/spring-jersey/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -14,15 +14,6 @@ 1.0.0-SNAPSHOT - - 2.26 - 3.2.0 - 1.6.1 - 4.4.9 - 4.5.5 - 4.0.0 - - spring-jersey @@ -177,4 +168,14 @@ + + + 2.26 + 3.2.0 + 1.6.1 + 4.4.9 + 4.5.5 + 4.0.0 + + diff --git a/spring-jinq/pom.xml b/spring-jinq/pom.xml index a895ae8dd4..30d8cef823 100644 --- a/spring-jinq/pom.xml +++ b/spring-jinq/pom.xml @@ -1,27 +1,18 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-jinq + 0.1-SNAPSHOT + spring-jinq + jar + com.baeldung parent-modules 1.0.0-SNAPSHOT - 4.0.0 - spring-jinq - 0.1-SNAPSHOT - - spring-jinq - - jar - - - UTF-8 - 1.8 - - 1.8.22 - - @@ -80,4 +71,10 @@ + + UTF-8 + 1.8 + 1.8.22 + + diff --git a/spring-jms/pom.xml b/spring-jms/pom.xml index 7ec5b9bb65..6547327161 100644 --- a/spring-jms/pom.xml +++ b/spring-jms/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-jms @@ -14,12 +14,6 @@ 1.0.0-SNAPSHOT - - 4.3.4.RELEASE - 5.14.1 - 2.6 - - @@ -58,4 +52,11 @@ spring-jms + + + 4.3.4.RELEASE + 5.14.1 + 2.6 + + diff --git a/spring-jooq/pom.xml b/spring-jooq/pom.xml index 763465be8c..bd8bc6f404 100644 --- a/spring-jooq/pom.xml +++ b/spring-jooq/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-jooq 0.0.1-SNAPSHOT @@ -185,41 +185,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 3.8.6 1.4.193 diff --git a/spring-kafka/pom.xml b/spring-kafka/pom.xml index 7160f989be..3891be1ec3 100644 --- a/spring-kafka/pom.xml +++ b/spring-kafka/pom.xml @@ -1,19 +1,12 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-kafka 0.0.1-SNAPSHOT - spring-kafka Intro to Kafka with Spring - - 1.1.3.RELEASE - 2.6.7 - - parent-boot-5 com.baeldung @@ -40,4 +33,9 @@ + + 1.1.3.RELEASE + 2.6.7 + + \ No newline at end of file diff --git a/spring-katharsis/pom.xml b/spring-katharsis/pom.xml index 00552c6d5b..27075de747 100644 --- a/spring-katharsis/pom.xml +++ b/spring-katharsis/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.springframework.samples spring-katharsis @@ -42,11 +42,11 @@ - - org.reflections - reflections - 0.9.10 - + + org.reflections + reflections + 0.9.10 + org.apache.commons commons-lang3 diff --git a/spring-mobile/pom.xml b/spring-mobile/pom.xml index 3a129c179e..6916bb9320 100644 --- a/spring-mobile/pom.xml +++ b/spring-mobile/pom.xml @@ -1,7 +1,7 @@ - 4.0.0 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + 4.0.0 com.baeldung spring-mobile @@ -9,14 +9,14 @@ spring-mobile war http://maven.apache.org - + parent-boot-5 com.baeldung 0.0.1-SNAPSHOT ../parent-boot-5 - + org.springframework.boot @@ -27,11 +27,11 @@ spring-mobile-device - org.springframework.boot - spring-boot-starter-freemarker + org.springframework.boot + spring-boot-starter-freemarker - + spring-releases @@ -39,7 +39,7 @@ https://repo.spring.io/libs-release - + spring-releases @@ -47,5 +47,5 @@ https://repo.spring.io/libs-release - + diff --git a/spring-mockito/pom.xml b/spring-mockito/pom.xml index 8c2949275c..63a5521c98 100644 --- a/spring-mockito/pom.xml +++ b/spring-mockito/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -30,41 +30,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 1.10.19 diff --git a/spring-mvc-email/pom.xml b/spring-mvc-email/pom.xml index 5f08b710ec..436b4155fa 100644 --- a/spring-mvc-email/pom.xml +++ b/spring-mvc-email/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.spring @@ -24,12 +24,12 @@ org.springframework.boot spring-boot-starter-tomcat - + org.springframework.boot spring-boot-starter-mail - + javax.servlet diff --git a/spring-mvc-forms-jsp/pom.xml b/spring-mvc-forms-jsp/pom.xml index 88b18b16c4..359e186f52 100644 --- a/spring-mvc-forms-jsp/pom.xml +++ b/spring-mvc-forms-jsp/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung diff --git a/spring-mvc-forms-thymeleaf/pom.xml b/spring-mvc-forms-thymeleaf/pom.xml index 9238153847..b6e931edda 100644 --- a/spring-mvc-forms-thymeleaf/pom.xml +++ b/spring-mvc-forms-thymeleaf/pom.xml @@ -1,73 +1,73 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - com.baeldung - spring-mvc-forms-thymeleaf - 0.0.1-SNAPSHOT - jar + com.baeldung + spring-mvc-forms-thymeleaf + 0.0.1-SNAPSHOT + jar - spring-mvc-forms-thymeleaf - spring forms examples using thymeleaf + spring-mvc-forms-thymeleaf + spring forms examples using thymeleaf - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.RELEASE - - + + org.springframework.boot + spring-boot-starter-parent + 2.0.0.RELEASE + + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + - - - org.springframework.boot - spring-boot-devtools - runtime - - - org.springframework.boot - spring-boot-starter-test - test - - + + + org.springframework.boot + spring-boot-devtools + runtime + + + org.springframework.boot + spring-boot-starter-test + test + + - - - - org.springframework.boot - spring-boot-maven-plugin - + + + + org.springframework.boot + spring-boot-maven-plugin + - - org.apache.maven.plugins - maven-surefire-plugin - - 3 - true - methods - true - - **/*IntegrationTest.java - **/*LiveTest.java - - - - - + + org.apache.maven.plugins + maven-surefire-plugin + + 3 + true + methods + true + + **/*IntegrationTest.java + **/*LiveTest.java + + + + + - - UTF-8 - UTF-8 - + + UTF-8 + UTF-8 + diff --git a/spring-mvc-java/README.md b/spring-mvc-java/README.md index d42efa7ff6..fd6002be62 100644 --- a/spring-mvc-java/README.md +++ b/spring-mvc-java/README.md @@ -24,3 +24,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Spring MVC Custom Validation](http://www.baeldung.com/spring-mvc-custom-validator) - [web.xml vs Initializer with Spring](http://www.baeldung.com/spring-xml-vs-java-config) - [The HttpMediaTypeNotAcceptableException in Spring MVC](http://www.baeldung.com/spring-httpmediatypenotacceptable) +- [Spring MVC @PathVariable with a dot (.) gets truncated](http://www.baeldung.com/spring-mvc-pathvariable-dot) + diff --git a/spring-mvc-java/pom.xml b/spring-mvc-java/pom.xml index 9b2981a747..9a4dc4870d 100644 --- a/spring-mvc-java/pom.xml +++ b/spring-mvc-java/pom.xml @@ -199,38 +199,6 @@ - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - live diff --git a/spring-mvc-java/src/main/java/com/baeldung/spring/web/config/CustomWebMvcConfigurationSupport.java b/spring-mvc-java/src/main/java/com/baeldung/spring/web/config/CustomWebMvcConfigurationSupport.java new file mode 100644 index 0000000000..4a9f6a3431 --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/spring/web/config/CustomWebMvcConfigurationSupport.java @@ -0,0 +1,17 @@ +package com.baeldung.spring.web.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +@Configuration +public class CustomWebMvcConfigurationSupport extends WebMvcConfigurationSupport { + + @Bean + public RequestMappingHandlerMapping requestMappingHandlerMapping() { + RequestMappingHandlerMapping handlerMapping = super.requestMappingHandlerMapping(); + handlerMapping.setUseSuffixPatternMatch(false); + return handlerMapping; + } +} diff --git a/spring-mvc-java/src/main/java/com/baeldung/web/controller/SiteController.java b/spring-mvc-java/src/main/java/com/baeldung/web/controller/SiteController.java new file mode 100644 index 0000000000..3867380665 --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/web/controller/SiteController.java @@ -0,0 +1,30 @@ +package com.baeldung.web.controller; + +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@RequestMapping("/site") +public class SiteController { + + @RequestMapping(value = "/{firstValue}/{secondValue}", method = RequestMethod.GET) + public String requestWithError(@PathVariable("firstValue") String firstValue, + @PathVariable("secondValue") String secondValue) { + + return firstValue + " - " + secondValue; + } + + @RequestMapping(value = "/{firstValue}/{secondValue:.+}", method = RequestMethod.GET) + public String requestWithRegex(@PathVariable("firstValue") String firstValue, + @PathVariable("secondValue") String secondValue) { + + return firstValue + " - " + secondValue; + } + + @RequestMapping(value = "/{firstValue}/{secondValue}/", method = RequestMethod.GET) + public String requestWithSlash(@PathVariable("firstValue") String firstValue, + @PathVariable("secondValue") String secondValue) { + + return firstValue + " - " + secondValue; + } +} diff --git a/spring-mvc-kotlin/README.md b/spring-mvc-kotlin/README.md index b7cbcb1a7a..4e92117c52 100644 --- a/spring-mvc-kotlin/README.md +++ b/spring-mvc-kotlin/README.md @@ -1,3 +1,4 @@ ### Relevant articles - [Spring MVC Setup with Kotlin](http://www.baeldung.com/spring-mvc-kotlin) - [Working with Kotlin and JPA](https://github.com/eugenp/tutorials/tree/master/spring-mvc-kotlin) +- [Kotlin-allopen and Spring](http://www.baeldung.com/kotlin-allopen-spring) diff --git a/spring-mvc-kotlin/pom.xml b/spring-mvc-kotlin/pom.xml index 0202f1a81b..cc2bd18255 100644 --- a/spring-mvc-kotlin/pom.xml +++ b/spring-mvc-kotlin/pom.xml @@ -3,6 +3,10 @@ xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + spring-mvc-kotlin + 0.1-SNAPSHOT + spring-mvc-kotlin + war com.baeldung @@ -10,22 +14,6 @@ 1.0.0-SNAPSHOT - spring-mvc-kotlin - 0.1-SNAPSHOT - - spring-mvc-kotlin - - war - - - UTF-8 - 5.2.15.Final - 1.2.30 - 4.3.10.RELEASE - 3.0.7.RELEASE - 1.4.196 - - org.jetbrains.kotlin @@ -125,5 +113,14 @@ - + + + UTF-8 + 5.2.15.Final + 1.2.30 + 4.3.10.RELEASE + 3.0.7.RELEASE + 1.4.196 + + \ No newline at end of file diff --git a/spring-mvc-simple/pom.xml b/spring-mvc-simple/pom.xml index 4e7f39bad3..2f2d1e9dca 100644 --- a/spring-mvc-simple/pom.xml +++ b/spring-mvc-simple/pom.xml @@ -1,51 +1,23 @@ - + 4.0.0 spring-mvc-simple war 0.0.1-SNAPSHOT Spring MVC simple Maven Webapp http://maven.apache.org + com.baeldung parent-modules 1.0.0-SNAPSHOT - - 1.8 - 1.8 - UTF-8 - 5.0.2.RELEASE - 3.2.0 - 3.7.0 - 2.21.0 - 1.2 - 2.3.2-b02 - 4.0.0 - 5.4.1.Final - enter-location-of-server - 1.3.2 - 1.8 - 3.0.7.RELEASE - 2.4.12 - 2.3.27-incubating - 1.2.5 - 5.0.2 - 5.0.2 - 1.0.2 - 1.9.0 - 2.9.4 - 1.4.9 - 5.1.0 - 20180130 - org.springframework spring-oxm - 5.0.2.RELEASE + ${spring-oxm.version} javax.servlet @@ -164,11 +136,6 @@ ${deploy-path} - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.version} - maven-surefire-plugin ${maven-surefire-plugin.version} @@ -192,4 +159,35 @@ springMvcSimple + + + 1.8 + 1.8 + UTF-8 + 5.0.2.RELEASE + 3.2.0 + 3.7.0 + 2.21.0 + 1.2 + 2.3.2-b02 + 4.0.0 + 5.4.1.Final + enter-location-of-server + 1.3.2 + 1.8 + 3.0.7.RELEASE + 2.4.12 + 2.3.27-incubating + 1.2.5 + 5.0.2 + 5.0.2 + 1.0.2 + 1.9.0 + 2.9.4 + 1.4.9 + 5.1.0 + 20180130 + 5.0.2.RELEASE + + diff --git a/spring-mvc-tiles/pom.xml b/spring-mvc-tiles/pom.xml index b466935c46..a62a92aad8 100644 --- a/spring-mvc-tiles/pom.xml +++ b/spring-mvc-tiles/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-mvc-tiles @@ -14,16 +14,6 @@ 1.0.0-SNAPSHOT - - 4.3.4.RELEASE - 3.0.7 - 3.1.0 - 2.3.1 - 1.2 - - 2.6 - - @@ -90,4 +80,14 @@ spring-mvc-tiles + + + 4.3.4.RELEASE + 3.0.7 + 3.1.0 + 2.3.1 + 1.2 + 2.6 + + diff --git a/spring-mvc-velocity/pom.xml b/spring-mvc-velocity/pom.xml index 7c517e2006..1a1ee66a1a 100644 --- a/spring-mvc-velocity/pom.xml +++ b/spring-mvc-velocity/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung 0.1-SNAPSHOT @@ -127,40 +127,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - diff --git a/spring-mvc-webflow/pom.xml b/spring-mvc-webflow/pom.xml index a100e5ac6c..f0a991912a 100644 --- a/spring-mvc-webflow/pom.xml +++ b/spring-mvc-webflow/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung 0.1-SNAPSHOT diff --git a/spring-mvc-xml/pom.xml b/spring-mvc-xml/pom.xml index 581b94e0c8..8ec2ff10e5 100644 --- a/spring-mvc-xml/pom.xml +++ b/spring-mvc-xml/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung 0.1-SNAPSHOT diff --git a/spring-mybatis/pom.xml b/spring-mybatis/pom.xml index ce3c83a9e7..073c332705 100644 --- a/spring-mybatis/pom.xml +++ b/spring-mybatis/pom.xml @@ -1,69 +1,69 @@ - 4.0.0 - com.baeldung - spring-mybatis - jar - 0.0.1-SNAPSHOT - spring-mybatis Maven Webapp - http://maven.apache.org + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung + spring-mybatis + jar + 0.0.1-SNAPSHOT + spring-mybatis Maven Webapp + http://maven.apache.org - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - - - - - org.mybatis - mybatis - 3.1.1 - - - org.mybatis - mybatis-spring - 1.1.1 - - - org.springframework - spring-context-support - 3.1.1.RELEASE - - - org.springframework - spring-test - 3.1.1.RELEASE - test - - - mysql - mysql-connector-java - 5.1.40 - - - javax.servlet - jstl - 1.2 - - - org.springframework - spring-webmvc - 3.2.4.RELEASE - - - javax.servlet - servlet-api - 2.5 - - - junit - junit - 3.8.1 - test - - - - spring-mybatis - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + + + org.mybatis + mybatis + 3.1.1 + + + org.mybatis + mybatis-spring + 1.1.1 + + + org.springframework + spring-context-support + 3.1.1.RELEASE + + + org.springframework + spring-test + 3.1.1.RELEASE + test + + + mysql + mysql-connector-java + 5.1.40 + + + javax.servlet + jstl + 1.2 + + + org.springframework + spring-webmvc + 3.2.4.RELEASE + + + javax.servlet + servlet-api + 2.5 + + + junit + junit + 3.8.1 + test + + + + spring-mybatis + diff --git a/spring-protobuf/pom.xml b/spring-protobuf/pom.xml index 1771c3e1f2..5081634d9b 100644 --- a/spring-protobuf/pom.xml +++ b/spring-protobuf/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-protobuf @@ -46,46 +46,10 @@ org.springframework.boot spring-boot-maven-plugin - - true - - - - - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - + + true + + + + diff --git a/spring-quartz/pom.xml b/spring-quartz/pom.xml index 78beab6e38..435e571180 100644 --- a/spring-quartz/pom.xml +++ b/spring-quartz/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -51,7 +51,7 @@ true - + \ No newline at end of file diff --git a/spring-reactor/pom.xml b/spring-reactor/pom.xml index 1a19d9c6d9..1098f8b60d 100644 --- a/spring-reactor/pom.xml +++ b/spring-reactor/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.baeldung spring-reactor @@ -40,7 +40,7 @@ - + spring-releases diff --git a/spring-remoting/remoting-amqp/pom.xml b/spring-remoting/remoting-amqp/pom.xml index 6a7d0804dc..3ada2337ee 100644 --- a/spring-remoting/remoting-amqp/pom.xml +++ b/spring-remoting/remoting-amqp/pom.xml @@ -11,7 +11,6 @@ pom - remoting-amqp remoting-amqp-server diff --git a/spring-remoting/remoting-http/pom.xml b/spring-remoting/remoting-http/pom.xml index 117d4ec295..439f6782ba 100644 --- a/spring-remoting/remoting-http/pom.xml +++ b/spring-remoting/remoting-http/pom.xml @@ -11,8 +11,8 @@ spring-remoting-http Parent for all modules related to HTTP Spring Remoting. pom - - server + + server client api diff --git a/spring-remoting/spring-remoting-rmi/remoting-rmi-server/pom.xml b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/pom.xml index 5ce3f7f949..f1633e5dc2 100644 --- a/spring-remoting/spring-remoting-rmi/remoting-rmi-server/pom.xml +++ b/spring-remoting/spring-remoting-rmi/remoting-rmi-server/pom.xml @@ -16,16 +16,16 @@ - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + com.baeldung api diff --git a/spring-rest-angular/pom.xml b/spring-rest-angular/pom.xml index 255aa840e7..7f3c21801c 100644 --- a/spring-rest-angular/pom.xml +++ b/spring-rest-angular/pom.xml @@ -73,42 +73,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - **/*UnitTest.java - - - - - - - json - - - - - - - - 19.0 3.5 diff --git a/spring-rest-embedded-tomcat/pom.xml b/spring-rest-embedded-tomcat/pom.xml index 51ac995f00..97fc3274af 100644 --- a/spring-rest-embedded-tomcat/pom.xml +++ b/spring-rest-embedded-tomcat/pom.xml @@ -1,78 +1,78 @@ - 4.0.0 - org.baeldung.embedded - SpringRestTomcat - 0.0.1-SNAPSHOT - - spring-rest-embedded-tomcat - war - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + org.baeldung.embedded + SpringRestTomcat + 0.0.1-SNAPSHOT + + spring-rest-embedded-tomcat + war + com.baeldung parent-modules 1.0.0-SNAPSHOT - - - junit - junit - ${junit.version} - test - + + + junit + junit + ${junit.version} + test + - - org.springframework - spring-core - ${spring.version} - - - org.springframework - spring-webmvc - ${spring.version} - + + org.springframework + spring-core + ${spring.version} + + + org.springframework + spring-webmvc + ${spring.version} + - - javax.servlet - javax.servlet-api - 4.0.0 - + + javax.servlet + javax.servlet-api + 4.0.0 + - - com.fasterxml.jackson.core - jackson-databind - ${jackson.library} - + + com.fasterxml.jackson.core + jackson-databind + ${jackson.library} + - - org.apache.tomcat.embed - tomcat-embed-core - 9.0.1 - test - - - - org.apache.tomcat - tomcat-jasper - 9.0.1 - test - + + org.apache.tomcat.embed + tomcat-embed-core + 9.0.1 + test + - - org.apache.httpcomponents - httpclient - 4.5.3 - + + org.apache.tomcat + tomcat-jasper + 9.0.1 + test + - - org.apache.httpcomponents - httpcore - 4.4.8 - + + org.apache.httpcomponents + httpclient + 4.5.3 + - + + org.apache.httpcomponents + httpcore + 4.4.8 + - - spring-rest-embedded-tomcat + + + + spring-rest-embedded-tomcat org.apache.maven.plugins @@ -91,16 +91,16 @@ - + - - 5.0.2.RELEASE + + 5.0.2.RELEASE 2.19.1 - 4.12 - 2.9.2 - 1.8 - 1.8 - false - + 4.12 + 2.9.2 + 1.8 + 1.8 + false + \ No newline at end of file diff --git a/spring-rest-full/pom.xml b/spring-rest-full/pom.xml index 3bd7ec07f6..fd2c485eaf 100644 --- a/spring-rest-full/pom.xml +++ b/spring-rest-full/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-rest-full @@ -270,39 +270,6 @@ - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - live diff --git a/spring-rest-query-language/pom.xml b/spring-rest-query-language/pom.xml index b329bec07e..d20a97268b 100644 --- a/spring-rest-query-language/pom.xml +++ b/spring-rest-query-language/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-rest-query-language @@ -289,39 +289,6 @@ - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - live diff --git a/spring-rest-simple/pom.xml b/spring-rest-simple/pom.xml index ac74534328..1c6c6e1044 100644 --- a/spring-rest-simple/pom.xml +++ b/spring-rest-simple/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-rest-simple @@ -184,12 +184,12 @@ kryo ${kryo.version} - - - com.jayway.jsonpath - json-path - - + + + com.jayway.jsonpath + json-path + + @@ -364,8 +364,8 @@ 3.4.1 - - 2.2.0 + + 2.2.0 diff --git a/spring-rest/pom.xml b/spring-rest/pom.xml index ebf174fb50..58d974cdba 100644 --- a/spring-rest/pom.xml +++ b/spring-rest/pom.xml @@ -1,367 +1,359 @@ - 4.0.0 - com.baeldung - spring-rest - 0.1-SNAPSHOT - spring-rest - war + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + spring-rest + 0.1-SNAPSHOT + spring-rest + war - - parent-boot-5 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-5 - + + spring-boot-starter-parent + org.springframework.boot + 2.0.1.RELEASE + - + - + - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-devtools - - - org.springframework.boot - spring-boot-test - + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-devtools + + + org.springframework.boot + spring-boot-starter-test + - + - - org.springframework - spring-web - - - commons-logging - commons-logging - - - - - org.springframework - spring-webmvc - - - org.springframework - spring-oxm - + + org.springframework + spring-web + + + commons-logging + commons-logging + + + + + org.springframework + spring-webmvc + + + org.springframework + spring-oxm + - - commons-fileupload - commons-fileupload - ${commons-fileupload.version} - - + + commons-fileupload + commons-fileupload + ${commons-fileupload.version} + + - - javax.servlet - javax.servlet-api - provided - + + javax.servlet + javax.servlet-api + provided + - - javax.servlet - jstl - runtime - + + javax.servlet + jstl + runtime + - + - - com.fasterxml.jackson.core - jackson-databind - + + com.fasterxml.jackson.core + jackson-databind + - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + - - com.thoughtworks.xstream - xstream - ${xstream.version} - + + com.thoughtworks.xstream + xstream + ${xstream.version} + - + - - com.google.guava - guava - ${guava.version} - + + com.google.guava + guava + ${guava.version} + - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + - + - - com.squareup.okhttp3 - okhttp - ${com.squareup.okhttp3.version} - + + com.squareup.okhttp3 + okhttp + ${com.squareup.okhttp3.version} + - + - - org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library - test - + + org.hamcrest + hamcrest-core + test + + + org.hamcrest + hamcrest-library + test + - - org.mockito - mockito-core - test - + + org.mockito + mockito-core + test + - - org.springframework - spring-test - + + org.springframework + spring-test + - - - com.google.protobuf - protobuf-java - ${protobuf-java.version} - - - com.googlecode.protobuf-java-format - protobuf-java-format - ${protobuf-java-format.version} - + + + com.google.protobuf + protobuf-java + ${protobuf-java.version} + + + com.googlecode.protobuf-java-format + protobuf-java-format + ${protobuf-java-format.version} + - - com.esotericsoftware - kryo - ${kryo.version} - + + com.esotericsoftware + kryo + ${kryo.version} + - - com.jayway.jsonpath - json-path - + + com.jayway.jsonpath + json-path + - - - commons-io - commons-io - 2.4 - - + + + commons-io + commons-io + 2.4 + + au.com.dius pact-jvm-provider-junit_2.11 ${pact.version} + + + io.rest-assured + rest-assured + ${rest-assured.version} + - + - - spring-rest - - - src/main/resources - true - - + + spring-rest + + + src/main/resources + true + + - - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - org.apache.maven.plugins - maven-war-plugin - + + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + org.apache.maven.plugins + maven-war-plugin + - - org.codehaus.cargo - cargo-maven2-plugin - ${cargo-maven2-plugin.version} - - - tomcat8x - embedded - - - - - - - 8082 - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle-maven-plugin.version} - - checkstyle.xml - - - - - check - - - - + + org.codehaus.cargo + cargo-maven2-plugin + ${cargo-maven2-plugin.version} + + + tomcat8x + embedded + + + + + + + 8082 + + + + - + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle-maven-plugin.version} + + checkstyle.xml + + + + + check + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 3 + true + + **/*IntegrationTest.java + **/*LongRunningUnitTest.java + **/*ManualTest.java + **/*LiveTest.java + + + + - + - + + + live + + + + org.codehaus.cargo + cargo-maven2-plugin + + + start-server + pre-integration-test + + start + + + + stop-server + post-integration-test + + stop + + + + - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - none - - - **/*IntegrationTest.java - **/*UnitTest.java - - - - - + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + none + + + **/*LiveTest.java + + + cargo + + + + + - - - + + + - - live - - - - org.codehaus.cargo - cargo-maven2-plugin - - - start-server - pre-integration-test - - start - - - - stop-server - post-integration-test - - stop - - - - + - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - none - - - **/*LiveTest.java - - - cargo - - - - - + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${checkstyle-maven-plugin.version} + + checkstyle.xml + + + + - - - + + 1.3.2 + 4.0.0 + 1.4 + 3.1.0 + 3.5 + 1.4.9 - + + 20.0 - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${checkstyle-maven-plugin.version} - - checkstyle.xml - - - - + + 1.6.0 + 3.0.4 + 3.0.0 + false + + 3.4.1 - - 1.3.2 - 4.0.0 - 1.4 - 3.1.0 - 3.5 - 1.4.9 + 2.2.0 - - 20.0 - - - 1.6.0 - 3.0.4 - 3.0.0 - false - - 3.4.1 - - 2.2.0 - - 3.5.11 - + 3.5.11 + 3.1.0 + diff --git a/spring-rest/src/main/java/com/baeldung/custom/CustomApplication.java b/spring-rest/src/main/java/com/baeldung/custom/CustomApplication.java new file mode 100644 index 0000000000..75f4d714e2 --- /dev/null +++ b/spring-rest/src/main/java/com/baeldung/custom/CustomApplication.java @@ -0,0 +1,17 @@ +package com.baeldung.custom; + +import java.util.Collections; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class CustomApplication { + + public static void main(String[] args) { + SpringApplication app = new SpringApplication(CustomApplication.class); + app.setDefaultProperties(Collections.singletonMap("server.port", "8083")); + app.run(args); + } + +} \ No newline at end of file diff --git a/spring-rest/src/main/java/com/baeldung/custom/ServerPortCustomizer.java b/spring-rest/src/main/java/com/baeldung/custom/ServerPortCustomizer.java new file mode 100644 index 0000000000..978e7c8a82 --- /dev/null +++ b/spring-rest/src/main/java/com/baeldung/custom/ServerPortCustomizer.java @@ -0,0 +1,15 @@ +package com.baeldung.custom; + +import org.springframework.boot.web.server.ConfigurableWebServerFactory; +import org.springframework.boot.web.server.WebServerFactoryCustomizer; +import org.springframework.stereotype.Component; + +//@Component +public class ServerPortCustomizer implements WebServerFactoryCustomizer { + + @Override + public void customize(ConfigurableWebServerFactory factory) { + factory.setPort(8086); + } + +} \ No newline at end of file diff --git a/spring-rest/src/main/java/com/baeldung/web/log/app/Application.java b/spring-rest/src/main/java/com/baeldung/web/log/app/Application.java index 41042008ef..e9d451b55e 100644 --- a/spring-rest/src/main/java/com/baeldung/web/log/app/Application.java +++ b/spring-rest/src/main/java/com/baeldung/web/log/app/Application.java @@ -3,8 +3,8 @@ package com.baeldung.web.log.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.support.SpringBootServletInitializer; import org.springframework.context.annotation.ComponentScan; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; @EnableAutoConfiguration @ComponentScan("com.baeldung.web.log") diff --git a/spring-rest/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java b/spring-rest/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java index 7de88d44a8..b1ddf16dfe 100644 --- a/spring-rest/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java +++ b/spring-rest/src/main/java/com/baeldung/web/log/controller/TaxiFareController.java @@ -5,11 +5,9 @@ import javax.validation.Valid; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; 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.ResponseBody; import com.baeldung.web.log.data.RateCard; import com.baeldung.web.log.data.TaxiRide; diff --git a/spring-rest/src/main/java/org/baeldung/config/MainApplication.java b/spring-rest/src/main/java/org/baeldung/config/MainApplication.java index 36b021a537..6a7fdc041a 100644 --- a/spring-rest/src/main/java/org/baeldung/config/MainApplication.java +++ b/spring-rest/src/main/java/org/baeldung/config/MainApplication.java @@ -3,11 +3,11 @@ package org.baeldung.config; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @EnableAutoConfiguration @ComponentScan("org.baeldung") -public class MainApplication extends WebMvcConfigurerAdapter { +public class MainApplication implements WebMvcConfigurer { public static void main(final String[] args) { SpringApplication.run(MainApplication.class, args); diff --git a/spring-rest/src/main/java/org/baeldung/config/WebConfig.java b/spring-rest/src/main/java/org/baeldung/config/WebConfig.java index f42c3cb283..5a6f906204 100644 --- a/spring-rest/src/main/java/org/baeldung/config/WebConfig.java +++ b/spring-rest/src/main/java/org/baeldung/config/WebConfig.java @@ -3,7 +3,7 @@ package org.baeldung.config; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; /* * Please note that main web configuration is in src/main/webapp/WEB-INF/api-servlet.xml @@ -11,7 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter @Configuration @EnableWebMvc @ComponentScan({ "org.baeldung.web" }) -public class WebConfig extends WebMvcConfigurerAdapter { +public class WebConfig implements WebMvcConfigurer { public WebConfig() { super(); diff --git a/spring-rest/src/main/resources/application.properties b/spring-rest/src/main/resources/application.properties index 300589f561..dd7e4e2f2d 100644 --- a/spring-rest/src/main/resources/application.properties +++ b/spring-rest/src/main/resources/application.properties @@ -1,2 +1,2 @@ server.port= 8082 -server.context-path=/spring-rest \ No newline at end of file +server.servlet.context-path=/spring-rest \ No newline at end of file diff --git a/spring-rest/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java b/spring-rest/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java index a26801429e..a8a71c7d73 100644 --- a/spring-rest/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java +++ b/spring-rest/src/test/java/org/baeldung/client/TestRestTemplateBasicLiveTest.java @@ -19,14 +19,14 @@ import static org.junit.Assert.assertTrue; public class TestRestTemplateBasicLiveTest { - private RestTemplate restTemplate; + private RestTemplateBuilder restTemplate; private static final String FOO_RESOURCE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest/foos"; private static final String URL_SECURED_BY_AUTHENTICATION = "http://httpbin.org/basic-auth/user/passwd"; private static final String BASE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest"; @Before public void beforeTest() { - restTemplate = new RestTemplate(); + restTemplate = new RestTemplateBuilder(); } // GET diff --git a/spring-rest/src/test/java/org/baeldung/pact/PactProviderTest.java b/spring-rest/src/test/java/org/baeldung/pact/PactProviderLiveTest.java similarity index 97% rename from spring-rest/src/test/java/org/baeldung/pact/PactProviderTest.java rename to spring-rest/src/test/java/org/baeldung/pact/PactProviderLiveTest.java index 0456b0d3e7..f020fb88db 100644 --- a/spring-rest/src/test/java/org/baeldung/pact/PactProviderTest.java +++ b/spring-rest/src/test/java/org/baeldung/pact/PactProviderLiveTest.java @@ -17,7 +17,7 @@ import au.com.dius.pact.provider.junit.target.TestTarget; @RunWith(PactRunner.class) @Provider("test_provider") @PactFolder("pacts") -public class PactProviderTest { +public class PactProviderLiveTest { @TestTarget public final Target target = new HttpTarget("http", "localhost", 8082, "/spring-rest"); diff --git a/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.0 b/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.0 index f0a4a9d3fd..bc64f40e5d 100644 --- a/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.0 +++ b/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.0 @@ -8,7 +8,7 @@ Content-Length: 1759 Connection: keep-alive Accept-Ranges: bytes Server: nginx/1.10.0 (Ubuntu) -Date: Fri, 23 Jun 2017 15:44:52 GMT +Date: Sat, 28 Apr 2018 20:53:35 GMT Last-Modified: Tue, 27 May 2014 02:35:47 GMT ETag: "5383fa03-6df" OkHttp-Sent-Millis: 1489054646765 diff --git a/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.0 b/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.0 index c202030c3f..bbd34c75f6 100644 --- a/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.0 +++ b/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.0 @@ -4,10 +4,10 @@ GET HTTP/1.1 301 Moved Permanently 8 Server: nginx/1.10.0 (Ubuntu) -Date: Sat, 24 Jun 2017 01:06:43 GMT +Date: Sat, 28 Apr 2018 20:53:33 GMT Content-Type: text/html Content-Length: 194 Connection: keep-alive Location: https://publicobject.com/helloworld.txt -OkHttp-Sent-Millis: 1498266403462 -OkHttp-Received-Millis: 1498266403727 +OkHttp-Sent-Millis: 1524948815122 +OkHttp-Received-Millis: 1524948815342 diff --git a/spring-rest/src/test/resources/cache/journal b/spring-rest/src/test/resources/cache/journal index 4640ee324c..eed030a85d 100644 --- a/spring-rest/src/test/resources/cache/journal +++ b/spring-rest/src/test/resources/cache/journal @@ -61,3 +61,9 @@ READ 2d9345a30d2cc31bb3091d70a8ef6c18 READ 4b217e04ba52215f3a6b64d28f6729c6 DIRTY 4b217e04ba52215f3a6b64d28f6729c6 CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 +READ 4b217e04ba52215f3a6b64d28f6729c6 +DIRTY 4b217e04ba52215f3a6b64d28f6729c6 +CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 +READ 2d9345a30d2cc31bb3091d70a8ef6c18 +DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18 +CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759 diff --git a/spring-roo/pom.xml b/spring-roo/pom.xml index acc03953d0..5827aba7af 100644 --- a/spring-roo/pom.xml +++ b/spring-roo/pom.xml @@ -1,139 +1,139 @@ - - - io.spring.platform - platform-bom - Athens-RELEASE - - - 4.0.0 - com.baeldung - roo - 1.0.0.BUILD-SNAPSHOT - roo + + + io.spring.platform + platform-bom + Athens-RELEASE + + + 4.0.0 + com.baeldung + roo + 1.0.0.BUILD-SNAPSHOT + roo - jar + jar - - 2.0.0.RC1 - 8 - UTF-8 - 1.8 - 1.5.4 - 1.4.1.RELEASE - 1.8 - 1.2.0.RC1 - 1.1.2 - 3.0.0.RELEASE - 2.0.0 - 2.0.1 - 5.0.11 - 1.0 - 3.3.6 - 1.10.12 - 1.10.11 - 1.1.2 - 1.1.2 - 2.0.2 - 2.0.2 - 1.1.2 - 1.1.2 - 1.1.2 - 2.0.0 - 2.5.4 - 4.6.2 - 1.12.3 - 3.3.1 - 1.15.0 - 2.13.0 - 4.0.3 - 0.1.0-beta.7 - 1.4.2 - 3.7.3 - 1.0.3 + + 2.0.0.RC1 + 8 + UTF-8 + 1.8 + 1.5.4 + 1.4.1.RELEASE + 1.8 + 1.2.0.RC1 + 1.1.2 + 3.0.0.RELEASE + 2.0.0 + 2.0.1 + 5.0.11 + 1.0 + 3.3.6 + 1.10.12 + 1.10.11 + 1.1.2 + 1.1.2 + 2.0.2 + 2.0.2 + 1.1.2 + 1.1.2 + 1.1.2 + 2.0.0 + 2.5.4 + 4.6.2 + 1.12.3 + 3.3.1 + 1.15.0 + 2.13.0 + 4.0.3 + 0.1.0-beta.7 + 1.4.2 + 3.7.3 + 1.0.3 - - - - maven-snapshot-repository - Maven Snapshot Repository - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - spring-roo-repository - Spring Roo Repository - http://repo.spring.io/spring-roo - - + + + + maven-snapshot-repository + Maven Snapshot Repository + https://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + + + + spring-roo-repository + Spring Roo Repository + http://repo.spring.io/spring-roo + + - - + + - - - org.springframework.roo - org.springframework.roo.annotations - ${roo.version} - pom - provided - + + + org.springframework.roo + org.springframework.roo.annotations + ${roo.version} + pom + provided + - + io.springlets springlets-data-jpa ${springlets.version} - + io.springlets springlets-data-commons ${springlets.version} - + io.springlets springlets-context ${springlets.version} - + org.springframework.roo org.springframework.roo.querydsl.processor 2.0.0.RELEASE - + io.tracee.binding tracee-springmvc ${tracee.version} - + io.springlets springlets-boot-starter-web ${springlets.version} - + com.github.mxab.thymeleaf.extras thymeleaf-extras-data-attribute ${thymeleaf-data-dialect.version} - + ar.com.fdvs DynamicJasper ${dynamicjasper.version} - + ar.com.fdvs DynamicJasper-core-fonts ${dynamicjasper-fonts.version} - + org.webjars.bower bootstrap ${bootstrap.version} @@ -260,54 +260,54 @@ ${bootstrap.ie10-viewport-bug-workaround.version} - + - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-test - test - + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-test + test + - - org.springframework.boot - spring-boot-devtools - true - + + org.springframework.boot + spring-boot-devtools + true + - - - org.springframework.roo - org.springframework.roo.annotations - pom - + + + org.springframework.roo + org.springframework.roo.annotations + pom + - - - org.aspectj - aspectjrt - + + + org.aspectj + aspectjrt + - - - org.apache.commons - commons-lang3 - + + + org.apache.commons + commons-lang3 + - - - org.assertj - assertj-core - + + + org.assertj + assertj-core + - + - + org.springframework.boot spring-boot-starter-data-jpa @@ -321,75 +321,75 @@ hsqldb provided - + io.springlets springlets-data-jpa - + io.springlets springlets-data-commons - + io.springlets springlets-context - + javax.validation validation-api - + com.querydsl querydsl-jpa - + org.springframework.roo org.springframework.roo.querydsl.processor - + org.springframework.boot spring-boot-starter-web - + joda-time joda-time - + io.tracee.binding tracee-springmvc - + io.springlets springlets-boot-starter-web - + org.springframework.boot spring-boot-starter-thymeleaf - + nz.net.ultraq.thymeleaf thymeleaf-layout-dialect - + com.github.mxab.thymeleaf.extras thymeleaf-extras-data-attribute - + ar.com.fdvs DynamicJasper - + ar.com.fdvs DynamicJasper-core-fonts - + org.apache.poi poi - + org.springframework spring-context-support - + org.webjars webjars-locator @@ -483,109 +483,109 @@ - + - - - - org.springframework.boot - spring-boot-maven-plugin - - ${start-class} - exec - true - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - ${java.version} - ${java.version} - ${project.build.sourceEncoding} - false - - - - - org.codehaus.mojo - aspectj-maven-plugin - ${aspectj.plugin.version} - - ${java.version} - ${java.version} - ignore - ${java.version} - UTF-8 - - - - process-sources - - compile - test-compile - - - - - - org.aspectj - aspectjtools - ${aspectj.version} - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*_Roo_* - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - --base-dir ${project.basedir} - --attribute - "projectName=${project.name}" - --attribute - "projectVersion=${project.version}" - --attribute "doctype=book" - - - ${project.groupId}:* - - org.asciidoctor.Asciidoclet - - org.asciidoctor - asciidoclet - ${asciidoclet.version} - - true - true - - http://docs.oracle.com/javase/${java.version}/docs/api/ - http://docs.oracle.com/javaee/${java.product.version}/api/ - http://docs.spring.io/spring-framework/docs/${spring.version}/javadoc-api/ - http://docs.spring.io/spring-boot/docs/${spring-boot.version}/api/ - http://fasterxml.github.io/jackson-core/javadoc/2.8/ - http://fasterxml.github.io/jackson-databind/javadoc/2.8 - http://cxf.apache.org/javadoc/latest-3.1.x/ - - src/main/java/overview.adoc - private - ${java.version} - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + ${start-class} + exec + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + ${java.version} + ${java.version} + ${project.build.sourceEncoding} + false + + + + + org.codehaus.mojo + aspectj-maven-plugin + ${aspectj.plugin.version} + + ${java.version} + ${java.version} + ignore + ${java.version} + UTF-8 + + + + process-sources + + compile + test-compile + + + + + + org.aspectj + aspectjtools + ${aspectj.version} + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*_Roo_* + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + --base-dir ${project.basedir} + --attribute + "projectName=${project.name}" + --attribute + "projectVersion=${project.version}" + --attribute "doctype=book" + + + ${project.groupId}:* + + org.asciidoctor.Asciidoclet + + org.asciidoctor + asciidoclet + ${asciidoclet.version} + + true + true + + http://docs.oracle.com/javase/${java.version}/docs/api/ + http://docs.oracle.com/javaee/${java.product.version}/api/ + http://docs.spring.io/spring-framework/docs/${spring.version}/javadoc-api/ + http://docs.spring.io/spring-boot/docs/${spring-boot.version}/api/ + http://fasterxml.github.io/jackson-core/javadoc/2.8/ + http://fasterxml.github.io/jackson-databind/javadoc/2.8 + http://cxf.apache.org/javadoc/latest-3.1.x/ + + src/main/java/overview.adoc + private + ${java.version} + + + com.mysema.maven apt-maven-plugin 1.1.3 @@ -595,12 +595,12 @@ process - target/generated-sources/java - - org.springframework.roo.querydsl.processor.RooAnnotationProcessor - - - + target/generated-sources/java + + org.springframework.roo.querydsl.processor.RooAnnotationProcessor + + + @@ -612,34 +612,34 @@ - + - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.codehaus.mojo - aspectj-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.codehaus.mojo + aspectj-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + + org.apache.maven.plugins + maven-javadoc-plugin + + com.mysema.maven apt-maven-plugin - + diff --git a/spring-security-acl/pom.xml b/spring-security-acl/pom.xml index a19a54dd88..7ddbf66365 100644 --- a/spring-security-acl/pom.xml +++ b/spring-security-acl/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-security-acl @@ -42,22 +42,22 @@ - org.springframework.security - spring-security-acl - - - org.springframework.security - spring-security-config - - - org.springframework - spring-context-support - - - net.sf.ehcache - ehcache-core - 2.6.11 - jar + org.springframework.security + spring-security-acl + + + org.springframework.security + spring-security-config + + + org.springframework + spring-context-support + + + net.sf.ehcache + ehcache-core + 2.6.11 + jar diff --git a/spring-security-cache-control/pom.xml b/spring-security-cache-control/pom.xml index 4ccb83c29b..890ff5bd3f 100644 --- a/spring-security-cache-control/pom.xml +++ b/spring-security-cache-control/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-security-client/spring-security-jsp-authentication/pom.xml b/spring-security-client/spring-security-jsp-authentication/pom.xml index 2509b26293..9b1ebc6fdc 100644 --- a/spring-security-client/spring-security-jsp-authentication/pom.xml +++ b/spring-security-client/spring-security-jsp-authentication/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-security-client/spring-security-jsp-authorize/pom.xml b/spring-security-client/spring-security-jsp-authorize/pom.xml index bd13520948..ee8c9bacbd 100644 --- a/spring-security-client/spring-security-jsp-authorize/pom.xml +++ b/spring-security-client/spring-security-jsp-authorize/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-security-client/spring-security-jsp-config/pom.xml b/spring-security-client/spring-security-jsp-config/pom.xml index 0a4c8fb5be..0ec72c3527 100644 --- a/spring-security-client/spring-security-jsp-config/pom.xml +++ b/spring-security-client/spring-security-jsp-config/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-security-client/spring-security-mvc/pom.xml b/spring-security-client/spring-security-mvc/pom.xml index c67bc336f6..a6c3065cc8 100644 --- a/spring-security-client/spring-security-mvc/pom.xml +++ b/spring-security-client/spring-security-mvc/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -9,7 +9,7 @@ war spring-security-mvc - Spring Security MVC + Spring Security MVC parent-boot-5 diff --git a/spring-security-client/spring-security-thymeleaf-authentication/pom.xml b/spring-security-client/spring-security-thymeleaf-authentication/pom.xml index e42d499b64..345daa9570 100644 --- a/spring-security-client/spring-security-thymeleaf-authentication/pom.xml +++ b/spring-security-client/spring-security-thymeleaf-authentication/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-security-client/spring-security-thymeleaf-authorize/pom.xml b/spring-security-client/spring-security-thymeleaf-authorize/pom.xml index 5fa2016be8..3e66e9f613 100644 --- a/spring-security-client/spring-security-thymeleaf-authorize/pom.xml +++ b/spring-security-client/spring-security-thymeleaf-authorize/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-security-client/spring-security-thymeleaf-config/pom.xml b/spring-security-client/spring-security-thymeleaf-config/pom.xml index 9a00ad0080..f5d4306754 100644 --- a/spring-security-client/spring-security-thymeleaf-config/pom.xml +++ b/spring-security-client/spring-security-thymeleaf-config/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-security-core/pom.xml b/spring-security-core/pom.xml index db8837df46..27c6741790 100644 --- a/spring-security-core/pom.xml +++ b/spring-security-core/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-core diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-mvc-boot/pom.xml index b717a1366d..bbc701313a 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-mvc-boot/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -121,24 +121,24 @@ jstl-api ${jstl.version} - + - org.springframework.security - spring-security-acl - - - org.springframework.security - spring-security-config - - - org.springframework - spring-context-support - - - net.sf.ehcache - ehcache-core - 2.6.11 - jar + org.springframework.security + spring-security-acl + + + org.springframework.security + spring-security-config + + + org.springframework + spring-context-support + + + net.sf.ehcache + ehcache-core + 2.6.11 + jar @@ -169,39 +169,6 @@ - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - live diff --git a/spring-security-mvc-custom/pom.xml b/spring-security-mvc-custom/pom.xml index 805792b795..2ca383bdab 100644 --- a/spring-security-mvc-custom/pom.xml +++ b/spring-security-mvc-custom/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-mvc-custom @@ -119,33 +119,33 @@ jackson-databind ${jackson-databind.version} - + org.apache.commons commons-lang3 ${commons-lang3.version} - + com.google.guava guava ${guava.version} - + - + org.springframework spring-test - ${org.springframework.version} + ${org.springframework.version} test org.springframework.security spring-security-test - ${org.springframework.security.version} - test + ${org.springframework.security.version} + test @@ -209,7 +209,7 @@ 19.0 3.5 2.9.1 - + 4.5.2 4.4.5 diff --git a/spring-security-mvc-digest-auth/pom.xml b/spring-security-mvc-digest-auth/pom.xml index 202d98da54..8ea270cc9d 100644 --- a/spring-security-mvc-digest-auth/pom.xml +++ b/spring-security-mvc-digest-auth/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-mvc-digest-auth diff --git a/spring-security-mvc-ldap/pom.xml b/spring-security-mvc-ldap/pom.xml index 4b0b9525e4..286b189d87 100644 --- a/spring-security-mvc-ldap/pom.xml +++ b/spring-security-mvc-ldap/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-mvc-ldap diff --git a/spring-security-mvc-login/pom.xml b/spring-security-mvc-login/pom.xml index 27e7239ee6..e391bdfb60 100644 --- a/spring-security-mvc-login/pom.xml +++ b/spring-security-mvc-login/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-mvc-login diff --git a/spring-security-mvc-persisted-remember-me/pom.xml b/spring-security-mvc-persisted-remember-me/pom.xml index 0bb654d96a..e5c5e78bd4 100644 --- a/spring-security-mvc-persisted-remember-me/pom.xml +++ b/spring-security-mvc-persisted-remember-me/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-mvc-persisted-remember-me diff --git a/spring-security-mvc-session/pom.xml b/spring-security-mvc-session/pom.xml index 413a0c67ba..995f089d37 100644 --- a/spring-security-mvc-session/pom.xml +++ b/spring-security-mvc-session/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-mvc-session diff --git a/spring-security-mvc-socket/pom.xml b/spring-security-mvc-socket/pom.xml index 1bc295a778..931528811a 100644 --- a/spring-security-mvc-socket/pom.xml +++ b/spring-security-mvc-socket/pom.xml @@ -4,20 +4,16 @@ 4.0.0 com.baeldung.springsecuredsockets spring-security-mvc-socket + 1.0.0 + spring-security-mvc-socket war - + + com.baeldung parent-modules 1.0.0-SNAPSHOT - 1.0.0 - spring-security-mvc-socket - - 4.3.8.RELEASE - 4.2.3.RELEASE - 2.8.7 - 1.7.25 - + @@ -70,17 +66,17 @@ org.springframework.data spring-data-jpa - 1.11.3.RELEASE + ${spring-data-jpa.version} org.hibernate hibernate-core - 5.2.10.Final + ${hibernate-core.version} com.h2database h2 - 1.4.196 + ${h2database.version} @@ -109,29 +105,29 @@ ch.qos.logback logback-classic - 1.2.3 + ${logback-classic.version} javax.servlet javax.servlet-api - 3.1.0 + ${javax.servlet-api.version} javax.servlet.jsp.jstl jstl-api - 1.2 + ${jstl-api.version} javax.servlet.jsp javax.servlet.jsp-api - 2.3.1 + ${javax.servlet.jsp-api.version} javax.servlet jstl - 1.2 + ${jstl.version} @@ -154,14 +150,6 @@ - - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - org.apache.tomcat.maven tomcat7-maven-plugin @@ -183,4 +171,16 @@ spring-security-mvc-socket + + + 4.3.8.RELEASE + 4.2.3.RELEASE + 2.8.7 + 1.7.25 + 5.2.10.Final + 1.11.3.RELEASE + 1.4.196 + 1.2.3 + + \ No newline at end of file diff --git a/spring-security-openid/pom.xml b/spring-security-openid/pom.xml index a3942a8423..89e0977c05 100644 --- a/spring-security-openid/pom.xml +++ b/spring-security-openid/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung @@ -11,12 +11,12 @@ spring-security-openid Spring OpenID sample project - - org.springframework.boot - spring-boot-starter-parent - 2.0.0.M7 - - + + org.springframework.boot + spring-boot-starter-parent + 2.0.0.M7 + + @@ -36,19 +36,19 @@ org.springframework.security.oauth spring-security-oauth2 - 2.2.1.RELEASE + ${spring-security-oauth2.version} org.springframework.security spring-security-jwt - 1.0.9.RELEASE + ${spring-security-jwt.version} - + com.auth0 jwks-rsa - 0.3.0 + ${jwks-rsa.version} @@ -73,4 +73,10 @@ + + 2.2.1.RELEASE + 1.0.9.RELEASE + 0.3.0 + + diff --git a/spring-security-rest-basic-auth/pom.xml b/spring-security-rest-basic-auth/pom.xml index 3039b10040..bfa8c1c7b9 100644 --- a/spring-security-rest-basic-auth/pom.xml +++ b/spring-security-rest-basic-auth/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-rest-basic-auth diff --git a/spring-security-rest-custom/pom.xml b/spring-security-rest-custom/pom.xml index 746ddb6615..cfa3ad4b99 100644 --- a/spring-security-rest-custom/pom.xml +++ b/spring-security-rest-custom/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-rest-custom @@ -78,7 +78,7 @@ commons-logging ${commons-logging.version} - + @@ -159,10 +159,10 @@ org.springframework.boot spring-boot-maven-plugin - - true - - + + true + + org.apache.maven.plugins maven-war-plugin diff --git a/spring-security-rest/pom.xml b/spring-security-rest/pom.xml index e4bb071a6a..242b104c4a 100644 --- a/spring-security-rest/pom.xml +++ b/spring-security-rest/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-security-rest @@ -28,7 +28,7 @@ spring-security-config ${org.springframework.security.version} - + diff --git a/spring-security-sso/pom.xml b/spring-security-sso/pom.xml index 7438cede16..938636ff18 100644 --- a/spring-security-sso/pom.xml +++ b/spring-security-sso/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung spring-security-sso @@ -20,7 +20,7 @@ spring-security-sso-ui spring-security-sso-ui-2 - + 3.0.1 diff --git a/spring-security-sso/spring-security-sso-auth-server/pom.xml b/spring-security-sso/spring-security-sso-auth-server/pom.xml index c7b23249f9..0d0086beb0 100644 --- a/spring-security-sso/spring-security-sso-auth-server/pom.xml +++ b/spring-security-sso/spring-security-sso-auth-server/pom.xml @@ -17,7 +17,7 @@ org.springframework.boot spring-boot-starter-web - + org.springframework.security.oauth spring-security-oauth2 diff --git a/spring-security-sso/spring-security-sso-ui-2/pom.xml b/spring-security-sso/spring-security-sso-ui-2/pom.xml index 6a8dc5385b..a2323a044d 100644 --- a/spring-security-sso/spring-security-sso-ui-2/pom.xml +++ b/spring-security-sso/spring-security-sso-ui-2/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-security-sso-ui-2 @@ -23,12 +23,12 @@ org.springframework.boot spring-boot-starter-security - + org.springframework.security.oauth spring-security-oauth2 - + org.springframework.boot spring-boot-starter-thymeleaf diff --git a/spring-security-sso/spring-security-sso-ui/pom.xml b/spring-security-sso/spring-security-sso-ui/pom.xml index fe1cd56a76..dbb167b61c 100644 --- a/spring-security-sso/spring-security-sso-ui/pom.xml +++ b/spring-security-sso/spring-security-sso-ui/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-security-sso-ui @@ -23,12 +23,12 @@ org.springframework.boot spring-boot-starter-security - + org.springframework.security.oauth spring-security-oauth2 - + org.springframework.boot spring-boot-starter-thymeleaf diff --git a/spring-security-stormpath/pom.xml b/spring-security-stormpath/pom.xml index 060f8a553d..17973165ea 100644 --- a/spring-security-stormpath/pom.xml +++ b/spring-security-stormpath/pom.xml @@ -1,12 +1,19 @@ - 4.0.0 - com.baeldung - spring-security-stormpath - war - 1.0-SNAPSHOT - spring-security-stormpath - http://maven.apache.org + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung + spring-security-stormpath + war + 1.0-SNAPSHOT + spring-security-stormpath + http://maven.apache.org + + + parent-boot-5 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-5 + @@ -17,19 +24,6 @@ - - UTF-8 - UTF-8 - 1.8 - - - - parent-boot-5 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-5 - - org.springframework.boot @@ -58,21 +52,27 @@ - - org.springframework.boot - spring-boot-maven-plugin - - true - - - - - repackage - - - - - - + + org.springframework.boot + spring-boot-maven-plugin + + true + + + + + repackage + + + + + + + + + UTF-8 + UTF-8 + 1.8 + diff --git a/spring-security-thymeleaf/pom.xml b/spring-security-thymeleaf/pom.xml index f40aabcf8b..aa36e5f59a 100644 --- a/spring-security-thymeleaf/pom.xml +++ b/spring-security-thymeleaf/pom.xml @@ -1,66 +1,64 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + spring-security-thymeleaf + 0.0.1-SNAPSHOT + jar + spring-security-thymeleaf + Spring Security with Thymeleaf tutorial - com.baeldung - spring-security-thymeleaf - 0.0.1-SNAPSHOT - jar + + parent-boot-5 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-5 + - spring-security-thymeleaf - Spring Security with Thymeleaf tutorial + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-web + - - parent-boot-5 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-5 - + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + org.thymeleaf.extras + thymeleaf-extras-springsecurity4 + + - - UTF-8 - UTF-8 - 1.8 - + + + + org.springframework.boot + spring-boot-maven-plugin + + + - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.security - spring-security-test - test - - - org.thymeleaf.extras - thymeleaf-extras-springsecurity4 - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + UTF-8 + UTF-8 + 1.8 + diff --git a/spring-security-x509/pom.xml b/spring-security-x509/pom.xml index 6225f73ebc..89fed39920 100644 --- a/spring-security-x509/pom.xml +++ b/spring-security-x509/pom.xml @@ -1,19 +1,13 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-security-x509 0.0.1-SNAPSHOT pom - - spring-security-x509-basic-auth - spring-security-x509-client-auth - - parent-boot-5 com.baeldung @@ -21,6 +15,11 @@ ../parent-boot-5 + + spring-security-x509-basic-auth + spring-security-x509-client-auth + + org.springframework.boot @@ -35,5 +34,5 @@ spring-boot-starter-thymeleaf - + diff --git a/spring-security-x509/spring-security-x509-basic-auth/pom.xml b/spring-security-x509/spring-security-x509-basic-auth/pom.xml index e46629f44d..67a7e29e6f 100644 --- a/spring-security-x509/spring-security-x509-basic-auth/pom.xml +++ b/spring-security-x509/spring-security-x509-basic-auth/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 basic-secured-server @@ -37,39 +37,4 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - diff --git a/spring-security-x509/spring-security-x509-client-auth/pom.xml b/spring-security-x509/spring-security-x509-client-auth/pom.xml index ac8cd0adca..7dd919973d 100644 --- a/spring-security-x509/spring-security-x509-client-auth/pom.xml +++ b/spring-security-x509/spring-security-x509-client-auth/pom.xml @@ -1,7 +1,7 @@ + xmlns="http://maven.apache.org/POM/4.0.0" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 client-auth-server diff --git a/spring-session/pom.xml b/spring-session/pom.xml index b62d814665..c1c872ca74 100644 --- a/spring-session/pom.xml +++ b/spring-session/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - spring-session 1.0.0-SNAPSHOT jar diff --git a/spring-sleuth/pom.xml b/spring-sleuth/pom.xml index 1a5c8b9cda..2fee474dbe 100644 --- a/spring-sleuth/pom.xml +++ b/spring-sleuth/pom.xml @@ -1,37 +1,18 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - - 1.8 - 1.8 - - - - parent-boot-5 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-5 - - - com.baeldung spring-sleuth 1.0.0-SNAPSHOT jar - - - - spring-milestones - Spring Milestones - https://repo.spring.io/libs-milestone - - false - - - + + parent-boot-5 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-5 + @@ -45,15 +26,30 @@ - - - org.springframework.cloud - spring-cloud-sleuth - 2.0.0.M7 - pom - import - - - + + + org.springframework.cloud + spring-cloud-sleuth + ${spring-cloud-sleuth.version} + pom + import + + + + + + + spring-milestones + Spring Milestones + https://repo.spring.io/libs-milestone + + false + + + + + + 2.0.0.M7 + diff --git a/spring-social-login/pom.xml b/spring-social-login/pom.xml index 50e2abfbfc..d2e9497bcf 100644 --- a/spring-social-login/pom.xml +++ b/spring-social-login/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-social-login - spring-social-login war @@ -95,41 +94,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 3.3.2 diff --git a/spring-spel/pom.xml b/spring-spel/pom.xml index 4262482617..8e805ed6ac 100644 --- a/spring-spel/pom.xml +++ b/spring-spel/pom.xml @@ -1,8 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spel 1.0-SNAPSHOT @@ -13,10 +12,6 @@ 1.0.0-SNAPSHOT - - 4.3.4.RELEASE - - org.springframework @@ -31,38 +26,8 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + + 4.3.4.RELEASE + + \ No newline at end of file diff --git a/spring-state-machine/pom.xml b/spring-state-machine/pom.xml index 79d2db8e57..2755b6e45a 100644 --- a/spring-state-machine/pom.xml +++ b/spring-state-machine/pom.xml @@ -1,34 +1,38 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-state-machine + parent-modules com.baeldung 1.0.0-SNAPSHOT - 4.0.0 - - spring-state-machine org.springframework.statemachine spring-statemachine-core - 1.2.3.RELEASE + ${spring-statemachine-core.version} org.springframework spring-test - 4.3.7.RELEASE + ${spring-test.version} - com.jayway.awaitility awaitility - 1.7.0 + ${jayway.awaitility.version} test - + + 1.2.3.RELEASE + 4.3.7.RELEASE + 1.7.0 + + \ No newline at end of file diff --git a/spring-swagger-codegen/pom.xml b/spring-swagger-codegen/pom.xml index dfb5d8419a..09b7b61156 100644 --- a/spring-swagger-codegen/pom.xml +++ b/spring-swagger-codegen/pom.xml @@ -1,17 +1,20 @@ - 4.0.0 - com.baeldung - spring-swagger-codegen - 0.0.1-SNAPSHOT - pom - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + spring-swagger-codegen + 0.0.1-SNAPSHOT + pom + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - spring-swagger-codegen-api-client - spring-swagger-codegen-app - + + + spring-swagger-codegen-api-client + spring-swagger-codegen-app + + diff --git a/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml index 61df37ad57..f0f58b86b8 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml @@ -1,248 +1,239 @@ - 4.0.0 - com.baeldung - spring-swagger-codegen-api-client - jar - spring-swagger-codegen-api-client - 0.0.1-SNAPSHOT - https://github.com/swagger-api/swagger-codegen - Swagger Java - - com.baeldung - spring-swagger-codegen - 0.0.1-SNAPSHOT - - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung + spring-swagger-codegen-api-client + jar + spring-swagger-codegen-api-client + 0.0.1-SNAPSHOT https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - + Swagger Java + + com.baeldung + spring-swagger-codegen + 0.0.1-SNAPSHOT + + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - + + + Unlicense + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - add_sources - generate-sources - - add-source - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - - - - - sign-artifacts - + - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + - - - + - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - org.springframework - spring-web - ${spring-web-version} - - - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 4.3.9.RELEASE - 2.8.9 - 2.9.9 - 1.0.0 - 4.12 - + + + org.springframework + spring-web + ${spring-web-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 4.3.9.RELEASE + 2.8.9 + 2.9.9 + 1.0.0 + 4.12 + diff --git a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml index b7b898237f..c9e0f5e27f 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung diff --git a/spring-thymeleaf/README.md b/spring-thymeleaf/README.md index 2c37e73ada..9210186a98 100644 --- a/spring-thymeleaf/README.md +++ b/spring-thymeleaf/README.md @@ -10,6 +10,8 @@ - [Spring MVC + Thymeleaf 3.0: New Features](http://www.baeldung.com/spring-thymeleaf-3) - [How to Work with Dates in Thymeleaef](http://www.baeldung.com/dates-in-thymeleaf) - [How to Create an Executable JAR with Maven](http://www.baeldung.com/executable-jar-with-maven) +- [Working with Booleans in Thymeleaf](http://www.baeldung.com/working-with-booleans-in-thymeleaf) +- [Working with Fragments in Thymeleaf](http://www.baeldung.com/spring-thymeleaf-fragments) ### Build the Project @@ -22,11 +24,12 @@ mvn cargo:run Access the pages using the URLs: -http://localhost:8082/spring-thymeleaf/ -http://localhost:8082/spring-thymeleaf/addStudent/ -http://localhost:8082/spring-thymeleaf/listStudents/ + - http://localhost:8082/spring-thymeleaf/ + - http://localhost:8082/spring-thymeleaf/addStudent/ + - http://localhost:8082/spring-thymeleaf/listStudents/ + - http://localhost:8082/spring-thymeleaf/booleans/ -The first URL is the home page of the application. The home page has links to the other two pages. +The first URL is the home page of the application. The home page has links to the second and third pages. ### Security The user/password required is: user1/user1Pass diff --git a/spring-thymeleaf/pom.xml b/spring-thymeleaf/pom.xml index 5ce2a4b637..d13356b3d7 100644 --- a/spring-thymeleaf/pom.xml +++ b/spring-thymeleaf/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-thymeleaf @@ -12,27 +12,6 @@ 1.0.0-SNAPSHOT - - 1.8 - - 4.3.4.RELEASE - 4.2.0.RELEASE - 3.1.0 - - 3.0.9.RELEASE - 3.0.0.RELEASE - 2.1.2 - - 1.1.0.Final - 5.3.3.Final - 5.2.5.Final - - - 2.6 - 1.6.1 - 2.2 - - @@ -173,38 +152,25 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - + + 1.8 + + 4.3.4.RELEASE + 4.2.0.RELEASE + 3.1.0 + + 3.0.9.RELEASE + 3.0.0.RELEASE + 2.1.2 + + 1.1.0.Final + 5.3.3.Final + 5.2.5.Final + + + 2.6 + 1.6.1 + 2.2 + + \ No newline at end of file diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BooleanExpressionsController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BooleanExpressionsController.java new file mode 100644 index 0000000000..3a640e1499 --- /dev/null +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/BooleanExpressionsController.java @@ -0,0 +1,45 @@ +package com.baeldung.thymeleaf.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * Controller to test boolean expressions + * + */ +@Controller +public class BooleanExpressionsController { + + @RequestMapping(value = "/booleans", method = RequestMethod.GET) + public String getDates(Model model) { + // "truthy" values + model.addAttribute("trueValue", true); + model.addAttribute("one", 1); + model.addAttribute("nonZeroCharacter", 'a'); + model.addAttribute("emptyString", ""); + model.addAttribute("foo", "foo"); + model.addAttribute("object", new Object()); + model.addAttribute("arrayOfZeros", new Integer[] { 0, 0 }); + model.addAttribute("arrayOfZeroAndOne", new Integer[] { 0, 1 }); + model.addAttribute("arrayOfOnes", new Integer[] { 1, 1 }); + + // "falsy" values + model.addAttribute("nullValue", null); + model.addAttribute("falseValue", false); + model.addAttribute("zero", 0); + model.addAttribute("zeroCharacter", '\0'); + model.addAttribute("falseString", "false"); + model.addAttribute("no", "no"); + model.addAttribute("off", "off"); + + model.addAttribute("isRaining", true); + model.addAttribute("isSunny", true); + model.addAttribute("isCold", false); + model.addAttribute("isWarm", true); + + return "booleans.html"; + } + +} diff --git a/spring-thymeleaf/src/main/webapp/WEB-INF/views/booleans.html b/spring-thymeleaf/src/main/webapp/WEB-INF/views/booleans.html new file mode 100644 index 0000000000..63d894421b --- /dev/null +++ b/spring-thymeleaf/src/main/webapp/WEB-INF/views/booleans.html @@ -0,0 +1,179 @@ + + + + +Expression utility objects + + + +

'Truthy' and 'falsy' expressions

+
    +
  • 'true' is evaluated to
  • +
  • '1' is evaluated to
  • +
  • non zero character is evaluated to
  • +
  • empty string is evaluated to
  • +
  • the string "foo" is evaluated to
  • +
  • an object is evaluated to
  • +
  • the array [0, 0] is evaluated to
  • +
  • the array [0, 1] is evaluated to
  • +
  • the array [1, 1] is evaluated to
  • + +
  • null value is evaluated to
  • +
  • 'false' is evaluated to
  • +
  • '0' is evaluated to
  • +
  • zero character is evaluated to
  • +
  • the string "false" is evaluated to
  • +
  • the string "no" is evaluated to
  • +
  • the string "off" is evaluated to
  • +
+ +

Using booleans as rendering conditions

+ + + + + + + + + + + + + + + + +
th:ifth:unless
truewill be renderedwon't be rendered
falsewon't be renderedwill be rendered
+ +

Boolean and conditional operators

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AB${A or B}${A} or ${B}${A and B}${A} and ${B}${!A}!${A}${not A}not ${A}
truetrue
truefalse
falsetrue
falsefalse
+ +
    +
  • the result of "true ? 'then'" is
  • +
  • the result of "false ? 'then'" is
  • +
  • the result of "true ? 'then' : 'else'" is
  • +
  • the result of "false ? 'then' : 'else'" is
  • +
  • the result of "'foo' ?: 'bar'" is
  • +
  • the result of "null ?: 'bar'" is
  • +
  • the result of "0 ?: 'bar'" is
  • +
  • the result of "1 ?: 'bar'" is
  • +
+ +
    +
  • The weather is bad
  • +
  • The weather is bad
  • +
  • The weather is good
  • +
  • The weather is good
  • +
  • It's warm
  • +
  • It's warm
  • +
  • It's warm
  • +
  • It's warm
  • +
  • It's
  • +
  • +
+ +

#bools utility object

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Array#bools.arrayIsTrue()#bools.arrayIsFalse()#bools.arrayAnd()#bools.arrayOr()
[0, 0]
[0, 1]
[1, 1]
+ + \ No newline at end of file diff --git a/spring-thymeleaf/src/main/webapp/WEB-INF/views/listStudents.html b/spring-thymeleaf/src/main/webapp/WEB-INF/views/listStudents.html index 4e281bb27f..8bc606f332 100644 --- a/spring-thymeleaf/src/main/webapp/WEB-INF/views/listStudents.html +++ b/spring-thymeleaf/src/main/webapp/WEB-INF/views/listStudents.html @@ -22,15 +22,23 @@ + + + + - + - + + + + + diff --git a/spring-userservice/pom.xml b/spring-userservice/pom.xml index 72a4f0edac..9cbc3d7ed2 100644 --- a/spring-userservice/pom.xml +++ b/spring-userservice/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-userservice spring-userservice @@ -213,41 +213,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 4.2.0.RELEASE diff --git a/spring-vertx/pom.xml b/spring-vertx/pom.xml index 2b26d939a5..0d535f79e4 100644 --- a/spring-vertx/pom.xml +++ b/spring-vertx/pom.xml @@ -2,12 +2,10 @@ 4.0.0 - com.baeldung vertx-spring 0.0.1-SNAPSHOT jar - spring-vertx A demo project with vertx spring integration @@ -19,13 +17,6 @@ - - UTF-8 - UTF-8 - 1.8 - 3.4.1 - - org.springframework.boot @@ -86,5 +77,11 @@ + + UTF-8 + UTF-8 + 1.8 + 3.4.1 + diff --git a/spring-zuul/pom.xml b/spring-zuul/pom.xml index ca9cbc765d..b1036c9a8a 100644 --- a/spring-zuul/pom.xml +++ b/spring-zuul/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-zuul 1.0.0-SNAPSHOT - spring-zuul pom diff --git a/spring-zuul/spring-zuul-foos-resource/pom.xml b/spring-zuul/spring-zuul-foos-resource/pom.xml index 68c3df683d..58274c523a 100644 --- a/spring-zuul/spring-zuul-foos-resource/pom.xml +++ b/spring-zuul/spring-zuul-foos-resource/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-zuul-foos-resource spring-zuul-foos-resource diff --git a/spring-zuul/spring-zuul-ui/pom.xml b/spring-zuul/spring-zuul-ui/pom.xml index 8bd09cf74f..42c18a46c7 100644 --- a/spring-zuul/spring-zuul-ui/pom.xml +++ b/spring-zuul/spring-zuul-ui/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-zuul-ui @@ -13,7 +13,6 @@ - org.springframework.cloud diff --git a/static-analysis/README.md b/static-analysis/README.md index 74cc64b90d..e4d4bc7bfc 100644 --- a/static-analysis/README.md +++ b/static-analysis/README.md @@ -1,3 +1,4 @@ ## Relevant articles: - [Introduction to PMD](http://www.baeldung.com/pmd) +- [Java Static Analysis Tools in Eclipse and IntelliJ IDEA](http://www.baeldung.com/java-static-analysis-tools) diff --git a/static-analysis/pom.xml b/static-analysis/pom.xml index 3540938026..93d071714e 100644 --- a/static-analysis/pom.xml +++ b/static-analysis/pom.xml @@ -3,7 +3,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung static-analysis 1.0-SNAPSHOT @@ -12,11 +11,8 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - - + + diff --git a/stripe/pom.xml b/stripe/pom.xml index 7823a1827f..b6dae6e680 100644 --- a/stripe/pom.xml +++ b/stripe/pom.xml @@ -2,12 +2,10 @@ 4.0.0 - com.baeldung.stripe stripe 0.0.1-SNAPSHOT jar - Stripe Demo project for Stripe API diff --git a/struts-2/pom.xml b/struts-2/pom.xml index 8ccd9529bd..44cb6dae3d 100644 --- a/struts-2/pom.xml +++ b/struts-2/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung struts diff --git a/testing-modules/gatling/pom.xml b/testing-modules/gatling/pom.xml index e15eb34954..10df52835a 100644 --- a/testing-modules/gatling/pom.xml +++ b/testing-modules/gatling/pom.xml @@ -1,11 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung gatling 1.0-SNAPSHOT - + com.baeldung parent-modules 1.0.0-SNAPSHOT @@ -105,7 +105,9 @@ test - execute + + execute + diff --git a/testing-modules/groovy-spock/pom.xml b/testing-modules/groovy-spock/pom.xml index 3d67657224..84b27187eb 100644 --- a/testing-modules/groovy-spock/pom.xml +++ b/testing-modules/groovy-spock/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 org.spockframework groovy-spock @@ -8,11 +8,6 @@ jar Spock Framework - Example Project - - UTF-8 - UTF-8 - - com.baeldung parent-modules @@ -25,7 +20,7 @@ org.codehaus.gmavenplus gmavenplus-plugin - 1.5 + ${gmavenplus-plugin.version} @@ -42,13 +37,22 @@ org.spockframework spock-core - 1.0-groovy-2.4 + ${spock-core.version} test org.codehaus.groovy groovy-all - 2.4.7 + ${groovy-all.version} + + + UTF-8 + UTF-8 + 1.0-groovy-2.4 + 2.4.7 + 1.5 + + \ No newline at end of file diff --git a/testing-modules/junit-5/README.md b/testing-modules/junit-5/README.md index 85e628668a..0a9dccf666 100644 --- a/testing-modules/junit-5/README.md +++ b/testing-modules/junit-5/README.md @@ -11,4 +11,4 @@ - [JUnit 5 @Test Annotation](http://www.baeldung.com/junit-5-test-annotation) - [JUnit Assert an Exception is Thrown](http://www.baeldung.com/junit-assert-exception) - [@Before vs @BeforeClass vs @BeforeEach vs @BeforeAll](http://www.baeldung.com/junit-before-beforeclass-beforeeach-beforeall) - +- [Migrating from JUnit 4 to JUnit 5](http://www.baeldung.com/junit-5-migration) diff --git a/testing-modules/junit-5/pom.xml b/testing-modules/junit-5/pom.xml index 28a29d8545..dd1486be1d 100644 --- a/testing-modules/junit-5/pom.xml +++ b/testing-modules/junit-5/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 @@ -9,12 +9,12 @@ junit-5 Intro to JUnit 5 - + com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ @@ -41,14 +41,6 @@ - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - - maven-surefire-plugin ${maven-surefire-plugin.version} @@ -107,7 +99,7 @@ h2 ${h2.version} - + junit junit ${junit4.version} @@ -124,7 +116,7 @@ spring-context ${spring.version} - + - + diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index 2d119ae8af..f51919858f 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/pom.xml @@ -1,6 +1,5 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung mockito-2 @@ -15,41 +14,6 @@ ../../ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - UTF-8 diff --git a/testing-modules/mockito/pom.xml b/testing-modules/mockito/pom.xml index d9478d5bd1..3ba9fd0385 100644 --- a/testing-modules/mockito/pom.xml +++ b/testing-modules/mockito/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung mockito 0.1-SNAPSHOT - mockito diff --git a/testing-modules/mocks/README.md b/testing-modules/mocks/README.md index d7b817c518..fe8e197061 100644 --- a/testing-modules/mocks/README.md +++ b/testing-modules/mocks/README.md @@ -4,3 +4,5 @@ - [A Guide to JMockit Expectations](http://www.baeldung.com/jmockit-expectations) - [JMockit 101](http://www.baeldung.com/jmockit-101) - [Mockito vs EasyMock vs JMockit](http://www.baeldung.com/mockito-vs-easymock-vs-jmockit) +- [EasyMock Argument Matchers](http://www.baeldung.com/easymock-argument-matchers) + diff --git a/testing-modules/mocks/jmockit/pom.xml b/testing-modules/mocks/jmockit/pom.xml index d998cb6918..0ce0818ca3 100644 --- a/testing-modules/mocks/jmockit/pom.xml +++ b/testing-modules/mocks/jmockit/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 diff --git a/testing-modules/mocks/mock-comparisons/pom.xml b/testing-modules/mocks/mock-comparisons/pom.xml index 5c1d5d31cd..9328639ad8 100644 --- a/testing-modules/mocks/mock-comparisons/pom.xml +++ b/testing-modules/mocks/mock-comparisons/pom.xml @@ -1,6 +1,8 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + mock-comparisons + mock-comparisons com.baeldung @@ -9,19 +11,7 @@ ../ - mock-comparisons - mock-comparisons - - - 2.9.0 - 3.5.1 - 1.34 - - UTF-8 - - - org.mockito mockito-core @@ -55,4 +45,11 @@ + + 2.9.0 + 3.5.1 + 1.34 + UTF-8 + + \ No newline at end of file diff --git a/testing-modules/mocks/mock-comparisons/src/main/java/com/baeldung/easymock/IUserService.java b/testing-modules/mocks/mock-comparisons/src/main/java/com/baeldung/easymock/IUserService.java index 4bb74abb64..96609bdf9d 100644 --- a/testing-modules/mocks/mock-comparisons/src/main/java/com/baeldung/easymock/IUserService.java +++ b/testing-modules/mocks/mock-comparisons/src/main/java/com/baeldung/easymock/IUserService.java @@ -4,8 +4,6 @@ import java.util.List; public interface IUserService { public boolean addUser(User user); - public List findByFirstName(String firstName); - public List findByLastName(String lastName); + public List findByEmail(String email); public List findByAge(double age); - public List findByEmail(String email); } diff --git a/testing-modules/mocks/mock-comparisons/src/test/java/com/baeldung/easymock/ArgumentMatchersUnitTest.java b/testing-modules/mocks/mock-comparisons/src/test/java/com/baeldung/easymock/ArgumentMatchersUnitTest.java index 6d4f4c09f5..6205def27b 100644 --- a/testing-modules/mocks/mock-comparisons/src/test/java/com/baeldung/easymock/ArgumentMatchersUnitTest.java +++ b/testing-modules/mocks/mock-comparisons/src/test/java/com/baeldung/easymock/ArgumentMatchersUnitTest.java @@ -60,11 +60,11 @@ public class ArgumentMatchersUnitTest { //============= anyX @Test - public void givenUserService_whenSearchForUserByFirstName_thenFound() { - expect(userService.findByFirstName(anyString())).andReturn(Collections.emptyList()); + public void givenUserService_whenSearchForUserByEmail_thenFound() { + expect(userService.findByEmail(anyString())).andReturn(Collections.emptyList()); replay(userService); - List result = userService.findByFirstName("joe"); + List result = userService.findByEmail("test@example.com"); verify(userService); assertEquals(0,result.size()); } @@ -191,21 +191,21 @@ public class ArgumentMatchersUnitTest { //================ custom matcher @Test - public void givenUserService_whenSearchForUserByLastName_thenFound() { - expect(userService.findByLastName(charCount(3))).andReturn(Collections.emptyList()); + public void givenUserService_whenSearchForUserByEmailCharCount_thenFound() { + expect(userService.findByEmail(minCharCount(5))).andReturn(Collections.emptyList()); replay(userService); - List result = userService.findByLastName("doe"); + List result = userService.findByEmail("test@example.com"); verify(userService); assertEquals(0,result.size()); } - public static String charCount(int value){ + public static String minCharCount(int value){ EasyMock.reportMatcher(new IArgumentMatcher() { @Override public boolean matches(Object argument) { return argument instanceof String - && ((String) argument).length() == value; + && ((String) argument).length() >= value; } @Override diff --git a/testing-modules/mocks/pom.xml b/testing-modules/mocks/pom.xml index 6473f07c13..b005164413 100644 --- a/testing-modules/mocks/pom.xml +++ b/testing-modules/mocks/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 diff --git a/testing-modules/mockserver/pom.xml b/testing-modules/mockserver/pom.xml index 8d3e97f129..96c86a23d7 100644 --- a/testing-modules/mockserver/pom.xml +++ b/testing-modules/mockserver/pom.xml @@ -3,14 +3,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung mockserver 1.0.0-SNAPSHOT - - 3.10.8 - 4.4.1 - + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + @@ -35,20 +37,11 @@ httpcore ${apche-http-version} - - - - - maven-surefire-plugin - 2.20 - - - **/**LiveTest.java - - - - - + + 3.10.8 + 4.4.1 + + \ No newline at end of file diff --git a/testing-modules/rest-assured/pom.xml b/testing-modules/rest-assured/pom.xml index 1006e9a373..dc577b647b 100644 --- a/testing-modules/rest-assured/pom.xml +++ b/testing-modules/rest-assured/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.baeldung rest-assured @@ -176,43 +176,6 @@ - - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - - 2.8.5 1.8 diff --git a/testing-modules/rest-testing/pom.xml b/testing-modules/rest-testing/pom.xml index ea63ee0e58..f9866496a4 100644 --- a/testing-modules/rest-testing/pom.xml +++ b/testing-modules/rest-testing/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung rest-testing @@ -11,7 +11,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ @@ -115,42 +115,6 @@ - - - integration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*UnitTest.java - **/*LiveTest.java - - - **/*IntegrationTest.java - - - - - - - json - - - - - - - - 2.8.5 diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index 418dd495a4..194871b58e 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung selenium-junit-testng @@ -9,7 +9,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../ diff --git a/testing-modules/testing/pom.xml b/testing-modules/testing/pom.xml index 91792a4681..ecef105b01 100644 --- a/testing-modules/testing/pom.xml +++ b/testing-modules/testing/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung testing @@ -64,7 +64,7 @@ ${pitest.version} pom - + com.google.truth truth @@ -87,7 +87,7 @@ jgotesting ${jgotesting.version} test - + org.jukito jukito diff --git a/testing-modules/testng/pom.xml b/testing-modules/testng/pom.xml index 7aed1837e5..e50f3bb563 100644 --- a/testing-modules/testng/pom.xml +++ b/testing-modules/testng/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 testng 0.1.0-SNAPSHOT diff --git a/undertow/pom.xml b/undertow/pom.xml index 7d45404824..35ea2b3348 100644 --- a/undertow/pom.xml +++ b/undertow/pom.xml @@ -1,57 +1,57 @@ - 4.0.0 - com.baeldung.undertow - undertow - jar - 1.0-SNAPSHOT - undertow - http://maven.apache.org - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung.undertow + undertow + jar + 1.0-SNAPSHOT + undertow + http://maven.apache.org + com.baeldung parent-modules 1.0.0-SNAPSHOT - - 1.8 - 1.8 - + + 1.8 + 1.8 + - - - io.undertow - undertow-servlet - 1.4.18.Final - - + + + io.undertow + undertow-servlet + 1.4.18.Final + + - - ${project.artifactId} - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - com.baeldung.undertow.SimpleServer - - - - - - + + ${project.artifactId} + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + com.baeldung.undertow.SimpleServer + + + + + + \ No newline at end of file diff --git a/vaadin/pom.xml b/vaadin/pom.xml index 114656a692..6fdf033c22 100644 --- a/vaadin/pom.xml +++ b/vaadin/pom.xml @@ -1,177 +1,177 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - org.test - vaadin-app - war - 1.0-SNAPSHOT - vaadin-app + org.test + vaadin-app + war + 1.0-SNAPSHOT + vaadin-app - - 3 - - + + 3 + + com.baeldung parent-modules 1.0.0-SNAPSHOT - - 7.7.10 - 8.0.6 - 9.3.9.v20160517 - UTF-8 - 1.8 - 1.8 - local + + 7.7.10 + 8.0.6 + 9.3.9.v20160517 + UTF-8 + 1.8 + 1.8 + local mytheme - + - - - vaadin-addons - http://maven.vaadin.com/vaadin-addons - - + + + vaadin-addons + http://maven.vaadin.com/vaadin-addons + + - - - - com.vaadin - vaadin-bom - ${vaadin.version} - pom - import - - - + + + + com.vaadin + vaadin-bom + ${vaadin.version} + pom + import + + + - - - javax.servlet - javax.servlet-api - 3.0.1 - provided - - - com.vaadin - vaadin-server - - - com.vaadin - vaadin-push - - - com.vaadin - vaadin-client-compiled - - - com.vaadin - vaadin-themes - - + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + com.vaadin + vaadin-server + + + com.vaadin + vaadin-push + + + com.vaadin + vaadin-client-compiled + + + com.vaadin + vaadin-themes + + - - - - org.apache.maven.plugins - maven-war-plugin - 3.0.0 - - false - - WEB-INF/classes/VAADIN/widgetsets/WEB-INF/** - - - - com.vaadin - vaadin-maven-plugin - ${vaadin.plugin.version} - - - - update-theme - update-widgetset - compile - - compile-theme - - - - - - org.apache.maven.plugins - maven-clean-plugin - 3.0.0 - - - - - src/main/webapp/VAADIN/themes - - **/styles.css - **/styles.scss.cache - - - - - + + + + org.apache.maven.plugins + maven-war-plugin + 3.0.0 + + false + + WEB-INF/classes/VAADIN/widgetsets/WEB-INF/** + + + + com.vaadin + vaadin-maven-plugin + ${vaadin.plugin.version} + + + + update-theme + update-widgetset + compile + + compile-theme + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + + + + src/main/webapp/VAADIN/themes + + **/styles.css + **/styles.scss.cache + + + + + - - - org.eclipse.jetty - jetty-maven-plugin - ${jetty.plugin.version} - - 2 - - - - + + + org.eclipse.jetty + jetty-maven-plugin + ${jetty.plugin.version} + + 2 + + + + - - - - vaadin-prerelease - - false - + + + + vaadin-prerelease + + false + - - - vaadin-prereleases - http://maven.vaadin.com/vaadin-prereleases - - - vaadin-snapshots - https://oss.sonatype.org/content/repositories/vaadin-snapshots/ - - false - - - true - - - - - - vaadin-prereleases - http://maven.vaadin.com/vaadin-prereleases - - - vaadin-snapshots - https://oss.sonatype.org/content/repositories/vaadin-snapshots/ - - false - - - true - - - - - + + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + vaadin-snapshots + https://oss.sonatype.org/content/repositories/vaadin-snapshots/ + + false + + + true + + + + + + vaadin-prereleases + http://maven.vaadin.com/vaadin-prereleases + + + vaadin-snapshots + https://oss.sonatype.org/content/repositories/vaadin-snapshots/ + + false + + + true + + + + + diff --git a/vavr/README.md b/vavr/README.md index 373f897486..4bef25b625 100644 --- a/vavr/README.md +++ b/vavr/README.md @@ -1,8 +1,8 @@ ### Relevant Articles: -- [Introduction to Vavr](http://www.baeldung.com/javaslang) -- [Guide to Try in Vavr](http://www.baeldung.com/javaslang-try) -- [Guide to Pattern Matching in Vavr](http://www.baeldung.com/javaslang-pattern-matching) -- [Property Testing Example With Vavr](http://www.baeldung.com/javaslang-property-testing) +- [Introduction to Vavr](http://www.baeldung.com/vavr) +- [Guide to Try in Vavr](http://www.baeldung.com/vavr-try) +- [Guide to Pattern Matching in Vavr](http://www.baeldung.com/vavr-pattern-matching) +- [Property Testing Example With Vavr](http://www.baeldung.com/vavr-property-testing) - [Exceptions in Lambda Expression Using Vavr](http://www.baeldung.com/exceptions-using-vavr) - [Vavr (ex-Javaslang) Support in Spring Data](http://www.baeldung.com/spring-vavr) - [Introduction to Vavr’s Validation API](http://www.baeldung.com/vavr-validation-api) diff --git a/vavr/pom.xml b/vavr/pom.xml index 28747af3ee..411748afdf 100644 --- a/vavr/pom.xml +++ b/vavr/pom.xml @@ -5,7 +5,7 @@ 1.0 vavr - + parent-boot-5 com.baeldung 0.0.1-SNAPSHOT @@ -66,27 +66,6 @@ - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 3 - true - - **/*IntegrationTest.java - **/*LongRunningUnitTest.java - **/*ManualTest.java - **/JdbcTest.java - **/*LiveTest.java - - - - - - 1.8 0.9.1 diff --git a/vertx-and-rxjava/pom.xml b/vertx-and-rxjava/pom.xml index 067b88c410..b0668c34a6 100644 --- a/vertx-and-rxjava/pom.xml +++ b/vertx-and-rxjava/pom.xml @@ -17,7 +17,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + 3.7.0 1.8 1.8 diff --git a/vertx/pom.xml b/vertx/pom.xml index 0498c6ad60..b5ca43b1f4 100644 --- a/vertx/pom.xml +++ b/vertx/pom.xml @@ -1,7 +1,7 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung @@ -50,14 +50,14 @@ + implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> io.vertx.core.Starter com.baeldung.SimpleServerVerticle - + ${project.build.directory}/${project.artifactId}-${project.version}-app.jar diff --git a/video-tutorials/jackson-annotations/pom.xml b/video-tutorials/jackson-annotations/pom.xml index e44611fab0..59e14810dd 100644 --- a/video-tutorials/jackson-annotations/pom.xml +++ b/video-tutorials/jackson-annotations/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung jackson-annotations 1.0.0-SNAPSHOT - jacksonannotation @@ -140,7 +139,6 @@ true - @@ -165,12 +163,9 @@ 2.8.9 - 4.4.1 4.5 - 2.9.0 - 3.6.1 2.2.6 3.0.1 diff --git a/video-tutorials/pom.xml b/video-tutorials/pom.xml index a1c01cd5f2..ceabfa6a3b 100644 --- a/video-tutorials/pom.xml +++ b/video-tutorials/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung video-tutorials diff --git a/vraptor/pom.xml b/vraptor/pom.xml index e90f286630..c5978173ab 100644 --- a/vraptor/pom.xml +++ b/vraptor/pom.xml @@ -1,138 +1,129 @@ - 4.0.0 + 4.0.0 - com.baeldung - vraptor - 1.0.0 - war + com.baeldung + vraptor + 1.0.0 + war - A demo project to start using VRaptor 4 - + A demo project to start using VRaptor 4 + com.baeldung parent-modules 1.0.0-SNAPSHOT - - UTF-8 - 2.1.2.Final - + + UTF-8 + 2.1.2.Final + - - - br.com.caelum - vraptor - 4.2.0.Final - + + + br.com.caelum + vraptor + 4.2.0.Final + + + + org.jboss.weld.servlet + weld-servlet-core + 2.1.2.Final + + + org.jboss.spec.javax.el + jboss-el-api_3.0_spec + + + - - org.jboss.weld.servlet - weld-servlet-core - 2.1.2.Final - - - org.jboss.spec.javax.el - jboss-el-api_3.0_spec - - - - org.jboss.weld weld-core-impl 2.1.2.Final - - - org.jboss.spec.javax.el - jboss-el-api_3.0_spec - - + + + org.jboss.spec.javax.el + jboss-el-api_3.0_spec + + - - javax.el - el-api - 2.2 - provided - - - - org.hibernate - hibernate-validator-cdi - 5.1.1.Final - + + javax.el + el-api + 2.2 + provided + - - javax.servlet - jstl - 1.2 - + + org.hibernate + hibernate-validator-cdi + 5.1.1.Final + - - javax.servlet - javax.servlet-api - 3.1.0 - provided - + + javax.servlet + jstl + 1.2 + - - org.slf4j - slf4j-log4j12 - 1.7.5 - + + javax.servlet + javax.servlet-api + 3.1.0 + provided + - - br.com.caelum.vraptor - vraptor-freemarker - 4.1.0-RC3 - + + org.slf4j + slf4j-log4j12 + 1.7.5 + - - br.com.caelum.vraptor - vraptor-hibernate - 4.0.4 - + + br.com.caelum.vraptor + vraptor-freemarker + 4.1.0-RC3 + - - mysql - mysql-connector-java - 8.0.8-dmr - + + br.com.caelum.vraptor + vraptor-hibernate + 4.0.4 + - - org.mindrot - jbcrypt - 0.4 - + + mysql + mysql-connector-java + 8.0.8-dmr + - - org.freemarker - freemarker - 2.3.27-incubating - + + org.mindrot + jbcrypt + 0.4 + - + + org.freemarker + freemarker + 2.3.27-incubating + - - vraptor - src/main/webapp/WEB-INF/classes - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - 1.8 - 1.8 - - - - org.apache.tomcat.maven - tomcat7-maven-plugin - 2.1 - - / - - - - + + + + vraptor + src/main/webapp/WEB-INF/classes + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.1 + + / + + + + diff --git a/wicket/pom.xml b/wicket/pom.xml index 2927e79c48..d3cb319902 100644 --- a/wicket/pom.xml +++ b/wicket/pom.xml @@ -13,8 +13,8 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - - + + 7.5.0 9.2.13.v20150730 diff --git a/xml/pom.xml b/xml/pom.xml index 66c17a4f33..c417ceb15d 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -1,10 +1,9 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung xml 0.1-SNAPSHOT - xml @@ -156,16 +155,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - ${java-version} - ${java-version} - - - org.apache.maven.plugins maven-surefire-plugin @@ -246,8 +235,8 @@ - + maven-assembly-plugin ${project.basedir} @@ -266,10 +255,8 @@ - make-assembly - package + make-assembly + package attached @@ -296,7 +283,6 @@ 1.8 - 1.3.1 diff --git a/xmlunit-2/pom.xml b/xmlunit-2/pom.xml index 591cb70ec8..171f3de03c 100644 --- a/xmlunit-2/pom.xml +++ b/xmlunit-2/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.baeldung xmlunit-2 diff --git a/xstream/pom.xml b/xstream/pom.xml index 5d41bc47b2..b8462ac34d 100644 --- a/xstream/pom.xml +++ b/xstream/pom.xml @@ -11,8 +11,8 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - - + + com.thoughtworks.xstream