diff --git a/README.md b/README.md index 4cad075cc3..5307efa008 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +**UPDATE**: The price of "Learn Spring Security OAuth" will permanently change on the 11th of December, along with the upcoming OAuth2 material: http://bit.ly/github-lss The Courses ============================== diff --git a/akka-http/pom.xml b/akka-http/pom.xml index 6d73f2f2e6..e276ef1aa4 100644 --- a/akka-http/pom.xml +++ b/akka-http/pom.xml @@ -1,47 +1,46 @@ - - + + + 4.0.0 + akka-http + akka-http - 4.0.0 - akka-http - akka-http + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - parent-modules - com.baeldung - 1.0.0-SNAPSHOT - + + + com.typesafe.akka + akka-http_2.12 + ${akka.http.version} + + + com.typesafe.akka + akka-stream_2.12 + ${akka.stream.version} + + + com.typesafe.akka + akka-http-jackson_2.12 + ${akka.http.version} + + + com.typesafe.akka + akka-http-testkit_2.12 + ${akka.http.version} + test + + - - - com.typesafe.akka - akka-http_2.12 - ${akka.http.version} - - - com.typesafe.akka - akka-stream_2.12 - ${akka.stream.version} - - - com.typesafe.akka - akka-http-jackson_2.12 - ${akka.http.version} - - - com.typesafe.akka - akka-http-testkit_2.12 - ${akka.http.version} - test - - + + UTF-8 + UTF-8 + 10.0.11 + 2.5.11 + - - UTF-8 - UTF-8 - 10.0.11 - 2.5.11 - diff --git a/akka-streams/pom.xml b/akka-streams/pom.xml index 7719bb7351..967556d976 100644 --- a/akka-streams/pom.xml +++ b/akka-streams/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 akka-streams akka-streams - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/algorithms-genetic/pom.xml b/algorithms-genetic/pom.xml index 56f6a31525..eeccb89d6f 100644 --- a/algorithms-genetic/pom.xml +++ b/algorithms-genetic/pom.xml @@ -1,10 +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 algorithms-genetic 0.0.1-SNAPSHOT algorithms-genetic - + com.baeldung parent-modules @@ -60,5 +61,4 @@ 1.11 - diff --git a/algorithms-miscellaneous-1/pom.xml b/algorithms-miscellaneous-1/pom.xml index affa66f147..a2183f7474 100644 --- a/algorithms-miscellaneous-1/pom.xml +++ b/algorithms-miscellaneous-1/pom.xml @@ -1,10 +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 algorithms-miscellaneous-1 0.0.1-SNAPSHOT algorithms-miscellaneous-1 - + com.baeldung parent-modules @@ -43,7 +44,7 @@ com.github.dpaukov combinatoricslib3 ${combinatoricslib3.version} - + diff --git a/algorithms-miscellaneous-2/pom.xml b/algorithms-miscellaneous-2/pom.xml index e85dd456a3..e4f4e5c2ea 100644 --- a/algorithms-miscellaneous-2/pom.xml +++ b/algorithms-miscellaneous-2/pom.xml @@ -1,5 +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 algorithms-miscellaneous-2 0.0.1-SNAPSHOT @@ -34,9 +35,9 @@ ${org.jgrapht.core.version} - org.jgrapht - jgrapht-ext - ${org.jgrapht.ext.version} + org.jgrapht + jgrapht-ext + ${org.jgrapht.ext.version} pl.allegro.finance diff --git a/algorithms-miscellaneous-3/pom.xml b/algorithms-miscellaneous-3/pom.xml index 67923d37d7..a893f0a045 100644 --- a/algorithms-miscellaneous-3/pom.xml +++ b/algorithms-miscellaneous-3/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -91,4 +92,5 @@ 1.19 1.19 + \ No newline at end of file diff --git a/algorithms-miscellaneous-4/pom.xml b/algorithms-miscellaneous-4/pom.xml index 8fd8f807ba..682234ad07 100644 --- a/algorithms-miscellaneous-4/pom.xml +++ b/algorithms-miscellaneous-4/pom.xml @@ -1,10 +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 algorithms-miscellaneous-4 0.0.1-SNAPSHOT algorithms-miscellaneous-4 - + com.baeldung parent-modules diff --git a/algorithms-miscellaneous-5/pom.xml b/algorithms-miscellaneous-5/pom.xml index 98a7f33474..2f530958e3 100644 --- a/algorithms-miscellaneous-5/pom.xml +++ b/algorithms-miscellaneous-5/pom.xml @@ -1,5 +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 algorithms-miscellaneous-5 0.0.1-SNAPSHOT diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/maximumsubarray/BruteForceAlgorithm.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/maximumsubarray/BruteForceAlgorithm.java new file mode 100644 index 0000000000..932ded5018 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/maximumsubarray/BruteForceAlgorithm.java @@ -0,0 +1,35 @@ +package com.baeldung.algorithms.maximumsubarray; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class BruteForceAlgorithm { + + private Logger logger = LoggerFactory.getLogger(BruteForceAlgorithm.class.getName()); + + public int maxSubArray(int[] arr) { + + int size = arr.length; + int maximumSubArraySum = Integer.MIN_VALUE; + int start = 0; + int end = 0; + + for (int left = 0; left < size; left++) { + + int runningWindowSum = 0; + + for (int right = left; right < size; right++) { + runningWindowSum += arr[right]; + + if (runningWindowSum > maximumSubArraySum) { + maximumSubArraySum = runningWindowSum; + start = left; + end = right; + } + } + } + logger.info("Found Maximum Subarray between {} and {}", start, end); + return maximumSubArraySum; + } + +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/maximumsubarray/KadaneAlgorithm.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/maximumsubarray/KadaneAlgorithm.java new file mode 100644 index 0000000000..0aaa1b6c23 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/maximumsubarray/KadaneAlgorithm.java @@ -0,0 +1,34 @@ +package com.baeldung.algorithms.maximumsubarray; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class KadaneAlgorithm { + + private Logger logger = LoggerFactory.getLogger(BruteForceAlgorithm.class.getName()); + + public int maxSubArraySum(int[] arr) { + + int size = arr.length; + int start = 0; + int end = 0; + + int maxSoFar = 0, maxEndingHere = 0; + + for (int i = 0; i < size; i++) { + + if (arr[i] > maxEndingHere + arr[i]) { + start = i; + maxEndingHere = arr[i]; + } else + maxEndingHere = maxEndingHere + arr[i]; + + if (maxSoFar < maxEndingHere) { + maxSoFar = maxEndingHere; + end = i; + } + } + logger.info("Found Maximum Subarray between {} and {}", start, end); + return maxSoFar; + } +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/mergesortedarrays/SortedArrays.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/mergesortedarrays/SortedArrays.java new file mode 100644 index 0000000000..5d1c4af650 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/mergesortedarrays/SortedArrays.java @@ -0,0 +1,33 @@ +package com.baeldung.algorithms.mergesortedarrays; + +public class SortedArrays { + + public static int[] merge(int[] foo, int[] bar) { + + int fooLength = foo.length; + int barLength = bar.length; + + int[] merged = new int[fooLength + barLength]; + + int fooPosition, barPosition, mergedPosition; + fooPosition = barPosition = mergedPosition = 0; + + while (fooPosition < fooLength && barPosition < barLength) { + if (foo[fooPosition] < bar[barPosition]) { + merged[mergedPosition++] = foo[fooPosition++]; + } else { + merged[mergedPosition++] = bar[barPosition++]; + } + } + + while (fooPosition < fooLength) { + merged[mergedPosition++] = foo[fooPosition++]; + } + + while (barPosition < barLength) { + merged[mergedPosition++] = bar[barPosition++]; + } + + return merged; + } +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Edge.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Edge.java new file mode 100644 index 0000000000..52ec4ef534 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Edge.java @@ -0,0 +1,36 @@ +package com.baeldung.algorithms.prim; + +public class Edge { + + private int weight; + private boolean isIncluded = false; + private boolean isPrinted = false; + + public Edge(int weight) { + this.weight = weight; + } + + public int getWeight() { + return weight; + } + + public void setWeight(int weight) { + this.weight = weight; + } + + public boolean isIncluded() { + return isIncluded; + } + + public void setIncluded(boolean included) { + isIncluded = included; + } + + public boolean isPrinted() { + return isPrinted; + } + + public void setPrinted(boolean printed) { + isPrinted = printed; + } +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Prim.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Prim.java new file mode 100644 index 0000000000..365dca6b62 --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Prim.java @@ -0,0 +1,73 @@ +package com.baeldung.algorithms.prim; + +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.apache.commons.math3.util.Pair; + +public class Prim { + + private List graph; + + public Prim(List graph){ + this.graph = graph; + } + + public void run(){ + if (graph.size() > 0){ + graph.get(0).setVisited(true); + } + while (isDisconnected()){ + Edge nextMinimum = new Edge(Integer.MAX_VALUE); + Vertex nextVertex = graph.get(0); + for (Vertex vertex : graph){ + if (vertex.isVisited()){ + Pair candidate = vertex.nextMinimum(); + if (candidate.getValue().getWeight() < nextMinimum.getWeight()){ + nextMinimum = candidate.getValue(); + nextVertex = candidate.getKey(); + } + } + } + nextMinimum.setIncluded(true); + nextVertex.setVisited(true); + } + } + + private boolean isDisconnected(){ + for (Vertex vertex : graph){ + if (!vertex.isVisited()){ + return true; + } + } + return false; + } + + public String originalGraphToString(){ + StringBuilder sb = new StringBuilder(); + for (Vertex vertex : graph){ + sb.append(vertex.originalToString()); + } + return sb.toString(); + } + + public void resetPrintHistory(){ + for (Vertex vertex : graph){ + Iterator> it = vertex.getEdges().entrySet().iterator(); + while (it.hasNext()) { + Map.Entry pair = it.next(); + pair.getValue().setPrinted(false); + } + } + } + + public String minimumSpanningTreeToString(){ + StringBuilder sb = new StringBuilder(); + for (Vertex vertex : graph){ + sb.append(vertex.includedToString()); + } + return sb.toString(); + } + +} diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Vertex.java b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Vertex.java new file mode 100644 index 0000000000..982d9331bc --- /dev/null +++ b/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/prim/Vertex.java @@ -0,0 +1,106 @@ +package com.baeldung.algorithms.prim; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.apache.commons.math3.util.Pair; + +public class Vertex { + + private String label = null; + private Map edges = new HashMap<>(); + private boolean isVisited = false; + + public Vertex(String label){ + this.label = label; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Map getEdges() { + return edges; + } + + public void addEdge(Vertex vertex, Edge edge){ + if (this.edges.containsKey(vertex)){ + if (edge.getWeight() < this.edges.get(vertex).getWeight()){ + this.edges.replace(vertex, edge); + } + } else { + this.edges.put(vertex, edge); + } + } + + public boolean isVisited() { + return isVisited; + } + + public void setVisited(boolean visited) { + isVisited = visited; + } + + public Pair nextMinimum(){ + Edge nextMinimum = new Edge(Integer.MAX_VALUE); + Vertex nextVertex = this; + Iterator> it = edges.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry pair = it.next(); + if (!pair.getKey().isVisited()){ + if (!pair.getValue().isIncluded()) { + if (pair.getValue().getWeight() < nextMinimum.getWeight()) { + nextMinimum = pair.getValue(); + nextVertex = pair.getKey(); + } + } + } + } + return new Pair<>(nextVertex, nextMinimum); + } + + public String originalToString(){ + StringBuilder sb = new StringBuilder(); + Iterator> it = edges.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry pair = it.next(); + if (!pair.getValue().isPrinted()) { + sb.append(getLabel()); + sb.append(" --- "); + sb.append(pair.getValue().getWeight()); + sb.append(" --- "); + sb.append(pair.getKey().getLabel()); + sb.append("\n"); + pair.getValue().setPrinted(true); + } + } + return sb.toString(); + } + + public String includedToString(){ + StringBuilder sb = new StringBuilder(); + if (isVisited()) { + Iterator> it = edges.entrySet().iterator(); + while (it.hasNext()) { + Map.Entry pair = it.next(); + if (pair.getValue().isIncluded()) { + if (!pair.getValue().isPrinted()) { + sb.append(getLabel()); + sb.append(" --- "); + sb.append(pair.getValue().getWeight()); + sb.append(" --- "); + sb.append(pair.getKey().getLabel()); + sb.append("\n"); + pair.getValue().setPrinted(true); + } + } + } + } + return sb.toString(); + } +} diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/maximumsubarray/BruteForceAlgorithmUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/maximumsubarray/BruteForceAlgorithmUnitTest.java new file mode 100644 index 0000000000..b818046b2a --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/maximumsubarray/BruteForceAlgorithmUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.algorithms.maximumsubarray; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class BruteForceAlgorithmUnitTest { + + @Test + void givenArrayWithNegativeNumberWhenMaximumSubarrayThenReturns6() { + //given + int[] arr = new int[]{-3, 1, -8, 4, -1, 2, 1, -5, 5}; + //when + BruteForceAlgorithm algorithm = new BruteForceAlgorithm(); + int maximumSum = algorithm.maxSubArray(arr); + //then + assertEquals(6, maximumSum); + } +} \ No newline at end of file diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/maximumsubarray/KadaneAlgorithmUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/maximumsubarray/KadaneAlgorithmUnitTest.java new file mode 100644 index 0000000000..9bece56f5b --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/maximumsubarray/KadaneAlgorithmUnitTest.java @@ -0,0 +1,19 @@ +package com.baeldung.algorithms.maximumsubarray; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class KadaneAlgorithmUnitTest { + + @Test + void givenArrayWithNegativeNumberWhenMaximumSubarrayThenReturns6() { + //given + int[] arr = new int[]{-3, 1, -8, 4, -1, 2, 1, -5, 5}; + //when + KadaneAlgorithm algorithm = new KadaneAlgorithm(); + int maxSum = algorithm.maxSubArraySum(arr); + //then + assertEquals(6, maxSum); + } +} \ No newline at end of file diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/mergesortedarrays/SortedArraysUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/mergesortedarrays/SortedArraysUnitTest.java new file mode 100644 index 0000000000..76eeb7b116 --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/mergesortedarrays/SortedArraysUnitTest.java @@ -0,0 +1,29 @@ +package com.baeldung.algorithms.mergesortedarrays; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import org.junit.jupiter.api.Test; + +import com.baeldung.algorithms.mergesortedarrays.SortedArrays; + +public class SortedArraysUnitTest { + + @Test + public void givenTwoSortedArrays_whenMerged_thenReturnMergedSortedArray() { + + int[] foo = { 3, 7 }; + int[] bar = { 4, 8, 11 }; + int[] merged = { 3, 4, 7, 8, 11 }; + + assertArrayEquals(merged, SortedArrays.merge(foo, bar)); + } + + @Test + public void givenTwoSortedArraysWithDuplicates_whenMerged_thenReturnMergedSortedArray() { + + int[] foo = { 3, 3, 7 }; + int[] bar = { 4, 8, 8, 11 }; + int[] merged = { 3, 3, 4, 7, 8, 8, 11 }; + + assertArrayEquals(merged, SortedArrays.merge(foo, bar)); + } +} diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/prim/PrimUnitTest.java b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/prim/PrimUnitTest.java new file mode 100644 index 0000000000..41e53fc9f2 --- /dev/null +++ b/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/prim/PrimUnitTest.java @@ -0,0 +1,54 @@ +package com.baeldung.algorithms.prim; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; + +public class PrimUnitTest { + + @Test + public void givenAGraph_whenPrimRuns_thenPrintMST() { + Prim prim = new Prim(createGraph()); + System.out.println(prim.originalGraphToString()); + System.out.println("----------------"); + prim.run(); + System.out.println(); + prim.resetPrintHistory(); + System.out.println(prim.minimumSpanningTreeToString()); + } + + public static List createGraph() { + List graph = new ArrayList<>(); + Vertex a = new Vertex("A"); + Vertex b = new Vertex("B"); + Vertex c = new Vertex("C"); + Vertex d = new Vertex("D"); + Vertex e = new Vertex("E"); + Edge ab = new Edge(2); + a.addEdge(b, ab); + b.addEdge(a, ab); + Edge ac = new Edge(3); + a.addEdge(c, ac); + c.addEdge(a, ac); + Edge bc = new Edge(2); + b.addEdge(c, bc); + c.addEdge(b, bc); + Edge be = new Edge(5); + b.addEdge(e, be); + e.addEdge(b, be); + Edge cd = new Edge(1); + c.addEdge(d, cd); + d.addEdge(c, cd); + Edge ce = new Edge(1); + c.addEdge(e, ce); + e.addEdge(c, ce); + graph.add(a); + graph.add(b); + graph.add(c); + graph.add(d); + graph.add(e); + return graph; + } + +} diff --git a/algorithms-searching/pom.xml b/algorithms-searching/pom.xml index 6bd4b0233e..da32874a18 100644 --- a/algorithms-searching/pom.xml +++ b/algorithms-searching/pom.xml @@ -1,5 +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 algorithms-searching 0.0.1-SNAPSHOT diff --git a/algorithms-sorting/pom.xml b/algorithms-sorting/pom.xml index 5bb19a8069..84856235d9 100644 --- a/algorithms-sorting/pom.xml +++ b/algorithms-sorting/pom.xml @@ -1,5 +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 algorithms-sorting 0.0.1-SNAPSHOT diff --git a/animal-sniffer-mvn-plugin/pom.xml b/animal-sniffer-mvn-plugin/pom.xml index fd8f6d3d8c..d04581aaac 100644 --- a/animal-sniffer-mvn-plugin/pom.xml +++ b/animal-sniffer-mvn-plugin/pom.xml @@ -1,5 +1,6 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 animal-sniffer-mvn-plugin 1.0-SNAPSHOT @@ -43,4 +44,5 @@ 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 d9aca6040d..645bbd7a0f 100644 --- a/annotations/annotation-processing/pom.xml +++ b/annotations/annotation-processing/pom.xml @@ -1,10 +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 annotation-processing annotation-processing - + com.baeldung 1.0.0-SNAPSHOT diff --git a/annotations/annotation-user/pom.xml b/annotations/annotation-user/pom.xml index 422cc7f119..ae47e19f05 100644 --- a/annotations/annotation-user/pom.xml +++ b/annotations/annotation-user/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 annotation-user annotation-user - annotations com.baeldung + annotations 1.0.0-SNAPSHOT ../ diff --git a/annotations/pom.xml b/annotations/pom.xml index 5fe89adf0a..41e1e8735b 100644 --- a/annotations/pom.xml +++ b/annotations/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 annotations annotations pom - + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/antlr/pom.xml b/antlr/pom.xml index 91b939a882..641382d450 100644 --- a/antlr/pom.xml +++ b/antlr/pom.xml @@ -1,5 +1,6 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 antlr antlr @@ -52,9 +53,10 @@ - + 4.7.1 3.0.0 + \ No newline at end of file diff --git a/apache-avro/pom.xml b/apache-avro/pom.xml index 6baae9c541..35898711c8 100644 --- a/apache-avro/pom.xml +++ b/apache-avro/pom.xml @@ -5,7 +5,7 @@ 4.0.0 apache-avro 0.0.1-SNAPSHOT - apache-avro + apache-avro com.baeldung @@ -67,5 +67,5 @@ 1.8.2 1.7.25 - + diff --git a/apache-bval/pom.xml b/apache-bval/pom.xml index 786f587fb1..4254242e55 100644 --- a/apache-bval/pom.xml +++ b/apache-bval/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 - apache-bval apache-bval 0.0.1-SNAPSHOT apache-bval - + com.baeldung parent-modules diff --git a/apache-curator/pom.xml b/apache-curator/pom.xml index 259319d547..ea8fb358ad 100644 --- a/apache-curator/pom.xml +++ b/apache-curator/pom.xml @@ -1,9 +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 apache-curator 0.0.1-SNAPSHOT - apache-curator + apache-curator jar diff --git a/apache-cxf/cxf-aegis/README.md b/apache-cxf/cxf-aegis/README.md new file mode 100644 index 0000000000..e055826554 --- /dev/null +++ b/apache-cxf/cxf-aegis/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Introduction to Apache CXF Aegis Data Binding](https://www.baeldung.com/aegis-data-binding-in-apache-cxf) diff --git a/apache-cxf/cxf-aegis/pom.xml b/apache-cxf/cxf-aegis/pom.xml index 1d36178b82..6e6c5b093c 100644 --- a/apache-cxf/cxf-aegis/pom.xml +++ b/apache-cxf/cxf-aegis/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 cxf-aegis - cxf-aegis - + cxf-aegis + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-introduction/pom.xml b/apache-cxf/cxf-introduction/pom.xml index 17f03afd25..0572b01a9d 100644 --- a/apache-cxf/cxf-introduction/pom.xml +++ b/apache-cxf/cxf-introduction/pom.xml @@ -1,11 +1,10 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-introduction - cxf-introduction - + cxf-introduction + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-jaxrs-implementation/pom.xml b/apache-cxf/cxf-jaxrs-implementation/pom.xml index 03d0f67c90..37b81882bb 100644 --- a/apache-cxf/cxf-jaxrs-implementation/pom.xml +++ b/apache-cxf/cxf-jaxrs-implementation/pom.xml @@ -1,11 +1,10 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 cxf-jaxrs-implementation - cxf-jaxrs-implementation - + cxf-jaxrs-implementation + com.baeldung apache-cxf diff --git a/apache-cxf/cxf-spring/README.md b/apache-cxf/cxf-spring/README.md new file mode 100644 index 0000000000..c4d55a5c94 --- /dev/null +++ b/apache-cxf/cxf-spring/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [A Guide to Apache CXF with Spring](https://www.baeldung.com/apache-cxf-with-spring) diff --git a/apache-cxf/cxf-spring/pom.xml b/apache-cxf/cxf-spring/pom.xml index 97715af54c..01ee7d9411 100644 --- a/apache-cxf/cxf-spring/pom.xml +++ b/apache-cxf/cxf-spring/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 cxf-spring + cxf-spring war - cxf-spring com.baeldung @@ -98,7 +99,6 @@ - diff --git a/apache-cxf/pom.xml b/apache-cxf/pom.xml index 0016f33d70..c993eff3a5 100644 --- a/apache-cxf/pom.xml +++ b/apache-cxf/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/apache-cxf/sse-jaxrs/pom.xml b/apache-cxf/sse-jaxrs/pom.xml index cb5c96660a..89bd5d4191 100644 --- a/apache-cxf/sse-jaxrs/pom.xml +++ b/apache-cxf/sse-jaxrs/pom.xml @@ -16,6 +16,6 @@ sse-jaxrs-server sse-jaxrs-client - + diff --git a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml index be2138e172..37a068003c 100644 --- a/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml +++ b/apache-cxf/sse-jaxrs/sse-jaxrs-client/pom.xml @@ -5,7 +5,7 @@ 4.0.0 sse-jaxrs-client sse-jaxrs-client - + com.baeldung sse-jaxrs diff --git a/apache-fop/pom.xml b/apache-fop/pom.xml index 150756d51d..41a6761eaf 100644 --- a/apache-fop/pom.xml +++ b/apache-fop/pom.xml @@ -1,5 +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 apache-fop 0.1-SNAPSHOT diff --git a/apache-geode/pom.xml b/apache-geode/pom.xml index 195dfadd20..78c6390f80 100644 --- a/apache-geode/pom.xml +++ b/apache-geode/pom.xml @@ -6,7 +6,7 @@ apache-geode 1.0-SNAPSHOT apache-geode - + com.baeldung parent-modules @@ -20,8 +20,9 @@ ${geode.core} - + 1.6.0 + \ No newline at end of file diff --git a/apache-meecrowave/pom.xml b/apache-meecrowave/pom.xml index 51c6514992..9e79780e22 100644 --- a/apache-meecrowave/pom.xml +++ b/apache-meecrowave/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 apache-meecrowave 0.0.1 apache-meecrowave A sample REST API application with Meecrowave - + com.baeldung parent-modules @@ -38,7 +39,7 @@ test - + @@ -48,14 +49,15 @@ - + 1.8 1.8 - 1.2.0 - 3.10.0 - 1.2.1 - 1.2.1 - 1.2.1 + 1.2.0 + 3.10.0 + 1.2.1 + 1.2.1 + 1.2.1 + \ No newline at end of file diff --git a/apache-olingo/olingo2/README.md b/apache-olingo/olingo2/README.md new file mode 100644 index 0000000000..b1cb23d822 --- /dev/null +++ b/apache-olingo/olingo2/README.md @@ -0,0 +1,4 @@ +### Relevant Articles: + +- [OData Protocol Guide](https://www.baeldung.com/odata) +- [Intro to OData with Olingo](https://www.baeldung.com/olingo) diff --git a/apache-olingo/olingo2/pom.xml b/apache-olingo/olingo2/pom.xml index 95b123efbc..fdbc9b4390 100644 --- a/apache-olingo/olingo2/pom.xml +++ b/apache-olingo/olingo2/pom.xml @@ -1,87 +1,87 @@ - 4.0.0 - org.baeldung.examples.olingo2 - olingo2 - olingo2 - Sample Olingo 2 Project + 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 + org.baeldung.examples.olingo2 + olingo2 + olingo2 + Sample Olingo 2 Project - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - - - org.springframework.boot - spring-boot-starter-jersey - - - org.springframework.boot - spring-boot-starter-data-jpa - - - com.h2database - h2 - runtime - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-starter-test - test - + + + org.springframework.boot + spring-boot-starter-jersey + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.springframework.boot + spring-boot-starter-test + test + - - - org.apache.olingo - olingo-odata2-core - ${olingo2.version} - - - - javax.ws.rs - javax.ws.rs-api - - - - - org.apache.olingo - olingo-odata2-jpa-processor-core - ${olingo2.version} - - - org.apache.olingo - olingo-odata2-jpa-processor-ref - ${olingo2.version} - - - org.eclipse.persistence - eclipselink - - - - + + + org.apache.olingo + olingo-odata2-core + ${olingo2.version} + + + + javax.ws.rs + javax.ws.rs-api + + + + + org.apache.olingo + olingo-odata2-jpa-processor-core + ${olingo2.version} + + + org.apache.olingo + olingo-odata2-jpa-processor-ref + ${olingo2.version} + + + org.eclipse.persistence + eclipselink + + + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + - - 2.0.11 - + + 2.0.11 + diff --git a/apache-opennlp/pom.xml b/apache-opennlp/pom.xml index 6b2e6a9729..701d33c6fd 100644 --- a/apache-opennlp/pom.xml +++ b/apache-opennlp/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 apache-opennlp 1.0-SNAPSHOT diff --git a/apache-poi/pom.xml b/apache-poi/pom.xml index 54c3e8e928..a114946c47 100644 --- a/apache-poi/pom.xml +++ b/apache-poi/pom.xml @@ -1,5 +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 apache-poi 0.0.1-SNAPSHOT diff --git a/apache-pulsar/pom.xml b/apache-pulsar/pom.xml index fdd9ae1e95..206e1ab74d 100644 --- a/apache-pulsar/pom.xml +++ b/apache-pulsar/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung.pulsar apache-pulsar @@ -22,8 +22,9 @@ compile - + - 2.1.1-incubating + 2.1.1-incubating + diff --git a/apache-shiro/pom.xml b/apache-shiro/pom.xml index 7f0d07589c..0458ba783f 100644 --- a/apache-shiro/pom.xml +++ b/apache-shiro/pom.xml @@ -6,10 +6,10 @@ apache-shiro 1.0-SNAPSHOT apache-shiro - + - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/apache-solrj/pom.xml b/apache-solrj/pom.xml index b19ceb1e48..b25fd0fb04 100644 --- a/apache-solrj/pom.xml +++ b/apache-solrj/pom.xml @@ -1,5 +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 apache-solrj 0.0.1-SNAPSHOT diff --git a/apache-spark/pom.xml b/apache-spark/pom.xml index 4eb00192ac..59843adc71 100644 --- a/apache-spark/pom.xml +++ b/apache-spark/pom.xml @@ -1,110 +1,112 @@ + - 4.0.0 - apache-spark - 1.0-SNAPSHOT - apache-spark - jar - http://maven.apache.org + 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 + apache-spark + 1.0-SNAPSHOT + apache-spark + jar + http://maven.apache.org - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - org.apache.spark - spark-core_2.11 - ${org.apache.spark.spark-core.version} - provided - - - org.apache.spark - spark-sql_2.11 - ${org.apache.spark.spark-sql.version} - provided - - - org.apache.spark - spark-graphx_2.11 - ${org.apache.spark.spark-graphx.version} - provided - - - graphframes - graphframes - ${graphframes.version} - provided - - - org.apache.spark - spark-streaming_2.11 - ${org.apache.spark.spark-streaming.version} - provided - - - org.apache.spark - spark-mllib_2.11 - ${org.apache.spark.spark-mllib.version} - provided - - - org.apache.spark - spark-streaming-kafka-0-10_2.11 - ${org.apache.spark.spark-streaming-kafka.version} - - - com.datastax.spark - spark-cassandra-connector_2.11 - ${com.datastax.spark.spark-cassandra-connector.version} - - - com.datastax.spark - spark-cassandra-connector-java_2.11 - ${com.datastax.spark.spark-cassandra-connector-java.version} - - + + + org.apache.spark + spark-core_2.11 + ${org.apache.spark.spark-core.version} + provided + + + org.apache.spark + spark-sql_2.11 + ${org.apache.spark.spark-sql.version} + provided + + + org.apache.spark + spark-graphx_2.11 + ${org.apache.spark.spark-graphx.version} + provided + + + graphframes + graphframes + ${graphframes.version} + provided + + + org.apache.spark + spark-streaming_2.11 + ${org.apache.spark.spark-streaming.version} + provided + + + org.apache.spark + spark-mllib_2.11 + ${org.apache.spark.spark-mllib.version} + provided + + + org.apache.spark + spark-streaming-kafka-0-10_2.11 + ${org.apache.spark.spark-streaming-kafka.version} + + + com.datastax.spark + spark-cassandra-connector_2.11 + ${com.datastax.spark.spark-cassandra-connector.version} + + + com.datastax.spark + spark-cassandra-connector-java_2.11 + ${com.datastax.spark.spark-cassandra-connector-java.version} + + - - - - maven-assembly-plugin - - - package - - single - - - - - - jar-with-dependencies - - - - - + + + + maven-assembly-plugin + + + package + + single + + + + + + jar-with-dependencies + + + + + - - 2.3.0 - 2.3.0 - 2.3.0 - 2.3.0 - 2.3.0 - 0.7.0-spark2.4-s_2.11 - 2.3.0 - 2.3.0 - 1.5.2 - + + + SparkPackagesRepo + http://dl.bintray.com/spark-packages/maven + + + + + 2.3.0 + 2.3.0 + 2.3.0 + 2.3.0 + 2.3.0 + 0.7.0-spark2.4-s_2.11 + 2.3.0 + 2.3.0 + 1.5.2 + - - - SparkPackagesRepo - http://dl.bintray.com/spark-packages/maven - - diff --git a/apache-tapestry/pom.xml b/apache-tapestry/pom.xml index da033d69d5..e306b56b4a 100644 --- a/apache-tapestry/pom.xml +++ b/apache-tapestry/pom.xml @@ -1,12 +1,14 @@ + 4.0.0 com.baeldung apache-tapestry 0.0.1-SNAPSHOT - war apache-tapestry - + war + + @@ -22,7 +24,7 @@ slf4j-log4j12 ${slf4j-release-version} - + org.apache.tapestry tapestry-webresources @@ -71,8 +73,8 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's ${tapestry-release-version} provided - + apache-tapestry @@ -142,6 +144,6 @@ of testing facilities designed for use with TestNG (http://testng.org/), so it's 2.5 6.8.21 1.7.19 - + diff --git a/apache-thrift/pom.xml b/apache-thrift/pom.xml index ab54fc2cef..409467ccc5 100644 --- a/apache-thrift/pom.xml +++ b/apache-thrift/pom.xml @@ -1,5 +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 apache-thrift 0.0.1-SNAPSHOT diff --git a/apache-tika/pom.xml b/apache-tika/pom.xml index 0399914a5f..24c904aec3 100644 --- a/apache-tika/pom.xml +++ b/apache-tika/pom.xml @@ -1,10 +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 apache-tika 0.0.1-SNAPSHOT apache-tika - + com.baeldung parent-modules diff --git a/apache-velocity/pom.xml b/apache-velocity/pom.xml index b370b11cc1..61d7e74498 100644 --- a/apache-velocity/pom.xml +++ b/apache-velocity/pom.xml @@ -1,8 +1,9 @@ + 4.0.0 - 0.1-SNAPSHOT apache-velocity + 0.1-SNAPSHOT apache-velocity war diff --git a/apache-zookeeper/pom.xml b/apache-zookeeper/pom.xml index 53e4217358..0bab6cded6 100644 --- a/apache-zookeeper/pom.xml +++ b/apache-zookeeper/pom.xml @@ -1,5 +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 apache-zookeeper 0.0.1-SNAPSHOT diff --git a/asciidoctor/pom.xml b/asciidoctor/pom.xml index 42ee544eb0..5421df91be 100644 --- a/asciidoctor/pom.xml +++ b/asciidoctor/pom.xml @@ -1,13 +1,13 @@ + 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 + parent-modules 1.0.0-SNAPSHOT @@ -63,7 +63,6 @@ 1.5.6 1.5.6 - 1.5.0-alpha.15 1.5.0-alpha.15 diff --git a/asm/pom.xml b/asm/pom.xml index e56438c808..77dbab964c 100644 --- a/asm/pom.xml +++ b/asm/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.examples asm diff --git a/atomix/pom.xml b/atomix/pom.xml index e50c1d867f..7821ef26d7 100644 --- a/atomix/pom.xml +++ b/atomix/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.atomix.io atomix 0.0.1-SNAPSHOT atomix - + com.baeldung parent-modules diff --git a/aws-lambda/pom.xml b/aws-lambda/pom.xml index 1f3c31f87c..12be77baef 100644 --- a/aws-lambda/pom.xml +++ b/aws-lambda/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 aws-lambda 0.1.0-SNAPSHOT @@ -8,13 +8,12 @@ jar - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT - com.amazonaws aws-java-sdk-dynamodb @@ -63,7 +62,7 @@ ${json-simple.version} - + @@ -84,7 +83,7 @@ - + 1.1.1 2.5 @@ -94,5 +93,5 @@ 1.11.241 3.0.0 - + \ No newline at end of file diff --git a/aws-reactive/images/rective-upload.png b/aws-reactive/images/rective-upload.png new file mode 100644 index 0000000000..ebe5a7d69c Binary files /dev/null and b/aws-reactive/images/rective-upload.png differ diff --git a/aws-reactive/images/rective-upload.txt b/aws-reactive/images/rective-upload.txt new file mode 100644 index 0000000000..fb5177544e --- /dev/null +++ b/aws-reactive/images/rective-upload.txt @@ -0,0 +1,29 @@ +participant "Client 1" as C1 +participant "Client 2" as C2 +participant "Reactive Web App" as RWS +participant "Backend" as S3 +C1 -> RWS: POST +activate C1 +activate RWS +RWS -> S3: Async POST +deactivate RWS +C2 -> RWS: POST +activate C2 +activate RWS +RWS -> S3: Async POST +deactivate RWS +S3 --> RWS: Async Result +activate RWS +RWS -->C2: Result +deactivate RWS +deactivate C2 +// First file EOF +S3 --> RWS: Async Result +activate RWS +RWS -->C1: Result +deactivate RWS +deactivate C1 + + + + diff --git a/aws-reactive/images/thread-per-client.png b/aws-reactive/images/thread-per-client.png new file mode 100644 index 0000000000..dc75839aa4 Binary files /dev/null and b/aws-reactive/images/thread-per-client.png differ diff --git a/aws-reactive/images/thread-per-client.txt b/aws-reactive/images/thread-per-client.txt new file mode 100644 index 0000000000..a7009e318c --- /dev/null +++ b/aws-reactive/images/thread-per-client.txt @@ -0,0 +1,28 @@ +participant Client 1 +participant Client 2 +participant Controller +participant Backend +Client 1-> Controller: POST Data +activate Client 1 +activate Controller +Controller -> Backend: Save Data +activate Backend +note left of Controller #yellow: Controller blocked\nuntil result received +Backend --> Controller: Result +deactivate Backend +Controller --> Client 1: Result +deactivate Client 1 +deactivate Controller +// 2nd Upload +Client 2-> Controller: POST Data +activate Client 2 +activate Controller +Controller -> Backend: Save Data +activate Backend +note left of Controller #yellow: Controller blocket\nuntil result received +Backend --> Controller: Result +deactivate Backend +Controller --> Client 2: Result +deactivate Controller +deactivate Client 2 + diff --git a/aws-reactive/pom.xml b/aws-reactive/pom.xml new file mode 100644 index 0000000000..b3fcb24902 --- /dev/null +++ b/aws-reactive/pom.xml @@ -0,0 +1,105 @@ + + + 4.0.0 + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + + + aws-reactive + 0.0.1-SNAPSHOT + aws-reactive + AWS Reactive Sample + + + 1.8 + + + + + + + + org.springframework.boot + spring-boot-dependencies + 2.2.1.RELEASE + pom + import + + + + software.amazon.awssdk + bom + 2.10.27 + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-webflux + + + + software.amazon.awssdk + s3 + compile + + + + netty-nio-client + software.amazon.awssdk + compile + + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + io.projectreactor + reactor-test + test + + + org.springframework.boot + spring-boot-devtools + runtime + + + org.springframework.boot + spring-boot-configuration-processor + + + org.projectlombok + lombok + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/DownloadFailedException.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/DownloadFailedException.java new file mode 100644 index 0000000000..a88e1ab010 --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/DownloadFailedException.java @@ -0,0 +1,32 @@ +package com.baeldung.aws.reactive.s3; + +import java.util.Optional; + +import org.springframework.http.HttpStatus; + +import lombok.AllArgsConstructor; +import software.amazon.awssdk.core.SdkResponse; +import software.amazon.awssdk.http.SdkHttpResponse; + +@AllArgsConstructor +public class DownloadFailedException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + private int statusCode; + private Optional statusText; + + public DownloadFailedException(SdkResponse response) { + + SdkHttpResponse httpResponse = response.sdkHttpResponse(); + if (httpResponse != null) { + this.statusCode = httpResponse.statusCode(); + this.statusText = httpResponse.statusText(); + } else { + this.statusCode = HttpStatus.INTERNAL_SERVER_ERROR.value(); + this.statusText = Optional.of("UNKNOWN"); + } + + } + +} diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/DownloadResource.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/DownloadResource.java new file mode 100644 index 0000000000..838ada1685 --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/DownloadResource.java @@ -0,0 +1,144 @@ +/** + * + */ +package com.baeldung.aws.reactive.s3; + +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.Map; +import java.util.Map.Entry; +import java.util.concurrent.CompletableFuture; + +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.core.io.buffer.DataBufferUtils; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.http.ResponseEntity.BodyBuilder; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import lombok.extern.slf4j.Slf4j; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import software.amazon.awssdk.core.ResponseBytes; +import software.amazon.awssdk.core.SdkResponse; +import software.amazon.awssdk.core.async.AsyncResponseTransformer; +import software.amazon.awssdk.core.async.SdkPublisher; +import software.amazon.awssdk.core.internal.async.ByteArrayAsyncResponseTransformer; +import software.amazon.awssdk.http.SdkHttpResponse; +import software.amazon.awssdk.services.s3.S3AsyncClient; +import software.amazon.awssdk.services.s3.model.GetObjectRequest; +import software.amazon.awssdk.services.s3.model.GetObjectResponse; + +/** + * @author Philippe + * + */ +@RestController +@RequestMapping("/inbox") +@Slf4j +public class DownloadResource { + + + private final S3AsyncClient s3client; + private final S3ClientConfigurarionProperties s3config; + + public DownloadResource(S3AsyncClient s3client, S3ClientConfigurarionProperties s3config) { + this.s3client = s3client; + this.s3config = s3config; + } + + + @GetMapping(path="/{filekey}") + public Mono>> downloadFile(@PathVariable("filekey") String filekey) { + + GetObjectRequest request = GetObjectRequest.builder() + .bucket(s3config.getBucket()) + .key(filekey) + .build(); + + return Mono.fromFuture(s3client.getObject(request,new FluxResponseProvider())) + .map( (response) -> { + checkResult(response.sdkResponse); + String filename = getMetadataItem(response.sdkResponse,"filename",filekey); + + log.info("[I65] filename={}, length={}",filename, response.sdkResponse.contentLength() ); + + return ResponseEntity.ok() + .header(HttpHeaders.CONTENT_TYPE, response.sdkResponse.contentType()) + .header(HttpHeaders.CONTENT_LENGTH, Long.toString(response.sdkResponse.contentLength())) + .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + filename + "\"") + .body(response.flux); + }); + } + + /** + * Lookup a metadata key in a case-insensitive way. + * @param sdkResponse + * @param key + * @param defaultValue + * @return + */ + private String getMetadataItem(GetObjectResponse sdkResponse, String key, String defaultValue) { + for( Entry entry : sdkResponse.metadata().entrySet()) { + if ( entry.getKey().equalsIgnoreCase(key)) { + return entry.getValue(); + } + } + return defaultValue; + } + + + // Helper used to check return codes from an API call + private static void checkResult(GetObjectResponse response) { + SdkHttpResponse sdkResponse = response.sdkHttpResponse(); + if ( sdkResponse != null && sdkResponse.isSuccessful()) { + return; + } + + throw new DownloadFailedException(response); + } + + + static class FluxResponseProvider implements AsyncResponseTransformer { + + private FluxResponse response; + + @Override + public CompletableFuture prepare() { + response = new FluxResponse(); + return response.cf; + } + + @Override + public void onResponse(GetObjectResponse sdkResponse) { + this.response.sdkResponse = sdkResponse; + } + + @Override + public void onStream(SdkPublisher publisher) { + response.flux = Flux.from(publisher); + response.cf.complete(response); + } + + @Override + public void exceptionOccurred(Throwable error) { + response.cf.completeExceptionally(error); + } + + } + + /** + * Holds the API response and stream + * @author Philippe + */ + static class FluxResponse { + + final CompletableFuture cf = new CompletableFuture<>(); + GetObjectResponse sdkResponse; + Flux flux; + } + +} diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/ReactiveS3Application.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/ReactiveS3Application.java new file mode 100644 index 0000000000..b90c085fc9 --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/ReactiveS3Application.java @@ -0,0 +1,13 @@ +package com.baeldung.aws.reactive.s3; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class ReactiveS3Application { + + public static void main(String[] args) { + SpringApplication.run(ReactiveS3Application.class, args); + } + +} diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/S3ClientConfigurarionProperties.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/S3ClientConfigurarionProperties.java new file mode 100644 index 0000000000..b30bc1e5fa --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/S3ClientConfigurarionProperties.java @@ -0,0 +1,28 @@ +package com.baeldung.aws.reactive.s3; + +import java.net.URI; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +import lombok.Data; +import software.amazon.awssdk.regions.Region; + +@ConfigurationProperties(prefix = "aws.s3") +@Data +public class S3ClientConfigurarionProperties { + + private Region region = Region.US_EAST_1; + private URI endpoint = null; + + private String accessKeyId; + private String secretAccessKey; + + // Bucket name we'll be using as our backend storage + private String bucket; + + // AWS S3 requires that file parts must have at least 5MB, except + // for the last part. This may change for other S3-compatible services, so let't + // define a configuration property for that + private int multipartMinPartSize = 5*1024*1024; + +} diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/S3ClientConfiguration.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/S3ClientConfiguration.java new file mode 100644 index 0000000000..906ea088a1 --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/S3ClientConfiguration.java @@ -0,0 +1,65 @@ +package com.baeldung.aws.reactive.s3; + +import java.time.Duration; + +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentials; +import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; +import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; +import software.amazon.awssdk.http.async.SdkAsyncHttpClient; +import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient; +import software.amazon.awssdk.services.s3.S3AsyncClient; +import software.amazon.awssdk.services.s3.S3AsyncClientBuilder; +import software.amazon.awssdk.services.s3.S3Configuration; +import software.amazon.awssdk.utils.StringUtils; + +@Configuration +@EnableConfigurationProperties(S3ClientConfigurarionProperties.class) +public class S3ClientConfiguration { + + @Bean + public S3AsyncClient s3client(S3ClientConfigurarionProperties s3props, AwsCredentialsProvider credentialsProvider) { + + SdkAsyncHttpClient httpClient = NettyNioAsyncHttpClient.builder() + .writeTimeout(Duration.ZERO) + .maxConcurrency(64) + .build(); + + S3Configuration serviceConfiguration = S3Configuration.builder() + .checksumValidationEnabled(false) + .chunkedEncodingEnabled(true) + .build(); + + S3AsyncClientBuilder b = S3AsyncClient.builder() + .httpClient(httpClient) + .region(s3props.getRegion()) + .credentialsProvider(credentialsProvider) + .serviceConfiguration(serviceConfiguration); + + if (s3props.getEndpoint() != null) { + b = b.endpointOverride(s3props.getEndpoint()); + } + + return b.build(); + } + + @Bean + public AwsCredentialsProvider awsCredentialsProvider(S3ClientConfigurarionProperties s3props) { + + if (StringUtils.isBlank(s3props.getAccessKeyId())) { + // Return default provider + return DefaultCredentialsProvider.create(); + } + else { + // Return custom credentials provider + return () -> { + AwsCredentials creds = AwsBasicCredentials.create(s3props.getAccessKeyId(), s3props.getSecretAccessKey()); + return creds; + }; + } + } +} diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadFailedException.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadFailedException.java new file mode 100644 index 0000000000..0cfebc85d2 --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadFailedException.java @@ -0,0 +1,32 @@ +package com.baeldung.aws.reactive.s3; + +import java.util.Optional; + +import org.springframework.http.HttpStatus; + +import lombok.AllArgsConstructor; +import software.amazon.awssdk.core.SdkResponse; +import software.amazon.awssdk.http.SdkHttpResponse; + +@AllArgsConstructor +public class UploadFailedException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + private int statusCode; + private Optional statusText; + + public UploadFailedException(SdkResponse response) { + + SdkHttpResponse httpResponse = response.sdkHttpResponse(); + if (httpResponse != null) { + this.statusCode = httpResponse.statusCode(); + this.statusText = httpResponse.statusText(); + } else { + this.statusCode = HttpStatus.INTERNAL_SERVER_ERROR.value(); + this.statusText = Optional.of("UNKNOWN"); + } + + } + +} diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadResource.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadResource.java new file mode 100644 index 0000000000..fa7bf6a471 --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadResource.java @@ -0,0 +1,308 @@ +/** + * + */ +package com.baeldung.aws.reactive.s3; + +import java.io.File; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collector; +import java.util.stream.Collectors; + +import org.reactivestreams.Publisher; +import org.springframework.core.io.buffer.DataBuffer; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.http.codec.multipart.FilePart; +import org.springframework.http.codec.multipart.Part; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import software.amazon.awssdk.core.SdkResponse; +import software.amazon.awssdk.core.async.AsyncRequestBody; +import software.amazon.awssdk.services.s3.S3AsyncClient; +import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadRequest; +import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadResponse; +import software.amazon.awssdk.services.s3.model.CompletedMultipartUpload; +import software.amazon.awssdk.services.s3.model.CompletedMultipartUpload.Builder; +import software.amazon.awssdk.services.s3.model.CompletedPart; +import software.amazon.awssdk.services.s3.model.CreateMultipartUploadRequest; +import software.amazon.awssdk.services.s3.model.CreateMultipartUploadResponse; +import software.amazon.awssdk.services.s3.model.PutObjectRequest; +import software.amazon.awssdk.services.s3.model.PutObjectResponse; +import software.amazon.awssdk.services.s3.model.UploadPartRequest; +import software.amazon.awssdk.services.s3.model.UploadPartResponse; + +/** + * @author Philippe + * + */ +@RestController +@RequestMapping("/inbox") +@Slf4j +public class UploadResource { + + private final S3AsyncClient s3client; + private final S3ClientConfigurarionProperties s3config; + + public UploadResource(S3AsyncClient s3client, S3ClientConfigurarionProperties s3config) { + this.s3client = s3client; + this.s3config = s3config; + } + + /** + * Standard file upload. + */ + @PostMapping + public Mono> uploadHandler(@RequestHeader HttpHeaders headers, @RequestBody Flux body) { + + long length = headers.getContentLength(); + if (length < 0) { + throw new UploadFailedException(HttpStatus.BAD_REQUEST.value(), Optional.of("required header missing: Content-Length")); + } + + String fileKey = UUID.randomUUID().toString(); + Map metadata = new HashMap(); + MediaType mediaType = headers.getContentType(); + + if (mediaType == null) { + mediaType = MediaType.APPLICATION_OCTET_STREAM; + } + + log.info("[I95] uploadHandler: mediaType{}, length={}", mediaType, length); + CompletableFuture future = s3client + .putObject(PutObjectRequest.builder() + .bucket(s3config.getBucket()) + .contentLength(length) + .key(fileKey.toString()) + .contentType(mediaType.toString()) + .metadata(metadata) + .build(), + AsyncRequestBody.fromPublisher(body)); + + return Mono.fromFuture(future) + .map((response) -> { + checkResult(response); + return ResponseEntity + .status(HttpStatus.CREATED) + .body(new UploadResult(HttpStatus.CREATED, new String[] {fileKey})); + }); + } + + + /** + * Multipart file upload + * @param bucket + * @param parts + * @param headers + * @return + */ + @RequestMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE, method = {RequestMethod.POST, RequestMethod.PUT}) + public Mono> multipartUploadHandler(@RequestHeader HttpHeaders headers, @RequestBody Flux parts ) { + + return parts + .ofType(FilePart.class) // We'll ignore other data for now + .flatMap((part) -> saveFile(headers, s3config.getBucket(), part)) + .collect(Collectors.toList()) + .map((keys) -> ResponseEntity.status(HttpStatus.CREATED) + .body(new UploadResult(HttpStatus.CREATED,keys))); + } + + + /** + * Save file using a multipart upload. This method does not require any temporary + * storage at the REST service + * @param headers + * @param bucket Bucket name + * @param part Uploaded file + * @return + */ + protected Mono saveFile(HttpHeaders headers,String bucket, FilePart part) { + + // Generate a filekey for this upload + String filekey = UUID.randomUUID().toString(); + + log.info("[I137] saveFile: filekey={}, filename={}", filekey, part.filename()); + + // Gather metadata + Map metadata = new HashMap(); + String filename = part.filename(); + if ( filename == null ) { + filename = filekey; + } + + metadata.put("filename", filename); + + MediaType mt = part.headers().getContentType(); + if ( mt == null ) { + mt = MediaType.APPLICATION_OCTET_STREAM; + } + + // Create multipart upload request + CompletableFuture uploadRequest = s3client + .createMultipartUpload(CreateMultipartUploadRequest.builder() + .contentType(mt.toString()) + .key(filekey) + .metadata(metadata) + .bucket(bucket) + .build()); + + // This variable will hold the upload state that we must keep + // around until all uploads complete + final UploadState uploadState = new UploadState(bucket,filekey); + + return Mono + .fromFuture(uploadRequest) + .flatMapMany((response) -> { + checkResult(response); + uploadState.uploadId = response.uploadId(); + log.info("[I183] uploadId={}", response.uploadId()); + return part.content(); + }) + .bufferUntil((buffer) -> { + uploadState.buffered += buffer.readableByteCount(); + if ( uploadState.buffered >= s3config.getMultipartMinPartSize() ) { + log.info("[I173] bufferUntil: returning true, bufferedBytes={}, partCounter={}, uploadId={}", uploadState.buffered, uploadState.partCounter, uploadState.uploadId); + uploadState.buffered = 0; + return true; + } + else { + return false; + } + }) + .map((buffers) -> concatBuffers(buffers)) + .flatMap((buffer) -> uploadPart(uploadState,buffer)) + .onBackpressureBuffer() + .reduce(uploadState,(state,completedPart) -> { + log.info("[I188] completed: partNumber={}, etag={}", completedPart.partNumber(), completedPart.eTag()); + state.completedParts.put(completedPart.partNumber(), completedPart); + return state; + }) + .flatMap((state) -> completeUpload(state)) + .map((response) -> { + checkResult(response); + return uploadState.filekey; + }); + } + + private static ByteBuffer concatBuffers(List buffers) { + log.info("[I198] creating BytBuffer from {} chunks", buffers.size()); + + int partSize = 0; + for( DataBuffer b : buffers) { + partSize += b.readableByteCount(); + } + + ByteBuffer partData = ByteBuffer.allocate(partSize); + buffers.forEach((buffer) -> { + partData.put(buffer.asByteBuffer()); + }); + + // Reset read pointer to first byte + partData.rewind(); + + log.info("[I208] partData: size={}", partData.capacity()); + return partData; + + } + + /** + * Upload a single file part to the requested bucket + * @param uploadState + * @param buffer + * @return + */ + private Mono uploadPart(UploadState uploadState, ByteBuffer buffer) { + final int partNumber = ++uploadState.partCounter; + log.info("[I218] uploadPart: partNumber={}, contentLength={}",partNumber, buffer.capacity()); + + CompletableFuture request = s3client.uploadPart(UploadPartRequest.builder() + .bucket(uploadState.bucket) + .key(uploadState.filekey) + .partNumber(partNumber) + .uploadId(uploadState.uploadId) + .contentLength((long) buffer.capacity()) + .build(), + AsyncRequestBody.fromPublisher(Mono.just(buffer))); + + return Mono + .fromFuture(request) + .map((uploadPartResult) -> { + checkResult(uploadPartResult); + log.info("[I230] uploadPart complete: part={}, etag={}",partNumber,uploadPartResult.eTag()); + return CompletedPart.builder() + .eTag(uploadPartResult.eTag()) + .partNumber(partNumber) + .build(); + }); + } + + private Mono completeUpload(UploadState state) { + log.info("[I202] completeUpload: bucket={}, filekey={}, completedParts.size={}", state.bucket, state.filekey, state.completedParts.size()); + + CompletedMultipartUpload multipartUpload = CompletedMultipartUpload.builder() + .parts(state.completedParts.values()) + .build(); + + return Mono.fromFuture(s3client.completeMultipartUpload(CompleteMultipartUploadRequest.builder() + .bucket(state.bucket) + .uploadId(state.uploadId) + .multipartUpload(multipartUpload) + .key(state.filekey) + .build())); + } + + + /** + * check result from an API call. + * @param result Result from an API call + */ + private static void checkResult(SdkResponse result) { + if (result.sdkHttpResponse() == null || !result.sdkHttpResponse().isSuccessful()) { + throw new UploadFailedException(result); + } + } + + + /** + * Holds upload state during a multipart upload + */ + static class UploadState { + final String bucket; + final String filekey; + + String uploadId; + int partCounter; + Map completedParts = new HashMap<>(); + int buffered = 0; + + UploadState(String bucket, String filekey) { + this.bucket = bucket; + this.filekey = filekey; + } + } + +} diff --git a/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadResult.java b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadResult.java new file mode 100644 index 0000000000..642ad426a5 --- /dev/null +++ b/aws-reactive/src/main/java/com/baeldung/aws/reactive/s3/UploadResult.java @@ -0,0 +1,25 @@ +package com.baeldung.aws.reactive.s3; + +import java.util.List; + +import org.springframework.http.HttpStatus; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; + +@Data +@AllArgsConstructor +@Builder +public class UploadResult { + HttpStatus status; + String[] keys; + + public UploadResult() {} + + public UploadResult(HttpStatus status, List keys) { + this.status = status; + this.keys = keys == null ? new String[] {}: keys.toArray(new String[] {}); + + } +} diff --git a/aws-reactive/src/main/resources/application-minio.yml b/aws-reactive/src/main/resources/application-minio.yml new file mode 100644 index 0000000000..93bc2ff18b --- /dev/null +++ b/aws-reactive/src/main/resources/application-minio.yml @@ -0,0 +1,15 @@ + +# +# Minio profile +# +aws: + s3: + region: sa-east-1 + endpoint: http://localhost:9000 + accessKeyId: 8KLF8U60JER4AP23H0A6 + secretAccessKey: vX4uM7e7nNGPqjcXycVVhceNR7NQkiMQkR9Hoctf + bucket: bucket1 + + + + diff --git a/aws-reactive/src/main/resources/application.yml b/aws-reactive/src/main/resources/application.yml new file mode 100644 index 0000000000..957ebf82c3 --- /dev/null +++ b/aws-reactive/src/main/resources/application.yml @@ -0,0 +1,16 @@ + +# +# Configurações de acesso ao Minio +# +aws: + s3: + region: sa-east-1 +# When using AWS, the library will use one of the available +# credential sources described in the documentation. +# accessKeyId: **** +# secretAccessKey: **** + bucket: dev1.token.com.br + + + + diff --git a/aws-reactive/src/test/java/com/baeldung/aws/reactive/s3/ReactiveS3ApplicationLiveTest.java b/aws-reactive/src/test/java/com/baeldung/aws/reactive/s3/ReactiveS3ApplicationLiveTest.java new file mode 100644 index 0000000000..9e5720225f --- /dev/null +++ b/aws-reactive/src/test/java/com/baeldung/aws/reactive/s3/ReactiveS3ApplicationLiveTest.java @@ -0,0 +1,85 @@ +package com.baeldung.aws.reactive.s3; + +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.core.io.Resource; +import org.springframework.http.ContentDisposition; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.util.ResourceUtils; + +import static org.junit.Assert.*; + +@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) +@ActiveProfiles("minio") +class ReactiveS3ApplicationLiveTest { + + @Autowired + private TestRestTemplate restTemplate; + + @LocalServerPort + private int serverPort; + + + @Test + void whenUploadSingleFile_thenSuccess() throws Exception { + + String url = "http://localhost:" + serverPort + "/inbox"; + byte[] data = Files.readAllBytes(Paths.get("src/test/resources/testimage1.png")); + UploadResult result = restTemplate.postForObject(url, data , UploadResult.class); + + assertEquals("Expected CREATED (202)", result.getStatus(), HttpStatus.CREATED ); + + } + + @Test + void whenUploadMultipleFiles_thenSuccess() throws Exception { + + + MultiValueMap body = new LinkedMultiValueMap<>(); + addFileEntity("f1", body, new File("src/test/resources/testimage1.png")); + addFileEntity("f2", body, new File("src/test/resources/testimage2.png")); + + HttpEntity> requestEntity = new HttpEntity<>(body); + String url = "http://localhost:" + serverPort + "/inbox"; + + ResponseEntity result = restTemplate.postForEntity(url, requestEntity, UploadResult.class); + + assertEquals("Http Code",HttpStatus.CREATED, result.getStatusCode() ); + assertEquals("File keys",2, result.getBody().getKeys().length); + + } + + private void addFileEntity(String name, MultiValueMap body, File file) throws Exception { + + byte[] data = Files.readAllBytes(file.toPath()); + MultiValueMap headers = new LinkedMultiValueMap<>(); + ContentDisposition contentDispositionHeader = ContentDisposition.builder("form-data") + .name(name) + .filename(file.getName()) + .build(); + + headers.add(HttpHeaders.CONTENT_DISPOSITION, contentDispositionHeader.toString()); + + HttpEntity fileEntity = new HttpEntity<>(data, headers); + body.add(name, fileEntity); + } + + +} diff --git a/aws-reactive/src/test/resources/testimage1.png b/aws-reactive/src/test/resources/testimage1.png new file mode 100644 index 0000000000..c61a9b677f Binary files /dev/null and b/aws-reactive/src/test/resources/testimage1.png differ diff --git a/aws-reactive/src/test/resources/testimage2.png b/aws-reactive/src/test/resources/testimage2.png new file mode 100644 index 0000000000..8c4f119ae6 Binary files /dev/null and b/aws-reactive/src/test/resources/testimage2.png differ diff --git a/aws/README.md b/aws/README.md index 9e4ca8b699..fcb9735878 100644 --- a/aws/README.md +++ b/aws/README.md @@ -1,6 +1,6 @@ ## AWS -This module contains articles about AWS +This module contains articles about Amazon Web Services (AWS) ### Relevant articles diff --git a/aws/pom.xml b/aws/pom.xml index 45a30f96ba..19057d48e9 100644 --- a/aws/pom.xml +++ b/aws/pom.xml @@ -1,5 +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 aws 0.1.0-SNAPSHOT @@ -18,7 +19,7 @@ aws-java-sdk ${aws-java-sdk.version} - + org.mockito mockito-core ${mockito-core.version} diff --git a/axon/pom.xml b/axon/pom.xml index 21e21f0ef2..be74b38fa6 100644 --- a/axon/pom.xml +++ b/axon/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 axon axon diff --git a/azure/pom.xml b/azure/pom.xml index 3d9c296748..7134a47cd7 100644 --- a/azure/pom.xml +++ b/azure/pom.xml @@ -1,16 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 azure 0.1 azure - Demo project for Spring Boot on Azure war + Demo project for Spring Boot on Azure - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -43,7 +43,6 @@ mysql-connector-java runtime - diff --git a/bazel/bazelapp/README.md b/bazel/bazelapp/README.md new file mode 100644 index 0000000000..528f797c21 --- /dev/null +++ b/bazel/bazelapp/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Building Java Applications with Bazel](https://www.baeldung.com/bazel-build-tool) diff --git a/bazel/bazelapp/pom.xml b/bazel/bazelapp/pom.xml index e56cc06ef4..6440c26cd6 100644 --- a/bazel/bazelapp/pom.xml +++ b/bazel/bazelapp/pom.xml @@ -5,10 +5,10 @@ 4.0.0 bazelapp bazelapp - + - bazel com.baeldung + bazel 1.0.0-SNAPSHOT diff --git a/bazel/bazelgreeting/README.md b/bazel/bazelgreeting/README.md new file mode 100644 index 0000000000..528f797c21 --- /dev/null +++ b/bazel/bazelgreeting/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Building Java Applications with Bazel](https://www.baeldung.com/bazel-build-tool) diff --git a/bazel/bazelgreeting/pom.xml b/bazel/bazelgreeting/pom.xml index e688a55bd5..ae8a6e4080 100644 --- a/bazel/bazelgreeting/pom.xml +++ b/bazel/bazelgreeting/pom.xml @@ -5,12 +5,11 @@ 4.0.0 bazelgreeting bazelgreeting - + - bazel com.baeldung + bazel 1.0.0-SNAPSHOT - \ No newline at end of file diff --git a/bazel/pom.xml b/bazel/pom.xml index cb784ec6e6..b1585cc73b 100644 --- a/bazel/pom.xml +++ b/bazel/pom.xml @@ -4,19 +4,18 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 bazel - pom bazel - + pom + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT - + bazelgreeting bazelapp - \ No newline at end of file diff --git a/blade/pom.xml b/blade/pom.xml index 6f8a78852d..e302f33c51 100644 --- a/blade/pom.xml +++ b/blade/pom.xml @@ -1,16 +1,16 @@ + - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 blade blade - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + @@ -65,8 +65,9 @@ test + - sample-blade-app + blade org.apache.maven.plugins @@ -121,7 +122,6 @@ - maven-assembly-plugin 3.1.0 @@ -149,17 +149,18 @@ - + - 2.0.14.RELEASE - 4.2.1 - 3.8.1 - 1.18.4 - 4.5.6 - 4.5.6 - 4.4.10 - 3.11.1 - 3.0.0-M3 - 0.7 + 2.0.14.RELEASE + 4.2.1 + 3.8.1 + 1.18.4 + 4.5.6 + 4.5.6 + 4.4.10 + 3.11.1 + 3.0.0-M3 + 0.7 + diff --git a/bootique/pom.xml b/bootique/pom.xml index 7601321b99..8e40b3ec8d 100644 --- a/bootique/pom.xml +++ b/bootique/pom.xml @@ -1,5 +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.bootique bootique diff --git a/cas/cas-secured-app/pom.xml b/cas/cas-secured-app/pom.xml index 338a9e5653..63d5d43417 100644 --- a/cas/cas-secured-app/pom.xml +++ b/cas/cas-secured-app/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 cas-secured-app cas-secured-app - Demo project for CAS jar + Demo project for CAS - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 diff --git a/cas/cas-server/README.md b/cas/cas-server/README.md index bacf45a2a1..44cfa2246c 100644 --- a/cas/cas-server/README.md +++ b/cas/cas-server/README.md @@ -98,4 +98,8 @@ Invokes the CAS Command Line Shell. For a list of commands either use no argumen ```bash ./build.sh cli -``` \ No newline at end of file +``` + +### Relevant Articles: + +- [CAS SSO With Spring Security](https://www.baeldung.com/spring-security-cas-sso) diff --git a/cas/cas-server/pom.xml b/cas/cas-server/pom.xml index 8a1e602114..bfd8f685ac 100644 --- a/cas/cas-server/pom.xml +++ b/cas/cas-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 cas-server 1.0 @@ -8,12 +8,12 @@ war - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 - + org.apereo.cas @@ -198,7 +198,7 @@ 0.0.4 2.6 - + 0.3.0 1.1.0 diff --git a/cas/pom.xml b/cas/pom.xml index 6d141277c5..f458b23797 100644 --- a/cas/pom.xml +++ b/cas/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 cas cas diff --git a/cdi/pom.xml b/cdi/pom.xml index 809622a5db..87ad9c111a 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -5,7 +5,7 @@ cdi 1.0-SNAPSHOT cdi - + com.baeldung parent-spring-4 @@ -23,7 +23,7 @@ org.jboss.weld.se weld-se-core ${weld-se-core.version} - + org.hamcrest hamcrest-core @@ -53,7 +53,7 @@ test - + 2.0.SP1 3.0.5.Final @@ -61,4 +61,5 @@ 3.10.0 5.1.2.RELEASE + diff --git a/checker-plugin/pom.xml b/checker-plugin/pom.xml index 63def4dbdc..0140d7951a 100644 --- a/checker-plugin/pom.xml +++ b/checker-plugin/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml index fe1b919905..1429ca8b24 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml +++ b/cloud-foundry-uaa/cf-uaa-oauth2-client/pom.xml @@ -8,8 +8,8 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -33,5 +33,5 @@ - + diff --git a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml index 7cd47bb7b3..6297c6f673 100644 --- a/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml +++ b/cloud-foundry-uaa/cf-uaa-oauth2-resource-server/pom.xml @@ -8,12 +8,12 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - + org.springframework.boot diff --git a/code-generation/pom.xml b/code-generation/pom.xml index 91ce0a4639..7cc076c58f 100644 --- a/code-generation/pom.xml +++ b/code-generation/pom.xml @@ -1,5 +1,6 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 code-generation 1.0 diff --git a/core-groovy-2/pom.xml b/core-groovy-2/pom.xml index 08526bac9a..e0987de4b3 100644 --- a/core-groovy-2/pom.xml +++ b/core-groovy-2/pom.xml @@ -180,9 +180,10 @@ 1.0.0 2.4.0 1.1-groovy-2.4 - 1.1.3 + 1.1.3 1.2.3 2.5.7 + diff --git a/core-groovy-collections/pom.xml b/core-groovy-collections/pom.xml index bf3ae26592..423be5e977 100644 --- a/core-groovy-collections/pom.xml +++ b/core-groovy-collections/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 core-groovy-collections 1.0-SNAPSHOT @@ -101,11 +101,11 @@ maven-surefire-plugin 2.20.1 - false - - **/*Test.java - **/*Spec.java - + false + + **/*Test.java + **/*Spec.java + @@ -127,5 +127,6 @@ 1.1-groovy-2.4 1.6 + diff --git a/core-groovy/pom.xml b/core-groovy/pom.xml index 80d6f8d2d5..6407f7c0c6 100644 --- a/core-groovy/pom.xml +++ b/core-groovy/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 core-groovy 1.0-SNAPSHOT @@ -116,5 +116,6 @@ 1.1-groovy-2.4 1.6 + diff --git a/core-java-modules/core-java-10/pom.xml b/core-java-modules/core-java-10/pom.xml index 7163619679..49ebbfb283 100644 --- a/core-java-modules/core-java-10/pom.xml +++ b/core-java-modules/core-java-10/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"> 4.0.0 - com.baeldung core-java-10 0.1.0-SNAPSHOT core-java-10 diff --git a/core-java-modules/core-java-11/pom.xml b/core-java-modules/core-java-11/pom.xml index 81917b6397..5bebaae00d 100644 --- a/core-java-modules/core-java-11/pom.xml +++ b/core-java-modules/core-java-11/pom.xml @@ -1,9 +1,8 @@ - + + 4.0.0 - com.baeldung core-java-11 0.1.0-SNAPSHOT core-java-11 @@ -110,4 +109,5 @@ benchmarks 1.22 + diff --git a/core-java-modules/core-java-12/pom.xml b/core-java-modules/core-java-12/pom.xml index 06c49a0021..171d3f6e73 100644 --- a/core-java-modules/core-java-12/pom.xml +++ b/core-java-modules/core-java-12/pom.xml @@ -1,9 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung core-java-12 0.1.0-SNAPSHOT core-java-12 diff --git a/core-java-modules/core-java-13/pom.xml b/core-java-modules/core-java-13/pom.xml new file mode 100644 index 0000000000..1f215ae6b0 --- /dev/null +++ b/core-java-modules/core-java-13/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + com.baeldung + core-java-13 + 0.1.0-SNAPSHOT + core-java-13 + jar + http://maven.apache.org + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${maven.compiler.source.version} + ${maven.compiler.target.version} + 13 + --enable-preview + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M3 + + --enable-preview + + + + + + + 13 + 13 + 3.6.1 + + + \ No newline at end of file diff --git a/core-java-modules/core-java-13/src/test/java/com/baeldung/switchExpression/SwitchExpressionsUnitTest.java b/core-java-modules/core-java-13/src/test/java/com/baeldung/switchExpression/SwitchExpressionsUnitTest.java new file mode 100644 index 0000000000..bb9250f000 --- /dev/null +++ b/core-java-modules/core-java-13/src/test/java/com/baeldung/switchExpression/SwitchExpressionsUnitTest.java @@ -0,0 +1,76 @@ +package com.baeldung.switchExpression; + +import static java.time.Month.AUGUST; +import static java.time.Month.JUNE; + +import static org.junit.Assert.assertEquals; + +import java.time.Month; +import java.util.function.Function; + +import org.junit.Test; + +public class SwitchExpressionsUnitTest { + + @Test + @SuppressWarnings ("preview") + public void whenSwitchingOverMonthJune_thenWillReturn3() { + + var month = JUNE; + + var result = switch (month) { + case JANUARY, JUNE, JULY -> 3; + case FEBRUARY, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER -> 1; + case MARCH, MAY, APRIL -> 2; + default -> 0; + }; + + assertEquals(result, 3); + } + + @Test + @SuppressWarnings ("preview") + public void whenSwitchingOverMonthAugust_thenWillReturn24() { + var month = AUGUST; + + var result = switch (month) { + case JANUARY, JUNE, JULY -> 3; + case FEBRUARY, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER -> 1; + case MARCH, MAY, APRIL, AUGUST -> { + int monthLength = month.toString().length(); + yield monthLength * 4; + } + default -> 0; + }; + + assertEquals(24, result); + } + + @Test + @SuppressWarnings ("preview") + public void whenSwitchingOverMonthJanuary_thenWillReturn3() { + + Function func = (month) -> { + switch (month) { + case JANUARY, JUNE, JULY -> { return 3; } + default -> { return 0; } + } + }; + + assertEquals(Integer.valueOf(3), func.apply(Month.JANUARY)); + } + + @Test + @SuppressWarnings ("preview") + public void whenSwitchingOverMonthAugust_thenWillReturn2() { + var month = AUGUST; + + var result = switch (month) { + case JANUARY, JUNE, JULY -> 3; + case FEBRUARY, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER -> 1; + case MARCH, MAY, APRIL, AUGUST -> 2; + }; + + assertEquals(result, 2); + } +} diff --git a/core-java-modules/core-java-8-2/pom.xml b/core-java-modules/core-java-8-2/pom.xml index 269631e0dd..746755f7a9 100644 --- a/core-java-modules/core-java-8-2/pom.xml +++ b/core-java-modules/core-java-8-2/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 core-java-8-2 0.1.0-SNAPSHOT @@ -33,4 +33,5 @@ 64.2 3.12.2 + diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml index 074359ae54..c2c84a5407 100644 --- a/core-java-modules/core-java-8/pom.xml +++ b/core-java-modules/core-java-8/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -76,4 +77,5 @@ 2.0.4.RELEASE + diff --git a/core-java-modules/core-java-9-improvements/pom.xml b/core-java-modules/core-java-9-improvements/pom.xml index aee289c79f..9958bf9364 100644 --- a/core-java-modules/core-java-9-improvements/pom.xml +++ b/core-java-modules/core-java-9-improvements/pom.xml @@ -1,9 +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 - core-java-9 + core-java-9-improvements 0.2-SNAPSHOT - core-java-9 + core-java-9-improvements com.baeldung @@ -39,7 +40,7 @@ - core-java-9 + core-java-9-improvements org.apache.maven.plugins diff --git a/core-java-modules/core-java-9-jigsaw/pom.xml b/core-java-modules/core-java-9-jigsaw/pom.xml index 8194ae9d00..ecb36c365d 100644 --- a/core-java-modules/core-java-9-jigsaw/pom.xml +++ b/core-java-modules/core-java-9-jigsaw/pom.xml @@ -1,9 +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 core-java-9-jigsaw 0.2-SNAPSHOT - core-java-9 + core-java-9-jigsaw com.baeldung diff --git a/core-java-modules/core-java-9-new-features/pom.xml b/core-java-modules/core-java-9-new-features/pom.xml index cfdbb285d4..9db1112f1d 100644 --- a/core-java-modules/core-java-9-new-features/pom.xml +++ b/core-java-modules/core-java-9-new-features/pom.xml @@ -1,9 +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 core-java-9-new-features 0.2-SNAPSHOT - core-java-9 + core-java-9-new-features com.baeldung diff --git a/core-java-modules/core-java-9-streams/pom.xml b/core-java-modules/core-java-9-streams/pom.xml index 6e167caf9c..99be29f2b0 100644 --- a/core-java-modules/core-java-9-streams/pom.xml +++ b/core-java-modules/core-java-9-streams/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -13,9 +14,6 @@ ../../parent-java - - - core-java-9-streams @@ -26,6 +24,4 @@ - - diff --git a/core-java-modules/core-java-9/pom.xml b/core-java-modules/core-java-9/pom.xml index aee289c79f..23a465caa1 100644 --- a/core-java-modules/core-java-9/pom.xml +++ b/core-java-modules/core-java-9/pom.xml @@ -1,5 +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 core-java-9 0.2-SNAPSHOT diff --git a/core-java-modules/core-java-annotations/pom.xml b/core-java-modules/core-java-annotations/pom.xml index 92b5afbd47..a97686a5b5 100644 --- a/core-java-modules/core-java-annotations/pom.xml +++ b/core-java-modules/core-java-annotations/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/core-java-modules/core-java-arrays-2/pom.xml b/core-java-modules/core-java-arrays-2/pom.xml index a1da169f2f..3f6b7094bb 100644 --- a/core-java-modules/core-java-arrays-2/pom.xml +++ b/core-java-modules/core-java-arrays-2/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -39,7 +40,6 @@ - 3.9 diff --git a/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/arraysort/SortComparisonUnitTest.java b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/arraysort/SortComparisonUnitTest.java new file mode 100644 index 0000000000..d1aba5a886 --- /dev/null +++ b/core-java-modules/core-java-arrays-2/src/test/java/com/baeldung/arraysort/SortComparisonUnitTest.java @@ -0,0 +1,185 @@ +package com.baeldung.arraysort; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNotSame; + +import java.util.Arrays; +import java.util.Random; + +import org.junit.After; +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runners.MethodSorters; + +/** + * Time taken by JUnit test cases can be seen in JUnit Runner + * @author rchaudhary23 + * + */ + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class SortComparisonUnitTest { + + private int[] sizeOfArrays = { 1000, 10000, 100000, 1000000 }; + + private int[] _1000_elements_array; + private int[] _10000_elements_array; + private int[] _100000_elements_array; + private int[] _1000000_elements_array; + + @Before + public void setUp() throws Exception { + + _1000_elements_array = new int[sizeOfArrays[0]]; + _10000_elements_array = new int[sizeOfArrays[1]]; + _100000_elements_array = new int[sizeOfArrays[2]]; + _1000000_elements_array = new int[sizeOfArrays[3]]; + + Random random = new Random(); + for (int i = 0; i < sizeOfArrays[0]; i++) { + _1000_elements_array[i] = random.nextInt(sizeOfArrays[0]) + random.nextInt(sizeOfArrays[0]); + } + + for (int i = 0; i < sizeOfArrays[1]; i++) { + _10000_elements_array[i] = random.nextInt(sizeOfArrays[1]) + random.nextInt(sizeOfArrays[1]); + } + + for (int i = 0; i < sizeOfArrays[2]; i++) { + _100000_elements_array[i] = random.nextInt(sizeOfArrays[2]) + random.nextInt(sizeOfArrays[2]); + } + + for (int i = 0; i < sizeOfArrays[3]; i++) { + _1000000_elements_array[i] = random.nextInt(sizeOfArrays[3]) + random.nextInt(sizeOfArrays[3]); + } + + } + + @Test + public void givenArrayOfIntegers_whenUsingArraysSortMethod_thenSortFullArrayInAscendingOrder() { + + int[] array = { 10, 4, 6, 2, 1, 9, 7, 8, 3, 5 }; + int[] expected = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + + Arrays.sort(array); + + assertArrayEquals(expected, array); + + } + + @Test + public void givenArrayOfIntegers_whenUsingArraysSortMethodWithRange_thenSortRangeOfArrayInAscendingOrder() { + int[] array = { 10, 4, 6, 2, 1, 9, 7, 8, 3, 5 }; + int[] expected = { 10, 4, 1, 2, 6, 7, 8, 9, 3, 5 }; + + Arrays.sort(array, 2, 8); + + assertArrayEquals(expected, array); + } + + @Test + public void givenArrayOfIntegers_whenUsingArraysParallelSortMethod_thenSortFullArrayInAscendingOrder() { + int[] array = { 10, 4, 6, 2, 1, 9, 7, 8, 3, 5 }; + int[] expected = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; + + Arrays.parallelSort(array); + + assertArrayEquals(expected, array); + } + + @Test + public void givenArrayOfIntegers_whenUsingArraysParallelSortMethodWithRange_thenSortRangeOfArrayInAscendingOrder() { + int[] array = { 10, 4, 6, 2, 1, 9, 7, 8, 3, 5 }; + int[] expected = { 10, 4, 1, 2, 6, 7, 8, 9, 3, 5 }; + + Arrays.parallelSort(array, 2, 8); + + assertArrayEquals(expected, array); + } + + @Test + public void givenIntegerArrayOf1000Elements_whenUsingArraysSortMethod_thenSortFullArrayInAscendingOrder() { + int[] sequentialDataSet = Arrays.copyOf(_1000_elements_array, _1000_elements_array.length); + Arrays.sort(sequentialDataSet); + + assertNotNull(sequentialDataSet); + assertNotSame(Arrays.copyOf(_1000_elements_array, _1000_elements_array.length), sequentialDataSet); + + } + + @Test + public void givenIntegerArrayOf1000Elements_whenUsingArraysParallelSortMethod_thenSortFullArrayInAscendingOrder() { + int[] parallelDataSet = Arrays.copyOf(_1000_elements_array, _1000_elements_array.length); + Arrays.parallelSort(parallelDataSet); + + assertNotNull(parallelDataSet); + assertNotSame(Arrays.copyOf(_1000_elements_array, _1000_elements_array.length), parallelDataSet); + + } + + @Test + public void givenIntegerArrayOf10000Elements_whenUsingArraysSortMethod_thenSortFullArrayInAscendingOrder() { + int[] sequentialDataSet = Arrays.copyOf(_10000_elements_array, _10000_elements_array.length); + Arrays.sort(sequentialDataSet); + + assertNotNull(sequentialDataSet); + assertNotSame(Arrays.copyOf(_10000_elements_array, _10000_elements_array.length), sequentialDataSet); + } + + @Test + public void givenIntegerArrayOf10000Elements_whenUsingArraysParallelSortMethod_thenSortFullArrayInAscendingOrder() { + int[] parallelDataSet = Arrays.copyOf(_10000_elements_array, _10000_elements_array.length); + Arrays.parallelSort(parallelDataSet); + + assertNotNull(parallelDataSet); + assertNotSame(Arrays.copyOf(_10000_elements_array, _10000_elements_array.length), parallelDataSet); + } + + @Test + public void givenIntegerArrayOf100000Elements_whenUsingArraysSortMethod_thenSortFullArrayInAscendingOrder() { + int[] sequentialDataSet = Arrays.copyOf(_100000_elements_array, _100000_elements_array.length); + Arrays.sort(sequentialDataSet); + + assertNotNull(sequentialDataSet); + assertNotSame(Arrays.copyOf(_100000_elements_array, _100000_elements_array.length), sequentialDataSet); + } + + @Test + public void givenIntegerArrayOf100000Elements_whenUsingArraysParallelSortMethod_thenSortFullArrayInAscendingOrder() { + int[] parallelDataSet = Arrays.copyOf(_100000_elements_array, _100000_elements_array.length); + Arrays.parallelSort(parallelDataSet); + + assertNotNull(parallelDataSet); + assertNotSame(Arrays.copyOf(_100000_elements_array, _100000_elements_array.length), parallelDataSet); + } + + @Test + public void givenIntegerArrayOf1000000Elements_whenUsingArraysSortMethod_thenSortFullArrayInAscendingOrder() { + int[] sequentialDataSet = Arrays.copyOf(_1000000_elements_array, _1000000_elements_array.length); + Arrays.sort(sequentialDataSet); + + assertNotNull(sequentialDataSet); + assertNotSame(Arrays.copyOf(_1000000_elements_array, _1000000_elements_array.length), sequentialDataSet); + } + + @Test + public void givenIntegerArrayOf1000000Elements_whenUsingArraysParallelSortMethod_thenSortFullArrayInAscendingOrder() { + int[] parallelDataSet = Arrays.copyOf(_1000000_elements_array, _1000000_elements_array.length); + Arrays.parallelSort(parallelDataSet); + + assertNotNull(parallelDataSet); + assertNotSame(Arrays.copyOf(_1000000_elements_array, _1000000_elements_array.length), parallelDataSet); + } + + @After + public void tearDown() throws Exception { + sizeOfArrays = null; + _1000_elements_array = null; + _10000_elements_array = null; + _100000_elements_array = null; + _1000000_elements_array = null; + } +} + + diff --git a/core-java-modules/core-java-arrays/pom.xml b/core-java-modules/core-java-arrays/pom.xml index ca4e262ff9..20a835594f 100644 --- a/core-java-modules/core-java-arrays/pom.xml +++ b/core-java-modules/core-java-arrays/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -171,12 +172,12 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - + org.apache.maven.plugins maven-javadoc-plugin @@ -237,7 +238,7 @@ java -classpath - + org.openjdk.jmh.Main .* @@ -356,10 +357,9 @@ - 3.9 - + 1.19 1.19 diff --git a/core-java-modules/core-java-collections-2/pom.xml b/core-java-modules/core-java-collections-2/pom.xml index 217c1d9258..e0e7dd5c82 100644 --- a/core-java-modules/core-java-collections-2/pom.xml +++ b/core-java-modules/core-java-collections-2/pom.xml @@ -1,5 +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 core-java-collections-2 core-java-collections-2 @@ -54,4 +55,5 @@ 1.2.0 1.3 + diff --git a/core-java-modules/core-java-collections-3/pom.xml b/core-java-modules/core-java-collections-3/pom.xml index 84c7865e68..f94ff6f71f 100644 --- a/core-java-modules/core-java-collections-3/pom.xml +++ b/core-java-modules/core-java-collections-3/pom.xml @@ -1,5 +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 core-java-collections-3 0.1.0-SNAPSHOT @@ -31,4 +32,5 @@ 1.19 3.11.1 + diff --git a/core-java-modules/core-java-collections-array-list/pom.xml b/core-java-modules/core-java-collections-array-list/pom.xml index 249103152a..cf7889fa58 100644 --- a/core-java-modules/core-java-collections-array-list/pom.xml +++ b/core-java-modules/core-java-collections-array-list/pom.xml @@ -1,5 +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 core-java-collections-array-list 0.1.0-SNAPSHOT @@ -31,4 +32,5 @@ 4.1 3.11.1 + diff --git a/core-java-modules/core-java-collections-list-2/pom.xml b/core-java-modules/core-java-collections-list-2/pom.xml index 9652a7d79f..05b82a179b 100644 --- a/core-java-modules/core-java-collections-list-2/pom.xml +++ b/core-java-modules/core-java-collections-list-2/pom.xml @@ -1,5 +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 core-java-collections-list-2 0.1.0-SNAPSHOT @@ -34,7 +35,8 @@ - 4.1 + 4.1 3.11.1 + diff --git a/core-java-modules/core-java-collections-list-3/pom.xml b/core-java-modules/core-java-collections-list-3/pom.xml index dab5058cd3..ced8a732c1 100644 --- a/core-java-modules/core-java-collections-list-3/pom.xml +++ b/core-java-modules/core-java-collections-list-3/pom.xml @@ -1,5 +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 core-java-collections-list-3 0.1.0-SNAPSHOT @@ -57,8 +58,9 @@ 4.1 3.11.1 - 3.0.2 - 8.1.0 - 1.2.0 + 3.0.2 + 8.1.0 + 1.2.0 + diff --git a/core-java-modules/core-java-collections-list/pom.xml b/core-java-modules/core-java-collections-list/pom.xml index c8e881110e..3227c94e78 100644 --- a/core-java-modules/core-java-collections-list/pom.xml +++ b/core-java-modules/core-java-collections-list/pom.xml @@ -1,5 +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 core-java-collections-list 0.1.0-SNAPSHOT @@ -37,4 +38,5 @@ 3.8.1 3.11.1 + diff --git a/core-java-modules/core-java-collections-set/pom.xml b/core-java-modules/core-java-collections-set/pom.xml index 1dd1e06ca1..d21bbeef77 100644 --- a/core-java-modules/core-java-collections-set/pom.xml +++ b/core-java-modules/core-java-collections-set/pom.xml @@ -1,5 +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 core-java-collections-set 0.1.0-SNAPSHOT @@ -35,4 +36,5 @@ 4.3 2.8.5 + \ No newline at end of file diff --git a/core-java-modules/core-java-collections/pom.xml b/core-java-modules/core-java-collections/pom.xml index 62b42b53e7..c9cbe94a4f 100644 --- a/core-java-modules/core-java-collections/pom.xml +++ b/core-java-modules/core-java-collections/pom.xml @@ -1,5 +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 core-java-collections 0.1.0-SNAPSHOT @@ -36,4 +37,5 @@ 1.19 3.11.1 + diff --git a/core-java-modules/core-java-concurrency-2/pom.xml b/core-java-modules/core-java-concurrency-2/pom.xml index 6b179a29c7..690fe97ae6 100644 --- a/core-java-modules/core-java-concurrency-2/pom.xml +++ b/core-java-modules/core-java-concurrency-2/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"> 4.0.0 - com.baeldung core-java-concurrency-2 0.1.0-SNAPSHOT core-java-concurrency-2 diff --git a/core-java-modules/core-java-concurrency-advanced-2/README.md b/core-java-modules/core-java-concurrency-advanced-2/README.md index 988ada9e4a..0e3d25689f 100644 --- a/core-java-modules/core-java-concurrency-advanced-2/README.md +++ b/core-java-modules/core-java-concurrency-advanced-2/README.md @@ -1,5 +1,3 @@ -========= - ## Core Java Concurrency Advanced Examples This module contains articles about advanced topics about multithreading with core Java. diff --git a/core-java-modules/core-java-concurrency-advanced-2/pom.xml b/core-java-modules/core-java-concurrency-advanced-2/pom.xml index cad492b1ea..7e76219c4e 100644 --- a/core-java-modules/core-java-concurrency-advanced-2/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced-2/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"> 4.0.0 - com.baeldung core-java-concurrency-advanced-2 0.1.0-SNAPSHOT core-java-concurrency-advanced-2 @@ -30,7 +30,7 @@ jmh-generator-annprocess ${jmh-generator-annprocess.version} - + org.assertj assertj-core @@ -52,7 +52,6 @@ 1.19 1.19 - 3.6.1 diff --git a/core-java-modules/core-java-concurrency-advanced-3/README.md b/core-java-modules/core-java-concurrency-advanced-3/README.md index d1622b5fe1..409d3aa464 100644 --- a/core-java-modules/core-java-concurrency-advanced-3/README.md +++ b/core-java-modules/core-java-concurrency-advanced-3/README.md @@ -6,4 +6,6 @@ This module contains articles about advanced topics about multithreading with co ### Relevant Articles: +- [Common Concurrency Pitfalls in Java](https://www.baeldung.com/java-common-concurrency-pitfalls) +- [Guide to RejectedExecutionHandler](https://www.baeldung.com/java-rejectedexecutionhandler) [[<-- previous]](/core-java-modules/core-java-concurrency-advanced-2) diff --git a/core-java-modules/core-java-concurrency-advanced-3/pom.xml b/core-java-modules/core-java-concurrency-advanced-3/pom.xml index 77b86d7d58..df9834181f 100644 --- a/core-java-modules/core-java-concurrency-advanced-3/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced-3/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"> 4.0.0 core-java-concurrency-advanced-3 diff --git a/core-java-modules/core-java-concurrency-advanced/pom.xml b/core-java-modules/core-java-concurrency-advanced/pom.xml index 4a9ee30d65..65ca811737 100644 --- a/core-java-modules/core-java-concurrency-advanced/pom.xml +++ b/core-java-modules/core-java-concurrency-advanced/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"> 4.0.0 - com.baeldung core-java-concurrency-advanced 0.1.0-SNAPSHOT core-java-concurrency-advanced diff --git a/core-java-modules/core-java-concurrency-basic-2/README.md b/core-java-modules/core-java-concurrency-basic-2/README.md index e72725b7cb..e3f7a94e14 100644 --- a/core-java-modules/core-java-concurrency-basic-2/README.md +++ b/core-java-modules/core-java-concurrency-basic-2/README.md @@ -1,6 +1,6 @@ -========= +## Core Java Concurrency Basic -## Core Java Concurrency Basic 2 Examples +This module contains articles about basic Java concurrency ### Relevant Articles: - [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) @@ -8,3 +8,4 @@ - [Difference Between Wait and Sleep in Java](https://www.baeldung.com/java-wait-and-sleep) - [Guide to the Synchronized Keyword in Java](https://www.baeldung.com/java-synchronized) - [Life Cycle of a Thread in Java](https://www.baeldung.com/java-thread-lifecycle) +- [[<-- Prev]](/core-java-modules/core-java-concurrency-basic) \ No newline at end of file diff --git a/core-java-modules/core-java-concurrency-basic-2/pom.xml b/core-java-modules/core-java-concurrency-basic-2/pom.xml index 396447ff75..0fee2c04ff 100644 --- a/core-java-modules/core-java-concurrency-basic-2/pom.xml +++ b/core-java-modules/core-java-concurrency-basic-2/pom.xml @@ -1,5 +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 core-java-concurrency-basic-2 0.1.0-SNAPSHOT @@ -13,9 +14,6 @@ ../../parent-java - - - core-java-concurrency-basic-2 diff --git a/core-java-modules/core-java-concurrency-basic/pom.xml b/core-java-modules/core-java-concurrency-basic/pom.xml index 93b8523eb4..9d9d2cb663 100644 --- a/core-java-modules/core-java-concurrency-basic/pom.xml +++ b/core-java-modules/core-java-concurrency-basic/pom.xml @@ -1,5 +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 core-java-concurrency-basic 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-concurrency-collections/pom.xml b/core-java-modules/core-java-concurrency-collections/pom.xml index 0d3a6042ac..f731b1acd1 100644 --- a/core-java-modules/core-java-concurrency-collections/pom.xml +++ b/core-java-modules/core-java-concurrency-collections/pom.xml @@ -1,5 +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 core-java-concurrency-collections 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-date-operations/README.md b/core-java-modules/core-java-date-operations/README.md index 98616a32c3..24bb493dce 100644 --- a/core-java-modules/core-java-date-operations/README.md +++ b/core-java-modules/core-java-date-operations/README.md @@ -1,3 +1,8 @@ +## Core Date Operations +This module contains articles about date operations in Java. + ### Relevant Articles: - [Get the Current Date Prior to Java 8](https://www.baeldung.com/java-get-the-current-date-legacy) - [Skipping Weekends While Adding Days to LocalDate in Java 8](https://www.baeldung.com/java-localdate-add-days-skip-weekends) +- [Checking If Two Java Dates Are on the Same Day](https://www.baeldung.com/java-check-two-dates-on-same-day) +- [Converting Java Date to OffsetDateTime](https://www.baeldung.com/java-convert-date-to-offsetdatetime) diff --git a/core-java-modules/core-java-date-operations/pom.xml b/core-java-modules/core-java-date-operations/pom.xml index dcfe893a46..4d267964ee 100644 --- a/core-java-modules/core-java-date-operations/pom.xml +++ b/core-java-modules/core-java-date-operations/pom.xml @@ -1,38 +1,41 @@ - 4.0.0 - core-java-date-operations - ${project.parent.version} - jar + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + core-java-date-operations + ${project.parent.version} + core-java-date-operations + jar - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java - + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + joda-time + joda-time + ${joda-time.version} + + + com.darwinsys + hirondelle-date4j + ${hirondelle-date4j.version} + + + + + 2.10 + 1.5.1 + - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - - joda-time - joda-time - ${joda-time.version} - - - com.darwinsys - hirondelle-date4j - ${hirondelle-date4j.version} - - - - 2.10 - 1.5.1 - \ No newline at end of file diff --git a/java-dates-2/src/main/java/com/baeldung/date/conversion/ConvertToOffsetDateTime.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTime.java similarity index 92% rename from java-dates-2/src/main/java/com/baeldung/date/conversion/ConvertToOffsetDateTime.java rename to core-java-modules/core-java-date-operations/src/main/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTime.java index 34914962f9..defd0a335e 100644 --- a/java-dates-2/src/main/java/com/baeldung/date/conversion/ConvertToOffsetDateTime.java +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTime.java @@ -1,4 +1,4 @@ -package com.baeldung.date.conversion; +package com.baeldung.offsetdatetime; import java.time.OffsetDateTime; import java.time.ZoneOffset; diff --git a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtils.java b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/skipweekends/AddSubtractDaysSkippingWeekendsUtils.java similarity index 96% rename from core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtils.java rename to core-java-modules/core-java-date-operations/src/main/java/com/baeldung/skipweekends/AddSubtractDaysSkippingWeekendsUtils.java index bf32fdb79a..94adfa0c9d 100644 --- a/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtils.java +++ b/core-java-modules/core-java-date-operations/src/main/java/com/baeldung/skipweekends/AddSubtractDaysSkippingWeekendsUtils.java @@ -1,4 +1,4 @@ -package com.baeldung.datetime; +package com.baeldung.skipweekends; import java.time.DayOfWeek; import java.time.LocalDate; diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/date/comparison/DateComparisonUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/date/comparison/DateComparisonUtilsUnitTest.java index f02d97d73c..db55aadcca 100644 --- a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/date/comparison/DateComparisonUtilsUnitTest.java +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/date/comparison/DateComparisonUtilsUnitTest.java @@ -1,13 +1,13 @@ package com.baeldung.date.comparison; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; -import org.junit.Test; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class DateComparisonUtilsUnitTest { diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/CalendarUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/CalendarUtilsUnitTest.java index 0060162ffb..8c9ed695d7 100644 --- a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/CalendarUtilsUnitTest.java +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/CalendarUtilsUnitTest.java @@ -1,15 +1,12 @@ package com.baeldung.datetime; -import static org.junit.Assert.assertEquals; - import org.junit.Test; -import com.baeldung.datetime.CalendarUtils; -import com.baeldung.datetime.DateUtils; - import java.text.ParseException; import java.util.Date; +import static org.junit.Assert.assertEquals; + public class CalendarUtilsUnitTest { @Test diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/DateUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/DateUtilsUnitTest.java index 62a0fc0b4b..8711455265 100644 --- a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/DateUtilsUnitTest.java +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/DateUtilsUnitTest.java @@ -1,14 +1,12 @@ package com.baeldung.datetime; -import static org.junit.Assert.assertEquals; - import org.junit.Test; -import com.baeldung.datetime.DateUtils; - import java.text.ParseException; import java.util.Date; +import static org.junit.Assert.assertEquals; + public class DateUtilsUnitTest { @Test diff --git a/java-dates-2/src/test/java/com/baeldung/date/conversion/ConvertToOffsetDateTimeUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTimeUnitTest.java similarity index 95% rename from java-dates-2/src/test/java/com/baeldung/date/conversion/ConvertToOffsetDateTimeUnitTest.java rename to core-java-modules/core-java-date-operations/src/test/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTimeUnitTest.java index c927da00c8..a6fd6c03c2 100644 --- a/java-dates-2/src/test/java/com/baeldung/date/conversion/ConvertToOffsetDateTimeUnitTest.java +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/offsetdatetime/ConvertToOffsetDateTimeUnitTest.java @@ -1,12 +1,12 @@ -package com.baeldung.date.conversion; +package com.baeldung.offsetdatetime; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.junit.Test; import java.time.OffsetDateTime; import java.util.Date; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; public class ConvertToOffsetDateTimeUnitTest { diff --git a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/skipweekends/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java similarity index 89% rename from core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java rename to core-java-modules/core-java-date-operations/src/test/java/com/baeldung/skipweekends/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java index d60a0f4015..76bd9f4558 100644 --- a/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/datetime/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java +++ b/core-java-modules/core-java-date-operations/src/test/java/com/baeldung/skipweekends/AddSubtractDaysSkippingWeekendsUtilsUnitTest.java @@ -1,7 +1,8 @@ -package com.baeldung.datetime; +package com.baeldung.skipweekends; import static org.junit.Assert.assertEquals; +import com.baeldung.skipweekends.AddSubtractDaysSkippingWeekendsUtils; import org.junit.Test; import java.time.LocalDate; diff --git a/core-java-modules/core-java-datetime-computations/pom.xml b/core-java-modules/core-java-datetime-computations/pom.xml index 934df8018f..af6b110296 100644 --- a/core-java-modules/core-java-datetime-computations/pom.xml +++ b/core-java-modules/core-java-datetime-computations/pom.xml @@ -1,5 +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 core-java-datetime-computations ${project.parent.version} @@ -68,4 +69,5 @@ 1.9 1.9 + diff --git a/core-java-modules/core-java-datetime-conversion/pom.xml b/core-java-modules/core-java-datetime-conversion/pom.xml index a93eca00af..e2b143aa88 100644 --- a/core-java-modules/core-java-datetime-conversion/pom.xml +++ b/core-java-modules/core-java-datetime-conversion/pom.xml @@ -1,5 +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 core-java-datetime-conversion ${project.parent.version} @@ -64,7 +65,8 @@ 2.10 3.6.1 - 1.9 + 1.9 1.9 + diff --git a/core-java-modules/core-java-datetime-java8/pom.xml b/core-java-modules/core-java-datetime-java8/pom.xml index 72d51b5f10..34323fe76c 100644 --- a/core-java-modules/core-java-datetime-java8/pom.xml +++ b/core-java-modules/core-java-datetime-java8/pom.xml @@ -1,5 +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 core-java-datetime-java8 ${project.parent.version} @@ -61,10 +62,11 @@ - 1.9 + 1.9 1.9 2.10 3.6.1 + diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseDateTimeFormatter.java diff --git a/java-dates/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java b/core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java similarity index 100% rename from java-dates/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java rename to core-java-modules/core-java-datetime-java8/src/main/java/com/baeldung/datetime/UseOffsetDateTime.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseDateTimeFormatterUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseOffsetDateTimeUnitTest.java diff --git a/java-dates/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java b/core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java similarity index 100% rename from java-dates/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java rename to core-java-modules/core-java-datetime-java8/src/test/java/com/baeldung/datetime/UseToInstantUnitTest.java diff --git a/core-java-modules/core-java-datetime-string/pom.xml b/core-java-modules/core-java-datetime-string/pom.xml index b4e7aff524..dd793f7fe8 100644 --- a/core-java-modules/core-java-datetime-string/pom.xml +++ b/core-java-modules/core-java-datetime-string/pom.xml @@ -1,5 +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 core-java-datetime-string ${project.parent.version} @@ -77,7 +78,8 @@ 2.10 3.6.1 - 1.9 + 1.9 1.9 + diff --git a/core-java-modules/core-java-exceptions-2/README.md b/core-java-modules/core-java-exceptions-2/README.md new file mode 100644 index 0000000000..3ad5189b5e --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/README.md @@ -0,0 +1,5 @@ +## Core Java Exceptions 2 + +This module contains articles about core java exceptions + +### diff --git a/core-java-modules/core-java-exceptions-2/pom.xml b/core-java-modules/core-java-exceptions-2/pom.xml new file mode 100644 index 0000000000..2f7f613faf --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/pom.xml @@ -0,0 +1,24 @@ + + 4.0.0 + + core-java-exceptions-2 + core-java-exceptions-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + http://maven.apache.org + + + UTF-8 + + + diff --git a/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/RethrowDifferentExceptionDemo.java b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/RethrowDifferentExceptionDemo.java new file mode 100644 index 0000000000..ce2fcb2c7a --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/RethrowDifferentExceptionDemo.java @@ -0,0 +1,29 @@ +package com.baeldung.rethrow; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.baeldung.rethrow.custom.InvalidDataException; + +public class RethrowDifferentExceptionDemo { + + private final static Logger LOGGER = Logger.getLogger(RethrowDifferentExceptionDemo.class.getName()); + + public static void main(String[] args) throws Exception { + String name = null; + + try { + + // Below line will throw NullPointerException + if (name.equals("Joe")) { + // Do blah blah.. + } + + } catch (Exception e) { + LOGGER.log(Level.WARNING, "So and so user is unable to cast vote because he is found uneligible"); + throw new InvalidDataException(e); + } + + } + +} diff --git a/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/RethrowSameExceptionDemo.java b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/RethrowSameExceptionDemo.java new file mode 100644 index 0000000000..bf53f67d34 --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/RethrowSameExceptionDemo.java @@ -0,0 +1,27 @@ +package com.baeldung.rethrow; + +import java.util.logging.Level; +import java.util.logging.Logger; + +public class RethrowSameExceptionDemo { + + private final static Logger LOGGER = Logger.getLogger(RethrowDifferentExceptionDemo.class.getName()); + + public static void main(String[] args) throws Exception { + String name = null; + + try { + + // Below line will throw NullPointerException + if (name.equals("Joe")) { + // Do blah blah.. + } + + } catch (Exception e) { + LOGGER.log(Level.WARNING, "Exception occurred due to invalid name"); + throw e; + } + + } + +} diff --git a/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/custom/InvalidDataException.java b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/custom/InvalidDataException.java new file mode 100644 index 0000000000..5a74e32012 --- /dev/null +++ b/core-java-modules/core-java-exceptions-2/src/main/java/com/baeldung/rethrow/custom/InvalidDataException.java @@ -0,0 +1,8 @@ +package com.baeldung.rethrow.custom; + +public class InvalidDataException extends Exception { + + public InvalidDataException(Exception e) { + super(e); + } +} diff --git a/core-java-modules/core-java-exceptions/README.md b/core-java-modules/core-java-exceptions/README.md index 63a3eb19a1..b7222540e9 100644 --- a/core-java-modules/core-java-exceptions/README.md +++ b/core-java-modules/core-java-exceptions/README.md @@ -17,3 +17,4 @@ This module contains articles about core java exceptions - [Common Java Exceptions](https://www.baeldung.com/java-common-exceptions) - [How to Find an Exception’s Root Cause in Java](https://www.baeldung.com/java-exception-root-cause) - [Is It a Bad Practice to Catch Throwable?](https://www.baeldung.com/java-catch-throwable-bad-practice) +- [[Next -->]](/core-java-modules/core-java-exceptions-2) \ No newline at end of file diff --git a/core-java-modules/core-java-exceptions/pom.xml b/core-java-modules/core-java-exceptions/pom.xml index da5ec76622..303a09d5b7 100644 --- a/core-java-modules/core-java-exceptions/pom.xml +++ b/core-java-modules/core-java-exceptions/pom.xml @@ -2,8 +2,8 @@ - com.baeldung.exceptions 4.0.0 + com.baeldung.exceptions core-java-exceptions 0.1.0-SNAPSHOT core-java-exceptions diff --git a/core-java-modules/core-java-function/pom.xml b/core-java-modules/core-java-function/pom.xml index 22b2fd9bda..0e61f73c84 100644 --- a/core-java-modules/core-java-function/pom.xml +++ b/core-java-modules/core-java-function/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -37,4 +38,5 @@ 3.6.1 + diff --git a/core-java-modules/core-java-io-2/pom.xml b/core-java-modules/core-java-io-2/pom.xml index dd0f8931c3..0c271737d9 100644 --- a/core-java-modules/core-java-io-2/pom.xml +++ b/core-java-modules/core-java-io-2/pom.xml @@ -1,5 +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 core-java-io-2 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-io-apis/pom.xml b/core-java-modules/core-java-io-apis/pom.xml index 0eab844681..6eb869c537 100644 --- a/core-java-modules/core-java-io-apis/pom.xml +++ b/core-java-modules/core-java-io-apis/pom.xml @@ -1,5 +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 core-java-io-apis 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java index 57e12560bb..a4317af372 100644 --- a/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java +++ b/core-java-modules/core-java-io-apis/src/test/java/com/baeldung/file/FileClassUnitTest.java @@ -156,10 +156,16 @@ public class FileClassUnitTest { private static File makeDir(String name) { File directory = new File(name); - directory.mkdir(); - if (directory.isDirectory()) { + + // If the directory already exists, make sure we create it 'from scratch', i.e. all the files inside are deleted first + if (directory.exists()) { + removeDir(directory); + } + + if (directory.mkdir()) { return directory; } + throw new RuntimeException("'" + name + "' not made!"); } diff --git a/core-java-modules/core-java-io-conversions/pom.xml b/core-java-modules/core-java-io-conversions/pom.xml index 186dde2721..c3a1b2fe2d 100644 --- a/core-java-modules/core-java-io-conversions/pom.xml +++ b/core-java-modules/core-java-io-conversions/pom.xml @@ -1,5 +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 core-java-io-conversions 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-io/pom.xml b/core-java-modules/core-java-io/pom.xml index 0244011f78..1c568a610d 100644 --- a/core-java-modules/core-java-io/pom.xml +++ b/core-java-modules/core-java-io/pom.xml @@ -1,5 +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 core-java-io 0.1.0-SNAPSHOT @@ -72,7 +73,7 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed @@ -86,7 +87,7 @@ ${maven.compiler.target} - + org.apache.maven.plugins @@ -126,7 +127,7 @@ java -classpath - + org.openjdk.jmh.Main .* diff --git a/core-java-modules/core-java-jar/pom.xml b/core-java-modules/core-java-jar/pom.xml index cd86479d72..a3e8941622 100644 --- a/core-java-modules/core-java-jar/pom.xml +++ b/core-java-modules/core-java-jar/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -63,7 +64,7 @@ - core-java + core-java-jar src/main/resources @@ -195,12 +196,12 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - + org.apache.maven.plugins maven-javadoc-plugin @@ -261,7 +262,7 @@ java -classpath - + org.openjdk.jmh.Main .* @@ -383,7 +384,7 @@ 0.4 1.8.7 - + 3.10.0 @@ -397,4 +398,5 @@ 2.0.3.RELEASE 1.6.0 + diff --git a/core-java-modules/core-java-jndi/pom.xml b/core-java-modules/core-java-jndi/pom.xml index 7f621af21d..13504886d6 100644 --- a/core-java-modules/core-java-jndi/pom.xml +++ b/core-java-modules/core-java-jndi/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.jndi core-java-jndi 1.0-SNAPSHOT @@ -63,4 +62,5 @@ + diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/pom.xml index 059075318a..ddf52d8fef 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern1/consumermodule/pom.xml @@ -1,24 +1,25 @@ - + 4.0.0 consumermodule - jar 1.0 - + jar + com.baeldung.decoupling-pattern1 decoupling-pattern1 1.0 - + com.baeldung.servicemodule servicemodule - 1.0 + 1.0 - + @@ -27,4 +28,5 @@ + diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml index 282723e0a0..78a9d1eaad 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern1/pom.xml @@ -1,18 +1,18 @@ - + 4.0.0 com.baeldung.decoupling-pattern1 decoupling-pattern1 1.0 pom - + servicemodule consumermodule - + @@ -28,8 +28,9 @@ - + UTF-8 + \ No newline at end of file diff --git a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/pom.xml index 1bda70f867..ece85fd5dc 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern1/servicemodule/pom.xml @@ -1,17 +1,17 @@ - + 4.0.0 - com.baeldung.servicemodule servicemodule jar - + com.baeldung.decoupling-pattern1 decoupling-pattern1 1.0 - + @@ -20,5 +20,5 @@ - + \ No newline at end of file diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml index 09ca44d9be..734774af0e 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/consumermodule/pom.xml @@ -8,8 +8,8 @@ 1.0 - com.baeldung.decoupling-pattern2 decoupling-pattern2 + com.baeldung.decoupling-pattern2 1.0-SNAPSHOT diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/pom.xml index f8c05d40b8..2f84c69fd6 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/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.decoupling-pattern2 decoupling-pattern2 1.0-SNAPSHOT diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml index ceeda9049c..5ec36c581e 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/providermodule/pom.xml @@ -2,15 +2,14 @@ - 4.0.0 com.baeldung.providermodule providermodule 1.0 - com.baeldung.decoupling-pattern2 decoupling-pattern2 + com.baeldung.decoupling-pattern2 1.0-SNAPSHOT diff --git a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml index 861f06f089..9249ea5d89 100644 --- a/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml +++ b/core-java-modules/core-java-jpms/decoupling-pattern2/servicemodule/pom.xml @@ -8,8 +8,8 @@ 1.0 - >com.baeldung.decoupling-pattern2 decoupling-pattern2 + >com.baeldung.decoupling-pattern2 1.0-SNAPSHOT diff --git a/core-java-modules/core-java-jvm/pom.xml b/core-java-modules/core-java-jvm/pom.xml index 74960820d7..61c31ce82f 100644 --- a/core-java-modules/core-java-jvm/pom.xml +++ b/core-java-modules/core-java-jvm/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 core-java-jvm 0.1.0-SNAPSHOT - jar core-java-jvm + jar com.baeldung @@ -48,7 +49,6 @@ system ${java.home}/../lib/tools.jar - @@ -58,4 +58,5 @@ 2.1.0.1 1.8.0 + diff --git a/core-java-modules/core-java-jvm/src/main/java/com/baeldung/exitvshalt/JvmExitAndHaltDemo.java b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/exitvshalt/JvmExitAndHaltDemo.java new file mode 100644 index 0000000000..6d572455fb --- /dev/null +++ b/core-java-modules/core-java-jvm/src/main/java/com/baeldung/exitvshalt/JvmExitAndHaltDemo.java @@ -0,0 +1,34 @@ +package com.baeldung.exitvshalt; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class JvmExitAndHaltDemo { + + private static Logger LOGGER = LoggerFactory.getLogger(JvmExitAndHaltDemo.class); + + static { + Runtime.getRuntime() + .addShutdownHook(new Thread(() -> { + LOGGER.info("Shutdown hook initiated."); + })); + } + + public void processAndExit() { + process(); + LOGGER.info("Calling System.exit()."); + System.exit(0); + } + + public void processAndHalt() { + process(); + LOGGER.info("Calling Runtime.getRuntime().halt()."); + Runtime.getRuntime() + .halt(0); + } + + private void process() { + LOGGER.info("Process started."); + } + +} diff --git a/core-java-modules/core-java-jvm/src/test/java/com/baeldung/exitvshalt/JvmExitDemoUnitTest.java b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/exitvshalt/JvmExitDemoUnitTest.java new file mode 100644 index 0000000000..0c50651af0 --- /dev/null +++ b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/exitvshalt/JvmExitDemoUnitTest.java @@ -0,0 +1,14 @@ +package com.baeldung.exitvshalt; + +import org.junit.Test; + +public class JvmExitDemoUnitTest { + + JvmExitAndHaltDemo jvmExitAndHaltDemo = new JvmExitAndHaltDemo(); + + @Test + public void givenProcessComplete_whenExitCalled_thenTriggerShutdownHook() { + jvmExitAndHaltDemo.processAndExit(); + } + +} diff --git a/core-java-modules/core-java-jvm/src/test/java/com/baeldung/exitvshalt/JvmHaltDemoUnitTest.java b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/exitvshalt/JvmHaltDemoUnitTest.java new file mode 100644 index 0000000000..9f08e95c6a --- /dev/null +++ b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/exitvshalt/JvmHaltDemoUnitTest.java @@ -0,0 +1,14 @@ +package com.baeldung.exitvshalt; + +import org.junit.Test; + +public class JvmHaltDemoUnitTest { + + JvmExitAndHaltDemo jvmExitAndHaltDemo = new JvmExitAndHaltDemo(); + + @Test + public void givenProcessComplete_whenHaltCalled_thenDoNotTriggerShutdownHook() { + jvmExitAndHaltDemo.processAndHalt(); + } + +} diff --git a/core-java-modules/core-java-jvm/src/test/java/com/baeldung/shutdownhook/ShutdownHookUnitTest.java b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/shutdownhook/ShutdownHookUnitTest.java new file mode 100644 index 0000000000..0f97a2eb09 --- /dev/null +++ b/core-java-modules/core-java-jvm/src/test/java/com/baeldung/shutdownhook/ShutdownHookUnitTest.java @@ -0,0 +1,47 @@ +package com.baeldung.shutdownhook; + +import org.junit.Test; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +public class ShutdownHookUnitTest { + + @Test + public void givenAHook_WhenShutsDown_ThenHookShouldBeExecuted() { + Thread printingHook = new Thread(() -> System.out.println("In the middle of a shutdown")); + Runtime.getRuntime().addShutdownHook(printingHook); + } + + @Test + public void addingAHook_WhenThreadAlreadyStarted_ThenThrowsAnException() { + Thread longRunningHook = new Thread(() -> { + try { + Thread.sleep(300); + } catch (InterruptedException ignored) {} + }); + longRunningHook.start(); + + assertThatThrownBy(() -> Runtime.getRuntime().addShutdownHook(longRunningHook)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("Hook already running"); + } + + @Test + public void addingAHook_WhenAlreadyExists_ThenAnExceptionWouldBeThrown() { + Thread unfortunateHook = new Thread(() -> {}); + Runtime.getRuntime().addShutdownHook(unfortunateHook); + + assertThatThrownBy(() -> Runtime.getRuntime().addShutdownHook(unfortunateHook)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessage("Hook previously registered"); + } + + @Test + public void removeAHook_WhenItIsAlreadyRegistered_ThenWouldDeRegisterTheHook() { + Thread willNotRun = new Thread(() -> System.out.println("Won't run!")); + Runtime.getRuntime().addShutdownHook(willNotRun); + + assertThat(Runtime.getRuntime().removeShutdownHook(willNotRun)).isTrue(); + } +} diff --git a/core-java-modules/core-java-lambdas/pom.xml b/core-java-modules/core-java-lambdas/pom.xml index 433db0a9ca..fbcd9d5870 100644 --- a/core-java-modules/core-java-lambdas/pom.xml +++ b/core-java-modules/core-java-lambdas/pom.xml @@ -2,24 +2,25 @@ - 4.0.0 - core-java-lambdas - 0.1.0-SNAPSHOT - core-java-lambdas - jar + 4.0.0 + core-java-lambdas + 0.1.0-SNAPSHOT + core-java-lambdas + jar - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java - + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + - - - org.apache.commons - commons-lang3 - ${commons-lang3.version} - - \ No newline at end of file diff --git a/core-java-modules/core-java-lang-2/pom.xml b/core-java-modules/core-java-lang-2/pom.xml index 3230498f41..5657e64b17 100644 --- a/core-java-modules/core-java-lang-2/pom.xml +++ b/core-java-modules/core-java-lang-2/pom.xml @@ -1,54 +1,62 @@ - - 4.0.0 - core-java-lang-2 - 0.1.0-SNAPSHOT - core-java-lang-2 - jar - - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java - - - - - commons-beanutils - commons-beanutils - 1.9.4 - - - org.openjdk.jmh - jmh-generator-annprocess - ${jmh-generator.version} - - - org.openjdk.jmh - jmh-generator-bytecode - ${jmh-generator.version} - - - org.openjdk.jmh - jmh-core - ${jmh-core.version} - - - - - core-java-lang-2 - - - src/main/resources - true - - - - - - 1.19 - 1.19 - - - + + + 4.0.0 + core-java-lang-2 + 0.1.0-SNAPSHOT + core-java-lang-2 + jar + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + commons-beanutils + commons-beanutils + 1.9.4 + + + org.openjdk.jmh + jmh-generator-annprocess + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-generator-bytecode + ${jmh-generator.version} + + + org.openjdk.jmh + jmh-core + ${jmh-core.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + + + core-java-lang-2 + + + src/main/resources + true + + + + + + 1.19 + 1.19 + 3.12.2 + + + diff --git a/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/defaultparams/Tea.java b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/defaultparams/Tea.java new file mode 100644 index 0000000000..0680813041 --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/main/java/com/baeldung/defaultparams/Tea.java @@ -0,0 +1,61 @@ +package com.baeldung.defaultparams; + +public class Tea { + + static final int DEFAULT_TEA_POWDER = 1; // add 1 tbsp tea powder by default + + private String name; // mandatory + private int milk; // ml + private boolean herbs; // add herbs or don't + private int sugar; // tbsp + private int teaPowder; // tbsp + + public Tea(String name, int milk, boolean herbs, int sugar, int teaPowder) { + this.name = name; + this.milk = milk; + this.herbs = herbs; + this.sugar = sugar; + this.teaPowder = teaPowder; + } + + // when tea powder is not provided by client, use default value + public Tea(String name, int milk, boolean herbs, int sugar) { + this(name, milk, herbs, sugar, DEFAULT_TEA_POWDER); + } + + // when sugar is not provided by client, don't add it + public Tea(String name, int milk, boolean herbs) { + this(name, milk, herbs, 0); + } + + // when herbs is not provided by client, don't add it + public Tea(String name, int milk) { + this(name, milk, false); + } + + // when milk is not provided by client, don't add it + public Tea(String name) { + this(name, 0); + } + + public String getName() { + return name; + } + + public int getMilk() { + return milk; + } + + public boolean isHerbs() { + return herbs; + } + + public int getSugar() { + return sugar; + } + + public int getTeaPowder() { + return teaPowder; + } + +} diff --git a/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/defaultparams/TeaUnitTest.java b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/defaultparams/TeaUnitTest.java new file mode 100644 index 0000000000..418e2788aa --- /dev/null +++ b/core-java-modules/core-java-lang-2/src/test/java/com/baeldung/defaultparams/TeaUnitTest.java @@ -0,0 +1,20 @@ +package com.baeldung.defaultparams; + +import static org.assertj.core.api.Assertions.assertThat; +import org.junit.Test; + + +public class TeaUnitTest { + + @Test + public void whenTeaWithOnlyName_thenCreateDefaultTea() { + Tea blackTea = new Tea("Black Tea"); + + assertThat(blackTea.getName()).isEqualTo("Black Tea"); + assertThat(blackTea.getMilk()).isEqualTo(0); + assertThat(blackTea.isHerbs()).isFalse(); + assertThat(blackTea.getSugar()).isEqualTo(0); + assertThat(blackTea.getTeaPowder()).isEqualTo(Tea.DEFAULT_TEA_POWDER); + } + +} diff --git a/core-java-modules/core-java-lang-math/pom.xml b/core-java-modules/core-java-lang-math/pom.xml index f884aca3a9..671d5630d2 100644 --- a/core-java-modules/core-java-lang-math/pom.xml +++ b/core-java-modules/core-java-lang-math/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -37,4 +38,5 @@ 3.6.1 + diff --git a/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/overflow/OverflowUnitTest.java b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/overflow/OverflowUnitTest.java new file mode 100644 index 0000000000..b570592c7e --- /dev/null +++ b/core-java-modules/core-java-lang-math/src/test/java/com/baeldung/overflow/OverflowUnitTest.java @@ -0,0 +1,22 @@ +package com.baeldung.overflow; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class OverflowUnitTest { + + @Test + public void positive_and_negative_zero_are_not_always_equal() { + + double a = +0f; + double b = -0f; + + assertTrue(a == b); + + assertTrue(1/a == Double.POSITIVE_INFINITY); + assertTrue(1/b == Double.NEGATIVE_INFINITY); + + assertTrue(1/a != 1/b); + } +} diff --git a/core-java-modules/core-java-lang-oop-2/pom.xml b/core-java-modules/core-java-lang-oop-2/pom.xml index 5bca2f0dbf..01bacab0b9 100644 --- a/core-java-modules/core-java-lang-oop-2/pom.xml +++ b/core-java-modules/core-java-lang-oop-2/pom.xml @@ -1,5 +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 core-java-lang-oop-2 0.1.0-SNAPSHOT @@ -13,7 +14,7 @@ ../../parent-java - + org.assertj @@ -27,8 +28,8 @@ ${equalsverifier.version} test - - + + core-java-lang-oop-2 diff --git a/core-java-modules/core-java-lang-oop-3/pom.xml b/core-java-modules/core-java-lang-oop-3/pom.xml index 1caf17bef3..70939c32c9 100644 --- a/core-java-modules/core-java-lang-oop-3/pom.xml +++ b/core-java-modules/core-java-lang-oop-3/pom.xml @@ -1,5 +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 core-java-lang-oop-3 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-lang-oop-4/pom.xml b/core-java-modules/core-java-lang-oop-4/pom.xml index 72662a8ea4..9e138afddf 100644 --- a/core-java-modules/core-java-lang-oop-4/pom.xml +++ b/core-java-modules/core-java-lang-oop-4/pom.xml @@ -1,5 +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 core-java-lang-oop-4 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-lang-oop/pom.xml b/core-java-modules/core-java-lang-oop/pom.xml index bdd9857dfa..a628a4d6c2 100644 --- a/core-java-modules/core-java-lang-oop/pom.xml +++ b/core-java-modules/core-java-lang-oop/pom.xml @@ -1,5 +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 core-java-lang-oop 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-lang-operators/pom.xml b/core-java-modules/core-java-lang-operators/pom.xml index 81865552dd..03720122cb 100644 --- a/core-java-modules/core-java-lang-operators/pom.xml +++ b/core-java-modules/core-java-lang-operators/pom.xml @@ -1,3 +1,4 @@ + diff --git a/core-java-modules/core-java-lang-syntax-2/pom.xml b/core-java-modules/core-java-lang-syntax-2/pom.xml index 98eea99fc0..961cf022cb 100644 --- a/core-java-modules/core-java-lang-syntax-2/pom.xml +++ b/core-java-modules/core-java-lang-syntax-2/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -22,4 +23,5 @@ + diff --git a/core-java-modules/core-java-lang-syntax/pom.xml b/core-java-modules/core-java-lang-syntax/pom.xml index f4549b689d..c47a1011b7 100644 --- a/core-java-modules/core-java-lang-syntax/pom.xml +++ b/core-java-modules/core-java-lang-syntax/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/core-java-modules/core-java-lang/pom.xml b/core-java-modules/core-java-lang/pom.xml index 10b0526177..5b8fe4133b 100644 --- a/core-java-modules/core-java-lang/pom.xml +++ b/core-java-modules/core-java-lang/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/core-java-modules/core-java-networking-2/pom.xml b/core-java-modules/core-java-networking-2/pom.xml index c3a5891066..2e2eb51809 100644 --- a/core-java-modules/core-java-networking-2/pom.xml +++ b/core-java-modules/core-java-networking-2/pom.xml @@ -1,5 +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 core-java-networking-2 core-java-networking-2 @@ -44,4 +45,5 @@ 1.5.0-b01 2.4.5 + diff --git a/core-java-modules/core-java-networking/pom.xml b/core-java-modules/core-java-networking/pom.xml index cd84d2a27c..f5b39625f0 100644 --- a/core-java-modules/core-java-networking/pom.xml +++ b/core-java-modules/core-java-networking/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -27,5 +28,6 @@ 4.3.4.RELEASE - + + diff --git a/core-java-modules/core-java-nio-2/pom.xml b/core-java-modules/core-java-nio-2/pom.xml index c1fa423b38..cd5c87d44e 100644 --- a/core-java-modules/core-java-nio-2/pom.xml +++ b/core-java-modules/core-java-nio-2/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 core-java-nio-2 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-nio/pom.xml b/core-java-modules/core-java-nio/pom.xml index da8759a956..bc7801c398 100644 --- a/core-java-modules/core-java-nio/pom.xml +++ b/core-java-modules/core-java-nio/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 core-java-nio 0.1.0-SNAPSHOT diff --git a/core-java-modules/core-java-optional/pom.xml b/core-java-modules/core-java-optional/pom.xml index 3c556012da..9ab41d5a82 100644 --- a/core-java-modules/core-java-optional/pom.xml +++ b/core-java-modules/core-java-optional/pom.xml @@ -1,16 +1,18 @@ - + + 4.0.0 core-java-optional 0.1.0-SNAPSHOT - jar core-java-optional - + jar + com.baeldung.core-java-modules core-java-modules 1.0.0-SNAPSHOT - + org.hibernate @@ -69,4 +71,5 @@ 3.10.0 3.1.1 + \ No newline at end of file diff --git a/core-java-modules/core-java-os/pom.xml b/core-java-modules/core-java-os/pom.xml index f09b62ebf2..b934701067 100644 --- a/core-java-modules/core-java-os/pom.xml +++ b/core-java-modules/core-java-os/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung core-java-os 0.1.0-SNAPSHOT core-java-os @@ -80,7 +80,7 @@ 4.1 4.01 - + 3.6.1 1.8.9 @@ -90,4 +90,5 @@ 0.4 1.8.7 + diff --git a/core-java-modules/core-java-perf/pom.xml b/core-java-modules/core-java-perf/pom.xml index a6e20f198d..18e05c9741 100644 --- a/core-java-modules/core-java-perf/pom.xml +++ b/core-java-modules/core-java-perf/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/core-java-modules/core-java-security-manager/pom.xml b/core-java-modules/core-java-security-manager/pom.xml index f5be1639da..52f1554ace 100644 --- a/core-java-modules/core-java-security-manager/pom.xml +++ b/core-java-modules/core-java-security-manager/pom.xml @@ -1,10 +1,12 @@ - + + 4.0.0 core-java-security-manager 0.1.0-SNAPSHOT - jar core-java-security-manager - + jar + com.baeldung.core-java-modules core-java-modules diff --git a/core-java-modules/core-java-security/pom.xml b/core-java-modules/core-java-security/pom.xml index e882fd823e..cefbd3a8a7 100644 --- a/core-java-modules/core-java-security/pom.xml +++ b/core-java-modules/core-java-security/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -35,14 +36,12 @@ - 1.60 1.11 3.10.0 - diff --git a/core-java-modules/core-java-streams-2/pom.xml b/core-java-modules/core-java-streams-2/pom.xml index 20c028edaa..58f13d658c 100644 --- a/core-java-modules/core-java-streams-2/pom.xml +++ b/core-java-modules/core-java-streams-2/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 core-java-streams-2 1.0 @@ -43,11 +44,12 @@ test - + UTF-8 1.9 1.9 3.11.1 + \ No newline at end of file diff --git a/core-java-modules/core-java-streams-3/pom.xml b/core-java-modules/core-java-streams-3/pom.xml index b5b21a4368..02503d3cab 100644 --- a/core-java-modules/core-java-streams-3/pom.xml +++ b/core-java-modules/core-java-streams-3/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -50,4 +51,5 @@ 2.22.1 + diff --git a/core-java-modules/core-java-streams/pom.xml b/core-java-modules/core-java-streams/pom.xml index 9b68c8dded..56fdd523fe 100644 --- a/core-java-modules/core-java-streams/pom.xml +++ b/core-java-modules/core-java-streams/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -114,8 +115,9 @@ 3.11.1 1.8.9 - 3.1 + 3.1 1.8 1.8 + diff --git a/core-java-modules/core-java-string-algorithms-2/pom.xml b/core-java-modules/core-java-string-algorithms-2/pom.xml index 5b0e710bb8..a67f1df6d2 100644 --- a/core-java-modules/core-java-string-algorithms-2/pom.xml +++ b/core-java-modules/core-java-string-algorithms-2/pom.xml @@ -1,10 +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 core-java-string-algorithms-2 0.1.0-SNAPSHOT - jar core-java-string-algorithms-2 + jar com.baeldung diff --git a/core-java-modules/core-java-string-algorithms-3/README.md b/core-java-modules/core-java-string-algorithms-3/README.md new file mode 100644 index 0000000000..3aa31cea53 --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-3/README.md @@ -0,0 +1,5 @@ +## Java String Algorithms + +This module contains articles about string-related algorithms. + +### Relevant Articles: diff --git a/core-java-modules/core-java-string-algorithms-3/pom.xml b/core-java-modules/core-java-string-algorithms-3/pom.xml new file mode 100644 index 0000000000..a5dd31c762 --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-3/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + core-java-string-algorithms-3 + 0.1.0-SNAPSHOT + jar + core-java-string-algorithms-3 + + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + + + + + + org.assertj + assertj-core + ${assertj.version} + test + + + com.google.guava + guava + 28.1-jre + + + + org.junit.jupiter + junit-jupiter-api + ${junit-jupiter-api.version} + test + + + + + core-java-string-algorithms-3 + + + src/main/resources + true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + -parameters + + + + + + + 3.8.1 + 3.6.1 + 27.0.1-jre + 5.3.1 + + + diff --git a/core-java-modules/core-java-string-algorithms-3/src/main/java/com/baeldung/anagram/Anagram.java b/core-java-modules/core-java-string-algorithms-3/src/main/java/com/baeldung/anagram/Anagram.java new file mode 100644 index 0000000000..360bc5c6de --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-3/src/main/java/com/baeldung/anagram/Anagram.java @@ -0,0 +1,62 @@ +package com.baeldung.anagram; + +import java.util.Arrays; +import com.google.common.collect.HashMultiset; +import com.google.common.collect.Multiset; + +public class Anagram { + // This definition only works for single byte encoding character set. + // For multibyte encoding, such as UTF-8, 16, 32 etc., + // we need to increase this number so that it can contain all possible characters. + private static int CHARACTER_RANGE = 256; + + public boolean isAnagramSort(String string1, String string2) { + if (string1.length() != string2.length()) { + return false; + } + char[] a1 = string1.toCharArray(); + char[] a2 = string2.toCharArray(); + Arrays.sort(a1); + Arrays.sort(a2); + return Arrays.equals(a1, a2); + } + + public boolean isAnagramCounting(String string1, String string2) { + if (string1.length() != string2.length()) { + return false; + } + int count[] = new int[CHARACTER_RANGE]; + for (int i = 0; i < string1.length(); i++) { + count[string1.charAt(i)]++; + count[string2.charAt(i)]--; + } + for (int i = 0; i < CHARACTER_RANGE; i++) { + if (count[i] != 0) { + return false; + } + } + return true; + } + + public boolean isAnagramMultiset(String string1, String string2) { + if (string1.length() != string2.length()) { + return false; + } + Multiset multiset1 = HashMultiset.create(); + Multiset multiset2 = HashMultiset.create(); + for (int i = 0; i < string1.length(); i++) { + multiset1.add(string1.charAt(i)); + multiset2.add(string2.charAt(i)); + } + return multiset1.equals(multiset2); + } + + public boolean isLetterBasedAnagramMultiset(String string1, String string2) { + return isAnagramMultiset(preprocess(string1), preprocess(string2)); + } + + private String preprocess(String source) { + return source.replaceAll("[^a-zA-Z]", "").toLowerCase(); + } + +} diff --git a/core-java-modules/core-java-string-algorithms-3/src/test/java/com/baeldung/anagram/AnagramUnitTest.java b/core-java-modules/core-java-string-algorithms-3/src/test/java/com/baeldung/anagram/AnagramUnitTest.java new file mode 100644 index 0000000000..bedeeb9418 --- /dev/null +++ b/core-java-modules/core-java-string-algorithms-3/src/test/java/com/baeldung/anagram/AnagramUnitTest.java @@ -0,0 +1,72 @@ +package com.baeldung.anagram; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class AnagramUnitTest { + @Test + public void givenAnagram_whenUsingSort_thenIdentifyAnagram() { + Anagram anagram = new Anagram(); + String string1 = "abcab"; + String string2 = "cabba"; + assertTrue(anagram.isAnagramSort(string1, string2)); + } + + @Test + public void givenAnagram_whenUsingCounting_thenIdentifyAnagram() { + Anagram anagram = new Anagram(); + String string1 = "abcab"; + String string2 = "cabba"; + assertTrue(anagram.isAnagramCounting(string1, string2)); + } + + @Test + public void givenAnagram_whenUsingMultiset_thenIdentifyAnagram() { + Anagram anagram = new Anagram(); + String string1 = "abcab"; + String string2 = "cabba"; + assertTrue(anagram.isAnagramMultiset(string1, string2)); + } + + @Test + public void givenAnagram_whenUsingLetterBasedMultiset_thenIdentifyAnagram() { + Anagram anagram = new Anagram(); + String string1 = "A decimal point"; + String string2 = "I’m a dot in place."; + assertTrue(anagram.isLetterBasedAnagramMultiset(string1, string2)); + } + + @Test + public void givenNonAnagram_whenUsingSort_thenIdentifyNotAnagram() { + Anagram anagram = new Anagram(); + String string1 = "abcaba"; + String string2 = "cabbac"; + assertFalse(anagram.isAnagramSort(string1, string2)); + } + + @Test + public void givenNonAnagram_whenUsingCounting_thenIdentifyNotAnagram() { + Anagram anagram = new Anagram(); + String string1 = "abcaba"; + String string2 = "cabbac"; + assertFalse(anagram.isAnagramCounting(string1, string2)); + } + + @Test + public void givenNonAnagram_whenUsingMultiset_thenIdentifyNotAnagram() { + Anagram anagram = new Anagram(); + String string1 = "abcaba"; + String string2 = "cabbac"; + assertFalse(anagram.isAnagramMultiset(string1, string2)); + } + + @Test + public void ggivenNonAnagram_whenUsingLetterBasedMultiset_thenIdentifyAnagram() { + Anagram anagram = new Anagram(); + String string1 = "A decimal point"; + String string2 = "I’m dot in place."; + assertFalse(anagram.isAnagramMultiset(string1, string2)); + } +} diff --git a/core-java-modules/core-java-string-algorithms/pom.xml b/core-java-modules/core-java-string-algorithms/pom.xml index f1b7499b6d..6cae320f1d 100644 --- a/core-java-modules/core-java-string-algorithms/pom.xml +++ b/core-java-modules/core-java-string-algorithms/pom.xml @@ -1,10 +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 core-java-string-algorithms 0.1.0-SNAPSHOT - jar core-java-string-algorithms + jar com.baeldung diff --git a/core-java-modules/core-java-string-apis/pom.xml b/core-java-modules/core-java-string-apis/pom.xml index 7d9d888fa1..6d0fd4c6fd 100644 --- a/core-java-modules/core-java-string-apis/pom.xml +++ b/core-java-modules/core-java-string-apis/pom.xml @@ -1,10 +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 core-java-string-apis 0.1.0-SNAPSHOT - jar core-java-string-apis + jar com.baeldung diff --git a/core-java-modules/core-java-string-conversions-2/pom.xml b/core-java-modules/core-java-string-conversions-2/pom.xml index 396d836e6b..58b00b757a 100644 --- a/core-java-modules/core-java-string-conversions-2/pom.xml +++ b/core-java-modules/core-java-string-conversions-2/pom.xml @@ -1,10 +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 core-java-string-conversions-2 0.1.0-SNAPSHOT - jar core-java-string-conversions-2 + jar com.baeldung @@ -41,7 +42,6 @@ true - diff --git a/core-java-modules/core-java-string-conversions/pom.xml b/core-java-modules/core-java-string-conversions/pom.xml index 9c968b7f1c..e3d6036e53 100644 --- a/core-java-modules/core-java-string-conversions/pom.xml +++ b/core-java-modules/core-java-string-conversions/pom.xml @@ -1,10 +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 core-java-string-conversions 0.1.0-SNAPSHOT - jar core-java-string-conversions + jar com.baeldung diff --git a/core-java-modules/core-java-string-operations-2/pom.xml b/core-java-modules/core-java-string-operations-2/pom.xml index 95aeec8fcb..bd1a34f89f 100644 --- a/core-java-modules/core-java-string-operations-2/pom.xml +++ b/core-java-modules/core-java-string-operations-2/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 core-java-string-operations-2 0.1.0-SNAPSHOT - jar core-java-string-operations-2 + jar com.baeldung diff --git a/core-java-modules/core-java-string-operations/pom.xml b/core-java-modules/core-java-string-operations/pom.xml index ebbbade7a4..a1921c029f 100644 --- a/core-java-modules/core-java-string-operations/pom.xml +++ b/core-java-modules/core-java-string-operations/pom.xml @@ -1,10 +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 core-java-string-operations 0.1.0-SNAPSHOT - jar core-java-string-operations + jar com.baeldung diff --git a/core-java-modules/core-java-strings/pom.xml b/core-java-modules/core-java-strings/pom.xml index 6a80886549..9dfe48527f 100644 --- a/core-java-modules/core-java-strings/pom.xml +++ b/core-java-modules/core-java-strings/pom.xml @@ -1,10 +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 core-java-strings 0.1.0-SNAPSHOT - jar core-java-strings + jar com.baeldung diff --git a/core-java-modules/core-java-sun/pom.xml b/core-java-modules/core-java-sun/pom.xml index 7774d1f9b3..03b6646fec 100644 --- a/core-java-modules/core-java-sun/pom.xml +++ b/core-java-modules/core-java-sun/pom.xml @@ -1,5 +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 core-java-sun 0.1.0-SNAPSHOT @@ -31,7 +32,7 @@ - core-java + core-java-sun src/main/resources @@ -64,7 +65,7 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed @@ -94,7 +95,7 @@ java -classpath - + org.openjdk.jmh.Main .* diff --git a/core-java-modules/core-java-text/pom.xml b/core-java-modules/core-java-text/pom.xml index 43b0df6309..640b90764a 100644 --- a/core-java-modules/core-java-text/pom.xml +++ b/core-java-modules/core-java-text/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/core-java-modules/core-java-time-measurements/pom.xml b/core-java-modules/core-java-time-measurements/pom.xml index 0ff3787051..9377b04690 100644 --- a/core-java-modules/core-java-time-measurements/pom.xml +++ b/core-java-modules/core-java-time-measurements/pom.xml @@ -1,19 +1,20 @@ + - 4.0.0 - com.baeldung.exception.numberformat - core-java-time-measurements - 0.0.1-SNAPSHOT - jar - core-java-time-measurements + 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.exception.numberformat + core-java-time-measurements + 0.0.1-SNAPSHOT + core-java-time-measurements + jar - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java - + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + @@ -99,4 +100,5 @@ 2.22.1 + diff --git a/core-java-modules/core-java/pom.xml b/core-java-modules/core-java/pom.xml index 9d4bee081e..341363f8ed 100644 --- a/core-java-modules/core-java/pom.xml +++ b/core-java-modules/core-java/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -195,12 +196,12 @@ -Xmx300m -XX:+UseParallelGC -classpath - + com.baeldung.outofmemoryerror.OutOfMemoryGCLimitExceed - + org.apache.maven.plugins maven-javadoc-plugin @@ -261,7 +262,7 @@ java -classpath - + org.openjdk.jmh.Main .* @@ -383,7 +384,7 @@ 0.4 1.8.7 - + 3.10.0 @@ -397,4 +398,5 @@ 2.0.3.RELEASE 1.6.0 + diff --git a/core-java-modules/multimodulemavenproject/daomodule/pom.xml b/core-java-modules/multimodulemavenproject/daomodule/pom.xml index e98c48aa76..79c2628ea4 100644 --- a/core-java-modules/multimodulemavenproject/daomodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/daomodule/pom.xml @@ -1,17 +1,18 @@ - + 4.0.0 com.baeldung.daomodule daomodule 1.0 jar - + com.baeldung.multimodulemavenproject multimodulemavenproject 1.0 - + @@ -20,9 +21,10 @@ - + 9 9 + \ No newline at end of file diff --git a/core-java-modules/multimodulemavenproject/entitymodule/pom.xml b/core-java-modules/multimodulemavenproject/entitymodule/pom.xml index b90a7ed068..2cc789ffbb 100644 --- a/core-java-modules/multimodulemavenproject/entitymodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/entitymodule/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.baeldung.entitymodule entitymodule @@ -11,7 +12,7 @@ multimodulemavenproject 1.0 - + @@ -20,10 +21,10 @@ - - + + 9 9 - + \ No newline at end of file diff --git a/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml b/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml index 1f44a1690c..fa2d92d67f 100644 --- a/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/mainappmodule/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.baeldung.mainappmodule mainappmodule @@ -11,7 +12,7 @@ multimodulemavenproject 1.0 - + com.baeldung.entitymodule @@ -29,7 +30,7 @@ 1.0 - + @@ -38,9 +39,10 @@ - + 9 9 + \ No newline at end of file diff --git a/core-java-modules/multimodulemavenproject/pom.xml b/core-java-modules/multimodulemavenproject/pom.xml index ad347a4179..1d4aebf32e 100644 --- a/core-java-modules/multimodulemavenproject/pom.xml +++ b/core-java-modules/multimodulemavenproject/pom.xml @@ -1,26 +1,27 @@ - + 4.0.0 com.baeldung.multimodulemavenproject multimodulemavenproject 1.0 - pom multimodulemavenproject - + pom + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ - + entitymodule daomodule userdaomodule mainappmodule - + @@ -37,7 +38,7 @@ - + @@ -46,18 +47,17 @@ maven-compiler-plugin 3.8.0 - - 1.9 - 1.9 - + 1.9 + 1.9 - + UTF-8 3.12.2 + diff --git a/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml b/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml index d3543d5864..19012708cf 100644 --- a/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml +++ b/core-java-modules/multimodulemavenproject/userdaomodule/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 com.baeldung.userdaomodule userdaomodule @@ -11,7 +12,7 @@ multimodulemavenproject 1.0 - + com.baeldung.entitymodule @@ -24,7 +25,7 @@ 1.0 - + @@ -33,10 +34,10 @@ - + 9 9 - + \ No newline at end of file diff --git a/core-java-modules/pom.xml b/core-java-modules/pom.xml index 16ec19835a..dcc98d77f6 100644 --- a/core-java-modules/pom.xml +++ b/core-java-modules/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 com.baeldung.core-java-modules core-java-modules core-java-modules pom - + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -21,5 +21,5 @@ core-java-security-manager core-java-date-operations - + diff --git a/core-java-modules/pre-jpms/pom.xml b/core-java-modules/pre-jpms/pom.xml index f37daed0a5..cb23427138 100644 --- a/core-java-modules/pre-jpms/pom.xml +++ b/core-java-modules/pre-jpms/pom.xml @@ -1,72 +1,73 @@ + - 4.0.0 - pre-jpms - 0.0.1-SNAPSHOT - jar - pre-jpms + 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 + pre-jpms + 0.0.1-SNAPSHOT + pre-jpms + jar - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ - - - org.slf4j - slf4j-api - ${org.slf4j.version} - - + + + org.slf4j + slf4j-api + ${org.slf4j.version} + + - - pre-jpms - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 1.8 - 1.8 - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.1.1 - - - copy-dependencies - package - - copy-dependencies - - - - ${project.build.directory}/dependency-jars/ - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - com.baeldung.prejpms.App - true - dependency-jars/ - - - - - - + + pre-jpms + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.1.1 + + + copy-dependencies + package + + copy-dependencies + + + + ${project.build.directory}/dependency-jars/ + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + com.baeldung.prejpms.App + true + dependency-jars/ + + + + + + diff --git a/core-kotlin-2/README.md b/core-kotlin-2/README.md index 06dda396d9..5a443c1831 100644 --- a/core-kotlin-2/README.md +++ b/core-kotlin-2/README.md @@ -10,7 +10,5 @@ This module contains articles about core Kotlin. - [Kotlin Scope Functions](https://www.baeldung.com/kotlin-scope-functions) - [Kotlin Annotations](https://www.baeldung.com/kotlin-annotations) - [Split a List into Parts in Kotlin](https://www.baeldung.com/kotlin-split-list-into-parts) -- [String Comparison in Kotlin](https://www.baeldung.com/kotlin-string-comparison) -- [Guide to JVM Platform Annotations in Kotlin](https://www.baeldung.com/kotlin-jvm-annotations) - [Finding an Element in a List Using Kotlin](https://www.baeldung.com/kotlin-finding-element-in-list) - More articles: [[<-- prev]](/core-kotlin) diff --git a/core-kotlin-io/.gitignore b/core-kotlin-io/.gitignore deleted file mode 100644 index f521947850..0000000000 --- a/core-kotlin-io/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -/bin/ - -#ignore gradle -.gradle/ - - -#ignore build and generated files -build/ -node/ -target/ -out/ diff --git a/core-kotlin-io/pom.xml b/core-kotlin-io/pom.xml deleted file mode 100644 index 78b36626d6..0000000000 --- a/core-kotlin-io/pom.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - 4.0.0 - core-kotlin-io - core-kotlin-io - jar - - - com.baeldung - parent-kotlin - 1.0.0-SNAPSHOT - ../parent-kotlin - - - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - ${kotlin.version} - - - org.junit.jupiter - junit-jupiter - ${junit-jupiter.version} - test - - - org.mockito - mockito-core - ${mockito.version} - test - - - net.bytebuddy - byte-buddy - ${byte-buddy.version} - test - - - org.assertj - assertj-core - ${assertj.version} - test - - - org.jetbrains.kotlin - kotlin-test - ${kotlin.version} - test - - - org.jetbrains.kotlin - kotlin-test-junit5 - ${kotlin.version} - test - - - - - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - compile - compile - - compile - - - - test-compile - test-compile - - test-compile - - - - - 1.8 - - - - - - - 1.3.30 - 5.4.2 - 2.27.0 - 1.9.12 - 3.10.0 - - - diff --git a/core-kotlin-modules/README.md b/core-kotlin-modules/README.md new file mode 100644 index 0000000000..974db9378a --- /dev/null +++ b/core-kotlin-modules/README.md @@ -0,0 +1,5 @@ +## Core Kotlin + +This module contains articles about core Kotlin. + + diff --git a/core-kotlin-modules/core-kotlin-annotations/README.md b/core-kotlin-modules/core-kotlin-annotations/README.md new file mode 100644 index 0000000000..787b67be11 --- /dev/null +++ b/core-kotlin-modules/core-kotlin-annotations/README.md @@ -0,0 +1,8 @@ +## Core Kotlin Annotations + +This module contains articles about core Kotlin annotations. + +### Relevant articles: +- [Kotlin Annotations](https://www.baeldung.com/kotlin-annotations) +- [Guide to Kotlin @JvmField](https://www.baeldung.com/kotlin-jvm-field-annotation) +- [Guide to JVM Platform Annotations in Kotlin](https://www.baeldung.com/kotlin-jvm-annotations) diff --git a/core-kotlin-modules/core-kotlin-annotations/pom.xml b/core-kotlin-modules/core-kotlin-annotations/pom.xml new file mode 100644 index 0000000000..77670be151 --- /dev/null +++ b/core-kotlin-modules/core-kotlin-annotations/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + core-kotlin-annotations + core-kotlin-annotations + jar + + + com.baeldung.core-kotlin-modules + core-kotlin-modules + 1.0.0-SNAPSHOT + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.jetbrains.kotlin + kotlin-test + ${kotlin.version} + test + + + + + 1.3.30 + 3.10.0 + + + \ No newline at end of file diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Annotations.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Annotations.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Annotations.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Annotations.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Item.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Item.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Item.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Item.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Main.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Main.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Main.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Main.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Validator.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Validator.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/annotations/Validator.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/annotations/Validator.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/Document.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/Document.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/Document.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/Document.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/HtmlDocument.java b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/HtmlDocument.java similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/HtmlDocument.java rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/HtmlDocument.java diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/Message.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/Message.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/Message.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/Message.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/MessageConverter.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/MessageConverter.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/MessageConverter.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/MessageConverter.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/TextDocument.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/TextDocument.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/TextDocument.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/TextDocument.kt diff --git a/core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/XmlDocument.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/XmlDocument.kt similarity index 100% rename from core-kotlin-2/src/main/kotlin/com/baeldung/jvmannotations/XmlDocument.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmannotations/XmlDocument.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/JvmSample.kt b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmfield/JvmSample.kt similarity index 85% rename from core-kotlin/src/main/kotlin/com/baeldung/kotlin/JvmSample.kt rename to core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmfield/JvmSample.kt index 610d5282b2..e60894ba88 100644 --- a/core-kotlin/src/main/kotlin/com/baeldung/kotlin/JvmSample.kt +++ b/core-kotlin-modules/core-kotlin-annotations/src/main/kotlin/com/baeldung/jvmfield/JvmSample.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.jvmfield class JvmSample(text:String) { @JvmField diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/annotations/ValidationTest.kt b/core-kotlin-modules/core-kotlin-annotations/src/test/kotlin/com/baeldung/annotations/ValidationTest.kt similarity index 100% rename from core-kotlin-2/src/test/kotlin/com/baeldung/annotations/ValidationTest.kt rename to core-kotlin-modules/core-kotlin-annotations/src/test/kotlin/com/baeldung/annotations/ValidationTest.kt diff --git a/core-kotlin-2/src/test/kotlin/com/baeldung/range/DocumentTest.kt b/core-kotlin-modules/core-kotlin-annotations/src/test/kotlin/com/baeldung/jvmannotations/DocumentTest.kt similarity index 100% rename from core-kotlin-2/src/test/kotlin/com/baeldung/range/DocumentTest.kt rename to core-kotlin-modules/core-kotlin-annotations/src/test/kotlin/com/baeldung/jvmannotations/DocumentTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/JvmSampleTest.kt b/core-kotlin-modules/core-kotlin-annotations/src/test/kotlin/com/baeldung/jvmfield/JvmSampleTest.kt similarity index 94% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/JvmSampleTest.kt rename to core-kotlin-modules/core-kotlin-annotations/src/test/kotlin/com/baeldung/jvmfield/JvmSampleTest.kt index abe6edec92..769c0311c4 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/JvmSampleTest.kt +++ b/core-kotlin-modules/core-kotlin-annotations/src/test/kotlin/com/baeldung/jvmfield/JvmSampleTest.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.jvmfield import org.junit.Before import org.junit.Test diff --git a/core-kotlin-io/README.md b/core-kotlin-modules/core-kotlin-io/README.md similarity index 62% rename from core-kotlin-io/README.md rename to core-kotlin-modules/core-kotlin-io/README.md index ad4c503895..89f9534d4b 100644 --- a/core-kotlin-io/README.md +++ b/core-kotlin-modules/core-kotlin-io/README.md @@ -3,7 +3,7 @@ This module contains articles about core Kotlin I/O. ### Relevant articles: - - [InputStream to String in Kotlin](https://www.baeldung.com/kotlin-inputstream-to-string) - [Console I/O in Kotlin](https://www.baeldung.com/kotlin-console-io) - +- [Reading from a File in Kotlin](https://www.baeldung.com/kotlin-read-file) +- [Writing to a File in Kotlin](https://www.baeldung.com/kotlin-write-file) diff --git a/core-kotlin-modules/core-kotlin-io/pom.xml b/core-kotlin-modules/core-kotlin-io/pom.xml new file mode 100644 index 0000000000..9443cd0d5b --- /dev/null +++ b/core-kotlin-modules/core-kotlin-io/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + core-kotlin-io + core-kotlin-io + jar + + + com.baeldung.core-kotlin-modules + core-kotlin-modules + 1.0.0-SNAPSHOT + + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.mockito + mockito-core + ${mockito.version} + test + + + org.assertj + assertj-core + ${assertj.version} + test + + + org.jetbrains.kotlin + kotlin-test + ${kotlin.version} + test + + + + + 5.4.2 + 2.27.0 + 3.10.0 + + + \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileReader.kt b/core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/filesystem/FileReader.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileReader.kt rename to core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/filesystem/FileReader.kt diff --git a/core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileWriter.kt b/core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/filesystem/FileWriter.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/filesystem/FileWriter.kt rename to core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/filesystem/FileWriter.kt diff --git a/core-kotlin-io/src/main/kotlin/com/baeldung/inputstream/InputStreamExtension.kt b/core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/inputstream/InputStreamExtension.kt similarity index 100% rename from core-kotlin-io/src/main/kotlin/com/baeldung/inputstream/InputStreamExtension.kt rename to core-kotlin-modules/core-kotlin-io/src/main/kotlin/com/baeldung/inputstream/InputStreamExtension.kt diff --git a/core-kotlin-io/src/test/kotlin/com/baeldung/console/ConsoleIOUnitTest.kt b/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/console/ConsoleIOUnitTest.kt similarity index 100% rename from core-kotlin-io/src/test/kotlin/com/baeldung/console/ConsoleIOUnitTest.kt rename to core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/console/ConsoleIOUnitTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/filesystem/FileReaderTest.kt b/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/filesystem/FileReaderTest.kt similarity index 100% rename from core-kotlin/src/test/kotlin/com/baeldung/filesystem/FileReaderTest.kt rename to core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/filesystem/FileReaderTest.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/filesystem/FileWriterTest.kt b/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/filesystem/FileWriterTest.kt similarity index 100% rename from core-kotlin/src/test/kotlin/com/baeldung/filesystem/FileWriterTest.kt rename to core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/filesystem/FileWriterTest.kt diff --git a/core-kotlin-io/src/test/kotlin/com/baeldung/inputstream/InputStreamToStringTest.kt b/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/inputstream/InputStreamToStringTest.kt similarity index 99% rename from core-kotlin-io/src/test/kotlin/com/baeldung/inputstream/InputStreamToStringTest.kt rename to core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/inputstream/InputStreamToStringTest.kt index d10d23bef0..a0eb26b762 100644 --- a/core-kotlin-io/src/test/kotlin/com/baeldung/inputstream/InputStreamToStringTest.kt +++ b/core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/inputstream/InputStreamToStringTest.kt @@ -7,6 +7,7 @@ import java.io.File import kotlin.test.assertEquals class InputStreamToStringTest { + private val fileName = "src/test/resources/inputstream2string.txt" private val endOfLine = System.lineSeparator() private val fileFullContent = "Computer programming can be a hassle$endOfLine" + @@ -19,6 +20,7 @@ class InputStreamToStringTest { val content = inputStream.bufferedReader().use(BufferedReader::readText) assertEquals(fileFullContent, content) } + @Test fun whenReadFileWithBufferedReaderReadText_thenFullFileContentIsReadAsString() { val file = File(fileName) @@ -32,6 +34,7 @@ class InputStreamToStringTest { } assertEquals(fileFullContent, content) } + @Test fun whenReadFileWithBufferedReaderManually_thenFullFileContentIsReadAsString() { val file = File(fileName) @@ -67,6 +70,5 @@ class InputStreamToStringTest { assertEquals(fileFullContent, content) } - } diff --git a/core-kotlin/src/test/resources/Kotlin.in b/core-kotlin-modules/core-kotlin-io/src/test/resources/Kotlin.in similarity index 100% rename from core-kotlin/src/test/resources/Kotlin.in rename to core-kotlin-modules/core-kotlin-io/src/test/resources/Kotlin.in diff --git a/core-kotlin/src/test/resources/Kotlin.out b/core-kotlin-modules/core-kotlin-io/src/test/resources/Kotlin.out similarity index 100% rename from core-kotlin/src/test/resources/Kotlin.out rename to core-kotlin-modules/core-kotlin-io/src/test/resources/Kotlin.out diff --git a/core-kotlin-io/src/test/resources/inputstream2string.txt b/core-kotlin-modules/core-kotlin-io/src/test/resources/inputstream2string.txt similarity index 100% rename from core-kotlin-io/src/test/resources/inputstream2string.txt rename to core-kotlin-modules/core-kotlin-io/src/test/resources/inputstream2string.txt diff --git a/core-kotlin-io/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/core-kotlin-modules/core-kotlin-io/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker similarity index 100% rename from core-kotlin-io/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker rename to core-kotlin-modules/core-kotlin-io/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker diff --git a/core-kotlin-modules/core-kotlin-strings/README.md b/core-kotlin-modules/core-kotlin-strings/README.md new file mode 100644 index 0000000000..0e3d8ea57f --- /dev/null +++ b/core-kotlin-modules/core-kotlin-strings/README.md @@ -0,0 +1,9 @@ +## Core Kotlin Strings + +This module contains articles about core Kotlin strings. + +### Relevant articles: +- [Generate a Random Alphanumeric String in Kotlin](https://www.baeldung.com/kotlin-random-alphanumeric-string) +- [String Comparison in Kotlin](https://www.baeldung.com/kotlin-string-comparison) +- [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings) +- [Kotlin String Templates](https://www.baeldung.com/kotlin-string-template) diff --git a/core-kotlin-modules/core-kotlin-strings/pom.xml b/core-kotlin-modules/core-kotlin-strings/pom.xml new file mode 100644 index 0000000000..fb2998e9e1 --- /dev/null +++ b/core-kotlin-modules/core-kotlin-strings/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + core-kotlin-strings + core-kotlin-strings + jar + + + com.baeldung.core-kotlin-modules + core-kotlin-modules + 1.0.0-SNAPSHOT + + + + + org.apache.commons + commons-lang3 + ${commons-lang3.version} + + + + \ No newline at end of file diff --git a/core-kotlin/src/main/kotlin/com/baeldung/stringtemplates/Templates.kt b/core-kotlin-modules/core-kotlin-strings/src/main/kotlin/com/baeldung/stringtemplates/Templates.kt similarity index 100% rename from core-kotlin/src/main/kotlin/com/baeldung/stringtemplates/Templates.kt rename to core-kotlin-modules/core-kotlin-strings/src/main/kotlin/com/baeldung/stringtemplates/Templates.kt diff --git a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt b/core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/randomstring/RandomStringUnitTest.kt similarity index 98% rename from core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt rename to core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/randomstring/RandomStringUnitTest.kt index 62e8dfe720..5b84d1f67d 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/random/RandomStringUnitTest.kt +++ b/core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/randomstring/RandomStringUnitTest.kt @@ -1,3 +1,5 @@ +package com.baeldung.randomstring + import org.apache.commons.lang3.RandomStringUtils import org.junit.Before import org.junit.jupiter.api.BeforeAll diff --git a/core-kotlin-2/src/test/kotlin/stringcomparison/StringComparisonTest.kt b/core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/stringcomparison/StringComparisonTest.kt similarity index 97% rename from core-kotlin-2/src/test/kotlin/stringcomparison/StringComparisonTest.kt rename to core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/stringcomparison/StringComparisonTest.kt index 45a8dd7e04..9528f62df5 100644 --- a/core-kotlin-2/src/test/kotlin/stringcomparison/StringComparisonTest.kt +++ b/core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/stringcomparison/StringComparisonTest.kt @@ -1,4 +1,4 @@ -package stringcomparison +package com.baeldung.stringcomparison import org.junit.Test import kotlin.test.assertFalse diff --git a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/StringConcatenationTest.kt b/core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/stringconcatenation/StringConcatenationTest.kt similarity index 96% rename from core-kotlin/src/test/kotlin/com/baeldung/kotlin/StringConcatenationTest.kt rename to core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/stringconcatenation/StringConcatenationTest.kt index 9c371614a4..9ac011f7d2 100644 --- a/core-kotlin/src/test/kotlin/com/baeldung/kotlin/StringConcatenationTest.kt +++ b/core-kotlin-modules/core-kotlin-strings/src/test/kotlin/com/baeldung/stringconcatenation/StringConcatenationTest.kt @@ -1,4 +1,4 @@ -package com.baeldung.kotlin +package com.baeldung.stringconcatenation import org.junit.Test import kotlin.test.assertEquals diff --git a/core-kotlin-modules/pom.xml b/core-kotlin-modules/pom.xml new file mode 100644 index 0000000000..747e8b69de --- /dev/null +++ b/core-kotlin-modules/pom.xml @@ -0,0 +1,56 @@ + + + 4.0.0 + com.baeldung.core-kotlin-modules + core-kotlin-modules + core-kotlin-modules + pom + + + com.baeldung + parent-kotlin + 1.0.0-SNAPSHOT + ../parent-kotlin + + + + core-kotlin-annotations + core-kotlin-io + core-kotlin-strings + + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + test-compile + test-compile + + test-compile + + + + + 1.8 + + + + + + + 1.3.30 + + + diff --git a/core-kotlin/README.md b/core-kotlin/README.md index bdff95d36d..f75a4e764c 100644 --- a/core-kotlin/README.md +++ b/core-kotlin/README.md @@ -24,12 +24,8 @@ This module contains articles about core Kotlin. - [Try-with-resources in Kotlin](https://www.baeldung.com/kotlin-try-with-resources) - [Regular Expressions in Kotlin](https://www.baeldung.com/kotlin-regular-expressions) - [Objects in Kotlin](https://www.baeldung.com/kotlin-objects) -- [Reading from a File in Kotlin](https://www.baeldung.com/kotlin-read-file) -- [Guide to Kotlin @JvmField](https://www.baeldung.com/kotlin-jvm-field-annotation) - [Filtering Kotlin Collections](https://www.baeldung.com/kotlin-filter-collection) -- [Writing to a File in Kotlin](https://www.baeldung.com/kotlin-write-file) - [Lambda Expressions in Kotlin](https://www.baeldung.com/kotlin-lambda-expressions) -- [Kotlin String Templates](https://www.baeldung.com/kotlin-string-template) - [Working with Enums in Kotlin](https://www.baeldung.com/kotlin-enum) - [Create a Java and Kotlin Project with Maven](https://www.baeldung.com/kotlin-maven-java-project) - [Reflection with Kotlin](https://www.baeldung.com/kotlin-reflection) @@ -41,7 +37,6 @@ This module contains articles about core Kotlin. - [Fuel HTTP Library with Kotlin](https://www.baeldung.com/kotlin-fuel) - [Introduction to Kovenant Library for Kotlin](https://www.baeldung.com/kotlin-kovenant) - [Converting Kotlin Data Class from JSON using GSON](https://www.baeldung.com/kotlin-json-convert-data-class) -- [Concatenate Strings in Kotlin](https://www.baeldung.com/kotlin-concatenate-strings) - [Kotlin return, break, continue Keywords](https://www.baeldung.com/kotlin-return-break-continue) - [Mapping of Data Objects in Kotlin](https://www.baeldung.com/kotlin-data-objects) - [Initializing Arrays in Kotlin](https://www.baeldung.com/kotlin-initialize-array) @@ -50,7 +45,6 @@ This module contains articles about core Kotlin. - [Guide to Sorting in Kotlin](https://www.baeldung.com/kotlin-sort) - [Dependency Injection for Kotlin with Injekt](https://www.baeldung.com/kotlin-dependency-injection-with-injekt) - [Implementing a Binary Tree in Kotlin](https://www.baeldung.com/kotlin-binary-tree) -- [Generate a Random Alphanumeric String in Kotlin](https://www.baeldung.com/kotlin-random-alphanumeric-string) - [Kotlin Contracts](https://www.baeldung.com/kotlin-contracts) - [Operator Overloading in Kotlin](https://www.baeldung.com/kotlin-operator-overloading) - [Inline Classes in Kotlin](https://www.baeldung.com/kotlin-inline-classes) diff --git a/core-kotlin/pom.xml b/core-kotlin/pom.xml index e4d243360a..63a6d8035e 100644 --- a/core-kotlin/pom.xml +++ b/core-kotlin/pom.xml @@ -80,8 +80,8 @@ 5.2.0 3.10.0 1.15.0 - 3.3.0 - 1.16.1 + 3.3.0 + 1.16.1 diff --git a/core-scala/pom.xml b/core-scala/pom.xml index 343f21484a..d6793cf4c6 100644 --- a/core-scala/pom.xml +++ b/core-scala/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 core-scala 1.0-SNAPSHOT diff --git a/couchbase/pom.xml b/couchbase/pom.xml index fc40749c61..f4e98b32ba 100644 --- a/couchbase/pom.xml +++ b/couchbase/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"> 4.0.0 - com.baeldung couchbase 0.1-SNAPSHOT couchbase - Couchbase Tutorials jar + Couchbase Tutorials com.baeldung diff --git a/custom-pmd/pom.xml b/custom-pmd/pom.xml index 9964bf2bb4..601eedf08f 100644 --- a/custom-pmd/pom.xml +++ b/custom-pmd/pom.xml @@ -1,5 +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.pmd custom-pmd @@ -7,10 +8,10 @@ custom-pmd jar http://maven.apache.org - + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/dagger/pom.xml b/dagger/pom.xml index 80a3e961af..528a5383c6 100644 --- a/dagger/pom.xml +++ b/dagger/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 dagger dagger - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/data-structures/pom.xml b/data-structures/pom.xml index 4958598234..e8f4628062 100644 --- a/data-structures/pom.xml +++ b/data-structures/pom.xml @@ -1,5 +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 data-structures 0.0.1-SNAPSHOT diff --git a/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreeModel.java b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreeModel.java new file mode 100644 index 0000000000..94796bf997 --- /dev/null +++ b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreeModel.java @@ -0,0 +1,37 @@ +package com.baeldung.printbinarytree; + +public class BinaryTreeModel { + + private Object value; + private BinaryTreeModel left; + private BinaryTreeModel right; + + public BinaryTreeModel(Object value) { + this.value = value; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + public BinaryTreeModel getLeft() { + return left; + } + + public void setLeft(BinaryTreeModel left) { + this.left = left; + } + + public BinaryTreeModel getRight() { + return right; + } + + public void setRight(BinaryTreeModel right) { + this.right = right; + } + +} \ No newline at end of file diff --git a/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreePrinter.java b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreePrinter.java new file mode 100644 index 0000000000..0ec844d7b6 --- /dev/null +++ b/data-structures/src/main/java/com/baeldung/printbinarytree/BinaryTreePrinter.java @@ -0,0 +1,63 @@ +package com.baeldung.printbinarytree; + +import java.io.PrintStream; + +public class BinaryTreePrinter { + + private BinaryTreeModel tree; + + public BinaryTreePrinter(BinaryTreeModel tree) { + this.tree = tree; + } + + private String traversePreOrder(BinaryTreeModel root) { + + if (root == null) { + return ""; + } + + StringBuilder sb = new StringBuilder(); + sb.append(root.getValue()); + + String pointerRight = "└──"; + String pointerLeft = (root.getRight() != null) ? "├──" : "└──"; + + traverseNodes(sb, "", pointerLeft, root.getLeft(), root.getRight() != null); + traverseNodes(sb, "", pointerRight, root.getRight(), false); + + return sb.toString(); + } + + private void traverseNodes(StringBuilder sb, String padding, String pointer, BinaryTreeModel node, + boolean hasRightSibling) { + + if (node != null) { + + sb.append("\n"); + sb.append(padding); + sb.append(pointer); + sb.append(node.getValue()); + + StringBuilder paddingBuilder = new StringBuilder(padding); + if (hasRightSibling) { + paddingBuilder.append("│ "); + } else { + paddingBuilder.append(" "); + } + + String paddingForBoth = paddingBuilder.toString(); + String pointerRight = "└──"; + String pointerLeft = (node.getRight() != null) ? "├──" : "└──"; + + traverseNodes(sb, paddingForBoth, pointerLeft, node.getLeft(), node.getRight() != null); + traverseNodes(sb, paddingForBoth, pointerRight, node.getRight(), false); + + } + + } + + public void print(PrintStream os) { + os.print(traversePreOrder(tree)); + } + +} \ No newline at end of file diff --git a/data-structures/src/test/java/com/baeldung/printbinarytree/PrintingBinaryTreeModelUnitTest.java b/data-structures/src/test/java/com/baeldung/printbinarytree/PrintingBinaryTreeModelUnitTest.java new file mode 100644 index 0000000000..5c250730f9 --- /dev/null +++ b/data-structures/src/test/java/com/baeldung/printbinarytree/PrintingBinaryTreeModelUnitTest.java @@ -0,0 +1,178 @@ +package com.baeldung.printbinarytree; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.ByteArrayOutputStream; +import java.io.OutputStream; +import java.io.PrintStream; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.printbinarytree.BinaryTreeModel; +import com.baeldung.printbinarytree.BinaryTreePrinter; + +public class PrintingBinaryTreeModelUnitTest { + + private BinaryTreeModel balanced; + private BinaryTreeModel leftSkewed; + private BinaryTreeModel rightSkewed; + + private OutputStream output; + + @Before + public void setup() { + balanced = createBalancedTree(); + leftSkewed = createLeftUnbalancedTree(); + rightSkewed = createRightUnbalancedTree(); + + output = new ByteArrayOutputStream(); + System.setOut(new PrintStream(output)); + } + + @After + public void tearDown() { + System.setOut(System.out); + } + + private BinaryTreeModel createBalancedTree() { + + BinaryTreeModel root = new BinaryTreeModel("root"); + + BinaryTreeModel node1 = new BinaryTreeModel("node1"); + BinaryTreeModel node2 = new BinaryTreeModel("node2"); + root.setLeft(node1); + root.setRight(node2); + + BinaryTreeModel node3 = new BinaryTreeModel("node3"); + BinaryTreeModel node4 = new BinaryTreeModel("node4"); + node1.setLeft(node3); + node1.setRight(node4); + + node2.setLeft(new BinaryTreeModel("node5")); + node2.setRight(new BinaryTreeModel("node6")); + + BinaryTreeModel node7 = new BinaryTreeModel("node7"); + node3.setLeft(node7); + node7.setLeft(new BinaryTreeModel("node8")); + node7.setRight(new BinaryTreeModel("node9")); + + return root; + } + + private BinaryTreeModel createLeftUnbalancedTree() { + + BinaryTreeModel root = new BinaryTreeModel("root"); + + BinaryTreeModel node1 = new BinaryTreeModel("node1"); + root.setLeft(node1); + root.setRight(new BinaryTreeModel("node2")); + + BinaryTreeModel node3 = new BinaryTreeModel("node3"); + node1.setLeft(node3); + + BinaryTreeModel node4 = new BinaryTreeModel("node4"); + node3.setLeft(node4); + + BinaryTreeModel node5 = new BinaryTreeModel("node5"); + node4.setLeft(node5); + + BinaryTreeModel node6 = new BinaryTreeModel("node6"); + node5.setLeft(node6); + + BinaryTreeModel node7 = new BinaryTreeModel("node7"); + node6.setLeft(node7); + + node7.setLeft(new BinaryTreeModel("node8")); + + return root; + } + + private BinaryTreeModel createRightUnbalancedTree() { + + BinaryTreeModel root = new BinaryTreeModel("root"); + + BinaryTreeModel node2 = new BinaryTreeModel("node2"); + root.setLeft(new BinaryTreeModel("node1")); + root.setRight(node2); + + BinaryTreeModel node3 = new BinaryTreeModel("node3"); + node2.setRight(node3); + + BinaryTreeModel node4 = new BinaryTreeModel("node4"); + node3.setRight(node4); + + BinaryTreeModel node5 = new BinaryTreeModel("node5"); + node4.setRight(node5); + + BinaryTreeModel node6 = new BinaryTreeModel("node6"); + node5.setRight(node6); + + BinaryTreeModel node7 = new BinaryTreeModel("node7"); + node6.setRight(node7); + + node7.setRight(new BinaryTreeModel("node8")); + + return root; + } + + @Test + public void givenBinaryTreeModelBalanced_whenPrintWithBinaryTreePrinter_thenProduceCorrectOutput() { + + StringBuilder expected = new StringBuilder(); + expected.append("root").append("\n"); + expected.append("├──node1").append("\n"); + expected.append("│ ├──node3").append("\n"); + expected.append("│ │ └──node7").append("\n"); + expected.append("│ │ ├──node8").append("\n"); + expected.append("│ │ └──node9").append("\n"); + expected.append("│ └──node4").append("\n"); + expected.append("└──node2").append("\n"); + expected.append(" ├──node5").append("\n"); + expected.append(" └──node6"); + + new BinaryTreePrinter(balanced).print(System.out); + + assertEquals(expected.toString(), output.toString()); + } + + @Test + public void givenBinaryTreeModelLeftUnbalanced_whenPrintWithBinaryTreePrinter_thenProduceCorrectOutput() { + + StringBuilder expected = new StringBuilder(); + expected.append("root").append("\n"); + expected.append("├──node1").append("\n"); + expected.append("│ └──node3").append("\n"); + expected.append("│ └──node4").append("\n"); + expected.append("│ └──node5").append("\n"); + expected.append("│ └──node6").append("\n"); + expected.append("│ └──node7").append("\n"); + expected.append("│ └──node8").append("\n"); + expected.append("└──node2"); + + new BinaryTreePrinter(leftSkewed).print(System.out); + + assertEquals(expected.toString(), output.toString()); + } + + @Test + public void givenBinaryTreeModelRightUnbalanced_whenPrintWithBinaryTreePrinter_thenProduceCorrectOutput() { + + StringBuilder expected = new StringBuilder(); + expected.append("root").append("\n"); + expected.append("├──node1").append("\n"); + expected.append("└──node2").append("\n"); + expected.append(" └──node3").append("\n"); + expected.append(" └──node4").append("\n"); + expected.append(" └──node5").append("\n"); + expected.append(" └──node6").append("\n"); + expected.append(" └──node7").append("\n"); + expected.append(" └──node8"); + + new BinaryTreePrinter(rightSkewed).print(System.out); + + assertEquals(expected.toString(), output.toString()); + } + +} diff --git a/ddd/pom.xml b/ddd/pom.xml index 24410e9751..9a0523a4c6 100644 --- a/ddd/pom.xml +++ b/ddd/pom.xml @@ -1,5 +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.ddd ddd @@ -8,8 +9,8 @@ DDD series examples - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -34,7 +35,7 @@ org.junit.platform junit-platform-launcher - ${junit-platform.version} + ${junit-platform.version} test @@ -75,6 +76,11 @@ spring-boot-starter-test test + + org.mockito + mockito-core + test + de.flapdoodle.embed de.flapdoodle.embed.mongo @@ -84,7 +90,7 @@ 1.0.1 - 2.0.6.RELEASE + 2.0.6.RELEASE - + \ No newline at end of file diff --git a/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java b/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java index cd9be34278..3a52fd0440 100644 --- a/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java +++ b/ddd/src/main/java/com/baeldung/ddd/PersistingDddAggregatesApplication.java @@ -1,12 +1,12 @@ -package com.baeldung.ddd; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class PersistingDddAggregatesApplication { - - public static void main(String[] args) { - SpringApplication.run(PersistingDddAggregatesApplication.class, args); - } -} +package com.baeldung.ddd; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication(scanBasePackages = "com.baeldung.ddd.order") +public class PersistingDddAggregatesApplication { + + public static void main(String[] args) { + SpringApplication.run(PersistingDddAggregatesApplication.class, args); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java new file mode 100644 index 0000000000..988f96042b --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/DomainLayerApplication.java @@ -0,0 +1,13 @@ +package com.baeldung.dddhexagonalspring; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.PropertySource; + +@SpringBootApplication +@PropertySource(value = { "classpath:ddd-layers.properties" }) +public class DomainLayerApplication { + public static void main(final String[] args) { + SpringApplication.run(DomainLayerApplication.class, args); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/controller/OrderController.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/controller/OrderController.java new file mode 100644 index 0000000000..80ba36d01b --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/controller/OrderController.java @@ -0,0 +1,45 @@ +package com.baeldung.dddhexagonalspring.application.controller; + +import com.baeldung.dddhexagonalspring.application.request.AddProductRequest; +import com.baeldung.dddhexagonalspring.application.request.CreateOrderRequest; +import com.baeldung.dddhexagonalspring.application.response.CreateOrderResponse; +import com.baeldung.dddhexagonalspring.domain.service.OrderService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.*; + +import java.util.UUID; + +@RestController +@RequestMapping("/orders") +public class OrderController { + + private final OrderService orderService; + + @Autowired + public OrderController(OrderService orderService) { + this.orderService = orderService; + } + + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + CreateOrderResponse createOrder(@RequestBody final CreateOrderRequest createOrderRequest) { + final UUID id = orderService.createOrder(createOrderRequest.getProduct()); + + return new CreateOrderResponse(id); + } + + @PostMapping(value = "/{id}/products", consumes = MediaType.APPLICATION_JSON_VALUE) + void addProduct(@PathVariable final UUID id, @RequestBody final AddProductRequest addProductRequest) { + orderService.addProduct(id, addProductRequest.getProduct()); + } + + @DeleteMapping(value = "/{id}/products", consumes = MediaType.APPLICATION_JSON_VALUE) + void deleteProduct(@PathVariable final UUID id, @RequestParam final UUID productId) { + orderService.deleteProduct(id, productId); + } + + @PostMapping("/{id}/complete") + void completeOrder(@PathVariable final UUID id) { + orderService.completeOrder(id); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java new file mode 100644 index 0000000000..ec107d635b --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/AddProductRequest.java @@ -0,0 +1,20 @@ +package com.baeldung.dddhexagonalspring.application.request; + +import com.baeldung.dddhexagonalspring.domain.Product; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import javax.validation.constraints.NotNull; + +public class AddProductRequest { + @NotNull private Product product; + + @JsonCreator + public AddProductRequest(@JsonProperty("product") final Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java new file mode 100644 index 0000000000..8c51fbe479 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/request/CreateOrderRequest.java @@ -0,0 +1,20 @@ +package com.baeldung.dddhexagonalspring.application.request; + +import com.baeldung.dddhexagonalspring.domain.Product; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import javax.validation.constraints.NotNull; + +public class CreateOrderRequest { + @NotNull private Product product; + + @JsonCreator + public CreateOrderRequest(@JsonProperty("product") @NotNull final Product product) { + this.product = product; + } + + public Product getProduct() { + return product; + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java new file mode 100644 index 0000000000..72ee1134c3 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/application/response/CreateOrderResponse.java @@ -0,0 +1,15 @@ +package com.baeldung.dddhexagonalspring.application.response; + +import java.util.UUID; + +public class CreateOrderResponse { + private final UUID id; + + public CreateOrderResponse(final UUID id) { + this.id = id; + } + + public UUID getId() { + return id; + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java new file mode 100644 index 0000000000..7baef7bab6 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/DomainException.java @@ -0,0 +1,7 @@ +package com.baeldung.dddhexagonalspring.domain; + +class DomainException extends RuntimeException { + DomainException(final String message) { + super(message); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java new file mode 100644 index 0000000000..7d40007411 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Order.java @@ -0,0 +1,82 @@ +package com.baeldung.dddhexagonalspring.domain; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public class Order { + private UUID id; + private OrderStatus status; + private List orderItems; + private BigDecimal price; + + public Order(final UUID id, final Product product) { + this.id = id; + this.orderItems = new ArrayList<>(Collections.singletonList(new OrderItem(product))); + this.status = OrderStatus.CREATED; + this.price = product.getPrice(); + } + + public void complete() { + validateState(); + this.status = OrderStatus.COMPLETED; + } + + public void addOrder(final Product product) { + validateState(); + validateProduct(product); + orderItems.add(new OrderItem(product)); + price = price.add(product.getPrice()); + } + + public void removeOrder(final UUID id) { + validateState(); + final OrderItem orderItem = getOrderItem(id); + orderItems.remove(orderItem); + + price = price.subtract(orderItem.getPrice()); + } + + private OrderItem getOrderItem(final UUID id) { + return orderItems + .stream() + .filter(orderItem -> orderItem + .getProductId() + .equals(id)) + .findFirst() + .orElseThrow(() -> new DomainException("Product with " + id + " doesn't exist.")); + } + + private void validateState() { + if (OrderStatus.COMPLETED.equals(status)) { + throw new DomainException("The order is in completed state."); + } + } + + private void validateProduct(final Product product) { + if (product == null) { + throw new DomainException("The product cannot be null."); + } + } + + public UUID getId() { + return id; + } + + public OrderStatus getStatus() { + return status; + } + + public BigDecimal getPrice() { + return price; + } + + public List getOrderItems() { + return Collections.unmodifiableList(orderItems); + } + + private Order() { + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java new file mode 100644 index 0000000000..9debb02680 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderItem.java @@ -0,0 +1,39 @@ +package com.baeldung.dddhexagonalspring.domain; + +import java.math.BigDecimal; +import java.util.Objects; +import java.util.UUID; + +public class OrderItem { + private UUID productId; + private BigDecimal price; + + public OrderItem(final Product product) { + this.productId = product.getId(); + this.price = product.getPrice(); + } + + public UUID getProductId() { + return productId; + } + + public BigDecimal getPrice() { + return price; + } + + private OrderItem() { + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + OrderItem orderItem = (OrderItem) o; + return Objects.equals(productId, orderItem.productId) && Objects.equals(price, orderItem.price); + } + + @Override + public int hashCode() { + return Objects.hash(productId, price); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java new file mode 100644 index 0000000000..2ee5df3ab7 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/OrderStatus.java @@ -0,0 +1,5 @@ +package com.baeldung.dddhexagonalspring.domain; + +public enum OrderStatus { + CREATED, COMPLETED +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java new file mode 100644 index 0000000000..e05b4afe62 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/Product.java @@ -0,0 +1,46 @@ +package com.baeldung.dddhexagonalspring.domain; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.math.BigDecimal; +import java.util.Objects; +import java.util.UUID; + +public class Product { + private final UUID id; + private final BigDecimal price; + private final String name; + + @JsonCreator + public Product(@JsonProperty("id") final UUID id, @JsonProperty("price") final BigDecimal price, @JsonProperty("name") final String name) { + this.id = id; + this.price = price; + this.name = name; + } + + public BigDecimal getPrice() { + return price; + } + + public String getName() { + return name; + } + + public UUID getId() { + return id; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Product product = (Product) o; + return Objects.equals(id, product.id) && Objects.equals(price, product.price) && Objects.equals(name, product.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, price, name); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java new file mode 100644 index 0000000000..14b34e13f3 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/repository/OrderRepository.java @@ -0,0 +1,12 @@ +package com.baeldung.dddhexagonalspring.domain.repository; + +import com.baeldung.dddhexagonalspring.domain.Order; + +import java.util.Optional; +import java.util.UUID; + +public interface OrderRepository { + Optional findById(UUID id); + + void save(Order order); +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java new file mode 100644 index 0000000000..4fb2377745 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderService.java @@ -0,0 +1,54 @@ +package com.baeldung.dddhexagonalspring.domain.service; + +import com.baeldung.dddhexagonalspring.domain.Order; +import com.baeldung.dddhexagonalspring.domain.Product; +import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository; + +import java.util.UUID; + +public class DomainOrderService implements OrderService { + + private final OrderRepository orderRepository; + + public DomainOrderService(final OrderRepository orderRepository) { + this.orderRepository = orderRepository; + } + + @Override + public UUID createOrder(final Product product) { + final Order order = new Order(UUID.randomUUID(), product); + orderRepository.save(order); + + return order.getId(); + } + + @Override + public void addProduct(final UUID id, final Product product) { + final Order order = getOrder(id); + order.addOrder(product); + + orderRepository.save(order); + } + + @Override + public void completeOrder(final UUID id) { + final Order order = getOrder(id); + order.complete(); + + orderRepository.save(order); + } + + @Override + public void deleteProduct(final UUID id, final UUID productId) { + final Order order = getOrder(id); + order.removeOrder(productId); + + orderRepository.save(order); + } + + private Order getOrder(UUID id) { + return orderRepository + .findById(id) + .orElseThrow(() -> new RuntimeException("Order with given id doesn't exist")); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java new file mode 100644 index 0000000000..37297d74c4 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/domain/service/OrderService.java @@ -0,0 +1,15 @@ +package com.baeldung.dddhexagonalspring.domain.service; + +import com.baeldung.dddhexagonalspring.domain.Product; + +import java.util.UUID; + +public interface OrderService { + UUID createOrder(Product product); + + void addProduct(UUID id, Product product); + + void completeOrder(UUID id); + + void deleteProduct(UUID id, UUID productId); +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java new file mode 100644 index 0000000000..4be5d84ba7 --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/BeanConfiguration.java @@ -0,0 +1,19 @@ +package com.baeldung.dddhexagonalspring.infrastracture.configuration; + +import com.baeldung.dddhexagonalspring.DomainLayerApplication; +import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository; +import com.baeldung.dddhexagonalspring.domain.service.DomainOrderService; +import com.baeldung.dddhexagonalspring.domain.service.OrderService; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +@Configuration +@ComponentScan(basePackageClasses = DomainLayerApplication.class) +public class BeanConfiguration { + + @Bean + OrderService orderService(final OrderRepository orderRepository) { + return new DomainOrderService(orderRepository); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java new file mode 100644 index 0000000000..fd76b2eb0e --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/configuration/MongoDBConfiguration.java @@ -0,0 +1,8 @@ +package com.baeldung.dddhexagonalspring.infrastracture.configuration; + +import com.baeldung.dddhexagonalspring.infrastracture.repository.SpringDataOrderRepository; +import org.springframework.data.mongodb.repository.config.EnableMongoRepositories; + +@EnableMongoRepositories(basePackageClasses = SpringDataOrderRepository.class) +public class MongoDBConfiguration { +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepository.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepository.java new file mode 100644 index 0000000000..3123ef3e2f --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepository.java @@ -0,0 +1,30 @@ +package com.baeldung.dddhexagonalspring.infrastracture.repository; + +import com.baeldung.dddhexagonalspring.domain.Order; +import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Optional; +import java.util.UUID; + +@Component +public class MongoDbOrderRepository implements OrderRepository { + + private final SpringDataOrderRepository orderRepository; + + @Autowired + public MongoDbOrderRepository(final SpringDataOrderRepository orderRepository) { + this.orderRepository = orderRepository; + } + + @Override + public Optional findById(final UUID id) { + return orderRepository.findById(id); + } + + @Override + public void save(final Order order) { + orderRepository.save(order); + } +} diff --git a/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/SpringDataOrderRepository.java b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/SpringDataOrderRepository.java new file mode 100644 index 0000000000..0279a5ce4a --- /dev/null +++ b/ddd/src/main/java/com/baeldung/dddhexagonalspring/infrastracture/repository/SpringDataOrderRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.dddhexagonalspring.infrastracture.repository; + +import com.baeldung.dddhexagonalspring.domain.Order; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.stereotype.Repository; + +import java.util.UUID; + +@Repository +public interface SpringDataOrderRepository extends MongoRepository { +} diff --git a/ddd/src/main/resources/ddd-layers.properties b/ddd/src/main/resources/ddd-layers.properties new file mode 100644 index 0000000000..0479996b17 --- /dev/null +++ b/ddd/src/main/resources/ddd-layers.properties @@ -0,0 +1,5 @@ +spring.data.mongodb.host=localhost +spring.data.mongodb.port=27017 +spring.data.mongodb.database=order-database +spring.data.mongodb.username=order +spring.data.mongodb.password=order \ No newline at end of file diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java b/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java new file mode 100644 index 0000000000..c534713ca3 --- /dev/null +++ b/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderProvider.java @@ -0,0 +1,17 @@ +package com.baeldung.dddhexagonalspring.domain; + +import java.math.BigDecimal; +import java.util.UUID; + +public class OrderProvider { + public static Order getCreatedOrder() { + return new Order(UUID.randomUUID(), new Product(UUID.randomUUID(), BigDecimal.TEN, "productName")); + } + + public static Order getCompletedOrder() { + final Order order = getCreatedOrder(); + order.complete(); + + return order; + } +} diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java b/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java new file mode 100644 index 0000000000..eceed999d8 --- /dev/null +++ b/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/OrderUnitTest.java @@ -0,0 +1,65 @@ +package com.baeldung.dddhexagonalspring.domain; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.function.Executable; + +import java.math.BigDecimal; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class OrderUnitTest { + + @Test + void shouldCompleteOrder_thenChangeStatus() { + final Order order = OrderProvider.getCreatedOrder(); + + order.complete(); + + assertEquals(OrderStatus.COMPLETED, order.getStatus()); + } + + @Test + void shouldAddProduct_thenUpdatePrice() { + final Order order = OrderProvider.getCreatedOrder(); + final int orderOriginalProductSize = order + .getOrderItems() + .size(); + final BigDecimal orderOriginalPrice = order.getPrice(); + final Product productToAdd = new Product(UUID.randomUUID(), new BigDecimal("20"), "secondProduct"); + + order.addOrder(productToAdd); + + assertEquals(orderOriginalProductSize + 1, order + .getOrderItems() + .size()); + assertEquals(orderOriginalPrice.add(productToAdd.getPrice()), order.getPrice()); + } + + @Test + void shouldAddProduct_thenThrowException() { + final Order order = OrderProvider.getCompletedOrder(); + final Product productToAdd = new Product(UUID.randomUUID(), new BigDecimal("20"), "secondProduct"); + + final Executable executable = () -> order.addOrder(productToAdd); + + Assertions.assertThrows(DomainException.class, executable); + } + + @Test + void shouldRemoveProduct_thenUpdatePrice() { + final Order order = OrderProvider.getCreatedOrder(); + final UUID productId = order + .getOrderItems() + .get(0) + .getProductId(); + + order.removeOrder(productId); + + assertEquals(0, order + .getOrderItems() + .size()); + assertEquals(BigDecimal.ZERO, order.getPrice()); + } +} \ No newline at end of file diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java b/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java new file mode 100644 index 0000000000..797068a30a --- /dev/null +++ b/ddd/src/test/java/com/baeldung/dddhexagonalspring/domain/service/DomainOrderServiceUnitTest.java @@ -0,0 +1,91 @@ +package com.baeldung.dddhexagonalspring.domain.service; + +import com.baeldung.dddhexagonalspring.domain.Order; +import com.baeldung.dddhexagonalspring.domain.OrderProvider; +import com.baeldung.dddhexagonalspring.domain.Product; +import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.function.Executable; + +import java.math.BigDecimal; +import java.util.Optional; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; + +class DomainOrderServiceUnitTest { + + private OrderRepository orderRepository; + private DomainOrderService tested; + + @BeforeEach + void setUp() { + orderRepository = mock(OrderRepository.class); + tested = new DomainOrderService(orderRepository); + } + + @Test + void shouldCreateOrder_thenSaveIt() { + final Product product = new Product(UUID.randomUUID(), BigDecimal.TEN, "productName"); + + final UUID id = tested.createOrder(product); + + verify(orderRepository).save(any(Order.class)); + assertNotNull(id); + } + + @Test + void shouldAddProduct_thenSaveOrder() { + final Order order = spy(OrderProvider.getCreatedOrder()); + final Product product = new Product(UUID.randomUUID(), BigDecimal.TEN, "test"); + when(orderRepository.findById(order.getId())).thenReturn(Optional.of(order)); + + tested.addProduct(order.getId(), product); + + verify(orderRepository).save(order); + verify(order).addOrder(product); + } + + @Test + void shouldAddProduct_thenThrowException() { + final Product product = new Product(UUID.randomUUID(), BigDecimal.TEN, "test"); + final UUID id = UUID.randomUUID(); + when(orderRepository.findById(id)).thenReturn(Optional.empty()); + + final Executable executable = () -> tested.addProduct(id, product); + + verify(orderRepository, times(0)).save(any(Order.class)); + assertThrows(RuntimeException.class, executable); + } + + @Test + void shouldCompleteOrder_thenSaveIt() { + final Order order = spy(OrderProvider.getCreatedOrder()); + when(orderRepository.findById(order.getId())).thenReturn(Optional.of(order)); + + tested.completeOrder(order.getId()); + + verify(orderRepository).save(any(Order.class)); + verify(order).complete(); + } + + @Test + void shouldDeleteProduct_thenSaveOrder() { + final Order order = spy(OrderProvider.getCreatedOrder()); + final UUID productId = order + .getOrderItems() + .get(0) + .getProductId(); + + when(orderRepository.findById(order.getId())).thenReturn(Optional.of(order)); + + tested.deleteProduct(order.getId(), productId); + + verify(orderRepository).save(order); + verify(order).removeOrder(productId); + } +} \ No newline at end of file diff --git a/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java b/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java new file mode 100644 index 0000000000..8f7e8260a3 --- /dev/null +++ b/ddd/src/test/java/com/baeldung/dddhexagonalspring/infrastracture/repository/MongoDbOrderRepositoryUnitTest.java @@ -0,0 +1,51 @@ +package com.baeldung.dddhexagonalspring.infrastracture.repository; + +import com.baeldung.dddhexagonalspring.domain.Order; +import com.baeldung.dddhexagonalspring.domain.Product; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.math.BigDecimal; +import java.util.Optional; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.*; + +class MongoDbOrderRepositoryUnitTest { + + private SpringDataOrderRepository springDataOrderRepository; + private MongoDbOrderRepository tested; + + @BeforeEach + void setUp(){ + springDataOrderRepository = mock(SpringDataOrderRepository.class); + + tested = new MongoDbOrderRepository(springDataOrderRepository); + } + + @Test + void shouldFindById_thenReturnOrder() { + final UUID id = UUID.randomUUID(); + final Order order = createOrder(id); + when(springDataOrderRepository.findById(id)).thenReturn(Optional.of(order)); + + final Optional result = tested.findById(id); + + assertEquals(order, result.get()); + } + + @Test + void shouldSaveOrder_viaSpringDataOrderRepository() { + final UUID id = UUID.randomUUID(); + final Order order = createOrder(id); + + tested.save(order); + + verify(springDataOrderRepository).save(order); + } + + private Order createOrder(UUID id) { + return new Order(id, new Product(UUID.randomUUID(), BigDecimal.TEN, "product")); + } +} \ No newline at end of file diff --git a/ddd/src/test/resources/com/baeldung/dddhexagonalspring/README.md b/ddd/src/test/resources/com/baeldung/dddhexagonalspring/README.md new file mode 100644 index 0000000000..e0337498fc --- /dev/null +++ b/ddd/src/test/resources/com/baeldung/dddhexagonalspring/README.md @@ -0,0 +1,7 @@ +## Setup DDD Hexagonal Spring Application + +To run this project, follow these steps: + +* Run the application database by executing `docker-compose up` in this directory. +* Launch the Spring Boot Application (DomainLayerApplication). +* By default, application will connect to this database (configuration in *ddd-layers.properties*) \ No newline at end of file diff --git a/ddd/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml b/ddd/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml new file mode 100644 index 0000000000..d85ddf4a0e --- /dev/null +++ b/ddd/src/test/resources/com/baeldung/dddhexagonalspring/docker-compose.yml @@ -0,0 +1,14 @@ +version: '3' + +services: + order-mongo-database: + image: mongo:3.4.13 + restart: always + ports: + - 27017:27017 + environment: + MONGO_INITDB_ROOT_USERNAME: admin + MONGO_INITDB_ROOT_PASSWORD: admin + MONGO_INITDB_DATABASE: order-database + volumes: + - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro \ No newline at end of file diff --git a/ddd/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js b/ddd/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js new file mode 100644 index 0000000000..b1564df50a --- /dev/null +++ b/ddd/src/test/resources/com/baeldung/dddhexagonalspring/mongo-init.js @@ -0,0 +1,12 @@ +db.createUser( + { + user: "order", + pwd: "order", + roles: [ + { + role: "readWrite", + db: "order-database" + } + ] + } +); \ No newline at end of file diff --git a/deeplearning4j/pom.xml b/deeplearning4j/pom.xml index a8663865e0..0e84fa1516 100644 --- a/deeplearning4j/pom.xml +++ b/deeplearning4j/pom.xml @@ -1,5 +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.deeplearning4j deeplearning4j diff --git a/disruptor/pom.xml b/disruptor/pom.xml index 213331f25c..94be78fad6 100644 --- a/disruptor/pom.xml +++ b/disruptor/pom.xml @@ -1,5 +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 disruptor 0.1.0-SNAPSHOT @@ -115,7 +116,7 @@ 3.3.6 - + 2.4.3 3.0.2 1.4.4 diff --git a/dozer/pom.xml b/dozer/pom.xml index c781962d83..e307354603 100644 --- a/dozer/pom.xml +++ b/dozer/pom.xml @@ -1,5 +1,6 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 dozer 1.0 diff --git a/drools/pom.xml b/drools/pom.xml index b5cfc7d6dc..b4421ff2e3 100644 --- a/drools/pom.xml +++ b/drools/pom.xml @@ -1,10 +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 drools drools - + com.baeldung parent-spring-4 diff --git a/dubbo/pom.xml b/dubbo/pom.xml index 947175b6a0..9a7aceb9e5 100644 --- a/dubbo/pom.xml +++ b/dubbo/pom.xml @@ -1,12 +1,13 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 dubbo dubbo - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/ethereum/pom.xml b/ethereum/pom.xml index 148909e787..6fc31208d2 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -6,8 +7,8 @@ ethereum - parent-spring-5 com.baeldung + parent-spring-5 0.0.1-SNAPSHOT ../parent-spring-5 diff --git a/feign/pom.xml b/feign/pom.xml index d2fa334270..6dc8e7bafa 100644 --- a/feign/pom.xml +++ b/feign/pom.xml @@ -1,10 +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.feign feign - feign + feign com.baeldung diff --git a/flyway-cdi-extension/pom.xml b/flyway-cdi-extension/pom.xml index 49bd6bd9fd..8f7d058db7 100644 --- a/flyway-cdi-extension/pom.xml +++ b/flyway-cdi-extension/pom.xml @@ -50,10 +50,10 @@ - 2.0.SP1 - 3.0.5.Final - 5.1.4 - 8.5.33 - 1.3.2 + 2.0.SP1 + 3.0.5.Final + 5.1.4 + 8.5.33 + 1.3.2 diff --git a/geotools/pom.xml b/geotools/pom.xml index 17beded326..71489bdf94 100644 --- a/geotools/pom.xml +++ b/geotools/pom.xml @@ -1,49 +1,50 @@ + - 4.0.0 - geotools - 0.0.1-SNAPSHOT - geotools - jar - http://maven.apache.org + 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 + geotools + 0.0.1-SNAPSHOT + geotools + jar + http://maven.apache.org - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - org.geotools - gt-shapefile - ${geotools-shapefile.version} - - - org.geotools - gt-epsg-hsql - ${geotools.version} - - - org.geotools - gt-swing - ${geotools-swing.version} - - + + + org.geotools + gt-shapefile + ${geotools-shapefile.version} + + + org.geotools + gt-epsg-hsql + ${geotools.version} + + + org.geotools + gt-swing + ${geotools-swing.version} + + - - - osgeo - Open Source Geospatial Foundation Repository - http://download.osgeo.org/webdav/geotools/ - - + + + osgeo + Open Source Geospatial Foundation Repository + http://download.osgeo.org/webdav/geotools/ + + - - 15.2 - 15.2 - 15.2 - + + 15.2 + 15.2 + 15.2 + diff --git a/google-cloud/pom.xml b/google-cloud/pom.xml index ec53b78070..15f7f5c824 100644 --- a/google-cloud/pom.xml +++ b/google-cloud/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 google-cloud 0.1-SNAPSHOT google-cloud - Google Cloud Tutorials jar + Google Cloud Tutorials com.baeldung diff --git a/google-web-toolkit/pom.xml b/google-web-toolkit/pom.xml index 8a7cb87701..e79b43c5e5 100644 --- a/google-web-toolkit/pom.xml +++ b/google-web-toolkit/pom.xml @@ -1,125 +1,124 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + 4.0.0 + google-web-toolkit + 1.0-SNAPSHOT + google-web-toolkit + war - - 4.0.0 - google-web-toolkit - 1.0-SNAPSHOT - google-web-toolkit - war - com.baeldung parent-modules 1.0.0-SNAPSHOT - - - - - com.google.gwt - gwt - ${gwt.version} - pom - import - - - + + + + + com.google.gwt + gwt + ${gwt.version} + pom + import + + + - - - com.google.gwt - gwt-servlet - runtime - - - com.google.gwt - gwt-user - provided - - - com.google.gwt - gwt-dev - provided - - - junit - junit - ${junit.version} - test - - + + + com.google.gwt + gwt-servlet + runtime + + + com.google.gwt + gwt-user + provided + + + com.google.gwt + gwt-dev + provided + + + junit + junit + ${junit.version} + test + + - - - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes + + + ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - + - - - net.ltgt.gwt.maven - gwt-maven-plugin - 1.0-rc-8 - - - - compile - test - - - - - com.baeldung.Google_web_toolkit - Google_web_toolkit - true - - 1.8 - - - - -compileReport - -XcompilerMetrics - - - ${project.build.directory}/${project.build.finalName} - compile+runtime - - - Google_web_toolkit.html - - - + + + net.ltgt.gwt.maven + gwt-maven-plugin + 1.0-rc-8 + + + + compile + test + + + + + com.baeldung.Google_web_toolkit + Google_web_toolkit + true + + 1.8 + + + + -compileReport + -XcompilerMetrics + + + ${project.build.directory}/${project.build.finalName} + compile+runtime + + + Google_web_toolkit.html + + + - - - maven-surefire-plugin - 2.17 - - true - - + + + maven-surefire-plugin + 2.17 + + true + + - - - - + + - - 1.8 - 1.8 + + + + 1.8 + 1.8 + + + UTF-8 + UTF-8 + 2.8.2 + - - UTF-8 - UTF-8 - 2.8.2 - - diff --git a/graphql/graphql-java/pom.xml b/graphql/graphql-java/pom.xml index fb121d3234..3613d89ae7 100644 --- a/graphql/graphql-java/pom.xml +++ b/graphql/graphql-java/pom.xml @@ -1,5 +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.graphql graphql-java diff --git a/grpc/pom.xml b/grpc/pom.xml index ab550c31d7..c7ae111da3 100644 --- a/grpc/pom.xml +++ b/grpc/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 grpc 0.0.1-SNAPSHOT - grpc + grpc jar - + com.baeldung parent-modules diff --git a/gson/pom.xml b/gson/pom.xml index 4aa6c00458..f2ed5509fa 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -1,3 +1,4 @@ + diff --git a/gson/src/main/java/org/baeldung/gson/entities/ActorGson.java b/gson/src/main/java/com/baeldung/gson/entities/ActorGson.java similarity index 97% rename from gson/src/main/java/org/baeldung/gson/entities/ActorGson.java rename to gson/src/main/java/com/baeldung/gson/entities/ActorGson.java index 92468683bf..a68dba2436 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/ActorGson.java +++ b/gson/src/main/java/com/baeldung/gson/entities/ActorGson.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import java.text.DateFormat; import java.text.SimpleDateFormat; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Animal.java b/gson/src/main/java/com/baeldung/gson/entities/Animal.java similarity index 65% rename from gson/src/main/java/org/baeldung/gson/entities/Animal.java rename to gson/src/main/java/com/baeldung/gson/entities/Animal.java index 2eec5f8704..6c0f4a6e4e 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Animal.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Animal.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public abstract class Animal { public String type = "Animal"; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Cow.java b/gson/src/main/java/com/baeldung/gson/entities/Cow.java similarity index 88% rename from gson/src/main/java/org/baeldung/gson/entities/Cow.java rename to gson/src/main/java/com/baeldung/gson/entities/Cow.java index 020bcd5860..5bd8d23f44 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Cow.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Cow.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public class Cow extends Animal { private String breed; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Dog.java b/gson/src/main/java/com/baeldung/gson/entities/Dog.java similarity index 88% rename from gson/src/main/java/org/baeldung/gson/entities/Dog.java rename to gson/src/main/java/com/baeldung/gson/entities/Dog.java index 042d73adcf..ac55573866 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Dog.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Dog.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public class Dog extends Animal { private String petName; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Employee.java b/gson/src/main/java/com/baeldung/gson/entities/Employee.java similarity index 94% rename from gson/src/main/java/org/baeldung/gson/entities/Employee.java rename to gson/src/main/java/com/baeldung/gson/entities/Employee.java index cedcd6572e..ecc4571dcc 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Employee.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Employee.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; public class Employee { private int id; diff --git a/gson/src/main/java/org/baeldung/gson/entities/Movie.java b/gson/src/main/java/com/baeldung/gson/entities/Movie.java similarity index 96% rename from gson/src/main/java/org/baeldung/gson/entities/Movie.java rename to gson/src/main/java/com/baeldung/gson/entities/Movie.java index ee688f228d..ebc4cff137 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Movie.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Movie.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import java.util.List; diff --git a/gson/src/main/java/org/baeldung/gson/entities/MovieWithNullValue.java b/gson/src/main/java/com/baeldung/gson/entities/MovieWithNullValue.java similarity index 96% rename from gson/src/main/java/org/baeldung/gson/entities/MovieWithNullValue.java rename to gson/src/main/java/com/baeldung/gson/entities/MovieWithNullValue.java index fe62d51ffb..381d7cb83b 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/MovieWithNullValue.java +++ b/gson/src/main/java/com/baeldung/gson/entities/MovieWithNullValue.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import com.google.gson.annotations.Expose; diff --git a/gson/src/main/java/org/baeldung/gson/entities/MyClass.java b/gson/src/main/java/com/baeldung/gson/entities/MyClass.java similarity index 96% rename from gson/src/main/java/org/baeldung/gson/entities/MyClass.java rename to gson/src/main/java/com/baeldung/gson/entities/MyClass.java index 4e717e72c3..66a1887414 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/MyClass.java +++ b/gson/src/main/java/com/baeldung/gson/entities/MyClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import java.util.Objects; diff --git a/gson/src/main/java/org/baeldung/gson/entities/User.java b/gson/src/main/java/com/baeldung/gson/entities/User.java similarity index 84% rename from gson/src/main/java/org/baeldung/gson/entities/User.java rename to gson/src/main/java/com/baeldung/gson/entities/User.java index b413f3300e..d821ef5552 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/User.java +++ b/gson/src/main/java/com/baeldung/gson/entities/User.java @@ -1,19 +1,19 @@ -package org.baeldung.gson.entities; - -public class User { - - private int id; - private String name; - private transient String nationality; - - public User(int id, String name, String nationality) { - this.id = id; - this.name = name; - this.nationality = nationality; - } - - public User(int id, String name) { - this(id, name, null); - } - -} +package com.baeldung.gson.entities; + +public class User { + + private int id; + private String name; + private transient String nationality; + + public User(int id, String name, String nationality) { + this.id = id; + this.name = name; + this.nationality = nationality; + } + + public User(int id, String name) { + this(id, name, null); + } + +} diff --git a/gson/src/main/java/org/baeldung/gson/entities/Weather.java b/gson/src/main/java/com/baeldung/gson/entities/Weather.java similarity index 95% rename from gson/src/main/java/org/baeldung/gson/entities/Weather.java rename to gson/src/main/java/com/baeldung/gson/entities/Weather.java index 383e9ef41c..b68ec4c6d4 100644 --- a/gson/src/main/java/org/baeldung/gson/entities/Weather.java +++ b/gson/src/main/java/com/baeldung/gson/entities/Weather.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.entities; +package com.baeldung.gson.entities; import com.google.gson.annotations.SerializedName; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/BooleanExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/BooleanExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/BooleanExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/BooleanExample.java index 1fe87650de..1f05fc6119 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/BooleanExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/BooleanExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class BooleanExample { public boolean value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/ByteExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/ByteExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/ByteExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/ByteExample.java index 2e1c68ee51..6ec4e42ea3 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/ByteExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/ByteExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class ByteExample { public byte value = (byte) 1; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/CharExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/CharExample.java similarity index 74% rename from gson/src/main/java/org/baeldung/gson/primitives/models/CharExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/CharExample.java index ccac913f23..69d1a95fcd 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/CharExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/CharExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class CharExample { public char value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/DoubleExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/DoubleExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/DoubleExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/DoubleExample.java index 5022b6a11e..7c9db2bd50 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/DoubleExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/DoubleExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class DoubleExample { public double value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/FloatExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/FloatExample.java similarity index 74% rename from gson/src/main/java/org/baeldung/gson/primitives/models/FloatExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/FloatExample.java index 00a97f68fc..86c0c4802c 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/FloatExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/FloatExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class FloatExample { public float value; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/InfinityValuesExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/InfinityValuesExample.java similarity index 70% rename from gson/src/main/java/org/baeldung/gson/primitives/models/InfinityValuesExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/InfinityValuesExample.java index 163b0a3d95..90f10c0751 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/InfinityValuesExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/InfinityValuesExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class InfinityValuesExample { public float negativeInfinity; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/LongExample.java b/gson/src/main/java/com/baeldung/gson/primitives/models/LongExample.java similarity index 75% rename from gson/src/main/java/org/baeldung/gson/primitives/models/LongExample.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/LongExample.java index e709650789..021de1d06d 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/LongExample.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/LongExample.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class LongExample { public long value = 1; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundle.java b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundle.java similarity index 93% rename from gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundle.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundle.java index ad7309a2f7..10134110f3 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundle.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundle.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class PrimitiveBundle { public byte byteValue; diff --git a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java similarity index 92% rename from gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java rename to gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java index 2780f7fd18..c6eb6ca267 100644 --- a/gson/src/main/java/org/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java +++ b/gson/src/main/java/com/baeldung/gson/primitives/models/PrimitiveBundleInitialized.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.primitives.models; +package com.baeldung.gson.primitives.models; public class PrimitiveBundleInitialized { // @formatter:off diff --git a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonDeserializer.java similarity index 94% rename from gson/src/main/java/org/baeldung/gson/serialization/ActorGsonDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/ActorGsonDeserializer.java index 016e3ba1e2..34c9f83888 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonDeserializer.java @@ -1,11 +1,11 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; -import org.baeldung.gson.entities.ActorGson; +import com.baeldung.gson.entities.ActorGson; import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonSerializer.java b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonSerializer.java similarity index 93% rename from gson/src/main/java/org/baeldung/gson/serialization/ActorGsonSerializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/ActorGsonSerializer.java index 8f2cd10f5a..4ca653f76b 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/ActorGsonSerializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/ActorGsonSerializer.java @@ -1,10 +1,10 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import org.baeldung.gson.entities.ActorGson; +import com.baeldung.gson.entities.ActorGson; import java.lang.reflect.Type; import java.text.SimpleDateFormat; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/AnimalDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/AnimalDeserializer.java similarity index 93% rename from gson/src/main/java/org/baeldung/gson/serialization/AnimalDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/AnimalDeserializer.java index 9dcef0e10b..6c72ddb0da 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/AnimalDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/AnimalDeserializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import com.google.gson.Gson; import com.google.gson.JsonDeserializationContext; @@ -8,7 +8,7 @@ import com.google.gson.JsonObject; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; -import org.baeldung.gson.entities.Animal; +import com.baeldung.gson.entities.Animal; public class AnimalDeserializer implements JsonDeserializer { private String animalTypeElementName; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/MapDeserializer.java similarity index 94% rename from gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/MapDeserializer.java index cdeb2e23c8..1954986547 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/MapDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/MapDeserializer.java @@ -1,12 +1,11 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; import java.math.BigDecimal; -import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.baeldung.gson.entities.Employee; +import com.baeldung.gson.entities.Employee; import com.google.gson.*; diff --git a/gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java b/gson/src/main/java/com/baeldung/gson/serialization/StringDateMapDeserializer.java similarity index 97% rename from gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java rename to gson/src/main/java/com/baeldung/gson/serialization/StringDateMapDeserializer.java index f18bdbc84f..fa9d7d2240 100644 --- a/gson/src/main/java/org/baeldung/gson/serialization/StringDateMapDeserializer.java +++ b/gson/src/main/java/com/baeldung/gson/serialization/StringDateMapDeserializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; import java.text.ParseException; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/Exclude.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/Exclude.java similarity index 82% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/Exclude.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/Exclude.java index 429cb9d1b5..d3067e3482 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/Exclude.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/Exclude.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClass.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClass.java similarity index 79% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClass.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClass.java index cc6c498458..8919792721 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClass.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java similarity index 85% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java index 5d41f8a224..4c38df1eac 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import com.google.gson.annotations.Expose; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java similarity index 83% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java index ace3583013..85871be03d 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithCustomAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java similarity index 82% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java index 5e781a6287..dfb9d4bd6e 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MyClassWithTransientFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClass.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClass.java similarity index 78% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClass.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClass.java index 5adac0697e..6b8a287020 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClass.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java similarity index 83% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java index a0f7b5d277..0c94e8f2cc 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import com.google.gson.annotations.Expose; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java similarity index 81% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java index f6aa4651b3..0bd9a149cb 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithCustomAnnotatedFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java similarity index 80% rename from gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java rename to gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java index d4e31b0bc8..817d2ee557 100644 --- a/gson/src/main/java/org/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java +++ b/gson/src/main/java/com/baeldung/gson/serializationwithexclusions/MySubClassWithTransientFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/gson/src/test/java/org/baeldung/gson/advance/GsonAdvanceUnitTest.java b/gson/src/test/java/com/baeldung/gson/advance/GsonAdvanceUnitTest.java similarity index 94% rename from gson/src/test/java/org/baeldung/gson/advance/GsonAdvanceUnitTest.java rename to gson/src/test/java/com/baeldung/gson/advance/GsonAdvanceUnitTest.java index 5b787f1956..d4adb6e406 100644 --- a/gson/src/test/java/org/baeldung/gson/advance/GsonAdvanceUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/advance/GsonAdvanceUnitTest.java @@ -1,8 +1,9 @@ -package org.baeldung.gson.advance; +package com.baeldung.gson.advance; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import com.baeldung.gson.entities.Dog; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; @@ -10,11 +11,10 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.baeldung.gson.entities.Animal; -import org.baeldung.gson.entities.Cow; -import org.baeldung.gson.entities.Dog; -import org.baeldung.gson.entities.MyClass; -import org.baeldung.gson.serialization.AnimalDeserializer; +import com.baeldung.gson.entities.Animal; +import com.baeldung.gson.entities.Cow; +import com.baeldung.gson.entities.MyClass; +import com.baeldung.gson.serialization.AnimalDeserializer; import org.junit.Test; public class GsonAdvanceUnitTest { diff --git a/gson/src/test/java/org/baeldung/gson/advance/RuntimeTypeAdapterFactory.java b/gson/src/test/java/com/baeldung/gson/advance/RuntimeTypeAdapterFactory.java similarity index 99% rename from gson/src/test/java/org/baeldung/gson/advance/RuntimeTypeAdapterFactory.java rename to gson/src/test/java/com/baeldung/gson/advance/RuntimeTypeAdapterFactory.java index 739dd889c7..aab3f5f3f1 100644 --- a/gson/src/test/java/org/baeldung/gson/advance/RuntimeTypeAdapterFactory.java +++ b/gson/src/test/java/com/baeldung/gson/advance/RuntimeTypeAdapterFactory.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.advance; +package com.baeldung.gson.advance; /* * Copyright (C) 2011 Google Inc. diff --git a/gson/src/test/java/org/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java b/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java similarity index 96% rename from gson/src/test/java/org/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java rename to gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java index 847ec1b85d..9f07617969 100644 --- a/gson/src/test/java/org/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/conversion/JsonObjectConversionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.conversion; +package com.baeldung.gson.conversion; import com.google.gson.*; import org.junit.Assert; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/Foo.java b/gson/src/test/java/com/baeldung/gson/deserialization/Foo.java similarity index 97% rename from gson/src/test/java/org/baeldung/gson/deserialization/Foo.java rename to gson/src/test/java/com/baeldung/gson/deserialization/Foo.java index 84f8aaef13..e556786020 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/Foo.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/Foo.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; public class Foo { public int intValue; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializer.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializer.java similarity index 95% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializer.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializer.java index 17c1dfae19..1ccb3f7de9 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializer.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java similarity index 94% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java index d4eaa39ac5..289f71820c 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooDeserializerFromJsonWithDifferentFields.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooInstanceCreator.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooInstanceCreator.java similarity index 84% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooInstanceCreator.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooInstanceCreator.java index 4df3986ec3..e3ebc09874 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooInstanceCreator.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooInstanceCreator.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/FooWithInner.java b/gson/src/test/java/com/baeldung/gson/deserialization/FooWithInner.java similarity index 92% rename from gson/src/test/java/org/baeldung/gson/deserialization/FooWithInner.java rename to gson/src/test/java/com/baeldung/gson/deserialization/FooWithInner.java index 705e534e77..ddad97b4ab 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/FooWithInner.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/FooWithInner.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; public class FooWithInner { public int intValue; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/GenericFoo.java b/gson/src/test/java/com/baeldung/gson/deserialization/GenericFoo.java similarity index 85% rename from gson/src/test/java/org/baeldung/gson/deserialization/GenericFoo.java rename to gson/src/test/java/com/baeldung/gson/deserialization/GenericFoo.java index 954cf007cf..9a81d5ae7a 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/GenericFoo.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/GenericFoo.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; public class GenericFoo { diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/GsonAlternateUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/GsonAlternateUnitTest.java similarity index 92% rename from gson/src/test/java/org/baeldung/gson/deserialization/GsonAlternateUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/GsonAlternateUnitTest.java index f3a5d24e3e..c49a1ea568 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/GsonAlternateUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/GsonAlternateUnitTest.java @@ -1,8 +1,8 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import static org.junit.Assert.assertEquals; -import org.baeldung.gson.entities.Weather; +import com.baeldung.gson.entities.Weather; import org.junit.Test; import com.google.gson.Gson; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/GsonDeserializeUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/GsonDeserializeUnitTest.java similarity index 90% rename from gson/src/test/java/org/baeldung/gson/deserialization/GsonDeserializeUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/GsonDeserializeUnitTest.java index 40e8524744..73e76967b9 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/GsonDeserializeUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/GsonDeserializeUnitTest.java @@ -1,10 +1,10 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.text.ParseException; -import org.baeldung.gson.entities.ActorGson; -import org.baeldung.gson.entities.Movie; -import org.baeldung.gson.serialization.ActorGsonDeserializer; +import com.baeldung.gson.entities.Movie; +import com.baeldung.gson.serialization.ActorGsonDeserializer; +import com.baeldung.gson.entities.ActorGson; import org.junit.Assert; import org.junit.Test; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/MapDeserializationUnitTest.java similarity index 95% rename from gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/MapDeserializationUnitTest.java index a5ae4194e8..77c934283a 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/MapDeserializationUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/MapDeserializationUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization; +package com.baeldung.gson.deserialization; import java.lang.reflect.Type; import java.text.ParseException; @@ -6,9 +6,9 @@ import java.util.Date; import java.util.Map; import org.apache.commons.lang3.time.DateUtils; -import org.baeldung.gson.entities.Employee; -import org.baeldung.gson.serialization.MapDeserializer; -import org.baeldung.gson.serialization.StringDateMapDeserializer; +import com.baeldung.gson.entities.Employee; +import com.baeldung.gson.serialization.MapDeserializer; +import com.baeldung.gson.serialization.StringDateMapDeserializer; import org.junit.Assert; import org.junit.Test; import org.slf4j.Logger; diff --git a/gson/src/test/java/org/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java b/gson/src/test/java/com/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java similarity index 93% rename from gson/src/test/java/org/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java rename to gson/src/test/java/com/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java index 784bb45a6a..adc046ed8e 100644 --- a/gson/src/test/java/org/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/deserialization/test/GsonDeserializationUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.deserialization.test; +package com.baeldung.gson.deserialization.test; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.instanceOf; @@ -10,11 +10,11 @@ import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collection; -import org.baeldung.gson.deserialization.Foo; -import org.baeldung.gson.deserialization.FooDeserializerFromJsonWithDifferentFields; -import org.baeldung.gson.deserialization.FooInstanceCreator; -import org.baeldung.gson.deserialization.FooWithInner; -import org.baeldung.gson.deserialization.GenericFoo; +import com.baeldung.gson.deserialization.Foo; +import com.baeldung.gson.deserialization.FooDeserializerFromJsonWithDifferentFields; +import com.baeldung.gson.deserialization.FooInstanceCreator; +import com.baeldung.gson.deserialization.FooWithInner; +import com.baeldung.gson.deserialization.GenericFoo; import org.junit.Test; import com.google.common.collect.Lists; diff --git a/gson/src/test/java/org/baeldung/gson/primitives/PrimitiveValuesUnitTest.java b/gson/src/test/java/com/baeldung/gson/primitives/PrimitiveValuesUnitTest.java similarity index 99% rename from gson/src/test/java/org/baeldung/gson/primitives/PrimitiveValuesUnitTest.java rename to gson/src/test/java/com/baeldung/gson/primitives/PrimitiveValuesUnitTest.java index 7d249bc55c..e1241fa92a 100644 --- a/gson/src/test/java/org/baeldung/gson/primitives/PrimitiveValuesUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/primitives/PrimitiveValuesUnitTest.java @@ -1,7 +1,7 @@ -package org.baeldung.gson.primitives; +package com.baeldung.gson.primitives; +import com.baeldung.gson.primitives.models.*; import com.google.gson.*; -import org.baeldung.gson.primitives.models.*; import org.junit.Test; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/DifferentNameSerializer.java b/gson/src/test/java/com/baeldung/gson/serialization/DifferentNameSerializer.java similarity index 94% rename from gson/src/test/java/org/baeldung/gson/serialization/DifferentNameSerializer.java rename to gson/src/test/java/com/baeldung/gson/serialization/DifferentNameSerializer.java index 9cef1da37b..b82f90f476 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/DifferentNameSerializer.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/DifferentNameSerializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/GsonSerializeUnitTest.java b/gson/src/test/java/com/baeldung/gson/serialization/GsonSerializeUnitTest.java similarity index 92% rename from gson/src/test/java/org/baeldung/gson/serialization/GsonSerializeUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serialization/GsonSerializeUnitTest.java index 4392ea1631..d5051060c4 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/GsonSerializeUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/GsonSerializeUnitTest.java @@ -1,11 +1,11 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; +import com.baeldung.gson.entities.Movie; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonParser; -import org.baeldung.gson.entities.ActorGson; -import org.baeldung.gson.entities.Movie; -import org.baeldung.gson.entities.MovieWithNullValue; +import com.baeldung.gson.entities.ActorGson; +import com.baeldung.gson.entities.MovieWithNullValue; import org.junit.Assert; import org.junit.Test; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java similarity index 95% rename from gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java rename to gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java index 769a4d33a7..554d63b29b 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsNotMatchingCriteriaSerializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import com.google.gson.JsonElement; import com.google.gson.JsonObject; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsSerializer.java b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsSerializer.java similarity index 93% rename from gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsSerializer.java rename to gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsSerializer.java index bd1928cb18..7f251894a0 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/IgnoringFieldsSerializer.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/IgnoringFieldsSerializer.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; import java.lang.reflect.Type; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/SourceClass.java b/gson/src/test/java/com/baeldung/gson/serialization/SourceClass.java similarity index 96% rename from gson/src/test/java/org/baeldung/gson/serialization/SourceClass.java rename to gson/src/test/java/com/baeldung/gson/serialization/SourceClass.java index 02de2636c2..181f1134b5 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/SourceClass.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/SourceClass.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serialization; +package com.baeldung.gson.serialization; public class SourceClass { private int intValue; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationUnitTest.java b/gson/src/test/java/com/baeldung/gson/serialization/test/GsonSerializationUnitTest.java similarity index 91% rename from gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serialization/test/GsonSerializationUnitTest.java index 6806c470b9..4780b8a6bf 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/test/GsonSerializationUnitTest.java @@ -1,18 +1,16 @@ -package org.baeldung.gson.serialization.test; +package com.baeldung.gson.serialization.test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.lang.reflect.Type; -import java.util.Calendar; import java.util.Collection; import java.util.Date; -import java.util.GregorianCalendar; -import org.baeldung.gson.serialization.DifferentNameSerializer; -import org.baeldung.gson.serialization.IgnoringFieldsNotMatchingCriteriaSerializer; -import org.baeldung.gson.serialization.IgnoringFieldsSerializer; -import org.baeldung.gson.serialization.SourceClass; +import com.baeldung.gson.serialization.DifferentNameSerializer; +import com.baeldung.gson.serialization.IgnoringFieldsNotMatchingCriteriaSerializer; +import com.baeldung.gson.serialization.IgnoringFieldsSerializer; +import com.baeldung.gson.serialization.SourceClass; import org.joda.time.DateTime; import org.junit.Test; diff --git a/gson/src/test/java/org/baeldung/gson/serialization/test/JsonFileUnitTest.java b/gson/src/test/java/com/baeldung/gson/serialization/test/JsonFileUnitTest.java similarity index 88% rename from gson/src/test/java/org/baeldung/gson/serialization/test/JsonFileUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serialization/test/JsonFileUnitTest.java index f6a8de080c..8e58435520 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/test/JsonFileUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serialization/test/JsonFileUnitTest.java @@ -1,43 +1,43 @@ -package org.baeldung.gson.serialization.test; - -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; -import java.nio.file.Files; -import java.nio.file.Paths; - -import org.baeldung.gson.entities.User; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; -import org.junit.runners.Parameterized.Parameter; -import org.junit.runners.Parameterized.Parameters; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; - -@RunWith(Parameterized.class) -public class JsonFileUnitTest { - - @Parameter - public Object object; - - @Parameters - public static Object[] data() { - return new Object[] { 123.45, new User(1, "Tom", "American") }; - } - - @Test - public void givenProperData_whenStoredInFile_shouldSaveJsonSuccessfully() { - String filePath = "target/output.json"; - try (Writer writer = new FileWriter(filePath)) { - Gson gson = new GsonBuilder().setPrettyPrinting().create(); - gson.toJson(object, writer); - Assert.assertTrue(Files.exists(Paths.get(filePath))); - } catch (IOException e) { - e.printStackTrace(); - } - } - -} +package com.baeldung.gson.serialization.test; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.nio.file.Files; +import java.nio.file.Paths; + +import com.baeldung.gson.entities.User; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameter; +import org.junit.runners.Parameterized.Parameters; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; + +@RunWith(Parameterized.class) +public class JsonFileUnitTest { + + @Parameter + public Object object; + + @Parameters + public static Object[] data() { + return new Object[] { 123.45, new User(1, "Tom", "American") }; + } + + @Test + public void givenProperData_whenStoredInFile_shouldSaveJsonSuccessfully() { + String filePath = "target/output.json"; + try (Writer writer = new FileWriter(filePath)) { + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + gson.toJson(object, writer); + Assert.assertTrue(Files.exists(Paths.get(filePath))); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/gson/src/test/java/org/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java b/gson/src/test/java/com/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java similarity index 98% rename from gson/src/test/java/org/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java rename to gson/src/test/java/com/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java index 632d06946b..d677f0b271 100644 --- a/gson/src/test/java/org/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java +++ b/gson/src/test/java/com/baeldung/gson/serializationwithexclusions/SerializationWithExclusionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.gson.serializationwithexclusions; +package com.baeldung.gson.serializationwithexclusions; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/guava-collections-map/pom.xml b/guava-collections-map/pom.xml index 21597d0e28..ee8ceb10f3 100644 --- a/guava-collections-map/pom.xml +++ b/guava-collections-map/pom.xml @@ -1,5 +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.guava guava-collections-map diff --git a/guava-collections-set/pom.xml b/guava-collections-set/pom.xml index 640a28c4c1..8bb0b924f9 100644 --- a/guava-collections-set/pom.xml +++ b/guava-collections-set/pom.xml @@ -1,5 +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 guava-collections-set 0.1.0-SNAPSHOT diff --git a/guava-collections/pom.xml b/guava-collections/pom.xml index 9dfcceaab8..9002ac2b91 100644 --- a/guava-collections/pom.xml +++ b/guava-collections/pom.xml @@ -1,5 +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 guava-collections 0.1.0-SNAPSHOT diff --git a/guava-io/pom.xml b/guava-io/pom.xml index aaaf7edd4e..7517d442b0 100644 --- a/guava-io/pom.xml +++ b/guava-io/pom.xml @@ -1,5 +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 guava-io 0.1.0-SNAPSHOT diff --git a/guava-modules/guava-18/pom.xml b/guava-modules/guava-18/pom.xml index d55aa9ce82..30d9f953ac 100644 --- a/guava-modules/guava-18/pom.xml +++ b/guava-modules/guava-18/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 guava-18 0.1.0-SNAPSHOT guava-18 - + com.baeldung parent-java diff --git a/guava-modules/guava-19/pom.xml b/guava-modules/guava-19/pom.xml index 0548bb0c1f..0060afd426 100644 --- a/guava-modules/guava-19/pom.xml +++ b/guava-modules/guava-19/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 guava-19 0.1.0-SNAPSHOT guava-19 - + com.baeldung parent-java diff --git a/guava-modules/guava-21/pom.xml b/guava-modules/guava-21/pom.xml index bdb1058a48..7932cfa6d8 100644 --- a/guava-modules/guava-21/pom.xml +++ b/guava-modules/guava-21/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 guava-21 1.0-SNAPSHOT guava-21 - + com.baeldung parent-java diff --git a/guava-modules/pom.xml b/guava-modules/pom.xml index fed9e446f7..2b899df162 100644 --- a/guava-modules/pom.xml +++ b/guava-modules/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 guava-modules guava-modules diff --git a/guava/pom.xml b/guava/pom.xml index 4ca9918455..3f07b77b0b 100644 --- a/guava/pom.xml +++ b/guava/pom.xml @@ -1,5 +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 guava 0.1.0-SNAPSHOT diff --git a/guava/src/main/java/org/baeldung/guava/CustomEvent.java b/guava/src/main/java/com/baeldung/guava/CustomEvent.java similarity index 90% rename from guava/src/main/java/org/baeldung/guava/CustomEvent.java rename to guava/src/main/java/com/baeldung/guava/CustomEvent.java index 8534d7da1c..a154790374 100644 --- a/guava/src/main/java/org/baeldung/guava/CustomEvent.java +++ b/guava/src/main/java/com/baeldung/guava/CustomEvent.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; public class CustomEvent { private String action; diff --git a/guava/src/main/java/org/baeldung/guava/EventListener.java b/guava/src/main/java/com/baeldung/guava/EventListener.java similarity index 97% rename from guava/src/main/java/org/baeldung/guava/EventListener.java rename to guava/src/main/java/com/baeldung/guava/EventListener.java index 60beebeea5..7bcfbcb8e9 100644 --- a/guava/src/main/java/org/baeldung/guava/EventListener.java +++ b/guava/src/main/java/com/baeldung/guava/EventListener.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.eventbus.DeadEvent; import com.google.common.eventbus.Subscribe; diff --git a/guava/src/main/java/org/baeldung/guava/memoizer/CostlySupplier.java b/guava/src/main/java/com/baeldung/guava/memoizer/CostlySupplier.java similarity index 89% rename from guava/src/main/java/org/baeldung/guava/memoizer/CostlySupplier.java rename to guava/src/main/java/com/baeldung/guava/memoizer/CostlySupplier.java index 63b3fbd438..9a929a15bd 100644 --- a/guava/src/main/java/org/baeldung/guava/memoizer/CostlySupplier.java +++ b/guava/src/main/java/com/baeldung/guava/memoizer/CostlySupplier.java @@ -1,4 +1,4 @@ -package org.baeldung.guava.memoizer; +package com.baeldung.guava.memoizer; import java.math.BigInteger; import java.util.Random; diff --git a/guava/src/main/java/org/baeldung/guava/memoizer/Factorial.java b/guava/src/main/java/com/baeldung/guava/memoizer/Factorial.java similarity index 93% rename from guava/src/main/java/org/baeldung/guava/memoizer/Factorial.java rename to guava/src/main/java/com/baeldung/guava/memoizer/Factorial.java index 74fcbdcc14..6497979682 100644 --- a/guava/src/main/java/org/baeldung/guava/memoizer/Factorial.java +++ b/guava/src/main/java/com/baeldung/guava/memoizer/Factorial.java @@ -1,4 +1,4 @@ -package org.baeldung.guava.memoizer; +package com.baeldung.guava.memoizer; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; diff --git a/guava/src/main/java/org/baeldung/guava/memoizer/FibonacciSequence.java b/guava/src/main/java/com/baeldung/guava/memoizer/FibonacciSequence.java similarity index 90% rename from guava/src/main/java/org/baeldung/guava/memoizer/FibonacciSequence.java rename to guava/src/main/java/com/baeldung/guava/memoizer/FibonacciSequence.java index 0c70f08c23..d0462fb001 100644 --- a/guava/src/main/java/org/baeldung/guava/memoizer/FibonacciSequence.java +++ b/guava/src/main/java/com/baeldung/guava/memoizer/FibonacciSequence.java @@ -1,11 +1,10 @@ -package org.baeldung.guava.memoizer; +package com.baeldung.guava.memoizer; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import java.math.BigInteger; -import java.util.concurrent.TimeUnit; public class FibonacciSequence { diff --git a/guava/src/test/java/org/baeldung/guava/BloomFilterUnitTest.java b/guava/src/test/java/com/baeldung/guava/BloomFilterUnitTest.java similarity index 98% rename from guava/src/test/java/org/baeldung/guava/BloomFilterUnitTest.java rename to guava/src/test/java/com/baeldung/guava/BloomFilterUnitTest.java index ff3031a0cb..c11bf27256 100644 --- a/guava/src/test/java/org/baeldung/guava/BloomFilterUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/BloomFilterUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.hash.BloomFilter; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaBigIntegerMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaBigIntegerMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaBigIntegerMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaBigIntegerMathUnitTest.java index f5afe20fc2..cca42a688f 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaBigIntegerMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaBigIntegerMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCacheLoaderUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaCacheLoaderUnitTest.java similarity index 98% rename from guava/src/test/java/org/baeldung/guava/GuavaCacheLoaderUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaCacheLoaderUnitTest.java index e27171bb84..bf9747ec18 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaCacheLoaderUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaCacheLoaderUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaCacheUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaCacheUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaCacheUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaCacheUnitTest.java index 49ce6b1a09..8aa56c7c52 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaCacheUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaCacheUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaDoubleMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaDoubleMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaDoubleMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaDoubleMathUnitTest.java index b39770e2e7..9c78fb36fa 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaDoubleMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaDoubleMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaEventBusUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaEventBusUnitTest.java similarity index 97% rename from guava/src/test/java/org/baeldung/guava/GuavaEventBusUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaEventBusUnitTest.java index 1bc62af300..bb9d26fcce 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaEventBusUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaEventBusUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.eventbus.EventBus; import org.junit.After; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaFunctionalExamplesUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaFunctionalExamplesUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaFunctionalExamplesUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaFunctionalExamplesUnitTest.java index c09ae696b3..b54a7c951a 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaFunctionalExamplesUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaFunctionalExamplesUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.equalTo; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaIntMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaIntMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaIntMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaIntMathUnitTest.java index 9270212929..547f423396 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaIntMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaIntMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaLongMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaLongMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaLongMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaLongMathUnitTest.java index 680f405149..33c28d4594 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaLongMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaLongMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMathUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaMathUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaMathUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaMathUnitTest.java index 1e1f806628..fce0fec13b 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaMathUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaMathUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.hamcrest.core.IsEqual.equalTo; import static org.junit.Assert.*; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaMemoizerUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaMemoizerUnitTest.java similarity index 94% rename from guava/src/test/java/org/baeldung/guava/GuavaMemoizerUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaMemoizerUnitTest.java index 8c37ecf07c..9bafb7ad3f 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaMemoizerUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaMemoizerUnitTest.java @@ -1,9 +1,9 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.base.Suppliers; -import org.baeldung.guava.memoizer.CostlySupplier; -import org.baeldung.guava.memoizer.Factorial; -import org.baeldung.guava.memoizer.FibonacciSequence; +import com.baeldung.guava.memoizer.CostlySupplier; +import com.baeldung.guava.memoizer.Factorial; +import com.baeldung.guava.memoizer.FibonacciSequence; import org.junit.Test; import java.math.BigInteger; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaPreConditionsUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaPreConditionsUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaPreConditionsUnitTest.java index 6bf9e5c7a2..fe3be9abf0 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaPreConditionsUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaPreConditionsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.util.Arrays; diff --git a/guava/src/test/java/org/baeldung/guava/GuavaReflectionUtilsUnitTest.java b/guava/src/test/java/com/baeldung/guava/GuavaReflectionUtilsUnitTest.java similarity index 99% rename from guava/src/test/java/org/baeldung/guava/GuavaReflectionUtilsUnitTest.java rename to guava/src/test/java/com/baeldung/guava/GuavaReflectionUtilsUnitTest.java index f2d1c08ae9..36df241711 100644 --- a/guava/src/test/java/org/baeldung/guava/GuavaReflectionUtilsUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/GuavaReflectionUtilsUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.collect.Lists; diff --git a/guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java b/guava/src/test/java/com/baeldung/guava/RateLimiterLongRunningUnitTest.java similarity index 98% rename from guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java rename to guava/src/test/java/com/baeldung/guava/RateLimiterLongRunningUnitTest.java index 914de01a6d..7372e9f6e9 100644 --- a/guava/src/test/java/org/baeldung/guava/RateLimiterLongRunningUnitTest.java +++ b/guava/src/test/java/com/baeldung/guava/RateLimiterLongRunningUnitTest.java @@ -1,4 +1,4 @@ -package org.baeldung.guava; +package com.baeldung.guava; import com.google.common.util.concurrent.RateLimiter; diff --git a/guest/core-java-9/pom.xml b/guest/core-java-9/pom.xml index 3847c19d16..786f85ce86 100644 --- a/guest/core-java-9/pom.xml +++ b/guest/core-java-9/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.stackify core-java-9 0.0.1-SNAPSHOT - core-java-9 - + core-java-9 + com.baeldung parent-modules diff --git a/guest/core-java/pom.xml b/guest/core-java/pom.xml index 5057f7eaed..aaf67fd27e 100644 --- a/guest/core-java/pom.xml +++ b/guest/core-java/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 com.stackify core-java 0.0.1-SNAPSHOT - core-java + core-java com.baeldung diff --git a/guest/core-kotlin/pom.xml b/guest/core-kotlin/pom.xml index a57dd28ffd..2d4a0c6144 100644 --- a/guest/core-kotlin/pom.xml +++ b/guest/core-kotlin/pom.xml @@ -2,12 +2,12 @@ 4.0.0 + com.stackify core-kotlin 1.0-SNAPSHOT - com.stackify + core-kotlin jar - core-kotlin - + jcenter diff --git a/guest/deep-jsf/pom.xml b/guest/deep-jsf/pom.xml index 12426a8833..91cf567e73 100644 --- a/guest/deep-jsf/pom.xml +++ b/guest/deep-jsf/pom.xml @@ -1,28 +1,27 @@ + + 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 deep-jsf 0.0.1-SNAPSHOT deep-jsf war - + com.baeldung parent-modules 1.0.0-SNAPSHOT ../../ - - + javax javaee-api ${javaee-api.version} provided - diff --git a/guest/junit5-example/pom.xml b/guest/junit5-example/pom.xml index c6370941d1..05e320f96d 100644 --- a/guest/junit5-example/pom.xml +++ b/guest/junit5-example/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 junit5-example junit5-example 0.0.1-SNAPSHOT junit5-example - + com.baeldung parent-modules diff --git a/guest/log4j2-example/pom.xml b/guest/log4j2-example/pom.xml index 31a32a4562..a3284dbfe3 100644 --- a/guest/log4j2-example/pom.xml +++ b/guest/log4j2-example/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 log4j2-example log4j2-example 0.0.1-SNAPSHOT log4j2-example - + com.baeldung parent-modules diff --git a/guest/logback-example/pom.xml b/guest/logback-example/pom.xml index 6e9fe0ddea..e7e83c743f 100644 --- a/guest/logback-example/pom.xml +++ b/guest/logback-example/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -5,14 +6,14 @@ logback-example 0.0.1-SNAPSHOT logback-example - + com.baeldung parent-modules 1.0.0-SNAPSHOT ../../ - + org.codehaus.janino @@ -20,7 +21,7 @@ ${janino.version} - + 3.0.7 diff --git a/guest/memory-leaks/pom.xml b/guest/memory-leaks/pom.xml index f1d411acbc..0712e0627d 100644 --- a/guest/memory-leaks/pom.xml +++ b/guest/memory-leaks/pom.xml @@ -1,10 +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 memory-leaks 0.0.1-SNAPSHOT memory-leaks - + com.baeldung parent-modules diff --git a/guest/remote-debugging/pom.xml b/guest/remote-debugging/pom.xml index 07b9cc49d8..4541160e37 100644 --- a/guest/remote-debugging/pom.xml +++ b/guest/remote-debugging/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.stackify remote-debugging @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent 1.5.8.RELEASE - + diff --git a/guest/slf4j/guide/pom.xml b/guest/slf4j/guide/pom.xml index 657ede73b6..8b479a4ba7 100644 --- a/guest/slf4j/guide/pom.xml +++ b/guest/slf4j/guide/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.stackify.slf4j.guide slf4j-parent-module @@ -44,7 +44,6 @@ - diff --git a/guest/slf4j/guide/slf4j-log4j/pom.xml b/guest/slf4j/guide/slf4j-log4j/pom.xml index bca5392f4d..70b93d8ab4 100644 --- a/guest/slf4j/guide/slf4j-log4j/pom.xml +++ b/guest/slf4j/guide/slf4j-log4j/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 slf4j-log4j 0.0.1-SNAPSHOT @@ -35,6 +35,7 @@ test + 1.7.25 diff --git a/guest/slf4j/guide/slf4j-log4j2/pom.xml b/guest/slf4j/guide/slf4j-log4j2/pom.xml index 9473362cb8..93a8d9e974 100644 --- a/guest/slf4j/guide/slf4j-log4j2/pom.xml +++ b/guest/slf4j/guide/slf4j-log4j2/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 slf4j-log4j2 0.0.1-SNAPSHOT diff --git a/guest/slf4j/guide/slf4j-logback/pom.xml b/guest/slf4j/guide/slf4j-logback/pom.xml index 0327e79732..74f4470bad 100644 --- a/guest/slf4j/guide/slf4j-logback/pom.xml +++ b/guest/slf4j/guide/slf4j-logback/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 slf4j-logback 0.0.1-SNAPSHOT diff --git a/guest/spring-boot-app/pom.xml b/guest/spring-boot-app/pom.xml index 423dadbb99..6f9c8e8aa9 100644 --- a/guest/spring-boot-app/pom.xml +++ b/guest/spring-boot-app/pom.xml @@ -1,5 +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-boot-app spring-boot-app diff --git a/guest/spring-mvc/pom.xml b/guest/spring-mvc/pom.xml index 3bffb1530d..df08fa0595 100644 --- a/guest/spring-mvc/pom.xml +++ b/guest/spring-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.stackify.guest spring-mvc @@ -13,7 +13,7 @@ org.springframework.boot spring-boot-starter-parent 2.0.0.RELEASE - + diff --git a/guest/spring-security/pom.xml b/guest/spring-security/pom.xml index 8be42ba32b..2ac8935c3c 100644 --- a/guest/spring-security/pom.xml +++ b/guest/spring-security/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.stackify.guest spring-security @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent 2.0.0.RELEASE - + diff --git a/guest/thread-pools/pom.xml b/guest/thread-pools/pom.xml index 2591cb2746..26809fccd8 100644 --- a/guest/thread-pools/pom.xml +++ b/guest/thread-pools/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.stackify thread-pools 0.0.1-SNAPSHOT thread-pools - + com.baeldung parent-modules diff --git a/guest/tomcat-app/pom.xml b/guest/tomcat-app/pom.xml index ab18023f70..acdecc445c 100644 --- a/guest/tomcat-app/pom.xml +++ b/guest/tomcat-app/pom.xml @@ -1,5 +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.stackify tomcat-app diff --git a/guest/webservices/rest-client/pom.xml b/guest/webservices/rest-client/pom.xml index 8508186e86..b05e435c4c 100644 --- a/guest/webservices/rest-client/pom.xml +++ b/guest/webservices/rest-client/pom.xml @@ -1,4 +1,6 @@ - + + 4.0.0 com.stackify rest-client diff --git a/guest/webservices/rest-server/pom.xml b/guest/webservices/rest-server/pom.xml index c576924215..ca81979b1e 100644 --- a/guest/webservices/rest-server/pom.xml +++ b/guest/webservices/rest-server/pom.xml @@ -1,5 +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.stackify rest-server diff --git a/guest/webservices/spring-rest-service/pom.xml b/guest/webservices/spring-rest-service/pom.xml index fcec8a3e12..6243f09727 100644 --- a/guest/webservices/spring-rest-service/pom.xml +++ b/guest/webservices/spring-rest-service/pom.xml @@ -1,5 +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.stackify spring-rest-service diff --git a/guice/pom.xml b/guice/pom.xml index 8ed2b557dc..d119bbf78e 100644 --- a/guice/pom.xml +++ b/guice/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.examples.guice guice diff --git a/hazelcast/pom.xml b/hazelcast/pom.xml index 9e0b0671d0..10234bb81f 100644 --- a/hazelcast/pom.xml +++ b/hazelcast/pom.xml @@ -1,5 +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 hazelcast 0.0.1-SNAPSHOT @@ -13,11 +14,11 @@ - - com.hazelcast.jet - hazelcast-jet - ${hazelcast.jet.version} - + + com.hazelcast.jet + hazelcast-jet + ${hazelcast.jet.version} + diff --git a/helidon/helidon-mp/pom.xml b/helidon/helidon-mp/pom.xml index 82d52ca2ef..38187a5cb8 100644 --- a/helidon/helidon-mp/pom.xml +++ b/helidon/helidon-mp/pom.xml @@ -4,13 +4,13 @@ 4.0.0 helidon-mp helidon-mp - - + + com.baeldung.helidon helidon 1.0.0-SNAPSHOT - + io.helidon.microprofile.bundles diff --git a/helidon/helidon-se/pom.xml b/helidon/helidon-se/pom.xml index ae16fa16e4..d5592dfb7b 100644 --- a/helidon/helidon-se/pom.xml +++ b/helidon/helidon-se/pom.xml @@ -5,7 +5,7 @@ 4.0.0 helidon-se helidon-se - + com.baeldung.helidon helidon @@ -54,7 +54,6 @@ helidon-security-integration-webserver ${helidon.version} - diff --git a/httpclient-simple/pom.xml b/httpclient-simple/pom.xml index 183c4438de..4b97070307 100644 --- a/httpclient-simple/pom.xml +++ b/httpclient-simple/pom.xml @@ -1,5 +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 httpclient-simple 0.1-SNAPSHOT diff --git a/httpclient/pom.xml b/httpclient/pom.xml index 6316ee4eed..606e9ed793 100644 --- a/httpclient/pom.xml +++ b/httpclient/pom.xml @@ -1,5 +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 httpclient 0.1-SNAPSHOT diff --git a/httpclient/src/test/java/org/baeldung/httpclient/HttpAsyncClientLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/HttpAsyncClientLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java index 47a587885e..082c282306 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/HttpAsyncClientLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/HttpAsyncClientLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientMultipartLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientMultipartLiveTest.java similarity index 94% rename from httpclient/src/test/java/org/baeldung/httpclient/HttpClientMultipartLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/HttpClientMultipartLiveTest.java index 9912e73c2b..7576e49034 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientMultipartLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientMultipartLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import org.apache.http.HttpEntity; import org.apache.http.HttpStatus; @@ -34,11 +34,11 @@ public class HttpClientMultipartLiveTest { // No longer available // private static final String SERVER = "http://echo.200please.com"; - private static final String SERVER = "http://posttestserver.com/post.php"; + private static final String SERVER = "http://localhost:8080/spring-mvc-java/stub/multipart"; private static final String TEXTFILENAME = "temp.txt"; private static final String IMAGEFILENAME = "image.jpg"; private static final String ZIPFILENAME = "zipFile.zip"; - private static final Logger LOGGER = Logger.getLogger("org.baeldung.httpclient.HttpClientMultipartLiveTest"); + private static final Logger LOGGER = Logger.getLogger("com.baeldung.httpclient.HttpClientMultipartLiveTest"); private CloseableHttpClient client; private HttpPost post; private BufferedReader rd; @@ -84,7 +84,7 @@ public class HttpClientMultipartLiveTest { // final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); - builder.addPart("upfile", fileBody); + builder.addPart("file", fileBody); builder.addPart("text1", stringBody1); builder.addPart("text2", stringBody2); final HttpEntity entity = builder.build(); @@ -112,7 +112,7 @@ public class HttpClientMultipartLiveTest { final String message = "This is a multipart post"; final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); - builder.addBinaryBody("upfile", file, ContentType.DEFAULT_BINARY, TEXTFILENAME); + builder.addBinaryBody("file", file, ContentType.DEFAULT_BINARY, TEXTFILENAME); builder.addTextBody("text", message, ContentType.DEFAULT_BINARY); final HttpEntity entity = builder.build(); post.setEntity(entity); @@ -141,7 +141,7 @@ public class HttpClientMultipartLiveTest { final String message = "This is a multipart post"; final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); - builder.addBinaryBody("upfile", file, ContentType.DEFAULT_BINARY, IMAGEFILENAME); + builder.addBinaryBody("file", file, ContentType.DEFAULT_BINARY, IMAGEFILENAME); builder.addBinaryBody("upstream", inputStream, ContentType.create("application/zip"), ZIPFILENAME); builder.addTextBody("text", message, ContentType.TEXT_PLAIN); final HttpEntity entity = builder.build(); @@ -165,7 +165,7 @@ public class HttpClientMultipartLiveTest { final byte[] bytes = "binary code".getBytes(); final MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); - builder.addBinaryBody("upfile", bytes, ContentType.DEFAULT_BINARY, TEXTFILENAME); + builder.addBinaryBody("file", bytes, ContentType.DEFAULT_BINARY, TEXTFILENAME); builder.addTextBody("text", message, ContentType.TEXT_PLAIN); final HttpEntity entity = builder.build(); post.setEntity(entity); diff --git a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientRedirectLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientRedirectLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/HttpClientRedirectLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/HttpClientRedirectLiveTest.java index a501367a6b..9a03ab02a5 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/HttpClientRedirectLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/HttpClientRedirectLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/ResponseUtil.java b/httpclient/src/test/java/com/baeldung/httpclient/ResponseUtil.java similarity index 94% rename from httpclient/src/test/java/org/baeldung/httpclient/ResponseUtil.java rename to httpclient/src/test/java/com/baeldung/httpclient/ResponseUtil.java index fd38b95cbe..e9ea08a723 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/ResponseUtil.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/ResponseUtil.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient; +package com.baeldung.httpclient; import org.apache.http.HttpEntity; import org.apache.http.client.methods.CloseableHttpResponse; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java b/httpclient/src/test/java/com/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java index 77d5a298c1..2235d0e9d0 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/advancedconfig/HttpClientAdvancedConfigurationIntegrationTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.advancedconfig; +package com.baeldung.httpclient.advancedconfig; import com.github.tomakehurst.wiremock.junit.WireMockRule; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java similarity index 95% rename from httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java index fe275be082..9d4573084b 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientBasicPostLiveTest.java @@ -1,5 +1,6 @@ -package org.baeldung.httpclient.base; +package com.baeldung.httpclient.base; +import com.baeldung.httpclient.ResponseUtil; import org.apache.http.auth.AuthenticationException; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.methods.CloseableHttpResponse; @@ -8,7 +9,6 @@ import org.apache.http.entity.StringEntity; import org.apache.http.impl.auth.BasicScheme; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.baeldung.httpclient.ResponseUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientLiveTest.java similarity index 97% rename from httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientLiveTest.java index 78097227e7..ef12c37412 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientLiveTest.java @@ -1,5 +1,6 @@ -package org.baeldung.httpclient.base; +package com.baeldung.httpclient.base; +import com.baeldung.httpclient.ResponseUtil; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpHeaders; @@ -11,7 +12,6 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.BasicHttpClientConnectionManager; -import org.baeldung.httpclient.ResponseUtil; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientSandboxLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientSandboxLiveTest.java similarity index 94% rename from httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientSandboxLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientSandboxLiveTest.java index d945d075f2..c667ae36f6 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/base/HttpClientSandboxLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/base/HttpClientSandboxLiveTest.java @@ -1,5 +1,6 @@ -package org.baeldung.httpclient.base; +package com.baeldung.httpclient.base; +import com.baeldung.httpclient.ResponseUtil; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; @@ -8,7 +9,6 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; -import org.baeldung.httpclient.ResponseUtil; import org.junit.Test; import java.io.IOException; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java index cf945098db..823b506113 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/HttpClientConnectionManagementLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import org.apache.http.HeaderElement; import org.apache.http.HeaderElementIterator; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/IdleConnectionMonitorThread.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/IdleConnectionMonitorThread.java similarity index 96% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/IdleConnectionMonitorThread.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/IdleConnectionMonitorThread.java index ffe4155a78..f1d7cbc427 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/IdleConnectionMonitorThread.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/IdleConnectionMonitorThread.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import java.util.concurrent.TimeUnit; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/MultiHttpClientConnThread.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/MultiHttpClientConnThread.java similarity index 98% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/MultiHttpClientConnThread.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/MultiHttpClientConnThread.java index 3794943f02..acadd1f240 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/MultiHttpClientConnThread.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/MultiHttpClientConnThread.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import java.io.IOException; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java b/httpclient/src/test/java/com/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java similarity index 97% rename from httpclient/src/test/java/org/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java rename to httpclient/src/test/java/com/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java index 9cc6480e74..a50858672e 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/conn/TesterVersion_MultiHttpClientConnThread.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.conn; +package com.baeldung.httpclient.conn; import java.io.IOException; diff --git a/httpclient/src/test/java/org/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java b/httpclient/src/test/java/com/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java similarity index 99% rename from httpclient/src/test/java/org/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java rename to httpclient/src/test/java/com/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java index 8fc79baed9..efa7953ba8 100644 --- a/httpclient/src/test/java/org/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java +++ b/httpclient/src/test/java/com/baeldung/httpclient/rare/HttpClientUnshortenLiveTest.java @@ -1,4 +1,4 @@ -package org.baeldung.httpclient.rare; +package com.baeldung.httpclient.rare; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; diff --git a/hystrix/pom.xml b/hystrix/pom.xml index 4aeb47f095..8c505c9104 100644 --- a/hystrix/pom.xml +++ b/hystrix/pom.xml @@ -1,13 +1,14 @@ + + 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 hystrix - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/image-processing/pom.xml b/image-processing/pom.xml index ce75145dc7..7b130329c7 100644 --- a/image-processing/pom.xml +++ b/image-processing/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 image-processing 1.0-SNAPSHOT image-processing - + com.baeldung parent-modules diff --git a/immutables/pom.xml b/immutables/pom.xml index efb21e584a..af4a62ea6b 100644 --- a/immutables/pom.xml +++ b/immutables/pom.xml @@ -1,10 +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 immutables immutables - + com.baeldung parent-modules diff --git a/intelliJ/remote-debugging/.idea/runConfigurations/Remote_Debugger.xml b/intelliJ/remote-debugging/.idea/runConfigurations/Remote_Debugger.xml new file mode 100644 index 0000000000..ca11791a08 --- /dev/null +++ b/intelliJ/remote-debugging/.idea/runConfigurations/Remote_Debugger.xml @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/intelliJ/remote-debugging/CONTRIBUTING.adoc b/intelliJ/remote-debugging/CONTRIBUTING.adoc new file mode 100644 index 0000000000..a97e428a48 --- /dev/null +++ b/intelliJ/remote-debugging/CONTRIBUTING.adoc @@ -0,0 +1,2 @@ +If you have not previously done so, please fill out and +submit the https://cla.pivotal.io/sign/spring[Contributor License Agreement]. \ No newline at end of file diff --git a/intelliJ/remote-debugging/LICENSE.code.txt b/intelliJ/remote-debugging/LICENSE.code.txt new file mode 100644 index 0000000000..4b5cde9fd2 --- /dev/null +++ b/intelliJ/remote-debugging/LICENSE.code.txt @@ -0,0 +1,16 @@ + All code in this repository is: + ======================================================================= + Copyright (c) 2013 GoPivotal, Inc. All Rights Reserved + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/intelliJ/remote-debugging/LICENSE.writing.txt b/intelliJ/remote-debugging/LICENSE.writing.txt new file mode 100644 index 0000000000..9d21229f84 --- /dev/null +++ b/intelliJ/remote-debugging/LICENSE.writing.txt @@ -0,0 +1 @@ +Except where otherwise noted, this work is licensed under https://creativecommons.org/licenses/by-nd/3.0/ diff --git a/intelliJ/remote-debugging/README.adoc b/intelliJ/remote-debugging/README.adoc new file mode 100644 index 0000000000..6a4b80959f --- /dev/null +++ b/intelliJ/remote-debugging/README.adoc @@ -0,0 +1,84 @@ +:toc: +:spring_version: current +:icons: font +:source-highlighter: prettify +:project_id: gs-scheduling-tasks +This guide walks you through the steps for scheduling tasks with Spring. + +== What you'll build + +You'll build an application that prints out the current time every five seconds using Spring's `@Scheduled` annotation. + +== What you'll need + +:java_version: 1.8 +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/prereq_editor_jdk_buildtools.adoc[] + + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/how_to_complete_this_guide.adoc[] + + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/hide-show-gradle.adoc[] + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/hide-show-maven.adoc[] + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/hide-show-sts.adoc[] + + + +[[initial]] +== Create a scheduled task +Now that you've set up your project, you can create a scheduled task. + +`src/main/java/hello/ScheduledTasks.java` +[source,java] +---- +include::complete/src/main/java/hello/ScheduledTasks.java[] +---- + +The `Scheduled` annotation defines when a particular method runs. +NOTE: This example uses `fixedRate`, which specifies the interval between method invocations measured from the start time of each invocation. There are https://docs.spring.io/spring/docs/{spring_version}/spring-framework-reference/html/scheduling.html#scheduling-annotation-support-scheduled[other options], like `fixedDelay`, which specifies the interval between invocations measured from the completion of the task. You can also https://docs.spring.io/spring/docs/{spring_version}/javadoc-api/org/springframework/scheduling/support/CronSequenceGenerator.html[use `@Scheduled(cron=". . .")` expressions for more sophisticated task scheduling]. + +== Enable Scheduling + +Although scheduled tasks can be embedded in web apps and WAR files, the simpler approach demonstrated below creates a standalone application. You package everything in a single, executable JAR file, driven by a good old Java `main()` method. + +`src/main/java/hello/Application.java` +[source,java] +---- +include::complete/src/main/java/hello/Application.java[] +---- + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/spring-boot-application.adoc[] + +https://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#scheduling-enable-annotation-support[`@EnableScheduling`] ensures that a background task executor is created. Without it, nothing gets scheduled. + + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/build_an_executable_jar_subhead.adoc[] + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/build_an_executable_jar_with_both.adoc[] + + + +Logging output is displayed and you can see from the logs that it is on a background thread. You should see your scheduled task fire every 5 seconds: + +.... +[...] +2016-08-25 13:10:00.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:00 +2016-08-25 13:10:05.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:05 +2016-08-25 13:10:10.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:10 +2016-08-25 13:10:15.143 INFO 31565 --- [pool-1-thread-1] hello.ScheduledTasks : The time is now 13:10:15 +.... + +== Summary + +Congratulations! You created an application with a scheduled task. Heck, the actual code was shorter than the build file! This technique works in any type of application. + +== See Also + +The following guides may also be helpful: + +* https://spring.io/guides/gs/spring-boot/[Building an Application with Spring Boot] +* https://spring.io/guides/gs/batch-processing/[Creating a Batch Service] + +include::https://raw.githubusercontent.com/spring-guides/getting-started-macros/master/footer.adoc[] diff --git a/intelliJ/remote-debugging/pom.xml b/intelliJ/remote-debugging/pom.xml new file mode 100644 index 0000000000..d18625e8f6 --- /dev/null +++ b/intelliJ/remote-debugging/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + com.baeldung + gs-scheduling-tasks + 0.1.0 + gs-scheduling-tasks + + + org.springframework.boot + spring-boot-starter-parent + 2.1.6.RELEASE + + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-test + test + + + org.awaitility + awaitility + 3.1.2 + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/intelliJ/remote-debugging/src/main/java/hello/Application.java b/intelliJ/remote-debugging/src/main/java/hello/Application.java new file mode 100644 index 0000000000..73b55f933b --- /dev/null +++ b/intelliJ/remote-debugging/src/main/java/hello/Application.java @@ -0,0 +1,14 @@ +package hello; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@EnableScheduling +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class); + } +} diff --git a/intelliJ/remote-debugging/src/main/java/hello/ScheduledTasks.java b/intelliJ/remote-debugging/src/main/java/hello/ScheduledTasks.java new file mode 100644 index 0000000000..de1f6eebeb --- /dev/null +++ b/intelliJ/remote-debugging/src/main/java/hello/ScheduledTasks.java @@ -0,0 +1,38 @@ +/* + * Copyright 2012-2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package hello; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class ScheduledTasks { + + private static final Logger log = LoggerFactory.getLogger(ScheduledTasks.class); + + private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); + + @Scheduled(fixedRate = 5000) + public void reportCurrentTime() { + log.info("The time is now {}", dateFormat.format(new Date())); + } +} diff --git a/jackson-2/.gitignore b/jackson-2/.gitignore deleted file mode 100644 index 4b1cfaf098..0000000000 --- a/jackson-2/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear - -# Files -/src/main/resources/orderOutput.yaml \ No newline at end of file diff --git a/jackson-2/README.md b/jackson-2/README.md deleted file mode 100644 index b583b588ef..0000000000 --- a/jackson-2/README.md +++ /dev/null @@ -1,12 +0,0 @@ -## Jackson Cookbooks and Examples - -This module contains articles about Jackson. - -### The Course -The "REST With Spring" Classes: http://bit.ly/restwithspring - -### Relevant Articles: -- [Working with Tree Model Nodes in Jackson](https://www.baeldung.com/jackson-json-node-tree-model) -- [Compare Two JSON Objects with Jackson](https://www.baeldung.com/jackson-compare-two-json-objects) -- [Calling Default Serializer from Custom Serializer in Jackson](https://www.baeldung.com/jackson-call-default-serializer-from-custom-serializer) -- More articles: [[<-- prev]](/../jackson) diff --git a/jackson-annotations/README.md b/jackson-annotations/README.md index d979ec0e0e..783a06605b 100644 --- a/jackson-annotations/README.md +++ b/jackson-annotations/README.md @@ -5,7 +5,5 @@ This module contains articles about Jackson annotations. ### Relevant Articles: - [Guide to @JsonFormat in Jackson](https://www.baeldung.com/jackson-jsonformat) - [More Jackson Annotations](https://www.baeldung.com/jackson-advanced-annotations) -- [Jackson Annotation Examples](https://www.baeldung.com/jackson-annotations) - [Jackson – Bidirectional Relationships](https://www.baeldung.com/jackson-bidirectional-relationships-and-infinite-recursion) -- [Jackson – Change Name of Field](https://www.baeldung.com/jackson-name-of-property) -- [Jackson Ignore Properties on Marshalling](https://www.baeldung.com/jackson-ignore-properties-on-serialization) +- [Jackson JSON Views](https://www.baeldung.com/jackson-json-view-annotation) diff --git a/jackson-annotations/pom.xml b/jackson-annotations/pom.xml index b3efc51e62..a259d895da 100644 --- a/jackson-annotations/pom.xml +++ b/jackson-annotations/pom.xml @@ -1,5 +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 jackson-annotations 0.0.1-SNAPSHOT diff --git a/jackson/src/test/java/com/baeldung/jackson/jsonview/Item.java b/jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/Item.java similarity index 100% rename from jackson/src/test/java/com/baeldung/jackson/jsonview/Item.java rename to jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/Item.java diff --git a/jackson/src/test/java/com/baeldung/jackson/jsonview/MyBeanSerializerModifier.java b/jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/MyBeanSerializerModifier.java similarity index 100% rename from jackson/src/test/java/com/baeldung/jackson/jsonview/MyBeanSerializerModifier.java rename to jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/MyBeanSerializerModifier.java diff --git a/jackson/src/test/java/com/baeldung/jackson/jsonview/UpperCasingWriter.java b/jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/UpperCasingWriter.java similarity index 100% rename from jackson/src/test/java/com/baeldung/jackson/jsonview/UpperCasingWriter.java rename to jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/UpperCasingWriter.java diff --git a/jackson/src/test/java/com/baeldung/jackson/jsonview/User.java b/jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/User.java similarity index 100% rename from jackson/src/test/java/com/baeldung/jackson/jsonview/User.java rename to jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/User.java diff --git a/jackson/src/test/java/com/baeldung/jackson/jsonview/Views.java b/jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/Views.java similarity index 100% rename from jackson/src/test/java/com/baeldung/jackson/jsonview/Views.java rename to jackson-annotations/src/main/java/com/baeldung/jackson/jsonview/Views.java diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDto.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDto.java deleted file mode 100644 index 3357c041c0..0000000000 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDto.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.baeldung.jackson.ignore.dtos; - -public class MyDto { - - private String stringValue; - private int intValue; - private boolean booleanValue; - - public MyDto() { - super(); - } - - public MyDto(final String stringValue, final int intValue, final boolean booleanValue) { - super(); - - this.stringValue = stringValue; - this.intValue = intValue; - this.booleanValue = booleanValue; - } - - // API - - public String getStringValue() { - return stringValue; - } - - public void setStringValue(final String stringValue) { - this.stringValue = stringValue; - } - - public int getIntValue() { - return intValue; - } - - public void setIntValue(final int intValue) { - this.intValue = intValue; - } - - public boolean isBooleanValue() { - return booleanValue; - } - - public void setBooleanValue(final boolean booleanValue) { - this.booleanValue = booleanValue; - } - - // - - @Override - public String toString() { - return "MyDto [stringValue=" + stringValue + ", intValue=" + intValue + ", booleanValue=" + booleanValue + "]"; - } - -} diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIncludeNonDefault.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIncludeNonDefault.java deleted file mode 100644 index cf5d1682db..0000000000 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIncludeNonDefault.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.baeldung.jackson.ignore.dtos; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -@JsonInclude(Include.NON_DEFAULT) -public class MyDtoIncludeNonDefault { - - private String stringValue; - private int intValue; - private boolean booleanValue; - - public MyDtoIncludeNonDefault() { - super(); - } - - // API - - public String getStringValue() { - return stringValue; - } - - public void setStringValue(final String stringValue) { - this.stringValue = stringValue; - } - - public int getIntValue() { - return intValue; - } - - public void setIntValue(final int intValue) { - this.intValue = intValue; - } - - public boolean isBooleanValue() { - return booleanValue; - } - - public void setBooleanValue(final boolean booleanValue) { - this.booleanValue = booleanValue; - } - -} diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoWithSpecialField.java b/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoWithSpecialField.java deleted file mode 100644 index edb0dab13b..0000000000 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoWithSpecialField.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.baeldung.jackson.ignore.dtos; - -public class MyDtoWithSpecialField { - - private String[] stringValue; - private int intValue; - private boolean booleanValue; - - public MyDtoWithSpecialField() { - super(); - } - - public MyDtoWithSpecialField(final String[] stringValue, final int intValue, final boolean booleanValue) { - super(); - - this.stringValue = stringValue; - this.intValue = intValue; - this.booleanValue = booleanValue; - } - - // API - - public String[] getStringValue() { - return stringValue; - } - - public void setStringValue(final String[] stringValue) { - this.stringValue = stringValue; - } - - public int getIntValue() { - return intValue; - } - - public void setIntValue(final int intValue) { - this.intValue = intValue; - } - - public boolean isBooleanValue() { - return booleanValue; - } - - public void setBooleanValue(final boolean booleanValue) { - this.booleanValue = booleanValue; - } - - // - - @Override - public String toString() { - return "MyDto [stringValue=" + stringValue + ", intValue=" + intValue + ", booleanValue=" + booleanValue + "]"; - } - -} diff --git a/jackson/src/test/java/com/baeldung/jackson/test/JacksonJsonViewUnitTest.java b/jackson-annotations/src/test/java/com/baeldung/jackson/jsonview/JacksonJsonViewUnitTest.java similarity index 98% rename from jackson/src/test/java/com/baeldung/jackson/test/JacksonJsonViewUnitTest.java rename to jackson-annotations/src/test/java/com/baeldung/jackson/jsonview/JacksonJsonViewUnitTest.java index 7930195ab0..4074da1a55 100644 --- a/jackson/src/test/java/com/baeldung/jackson/test/JacksonJsonViewUnitTest.java +++ b/jackson-annotations/src/test/java/com/baeldung/jackson/jsonview/JacksonJsonViewUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.test; +package com.baeldung.jackson.jsonview; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; diff --git a/jackson-conversions-2/README.md b/jackson-conversions-2/README.md index 210f5cd5bb..71c5578525 100644 --- a/jackson-conversions-2/README.md +++ b/jackson-conversions-2/README.md @@ -4,8 +4,6 @@ This module contains articles about Jackson conversions. ### Relevant Articles: - [Mapping a Dynamic JSON Object with Jackson](https://www.baeldung.com/jackson-mapping-dynamic-object) -- [Jackson Unmarshalling JSON with Unknown Properties](https://www.baeldung.com/jackson-deserialize-json-unknown-properties) -- [Ignore Null Fields with Jackson](https://www.baeldung.com/jackson-ignore-null-fields) - [Mapping Multiple JSON Fields to a Single Java Field](https://www.baeldung.com/json-multiple-fields-single-java-field) - [Convert XML to JSON Using Jackson](https://www.baeldung.com/jackson-convert-xml-json) - [Converting JSON to CSV in Java](https://www.baeldung.com/java-converting-json-to-csv) diff --git a/jackson-conversions-2/pom.xml b/jackson-conversions-2/pom.xml index 07104a8972..732c89c1e5 100644 --- a/jackson-conversions-2/pom.xml +++ b/jackson-conversions-2/pom.xml @@ -1,5 +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 jackson-conversions-2 0.0.1-SNAPSHOT diff --git a/jackson-conversions/pom.xml b/jackson-conversions/pom.xml index 58489fc7b5..c45d88bedd 100644 --- a/jackson-conversions/pom.xml +++ b/jackson-conversions/pom.xml @@ -1,5 +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 jackson-conversions 0.0.1-SNAPSHOT diff --git a/jackson-custom-conversions/README.md b/jackson-custom-conversions/README.md new file mode 100644 index 0000000000..68e9a6d50d --- /dev/null +++ b/jackson-custom-conversions/README.md @@ -0,0 +1,9 @@ +## Jackson Custom Conversions + +This module contains articles about Jackson custom conversions. + +### Relevant Articles: +- [Jackson – Custom Serializer](https://www.baeldung.com/jackson-custom-serialization) +- [Getting Started with Custom Deserialization in Jackson](https://www.baeldung.com/jackson-deserialization) +- [Serialize Only Fields that meet a Custom Criteria with Jackson](https://www.baeldung.com/jackson-serialize-field-custom-criteria) +- [Calling Default Serializer from Custom Serializer in Jackson](https://www.baeldung.com/jackson-call-default-serializer-from-custom-serializer) diff --git a/jackson-2/pom.xml b/jackson-custom-conversions/pom.xml similarity index 54% rename from jackson-2/pom.xml rename to jackson-custom-conversions/pom.xml index 87a050417c..68c785e972 100644 --- a/jackson-2/pom.xml +++ b/jackson-custom-conversions/pom.xml @@ -1,9 +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 - jackson-2 - 0.1-SNAPSHOT - jackson-2 + jackson-custom-conversions + 0.0.1-SNAPSHOT + jackson-custom-conversions com.baeldung @@ -13,27 +14,25 @@ - - + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson.version} - - - - - org.assertj - assertj-core - ${assertj.version} - test + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson.version} - jackson-2 + jackson-custom-conversions src/main/resources @@ -42,10 +41,4 @@ - - - - 3.11.0 - - diff --git a/jackson-2/src/main/java/com/baeldung/jackson/entities/File.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/File.java similarity index 84% rename from jackson-2/src/main/java/com/baeldung/jackson/entities/File.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/File.java index 0e8829e927..791ad3a466 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/entities/File.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/File.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.entities; +package com.baeldung.defaultserializercustomserializer; public class File { diff --git a/jackson-2/src/main/java/com/baeldung/jackson/entities/Folder.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/Folder.java similarity index 96% rename from jackson-2/src/main/java/com/baeldung/jackson/entities/Folder.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/Folder.java index c49e46b204..6f423059a2 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/entities/Folder.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/Folder.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.entities; +package com.baeldung.defaultserializercustomserializer; import java.util.ArrayList; import java.util.Date; diff --git a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderBeanSerializerModifier.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderBeanSerializerModifier.java similarity index 86% rename from jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderBeanSerializerModifier.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderBeanSerializerModifier.java index a3add58dc4..819971939c 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderBeanSerializerModifier.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderBeanSerializerModifier.java @@ -1,6 +1,5 @@ -package com.baeldung.jackson.serialization.custom.serializer; +package com.baeldung.defaultserializercustomserializer; -import com.baeldung.jackson.entities.Folder; import com.fasterxml.jackson.databind.BeanDescription; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializationConfig; diff --git a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializer.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializer.java similarity index 85% rename from jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializer.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializer.java index f385e63e09..3869ab15d8 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializer.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializer.java @@ -1,9 +1,7 @@ -package com.baeldung.jackson.serialization.custom.serializer; +package com.baeldung.defaultserializercustomserializer; import java.io.IOException; -import com.baeldung.jackson.entities.File; -import com.baeldung.jackson.entities.Folder; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; diff --git a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithCallingOwnSerializer.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithCallingOwnSerializer.java similarity index 87% rename from jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithCallingOwnSerializer.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithCallingOwnSerializer.java index ed5d9fffb8..544a4c6d1a 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithCallingOwnSerializer.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithCallingOwnSerializer.java @@ -1,8 +1,7 @@ -package com.baeldung.jackson.serialization.custom.serializer; +package com.baeldung.defaultserializercustomserializer; import java.io.IOException; -import com.baeldung.jackson.entities.Folder; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; diff --git a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithDefaultSerializerStored.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithDefaultSerializerStored.java similarity index 90% rename from jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithDefaultSerializerStored.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithDefaultSerializerStored.java index d4a95cd939..558b303301 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithDefaultSerializerStored.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithDefaultSerializerStored.java @@ -1,8 +1,7 @@ -package com.baeldung.jackson.serialization.custom.serializer; +package com.baeldung.defaultserializercustomserializer; import java.io.IOException; -import com.baeldung.jackson.entities.Folder; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; diff --git a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithInternalObjectMapper.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithInternalObjectMapper.java similarity index 90% rename from jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithInternalObjectMapper.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithInternalObjectMapper.java index b23dc32205..1ad51c63c0 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithInternalObjectMapper.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithInternalObjectMapper.java @@ -1,8 +1,7 @@ -package com.baeldung.jackson.serialization.custom.serializer; +package com.baeldung.defaultserializercustomserializer; import java.io.IOException; -import com.baeldung.jackson.entities.Folder; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializerProvider; diff --git a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithSerializerProvider.java b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithSerializerProvider.java similarity index 87% rename from jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithSerializerProvider.java rename to jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithSerializerProvider.java index 81990a084d..8aeb28b3d0 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/serialization/custom/serializer/FolderSerializerWithSerializerProvider.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/defaultserializercustomserializer/FolderSerializerWithSerializerProvider.java @@ -1,8 +1,7 @@ -package com.baeldung.jackson.serialization.custom.serializer; +package com.baeldung.defaultserializercustomserializer; import java.io.IOException; -import com.baeldung.jackson.entities.Folder; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; diff --git a/jackson/src/main/java/com/baeldung/jackson/entities/ActorJackson.java b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ActorJackson.java similarity index 97% rename from jackson/src/main/java/com/baeldung/jackson/entities/ActorJackson.java rename to jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ActorJackson.java index 76f87d80b3..4bf3bc57f6 100644 --- a/jackson/src/main/java/com/baeldung/jackson/entities/ActorJackson.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ActorJackson.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.entities; +package com.baeldung.deserialization; import java.text.DateFormat; import java.text.SimpleDateFormat; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/Item.java b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/Item.java similarity index 92% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/Item.java rename to jackson-custom-conversions/src/main/java/com/baeldung/deserialization/Item.java index 6fce2bc88e..e6234bb6e9 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/Item.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/Item.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.deserialization; public class Item { public int id; diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializer.java b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemDeserializer.java similarity index 90% rename from jackson/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializer.java rename to jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemDeserializer.java index bbc3f31a6c..7ae2faa04d 100644 --- a/jackson/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializer.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemDeserializer.java @@ -1,9 +1,7 @@ -package com.baeldung.jackson.deserialization; +package com.baeldung.deserialization; import java.io.IOException; -import com.baeldung.jackson.dtos.Item; -import com.baeldung.jackson.dtos.User; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializerOnClass.java b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemDeserializerOnClass.java similarity index 73% rename from jackson/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializerOnClass.java rename to jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemDeserializerOnClass.java index eaba9a7173..b9db114c4a 100644 --- a/jackson/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializerOnClass.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemDeserializerOnClass.java @@ -1,9 +1,7 @@ -package com.baeldung.jackson.deserialization; +package com.baeldung.deserialization; import java.io.IOException; -import com.baeldung.jackson.dtos.ItemWithSerializer; -import com.baeldung.jackson.dtos.User; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -11,7 +9,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.node.IntNode; -public class ItemDeserializerOnClass extends StdDeserializer { +public class ItemDeserializerOnClass extends StdDeserializer { private static final long serialVersionUID = 5579141241817332594L; @@ -27,7 +25,7 @@ public class ItemDeserializerOnClass extends StdDeserializer * {"id":1,"itemNr":"theItem","owner":2} */ @Override - public ItemWithSerializer deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { + public ItemWithDeserializer deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { final JsonNode node = jp.getCodec() .readTree(jp); final int id = (Integer) ((IntNode) node.get("id")).numberValue(); @@ -35,7 +33,7 @@ public class ItemDeserializerOnClass extends StdDeserializer .asText(); final int userId = (Integer) ((IntNode) node.get("owner")).numberValue(); - return new ItemWithSerializer(id, itemName, new User(userId, null)); + return new ItemWithDeserializer(id, itemName, new User(userId, null)); } } \ No newline at end of file diff --git a/jackson/src/test/java/com/baeldung/jackson/dtos/ItemWithSerializer.java b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemWithDeserializer.java similarity index 54% rename from jackson/src/test/java/com/baeldung/jackson/dtos/ItemWithSerializer.java rename to jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemWithDeserializer.java index aea9aa770d..1ab36e4acd 100644 --- a/jackson/src/test/java/com/baeldung/jackson/dtos/ItemWithSerializer.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/ItemWithDeserializer.java @@ -1,19 +1,14 @@ -package com.baeldung.jackson.dtos; - -import com.baeldung.jackson.deserialization.ItemDeserializerOnClass; -import com.baeldung.jackson.serialization.ItemSerializerOnClass; +package com.baeldung.deserialization; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -@JsonSerialize(using = ItemSerializerOnClass.class) @JsonDeserialize(using = ItemDeserializerOnClass.class) -public class ItemWithSerializer { +public class ItemWithDeserializer { public final int id; public final String itemName; public final User owner; - public ItemWithSerializer(final int id, final String itemName, final User owner) { + public ItemWithDeserializer(final int id, final String itemName, final User owner) { this.id = id; this.itemName = itemName; this.owner = owner; diff --git a/jackson/src/main/java/com/baeldung/jackson/entities/Movie.java b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/Movie.java similarity index 96% rename from jackson/src/main/java/com/baeldung/jackson/entities/Movie.java rename to jackson-custom-conversions/src/main/java/com/baeldung/deserialization/Movie.java index bdbb6c004f..fdb107dca2 100644 --- a/jackson/src/main/java/com/baeldung/jackson/entities/Movie.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/Movie.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.entities; +package com.baeldung.deserialization; import java.util.List; diff --git a/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/User.java b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/User.java new file mode 100644 index 0000000000..d22a85aafd --- /dev/null +++ b/jackson-custom-conversions/src/main/java/com/baeldung/deserialization/User.java @@ -0,0 +1,26 @@ +package com.baeldung.deserialization; + +public class User { + public int id; + public String name; + + public User() { + super(); + } + + public User(final int id, final String name) { + this.id = id; + this.name = name; + } + + // API + + public int getId() { + return id; + } + + public String getName() { + return name; + } + +} \ No newline at end of file diff --git a/jackson/src/test/java/com/baeldung/jackson/dtos/Item.java b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/Item.java similarity index 93% rename from jackson/src/test/java/com/baeldung/jackson/dtos/Item.java rename to jackson-custom-conversions/src/main/java/com/baeldung/serialization/Item.java index 6fce2bc88e..52a73b048c 100644 --- a/jackson/src/test/java/com/baeldung/jackson/dtos/Item.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/Item.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.serialization; public class Item { public int id; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/serialization/ItemSerializer.java b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemSerializer.java similarity index 91% rename from jackson-simple/src/test/java/com/baeldung/jackson/serialization/ItemSerializer.java rename to jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemSerializer.java index b5624c566a..dc0b5e1c88 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/serialization/ItemSerializer.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemSerializer.java @@ -1,8 +1,7 @@ -package com.baeldung.jackson.serialization; +package com.baeldung.serialization; import java.io.IOException; -import com.baeldung.jackson.dtos.Item; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.SerializerProvider; diff --git a/jackson/src/test/java/com/baeldung/jackson/serialization/ItemSerializerOnClass.java b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemSerializerOnClass.java similarity index 91% rename from jackson/src/test/java/com/baeldung/jackson/serialization/ItemSerializerOnClass.java rename to jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemSerializerOnClass.java index 1fdf44e17c..8f56c349f2 100644 --- a/jackson/src/test/java/com/baeldung/jackson/serialization/ItemSerializerOnClass.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemSerializerOnClass.java @@ -1,8 +1,7 @@ -package com.baeldung.jackson.serialization; +package com.baeldung.serialization; import java.io.IOException; -import com.baeldung.jackson.dtos.ItemWithSerializer; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.SerializerProvider; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/ItemWithSerializer.java b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemWithSerializer.java similarity index 74% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/ItemWithSerializer.java rename to jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemWithSerializer.java index aea9aa770d..5b38ad1af6 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/ItemWithSerializer.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/ItemWithSerializer.java @@ -1,13 +1,9 @@ -package com.baeldung.jackson.dtos; - -import com.baeldung.jackson.deserialization.ItemDeserializerOnClass; -import com.baeldung.jackson.serialization.ItemSerializerOnClass; +package com.baeldung.serialization; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @JsonSerialize(using = ItemSerializerOnClass.class) -@JsonDeserialize(using = ItemDeserializerOnClass.class) public class ItemWithSerializer { public final int id; public final String itemName; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/User.java b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/User.java similarity index 90% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/User.java rename to jackson-custom-conversions/src/main/java/com/baeldung/serialization/User.java index 2418e8070d..b01ccc9ffb 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/User.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/serialization/User.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.serialization; public class User { public int id; diff --git a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Address.java b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Address.java similarity index 94% rename from jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Address.java rename to jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Address.java index daca85f66a..a394bbc180 100644 --- a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Address.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Address.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dynamicIgnore; +package com.baeldung.skipfields; public class Address implements Hidable { private String city; diff --git a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Hidable.java b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Hidable.java similarity index 77% rename from jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Hidable.java rename to jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Hidable.java index a32e6844a6..fff7f81d1e 100644 --- a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Hidable.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Hidable.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dynamicIgnore; +package com.baeldung.skipfields; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/HidableSerializer.java b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/HidableSerializer.java similarity index 95% rename from jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/HidableSerializer.java rename to jackson-custom-conversions/src/main/java/com/baeldung/skipfields/HidableSerializer.java index 46396dae2a..8b300444c0 100644 --- a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/HidableSerializer.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/HidableSerializer.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dynamicIgnore; +package com.baeldung.skipfields; import java.io.IOException; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoWithFilter.java b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/MyDtoWithFilter.java similarity index 96% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoWithFilter.java rename to jackson-custom-conversions/src/main/java/com/baeldung/skipfields/MyDtoWithFilter.java index 91f5e148b2..50492c337a 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoWithFilter.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/MyDtoWithFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.skipfields; import com.fasterxml.jackson.annotation.JsonFilter; diff --git a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Person.java b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Person.java similarity index 94% rename from jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Person.java rename to jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Person.java index daa62b4be6..e1501947d3 100644 --- a/jackson/src/test/java/com/baeldung/jackson/dynamicIgnore/Person.java +++ b/jackson-custom-conversions/src/main/java/com/baeldung/skipfields/Person.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dynamicIgnore; +package com.baeldung.skipfields; public class Person implements Hidable { private String name; diff --git a/jackson-2/src/test/java/com/baeldung/jackson/serialization/custom/serializer/CallingDefaultSerializerUnitTest.java b/jackson-custom-conversions/src/test/java/com/baeldung/defaultserializercustomserializer/CallingDefaultSerializerUnitTest.java similarity index 97% rename from jackson-2/src/test/java/com/baeldung/jackson/serialization/custom/serializer/CallingDefaultSerializerUnitTest.java rename to jackson-custom-conversions/src/test/java/com/baeldung/defaultserializercustomserializer/CallingDefaultSerializerUnitTest.java index b067e7b501..c8b4ec7e1a 100644 --- a/jackson-2/src/test/java/com/baeldung/jackson/serialization/custom/serializer/CallingDefaultSerializerUnitTest.java +++ b/jackson-custom-conversions/src/test/java/com/baeldung/defaultserializercustomserializer/CallingDefaultSerializerUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.serialization.custom.serializer; +package com.baeldung.defaultserializercustomserializer; import static org.junit.Assert.assertTrue; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -14,8 +14,6 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; -import com.baeldung.jackson.entities.File; -import com.baeldung.jackson.entities.Folder; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; diff --git a/jackson/src/test/java/com/baeldung/jackson/test/JacksonDeserializationUnitTest.java b/jackson-custom-conversions/src/test/java/com/baeldung/deserialization/CustomDeserializationUnitTest.java similarity index 68% rename from jackson/src/test/java/com/baeldung/jackson/test/JacksonDeserializationUnitTest.java rename to jackson-custom-conversions/src/test/java/com/baeldung/deserialization/CustomDeserializationUnitTest.java index 7bb40cbef9..f2a2502c3e 100644 --- a/jackson/src/test/java/com/baeldung/jackson/test/JacksonDeserializationUnitTest.java +++ b/jackson-custom-conversions/src/test/java/com/baeldung/deserialization/CustomDeserializationUnitTest.java @@ -1,4 +1,16 @@ -package com.baeldung.jackson.test; +package com.baeldung.deserialization; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.module.SimpleModule; +import org.junit.Test; + +import java.io.IOException; +import java.time.ZoneId; +import java.time.ZonedDateTime; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; @@ -7,53 +19,7 @@ import static org.hamcrest.Matchers.notNullValue; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; -import java.io.IOException; -import java.time.ZoneId; -import java.time.ZonedDateTime; - -import org.junit.Test; - -import com.baeldung.jackson.deserialization.ItemDeserializer; -import com.baeldung.jackson.dtos.Item; -import com.baeldung.jackson.dtos.ItemWithSerializer; -import com.baeldung.jackson.dtos.MyDto; -import com.fasterxml.jackson.core.JsonFactory; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException; -import com.fasterxml.jackson.databind.module.SimpleModule; - -public class JacksonDeserializationUnitTest { - - @Test - public final void whenDeserializingAJsonToAClass_thenCorrect() throws JsonParseException, JsonMappingException, IOException { - final String jsonAsString = "{\"stringValue\":\"a\",\"intValue\":1,\"booleanValue\":true}"; - final ObjectMapper mapper = new ObjectMapper(); - - final MyDto readValue = mapper.readValue(jsonAsString, MyDto.class); - - assertNotNull(readValue); - assertThat(readValue.getStringValue(), equalTo("a")); - } - - @Test - public final void givenNotAllFieldsHaveValuesInJson_whenDeserializingAJsonToAClass_thenCorrect() throws JsonParseException, JsonMappingException, IOException { - final String jsonAsString = "{\"stringValue\":\"a\",\"booleanValue\":true}"; - final ObjectMapper mapper = new ObjectMapper(); - - final MyDto readValue = mapper.readValue(jsonAsString, MyDto.class); - - assertNotNull(readValue); - assertThat(readValue.getStringValue(), equalTo("a")); - assertThat(readValue.isBooleanValue(), equalTo(true)); - } - - // custom deserialization +public class CustomDeserializationUnitTest { @Test public final void whenDeserializingTheStandardRepresentation_thenCorrect() throws JsonParseException, JsonMappingException, IOException { @@ -80,7 +46,7 @@ public class JacksonDeserializationUnitTest { public final void givenDeserializerIsOnClass_whenDeserializingCustomRepresentation_thenCorrect() throws JsonParseException, JsonMappingException, IOException { final String json = "{\"id\":1,\"itemName\":\"theItem\",\"owner\":2}"; - final ItemWithSerializer readValue = new ObjectMapper().readValue(json, ItemWithSerializer.class); + final ItemWithDeserializer readValue = new ObjectMapper().readValue(json, ItemWithDeserializer.class); assertThat(readValue, notNullValue()); } diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/test/JacksonSerializationUnitTest.java b/jackson-custom-conversions/src/test/java/com/baeldung/serialization/CustomSerializationUnitTest.java similarity index 72% rename from jackson-simple/src/test/java/com/baeldung/jackson/test/JacksonSerializationUnitTest.java rename to jackson-custom-conversions/src/test/java/com/baeldung/serialization/CustomSerializationUnitTest.java index 93dd708b18..6cb4019fa2 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/test/JacksonSerializationUnitTest.java +++ b/jackson-custom-conversions/src/test/java/com/baeldung/serialization/CustomSerializationUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.test; +package com.baeldung.serialization; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; @@ -7,12 +7,6 @@ import static org.junit.Assert.assertThat; import java.io.IOException; import java.util.List; - -import com.baeldung.jackson.dtos.User; -import com.baeldung.jackson.dtos.Item; -import com.baeldung.jackson.dtos.ItemWithSerializer; -import com.baeldung.jackson.dtos.MyDto; -import com.baeldung.jackson.serialization.ItemSerializer; import org.junit.Test; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; @@ -24,21 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import com.google.common.collect.Lists; -public class JacksonSerializationUnitTest { - - // tests - multiple entities to json - - @Test - public final void whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException { - final List listOfDtos = Lists.newArrayList(new MyDto("a", 1, true), new MyDto("bc", 3, false)); - - final ObjectMapper mapper = new ObjectMapper(); - final String dtosAsString = mapper.writeValueAsString(listOfDtos); - - System.out.println(dtosAsString); - } - - // tests - custom serializer +public class CustomSerializationUnitTest { @Test public final void whenSerializing_thenNoExceptions() throws JsonGenerationException, JsonMappingException, IOException { diff --git a/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/IgnoreFieldsWithFilterUnitTest.java b/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/IgnoreFieldsWithFilterUnitTest.java new file mode 100644 index 0000000000..e71f31bc6a --- /dev/null +++ b/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/IgnoreFieldsWithFilterUnitTest.java @@ -0,0 +1,89 @@ +package com.baeldung.skipfields; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; +import com.fasterxml.jackson.databind.ser.FilterProvider; +import com.fasterxml.jackson.databind.ser.PropertyFilter; +import com.fasterxml.jackson.databind.ser.PropertyWriter; +import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; +import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; +import org.junit.Test; + +import java.io.IOException; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertThat; + +public class IgnoreFieldsWithFilterUnitTest { + + @Test + public final void givenTypeHasFilterThatIgnoresFieldByName_whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException { + final ObjectMapper mapper = new ObjectMapper(); + final SimpleBeanPropertyFilter theFilter = SimpleBeanPropertyFilter.serializeAllExcept("intValue"); + final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter); + + final MyDtoWithFilter dtoObject = new MyDtoWithFilter(); + dtoObject.setIntValue(12); + + final String dtoAsString = mapper.writer(filters) + .writeValueAsString(dtoObject); + + assertThat(dtoAsString, not(containsString("intValue"))); + assertThat(dtoAsString, containsString("booleanValue")); + assertThat(dtoAsString, containsString("stringValue")); + System.out.println(dtoAsString); + } + + @Test + public final void givenTypeHasFilterThatIgnoresNegativeInt_whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException { + final PropertyFilter theFilter = new SimpleBeanPropertyFilter() { + @Override + public final void serializeAsField(final Object pojo, final JsonGenerator jgen, final SerializerProvider provider, final PropertyWriter writer) throws Exception { + if (include(writer)) { + if (!writer.getName() + .equals("intValue")) { + writer.serializeAsField(pojo, jgen, provider); + return; + } + + final int intValue = ((MyDtoWithFilter) pojo).getIntValue(); + if (intValue >= 0) { + writer.serializeAsField(pojo, jgen, provider); + } + } else if (!jgen.canOmitFields()) { // since 2.3 + writer.serializeAsOmittedField(pojo, jgen, provider); + } + } + + @Override + protected final boolean include(final BeanPropertyWriter writer) { + return true; + } + + @Override + protected final boolean include(final PropertyWriter writer) { + return true; + } + }; + final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter); + + final MyDtoWithFilter dtoObject = new MyDtoWithFilter(); + dtoObject.setIntValue(-1); + + final ObjectMapper mapper = new ObjectMapper(); + final String dtoAsString = mapper.writer(filters) + .writeValueAsString(dtoObject); + + assertThat(dtoAsString, not(containsString("intValue"))); + assertThat(dtoAsString, containsString("booleanValue")); + assertThat(dtoAsString, containsString("stringValue")); + System.out.println(dtoAsString); + } + +} diff --git a/jackson/src/test/java/com/baeldung/jackson/test/JacksonDynamicIgnoreUnitTest.java b/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java similarity index 93% rename from jackson/src/test/java/com/baeldung/jackson/test/JacksonDynamicIgnoreUnitTest.java rename to jackson-custom-conversions/src/test/java/com/baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java index 2f0f45828b..6ba14f7476 100644 --- a/jackson/src/test/java/com/baeldung/jackson/test/JacksonDynamicIgnoreUnitTest.java +++ b/jackson-custom-conversions/src/test/java/com/baeldung/skipfields/JacksonDynamicIgnoreUnitTest.java @@ -1,14 +1,10 @@ -package com.baeldung.jackson.test; +package com.baeldung.skipfields; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.Arrays; -import com.baeldung.jackson.dynamicIgnore.Address; -import com.baeldung.jackson.dynamicIgnore.HidableSerializer; -import com.baeldung.jackson.dynamicIgnore.Person; -import com.baeldung.jackson.dynamicIgnore.Hidable; import org.junit.Before; import org.junit.Test; diff --git a/jackson-exceptions/pom.xml b/jackson-exceptions/pom.xml index ce580996de..3cf4796fa7 100644 --- a/jackson-exceptions/pom.xml +++ b/jackson-exceptions/pom.xml @@ -1,5 +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 jackson-exceptions 0.0.1-SNAPSHOT diff --git a/jackson-simple/README.md b/jackson-simple/README.md index 558b506c8a..ffc76ead22 100644 --- a/jackson-simple/README.md +++ b/jackson-simple/README.md @@ -6,4 +6,14 @@ This module contains articles about Jackson that are also part of the Jackson Eb The "REST With Spring" Classes: http://bit.ly/restwithspring -### Relevant Articles: +### Relevant Articles: +- [Jackson Annotation Examples](https://www.baeldung.com/jackson-annotations) +- [Intro to the Jackson ObjectMapper](https://www.baeldung.com/jackson-object-mapper-tutorial) +- [Jackson Ignore Properties on Marshalling](https://www.baeldung.com/jackson-ignore-properties-on-serialization) +- [Ignore Null Fields with Jackson](https://www.baeldung.com/jackson-ignore-null-fields) +- [Jackson – Change Name of Field](https://www.baeldung.com/jackson-name-of-property) +- [Jackson Unmarshalling JSON with Unknown Properties](https://www.baeldung.com/jackson-deserialize-json-unknown-properties) + +### NOTE: + +Since this is a module tied to an e-book, it should **not** be used to store the code for any further article. diff --git a/jackson-simple/pom.xml b/jackson-simple/pom.xml index 718c50ec80..cdda031e0f 100644 --- a/jackson-simple/pom.xml +++ b/jackson-simple/pom.xml @@ -1,5 +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 jackson-simple 0.1-SNAPSHOT @@ -21,7 +22,6 @@ - org.assertj assertj-core diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/AliasBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/AliasBean.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/AliasBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/AliasBean.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCreator.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithCustomAnnotation.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithFilter.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithGetter.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithIgnore.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/BeanWithInject.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/ExtendableBean.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/MyBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/MyBean.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/MyBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/MyBean.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/PrivateBean.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/RawBean.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/RawBean.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/RawBean.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/RawBean.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/UnwrappedUser.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/UserWithIgnoreType.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/Zoo.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/Zoo.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/Zoo.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/Zoo.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIdentity.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithIgnore.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/ItemWithRef.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIdentity.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithIgnore.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/bidirection/UserWithRef.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateDeserializer.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/CustomDateSerializer.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithFormat.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/date/EventWithSerializer.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/deserialization/ItemDeserializerOnClass.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/Item.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/ItemWithSerializer.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/User.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/User.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/User.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/User.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/dtos/withEnum/DistanceEnumWithValue.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRoot.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/exception/UserWithRootNamespace.java diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyMixInForIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ignore/MyMixInForIgnoreType.java similarity index 71% rename from jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyMixInForIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/ignore/MyMixInForIgnoreType.java index ce97d35c83..c016e44530 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyMixInForIgnoreType.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/ignore/MyMixInForIgnoreType.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.ignore.dtos; +package com.baeldung.jackson.annotation.ignore; import com.fasterxml.jackson.annotation.JsonIgnoreType; diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Item.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/jsonview/Views.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializer.java diff --git a/jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java b/jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java similarity index 100% rename from jackson-annotations/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java rename to jackson-simple/src/main/java/com/baeldung/jackson/annotation/serialization/ItemSerializerOnClass.java diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDto.java similarity index 96% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDto.java index 49cf07baea..b8fedc9c98 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDto.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDto.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.jackson.ignore; public class MyDto { diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreField.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreField.java similarity index 94% rename from jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreField.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreField.java index 8cbcb773cc..6880cf68fc 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreField.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreField.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.ignore.dtos; +package com.baeldung.jackson.ignore; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreFieldByName.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreFieldByName.java similarity index 95% rename from jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreFieldByName.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreFieldByName.java index 1aee31a1b3..f446096258 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreFieldByName.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreFieldByName.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.ignore.dtos; +package com.baeldung.jackson.ignore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreNull.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreNull.java similarity index 96% rename from jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreNull.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreNull.java index 75532f18c2..2fd388109c 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoIgnoreNull.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIgnoreNull.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.ignore.dtos; +package com.baeldung.jackson.ignore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoIncludeNonDefault.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIncludeNonDefault.java similarity index 95% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoIncludeNonDefault.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIncludeNonDefault.java index ca03a8be62..53b9316413 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoIncludeNonDefault.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoIncludeNonDefault.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.jackson.ignore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoWithFilter.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithFilter.java similarity index 96% rename from jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoWithFilter.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithFilter.java index 256b7d206d..f8e4043357 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/dtos/MyDtoWithFilter.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.ignore.dtos; +package com.baeldung.jackson.ignore; import com.fasterxml.jackson.annotation.JsonFilter; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoWithSpecialField.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithSpecialField.java similarity index 96% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoWithSpecialField.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithSpecialField.java index 58293c0562..f85823fb30 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyDtoWithSpecialField.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyDtoWithSpecialField.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.jackson.ignore; public class MyDtoWithSpecialField { diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyMixInForIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyMixInForIgnoreType.java similarity index 76% rename from jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyMixInForIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyMixInForIgnoreType.java index ca29c98b9a..3c5dfdfad3 100644 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/MyMixInForIgnoreType.java +++ b/jackson-simple/src/main/java/com/baeldung/jackson/ignore/MyMixInForIgnoreType.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.dtos; +package com.baeldung.jackson.ignore; import com.fasterxml.jackson.annotation.JsonIgnoreType; diff --git a/jackson-conversions-2/src/test/java/com/baeldung/jackson/ignorenullfields/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDto.java similarity index 100% rename from jackson-conversions-2/src/test/java/com/baeldung/jackson/ignorenullfields/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDto.java diff --git a/jackson-conversions-2/src/test/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java b/jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java similarity index 100% rename from jackson-conversions-2/src/test/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java rename to jackson-simple/src/main/java/com/baeldung/jackson/ignorenullfields/MyDtoIgnoreNull.java diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/jsonproperty/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDto.java similarity index 100% rename from jackson-annotations/src/test/java/com/baeldung/jackson/jsonproperty/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDto.java diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java b/jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java similarity index 100% rename from jackson-annotations/src/test/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java rename to jackson-simple/src/main/java/com/baeldung/jackson/jsonproperty/MyDtoFieldNameChanged.java diff --git a/jackson/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java similarity index 100% rename from jackson/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarDeserializer.java diff --git a/jackson/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java similarity index 100% rename from jackson/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/CustomCarSerializer.java diff --git a/jackson/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java similarity index 100% rename from jackson/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Car.java diff --git a/jackson/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java b/jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java similarity index 100% rename from jackson/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java rename to jackson-simple/src/main/java/com/baeldung/jackson/objectmapper/dto/Request.java diff --git a/jackson-conversions-2/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java b/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java similarity index 100% rename from jackson-conversions-2/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java rename to jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDto.java diff --git a/jackson-conversions-2/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java b/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java similarity index 100% rename from jackson-conversions-2/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java rename to jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreType.java diff --git a/jackson-conversions-2/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java b/jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java similarity index 100% rename from jackson-conversions-2/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java rename to jackson-simple/src/main/java/com/baeldung/jackson/unknownproperties/MyDtoIgnoreUnknown.java diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java similarity index 99% rename from jackson-annotations/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java index 462b65787a..bbbb79b0a8 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java +++ b/jackson-simple/src/test/java/com/baeldung/jackson/annotation/JacksonAnnotationUnitTest.java @@ -20,7 +20,7 @@ import com.baeldung.jackson.annotation.bidirection.UserWithIdentity; import com.baeldung.jackson.annotation.bidirection.UserWithRef; import com.baeldung.jackson.annotation.date.EventWithFormat; import com.baeldung.jackson.annotation.date.EventWithSerializer; -import com.baeldung.jackson.ignore.dtos.MyMixInForIgnoreType; +import com.baeldung.jackson.annotation.ignore.MyMixInForIgnoreType; import com.baeldung.jackson.annotation.dtos.withEnum.DistanceEnumWithValue; import com.baeldung.jackson.annotation.exception.UserWithRoot; import com.baeldung.jackson.annotation.exception.UserWithRootNamespace; diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializerOnClass.java b/jackson-simple/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializerOnClass.java deleted file mode 100644 index eaba9a7173..0000000000 --- a/jackson-simple/src/test/java/com/baeldung/jackson/deserialization/ItemDeserializerOnClass.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.baeldung.jackson.deserialization; - -import java.io.IOException; - -import com.baeldung.jackson.dtos.ItemWithSerializer; -import com.baeldung.jackson.dtos.User; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import com.fasterxml.jackson.databind.node.IntNode; - -public class ItemDeserializerOnClass extends StdDeserializer { - - private static final long serialVersionUID = 5579141241817332594L; - - public ItemDeserializerOnClass() { - this(null); - } - - public ItemDeserializerOnClass(final Class vc) { - super(vc); - } - - /** - * {"id":1,"itemNr":"theItem","owner":2} - */ - @Override - public ItemWithSerializer deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException { - final JsonNode node = jp.getCodec() - .readTree(jp); - final int id = (Integer) ((IntNode) node.get("id")).numberValue(); - final String itemName = node.get("itemName") - .asText(); - final int userId = (Integer) ((IntNode) node.get("owner")).numberValue(); - - return new ItemWithSerializer(id, itemName, new User(userId, null)); - } - -} \ No newline at end of file diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/withEnum/DistanceEnumWithValue.java b/jackson-simple/src/test/java/com/baeldung/jackson/dtos/withEnum/DistanceEnumWithValue.java deleted file mode 100644 index 574908523a..0000000000 --- a/jackson-simple/src/test/java/com/baeldung/jackson/dtos/withEnum/DistanceEnumWithValue.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.baeldung.jackson.annotation.dtos.withEnum; - -import com.fasterxml.jackson.annotation.JsonValue; - -public enum DistanceEnumWithValue { - KILOMETER("km", 1000), MILE("miles", 1609.34), METER("meters", 1), INCH("inches", 0.0254), CENTIMETER("cm", 0.01), MILLIMETER("mm", 0.001); - - private String unit; - private final double meters; - - private DistanceEnumWithValue(String unit, double meters) { - this.unit = unit; - this.meters = meters; - } - - @JsonValue - public double getMeters() { - return meters; - } - - public String getUnit() { - return unit; - } - - public void setUnit(String unit) { - this.unit = unit; - } - -} \ No newline at end of file diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/ignore/IgnoreFieldsWithFilterUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/ignore/IgnoreFieldsWithFilterUnitTest.java new file mode 100644 index 0000000000..9f1da451f8 --- /dev/null +++ b/jackson-simple/src/test/java/com/baeldung/jackson/ignore/IgnoreFieldsWithFilterUnitTest.java @@ -0,0 +1,87 @@ +package com.baeldung.jackson.ignore; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.BeanPropertyWriter; +import com.fasterxml.jackson.databind.ser.FilterProvider; +import com.fasterxml.jackson.databind.ser.PropertyFilter; +import com.fasterxml.jackson.databind.ser.PropertyWriter; +import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; +import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; +import org.junit.Test; + +import java.io.IOException; + +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertThat; + +public class IgnoreFieldsWithFilterUnitTest { + + @Test + public final void givenTypeHasFilterThatIgnoresFieldByName_whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException { + final ObjectMapper mapper = new ObjectMapper(); + final SimpleBeanPropertyFilter theFilter = SimpleBeanPropertyFilter.serializeAllExcept("intValue"); + final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter); + + final MyDtoWithFilter dtoObject = new MyDtoWithFilter(); + dtoObject.setIntValue(12); + + final String dtoAsString = mapper.writer(filters) + .writeValueAsString(dtoObject); + + assertThat(dtoAsString, not(containsString("intValue"))); + assertThat(dtoAsString, containsString("booleanValue")); + assertThat(dtoAsString, containsString("stringValue")); + System.out.println(dtoAsString); + } + + @Test + public final void givenTypeHasFilterThatIgnoresNegativeInt_whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException { + final PropertyFilter theFilter = new SimpleBeanPropertyFilter() { + @Override + public final void serializeAsField(final Object pojo, final JsonGenerator jgen, final SerializerProvider provider, final PropertyWriter writer) throws Exception { + if (include(writer)) { + if (!writer.getName() + .equals("intValue")) { + writer.serializeAsField(pojo, jgen, provider); + return; + } + + final int intValue = ((MyDtoWithFilter) pojo).getIntValue(); + if (intValue >= 0) { + writer.serializeAsField(pojo, jgen, provider); + } + } else if (!jgen.canOmitFields()) { // since 2.3 + writer.serializeAsOmittedField(pojo, jgen, provider); + } + } + + @Override + protected final boolean include(final BeanPropertyWriter writer) { + return true; + } + + @Override + protected final boolean include(final PropertyWriter writer) { + return true; + } + }; + final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter); + + final MyDtoWithFilter dtoObject = new MyDtoWithFilter(); + dtoObject.setIntValue(-1); + + final ObjectMapper mapper = new ObjectMapper(); + final String dtoAsString = mapper.writer(filters) + .writeValueAsString(dtoObject); + + assertThat(dtoAsString, not(containsString("intValue"))); + assertThat(dtoAsString, containsString("booleanValue")); + assertThat(dtoAsString, containsString("stringValue")); + System.out.println(dtoAsString); + } + +} diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java similarity index 60% rename from jackson-annotations/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java index c96eef4b05..da7c45859e 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java +++ b/jackson-simple/src/test/java/com/baeldung/jackson/ignore/JacksonSerializationIgnoreUnitTest.java @@ -5,19 +5,9 @@ import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import org.junit.Test; -import com.baeldung.jackson.ignore.dtos.MyDto; -import com.baeldung.jackson.ignore.dtos.MyDtoIncludeNonDefault; -import com.baeldung.jackson.ignore.dtos.MyDtoWithFilter; -import com.baeldung.jackson.ignore.dtos.MyDtoWithSpecialField; -import com.baeldung.jackson.ignore.dtos.MyMixInForIgnoreType; -import com.baeldung.jackson.ignore.dtos.MyDtoIgnoreField; -import com.baeldung.jackson.ignore.dtos.MyDtoIgnoreFieldByName; -import com.baeldung.jackson.ignore.dtos.MyDtoIgnoreNull; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParseException; @@ -99,70 +89,6 @@ public class JacksonSerializationIgnoreUnitTest { System.out.println(dtoAsString); } - @Test - public final void givenTypeHasFilterThatIgnoresFieldByName_whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException { - final ObjectMapper mapper = new ObjectMapper(); - final SimpleBeanPropertyFilter theFilter = SimpleBeanPropertyFilter.serializeAllExcept("intValue"); - final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter); - - final MyDtoWithFilter dtoObject = new MyDtoWithFilter(); - dtoObject.setIntValue(12); - - final String dtoAsString = mapper.writer(filters) - .writeValueAsString(dtoObject); - - assertThat(dtoAsString, not(containsString("intValue"))); - assertThat(dtoAsString, containsString("booleanValue")); - assertThat(dtoAsString, containsString("stringValue")); - System.out.println(dtoAsString); - } - - @Test - public final void givenTypeHasFilterThatIgnoresNegativeInt_whenDtoIsSerialized_thenCorrect() throws JsonParseException, IOException { - final PropertyFilter theFilter = new SimpleBeanPropertyFilter() { - @Override - public final void serializeAsField(final Object pojo, final JsonGenerator jgen, final SerializerProvider provider, final PropertyWriter writer) throws Exception { - if (include(writer)) { - if (!writer.getName() - .equals("intValue")) { - writer.serializeAsField(pojo, jgen, provider); - return; - } - - final int intValue = ((MyDtoWithFilter) pojo).getIntValue(); - if (intValue >= 0) { - writer.serializeAsField(pojo, jgen, provider); - } - } else if (!jgen.canOmitFields()) { // since 2.3 - writer.serializeAsOmittedField(pojo, jgen, provider); - } - } - - @Override - protected final boolean include(final BeanPropertyWriter writer) { - return true; - } - - @Override - protected final boolean include(final PropertyWriter writer) { - return true; - } - }; - final FilterProvider filters = new SimpleFilterProvider().addFilter("myFilter", theFilter); - - final MyDtoWithFilter dtoObject = new MyDtoWithFilter(); - dtoObject.setIntValue(-1); - - final ObjectMapper mapper = new ObjectMapper(); - final String dtoAsString = mapper.writer(filters) - .writeValueAsString(dtoObject); - - assertThat(dtoAsString, not(containsString("intValue"))); - assertThat(dtoAsString, containsString("booleanValue")); - assertThat(dtoAsString, containsString("stringValue")); - System.out.println(dtoAsString); - } - @Test public final void givenNullsIgnoredOnClass_whenWritingObjectWithNullField_thenIgnored() throws JsonProcessingException { final ObjectMapper mapper = new ObjectMapper(); diff --git a/jackson-conversions-2/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java similarity index 98% rename from jackson-conversions-2/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java index 192fe61889..ab1d9523e7 100644 --- a/jackson-conversions-2/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java +++ b/jackson-simple/src/test/java/com/baeldung/jackson/ignorenullfields/IgnoreNullFieldsUnitTest.java @@ -14,8 +14,6 @@ import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter; import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider; import org.junit.Test; -import java.io.IOException; - import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; diff --git a/jackson-annotations/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java similarity index 98% rename from jackson-annotations/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java index 59622ff8b8..e0571465fb 100644 --- a/jackson-annotations/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java +++ b/jackson-simple/src/test/java/com/baeldung/jackson/jsonproperty/JsonPropertyUnitTest.java @@ -5,7 +5,7 @@ import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; import java.io.IOException; -import java.util.List; + import org.junit.Test; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; diff --git a/jackson/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java similarity index 100% rename from jackson/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/JavaReadWriteJsonExampleUnitTest.java diff --git a/jackson/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java similarity index 100% rename from jackson/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/objectmapper/SerializationDeserializationFeatureUnitTest.java diff --git a/jackson-simple/src/test/java/com/baeldung/jackson/serialization/ItemSerializerOnClass.java b/jackson-simple/src/test/java/com/baeldung/jackson/serialization/ItemSerializerOnClass.java deleted file mode 100644 index 1fdf44e17c..0000000000 --- a/jackson-simple/src/test/java/com/baeldung/jackson/serialization/ItemSerializerOnClass.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.baeldung.jackson.serialization; - -import java.io.IOException; - -import com.baeldung.jackson.dtos.ItemWithSerializer; -import com.fasterxml.jackson.core.JsonGenerator; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.SerializerProvider; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; - -public class ItemSerializerOnClass extends StdSerializer { - - private static final long serialVersionUID = -1760959597313610409L; - - public ItemSerializerOnClass() { - this(null); - } - - public ItemSerializerOnClass(final Class t) { - super(t); - } - - @Override - public final void serialize(final ItemWithSerializer value, final JsonGenerator jgen, final SerializerProvider provider) throws IOException, JsonProcessingException { - jgen.writeStartObject(); - jgen.writeNumberField("id", value.id); - jgen.writeStringField("itemName", value.itemName); - jgen.writeNumberField("owner", value.owner.id); - jgen.writeEndObject(); - } - -} \ No newline at end of file diff --git a/jackson-conversions-2/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java b/jackson-simple/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java similarity index 100% rename from jackson-conversions-2/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java rename to jackson-simple/src/test/java/com/baeldung/jackson/unknownproperties/UnknownPropertiesUnitTest.java diff --git a/jackson/src/test/resources/json_car.json b/jackson-simple/src/test/resources/json_car.json similarity index 100% rename from jackson/src/test/resources/json_car.json rename to jackson-simple/src/test/resources/json_car.json diff --git a/jackson/README.md b/jackson/README.md index 72e82c26db..bcf8c3036f 100644 --- a/jackson/README.md +++ b/jackson/README.md @@ -7,13 +7,9 @@ This module contains articles about Jackson. The "REST With Spring" Classes: http://bit.ly/restwithspring ### Relevant Articles: - -- [Jackson – Custom Serializer](https://www.baeldung.com/jackson-custom-serialization) -- [Getting Started with Custom Deserialization in Jackson](https://www.baeldung.com/jackson-deserialization) -- [Jackson JSON Tutorial](https://www.baeldung.com/jackson) -- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson) - [Using Optional with Jackson](https://www.baeldung.com/jackson-optional) -- [Serialize Only Fields that meet a Custom Criteria with Jackson](https://www.baeldung.com/jackson-serialize-field-custom-criteria) -- [Intro to the Jackson ObjectMapper](https://www.baeldung.com/jackson-object-mapper-tutorial) +- [Compare Two JSON Objects with Jackson](https://www.baeldung.com/jackson-compare-two-json-objects) +- [Jackson vs Gson](https://www.baeldung.com/jackson-vs-gson) +- [Jackson JSON Tutorial](https://www.baeldung.com/jackson) - [Inheritance with Jackson](https://www.baeldung.com/jackson-inheritance) -- More articles: [[next -->]](/../jackson-2) +- [Working with Tree Model Nodes in Jackson](https://www.baeldung.com/jackson-json-node-tree-model) diff --git a/jackson/pom.xml b/jackson/pom.xml index 40e768381b..d7fc3aac9a 100644 --- a/jackson/pom.xml +++ b/jackson/pom.xml @@ -1,5 +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 jackson 0.1-SNAPSHOT diff --git a/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/ActorJackson.java b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/ActorJackson.java new file mode 100644 index 0000000000..b4b6d99447 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/ActorJackson.java @@ -0,0 +1,61 @@ +package com.baeldung.jackson.jacksonvsgson; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.TimeZone; + +public class ActorJackson { + + private String imdbId; + private Date dateOfBirth; + private List filmography; + + public ActorJackson() { + super(); + } + + public ActorJackson(String imdbId, Date dateOfBirth, List filmography) { + super(); + this.imdbId = imdbId; + this.dateOfBirth = dateOfBirth; + this.filmography = filmography; + } + + @Override + public String toString() { + return "ActorJackson [imdbId=" + imdbId + ", dateOfBirth=" + formatDateOfBirth() + ", filmography=" + filmography + "]"; + } + + public String getImdbId() { + return imdbId; + } + + public void setImdbId(String imdbId) { + this.imdbId = imdbId; + } + + public Date getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(Date dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public List getFilmography() { + return filmography; + } + + public void setFilmography(List filmography) { + this.filmography = filmography; + } + + private String formatDateOfBirth() { + final DateFormat formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss zzz yyyy", Locale.US); + formatter.setTimeZone(TimeZone.getTimeZone("GMT")); + return formatter.format(dateOfBirth); + } +} diff --git a/jackson/src/main/java/com/baeldung/jackson/serialization/ActorJacksonSerializer.java b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/ActorJacksonSerializer.java similarity index 92% rename from jackson/src/main/java/com/baeldung/jackson/serialization/ActorJacksonSerializer.java rename to jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/ActorJacksonSerializer.java index 2340de5957..837c837cf5 100644 --- a/jackson/src/main/java/com/baeldung/jackson/serialization/ActorJacksonSerializer.java +++ b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/ActorJacksonSerializer.java @@ -1,11 +1,9 @@ -package com.baeldung.jackson.serialization; +package com.baeldung.jackson.jacksonvsgson; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.stream.Collectors; -import com.baeldung.jackson.entities.ActorJackson; - import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.ser.std.StdSerializer; diff --git a/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/Movie.java b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/Movie.java new file mode 100644 index 0000000000..070d1bc2d4 --- /dev/null +++ b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/Movie.java @@ -0,0 +1,50 @@ +package com.baeldung.jackson.jacksonvsgson; + +import java.util.List; + +public class Movie { + + private String imdbId; + private String director; + private List actors; + + public Movie(String imdbId, String director, List actors) { + super(); + this.imdbId = imdbId; + this.director = director; + this.actors = actors; + } + + public Movie() { + super(); + } + + @Override + public String toString() { + return "Movie [imdbId=" + imdbId + ", director=" + director + ", actors=" + actors + "]"; + } + + public String getImdbId() { + return imdbId; + } + + public void setImdbId(String imdbId) { + this.imdbId = imdbId; + } + + public String getDirector() { + return director; + } + + public void setDirector(String director) { + this.director = director; + } + + public List getActors() { + return actors; + } + + public void setActors(List actors) { + this.actors = actors; + } +} \ No newline at end of file diff --git a/jackson/src/main/java/com/baeldung/jackson/entities/MovieWithNullValue.java b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/MovieWithNullValue.java similarity index 95% rename from jackson/src/main/java/com/baeldung/jackson/entities/MovieWithNullValue.java rename to jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/MovieWithNullValue.java index 4b31196ff9..a0b013cfc3 100644 --- a/jackson/src/main/java/com/baeldung/jackson/entities/MovieWithNullValue.java +++ b/jackson/src/main/java/com/baeldung/jackson/jacksonvsgson/MovieWithNullValue.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.entities; +package com.baeldung.jackson.jacksonvsgson; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/jackson-2/src/main/java/com/baeldung/jackson/node/JsonNodeIterator.java b/jackson/src/main/java/com/baeldung/jackson/node/JsonNodeIterator.java similarity index 75% rename from jackson-2/src/main/java/com/baeldung/jackson/node/JsonNodeIterator.java rename to jackson/src/main/java/com/baeldung/jackson/node/JsonNodeIterator.java index f582772587..dc1aa35aec 100644 --- a/jackson-2/src/main/java/com/baeldung/jackson/node/JsonNodeIterator.java +++ b/jackson/src/main/java/com/baeldung/jackson/node/JsonNodeIterator.java @@ -44,19 +44,19 @@ public class JsonNodeIterator { } -private void addFieldNameToYaml(StringBuilder yaml, String fieldName, int depth, boolean isFirstInArray) { - if (yaml.length()>0) { - yaml.append(NEW_LINE); - int requiredDepth = (isFirstInArray) ? depth-1 : depth; - for(int i = 0; i < requiredDepth; i++) { - yaml.append(YAML_PREFIX); - } - if (isFirstInArray) { - yaml.append(ARRAY_PREFIX); + private void addFieldNameToYaml(StringBuilder yaml, String fieldName, int depth, boolean isFirstInArray) { + if (yaml.length()>0) { + yaml.append(NEW_LINE); + int requiredDepth = (isFirstInArray) ? depth-1 : depth; + for(int i = 0; i < requiredDepth; i++) { + yaml.append(YAML_PREFIX); + } + if (isFirstInArray) { + yaml.append(ARRAY_PREFIX); + } } + yaml.append(fieldName); + yaml.append(FIELD_DELIMITER); } - yaml.append(fieldName); - yaml.append(FIELD_DELIMITER); -} } diff --git a/jackson/src/main/java/com/baeldung/jackson/miscellaneous/mixin/Book.java b/jackson/src/main/java/com/baeldung/jackson/optionalwithjackson/Book.java similarity index 89% rename from jackson/src/main/java/com/baeldung/jackson/miscellaneous/mixin/Book.java rename to jackson/src/main/java/com/baeldung/jackson/optionalwithjackson/Book.java index fb961efe85..5b83b7efc3 100644 --- a/jackson/src/main/java/com/baeldung/jackson/miscellaneous/mixin/Book.java +++ b/jackson/src/main/java/com/baeldung/jackson/optionalwithjackson/Book.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.miscellaneous.mixin; +package com.baeldung.jackson.optionalwithjackson; import java.util.Optional; diff --git a/jackson/src/test/java/com/baeldung/jackson/deserialization/JacksonDeserializeUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/jacksonvsgson/JacksonDeserializeUnitTest.java similarity index 95% rename from jackson/src/test/java/com/baeldung/jackson/deserialization/JacksonDeserializeUnitTest.java rename to jackson/src/test/java/com/baeldung/jackson/jacksonvsgson/JacksonDeserializeUnitTest.java index dc055a8f9a..b6b2f44c42 100644 --- a/jackson/src/test/java/com/baeldung/jackson/deserialization/JacksonDeserializeUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/jacksonvsgson/JacksonDeserializeUnitTest.java @@ -1,9 +1,8 @@ -package com.baeldung.jackson.deserialization; +package com.baeldung.jackson.jacksonvsgson; import java.io.IOException; import java.text.DateFormat; import java.text.SimpleDateFormat; -import com.baeldung.jackson.entities.Movie; import org.junit.Test; import com.fasterxml.jackson.databind.ObjectMapper; import static org.junit.Assert.assertEquals; diff --git a/jackson/src/test/java/com/baeldung/jackson/serialization/JacksonSerializeUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/jacksonvsgson/JacksonSerializeUnitTest.java similarity index 93% rename from jackson/src/test/java/com/baeldung/jackson/serialization/JacksonSerializeUnitTest.java rename to jackson/src/test/java/com/baeldung/jackson/jacksonvsgson/JacksonSerializeUnitTest.java index a003c5b526..aff01cb52a 100644 --- a/jackson/src/test/java/com/baeldung/jackson/serialization/JacksonSerializeUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/jacksonvsgson/JacksonSerializeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.serialization; +package com.baeldung.jackson.jacksonvsgson; import java.io.IOException; import java.text.ParseException; @@ -6,9 +6,6 @@ import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.TimeZone; -import com.baeldung.jackson.entities.ActorJackson; -import com.baeldung.jackson.entities.Movie; -import com.baeldung.jackson.entities.MovieWithNullValue; import org.junit.Assert; import org.junit.Test; diff --git a/jackson-2/src/test/java/com/baeldung/jackson/json/compare/JsonCompareUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/jsoncompare/JsonCompareUnitTest.java similarity index 99% rename from jackson-2/src/test/java/com/baeldung/jackson/json/compare/JsonCompareUnitTest.java rename to jackson/src/test/java/com/baeldung/jackson/jsoncompare/JsonCompareUnitTest.java index 03d7c63e36..8c6b6031c3 100644 --- a/jackson-2/src/test/java/com/baeldung/jackson/json/compare/JsonCompareUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/jsoncompare/JsonCompareUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.json.compare; +package com.baeldung.jackson.jsoncompare; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; diff --git a/jackson-2/src/test/java/com/baeldung/jackson/node/ExampleStructure.java b/jackson/src/test/java/com/baeldung/jackson/node/ExampleStructure.java similarity index 100% rename from jackson-2/src/test/java/com/baeldung/jackson/node/ExampleStructure.java rename to jackson/src/test/java/com/baeldung/jackson/node/ExampleStructure.java diff --git a/jackson-2/src/test/java/com/baeldung/jackson/node/JsonNodeIteratorUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/node/JsonNodeIteratorUnitTest.java similarity index 100% rename from jackson-2/src/test/java/com/baeldung/jackson/node/JsonNodeIteratorUnitTest.java rename to jackson/src/test/java/com/baeldung/jackson/node/JsonNodeIteratorUnitTest.java diff --git a/jackson-2/src/test/java/com/baeldung/jackson/node/NodeBean.java b/jackson/src/test/java/com/baeldung/jackson/node/NodeBean.java similarity index 100% rename from jackson-2/src/test/java/com/baeldung/jackson/node/NodeBean.java rename to jackson/src/test/java/com/baeldung/jackson/node/NodeBean.java diff --git a/jackson-2/src/test/java/com/baeldung/jackson/node/NodeOperationUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/node/NodeOperationUnitTest.java similarity index 100% rename from jackson-2/src/test/java/com/baeldung/jackson/node/NodeOperationUnitTest.java rename to jackson/src/test/java/com/baeldung/jackson/node/NodeOperationUnitTest.java diff --git a/jackson/src/test/java/com/baeldung/jackson/miscellaneous/mixin/OptionalTypeUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/optionalwithjackson/OptionalTypeUnitTest.java similarity index 97% rename from jackson/src/test/java/com/baeldung/jackson/miscellaneous/mixin/OptionalTypeUnitTest.java rename to jackson/src/test/java/com/baeldung/jackson/optionalwithjackson/OptionalTypeUnitTest.java index dc807a84b8..ed9d53b003 100644 --- a/jackson/src/test/java/com/baeldung/jackson/miscellaneous/mixin/OptionalTypeUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/optionalwithjackson/OptionalTypeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.jackson.miscellaneous.mixin; +package com.baeldung.jackson.optionalwithjackson; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; diff --git a/jackson/src/test/java/com/baeldung/jackson/sandbox/SandboxUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/sandbox/SandboxUnitTest.java index 6f22e2fa01..fca8a2461e 100644 --- a/jackson/src/test/java/com/baeldung/jackson/sandbox/SandboxUnitTest.java +++ b/jackson/src/test/java/com/baeldung/jackson/sandbox/SandboxUnitTest.java @@ -26,6 +26,4 @@ public class SandboxUnitTest { System.err.println(serialized); } - // - } diff --git a/jackson/src/test/java/com/baeldung/jackson/test/UnitTestSuite.java b/jackson/src/test/java/com/baeldung/jackson/test/UnitTestSuite.java index af99fed5d8..6096bc9961 100644 --- a/jackson/src/test/java/com/baeldung/jackson/test/UnitTestSuite.java +++ b/jackson/src/test/java/com/baeldung/jackson/test/UnitTestSuite.java @@ -7,9 +7,7 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ // @formatter:off - JacksonDeserializationUnitTest.class - ,JacksonDeserializationUnitTest.class - ,JacksonPrettyPrintUnitTest.class + JacksonPrettyPrintUnitTest.class ,SandboxUnitTest.class }) // @formatter:on public class UnitTestSuite { diff --git a/jackson/src/test/java/com/baeldung/jackson/try1/JacksonDeserializationUnitTest.java b/jackson/src/test/java/com/baeldung/jackson/try1/JacksonDeserializationUnitTest.java deleted file mode 100644 index 9fc195a8aa..0000000000 --- a/jackson/src/test/java/com/baeldung/jackson/try1/JacksonDeserializationUnitTest.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.jackson.try1; - -import static org.hamcrest.Matchers.notNullValue; -import static org.junit.Assert.assertThat; - -import java.io.IOException; - -import com.baeldung.jackson.dtos.ItemWithSerializer; -import org.junit.Test; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class JacksonDeserializationUnitTest { - - @Test - public final void givenDeserializerIsOnClass_whenDeserializingCustomRepresentation_thenCorrect() throws JsonParseException, JsonMappingException, IOException { - final String json = "{\"id\":1,\"itemName\":\"theItem\",\"owner\":2}"; - - final ItemWithSerializer readValue = new ObjectMapper().readValue(json, ItemWithSerializer.class); - assertThat(readValue, notNullValue()); - } - -} diff --git a/jackson-2/src/test/resources/node_example.json b/jackson/src/test/resources/node_example.json similarity index 100% rename from jackson-2/src/test/resources/node_example.json rename to jackson/src/test/resources/node_example.json diff --git a/java-blockchain/pom.xml b/java-blockchain/pom.xml index 4c5d0f31d5..3100fed7b9 100644 --- a/java-blockchain/pom.xml +++ b/java-blockchain/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.blockchain java-blockchain diff --git a/java-collections-conversions-2/pom.xml b/java-collections-conversions-2/pom.xml index 17eee0c009..b04d764719 100644 --- a/java-collections-conversions-2/pom.xml +++ b/java-collections-conversions-2/pom.xml @@ -1,5 +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 java-collections-conversions-2 0.1.0-SNAPSHOT diff --git a/java-collections-conversions/pom.xml b/java-collections-conversions/pom.xml index 25131d2031..2073640372 100644 --- a/java-collections-conversions/pom.xml +++ b/java-collections-conversions/pom.xml @@ -1,5 +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 java-collections-conversions 0.1.0-SNAPSHOT @@ -27,7 +28,7 @@ - java-collections-conversions-2 + java-collections-conversions src/main/resources diff --git a/java-collections-conversions/src/main/java/com/baeldung/convertToMap/ConvertToMap.java b/java-collections-conversions/src/main/java/com/baeldung/convertToMap/ConvertToMap.java index e33d9ee212..317cdca529 100644 --- a/java-collections-conversions/src/main/java/com/baeldung/convertToMap/ConvertToMap.java +++ b/java-collections-conversions/src/main/java/com/baeldung/convertToMap/ConvertToMap.java @@ -24,10 +24,7 @@ public class ConvertToMap { public TreeMap listToSortedMap(List books) { return books.stream() - .sorted(Comparator.comparing(Book::getName)) .collect(Collectors.toMap(Book::getName, Function.identity(), (o1, o2) -> o1, TreeMap::new)); } - - } diff --git a/java-collections-maps/pom.xml b/java-collections-maps/pom.xml index fb4d2fe88e..38cf1c38ad 100644 --- a/java-collections-maps/pom.xml +++ b/java-collections-maps/pom.xml @@ -1,5 +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 java-collections-maps 0.1.0-SNAPSHOT diff --git a/java-dates-2/README.md b/java-dates-2/README.md deleted file mode 100644 index 6e88c1628b..0000000000 --- a/java-dates-2/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Relevant Articles: -- [Converting Java Date to OffsetDateTime](https://www.baeldung.com/java-convert-date-to-offsetdatetime) diff --git a/java-ee-8-security-api/app-auth-basic-store-db/pom.xml b/java-ee-8-security-api/app-auth-basic-store-db/pom.xml index 582e82d8bb..02e3b04a40 100644 --- a/java-ee-8-security-api/app-auth-basic-store-db/pom.xml +++ b/java-ee-8-security-api/app-auth-basic-store-db/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 app-auth-basic-store-db app-auth-basic-store-db @@ -64,4 +64,5 @@ + diff --git a/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml b/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml index 43809f1cd5..9354782999 100644 --- a/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml +++ b/java-ee-8-security-api/app-auth-custom-form-store-custom/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 app-auth-custom-form-store-custom app-auth-custom-form-store-custom @@ -38,4 +38,5 @@ + diff --git a/java-ee-8-security-api/app-auth-custom-no-store/pom.xml b/java-ee-8-security-api/app-auth-custom-no-store/pom.xml index 51ee64097a..fee665e22d 100644 --- a/java-ee-8-security-api/app-auth-custom-no-store/pom.xml +++ b/java-ee-8-security-api/app-auth-custom-no-store/pom.xml @@ -1,6 +1,6 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 app-auth-custom-no-store app-auth-custom-no-store @@ -64,4 +64,5 @@ + diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml index 6a7b97b2d7..912a2cabac 100644 --- a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml +++ b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml @@ -47,4 +47,5 @@ + diff --git a/java-ee-8-security-api/pom.xml b/java-ee-8-security-api/pom.xml index f43f3d7c5f..5eeebcb6f0 100644 --- a/java-ee-8-security-api/pom.xml +++ b/java-ee-8-security-api/pom.xml @@ -8,11 +8,11 @@ java-ee-8-security-api pom - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + app-auth-basic-store-db @@ -22,14 +22,12 @@ - javax javaee-web-api ${javaee-version} provided - diff --git a/java-jdi/pom.xml b/java-jdi/pom.xml index 4fcaadf4f0..978ede604b 100644 --- a/java-jdi/pom.xml +++ b/java-jdi/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 java-jdi 0.1.0-SNAPSHOT @@ -20,7 +21,7 @@ tools ${tools.version} system - ${java.home}/../lib/tools.jar + ${java.home}/../lib/tools.jar @@ -35,6 +36,7 @@ - 1.8 + 1.8 + diff --git a/java-lite/pom.xml b/java-lite/pom.xml index ce6e838d92..7ff50a8fd3 100644 --- a/java-lite/pom.xml +++ b/java-lite/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 java-lite diff --git a/java-math-2/pom.xml b/java-math-2/pom.xml index 10af20812e..e22dcc2b31 100644 --- a/java-math-2/pom.xml +++ b/java-math-2/pom.xml @@ -1,10 +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 java-math-2 0.0.1-SNAPSHOT java-math-2 - + com.baeldung parent-modules diff --git a/java-math/pom.xml b/java-math/pom.xml index 9f0aa8d878..9b4af4c13d 100644 --- a/java-math/pom.xml +++ b/java-math/pom.xml @@ -1,10 +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 java-math 0.0.1-SNAPSHOT java-math - + com.baeldung parent-modules @@ -52,7 +53,7 @@ com.github.dpaukov combinatoricslib3 ${combinatoricslib3.version} - + org.openjdk.jmh diff --git a/java-numbers-2/pom.xml b/java-numbers-2/pom.xml index 3f49cbf5f4..ba40ef0a38 100644 --- a/java-numbers-2/pom.xml +++ b/java-numbers-2/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 java-numbers-2 0.1.0-SNAPSHOT diff --git a/java-numbers-2/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java b/java-numbers-2/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java new file mode 100644 index 0000000000..943fcffa56 --- /dev/null +++ b/java-numbers-2/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java @@ -0,0 +1,34 @@ +package com.baeldung.fibonacci; + +import static java.lang.Math.pow; + +public class FibonacciSeriesUtils { + + public static int nthFibonacciTermRecursiveMethod(int n) { + if (n == 0 || n == 1) { + return n; + } + return nthFibonacciTermRecursiveMethod(n - 1) + nthFibonacciTermRecursiveMethod(n - 2); + } + + public static int nthFibonacciTermIterativeMethod(int n) { + if (n == 0 || n == 1) { + return n; + } + int n0 = 0, n1 = 1; + int tempNthTerm; + for (int i = 2; i <= n; i++) { + tempNthTerm = n0 + n1; + n0 = n1; + n1 = tempNthTerm; + } + return n1; + } + + public static int nthFibonacciTermUsingBinetsFormula(int n) { + final double squareRootOf5 = Math.sqrt(5); + final double phi = (1 + squareRootOf5)/2; + int nthTerm = (int) ((Math.pow(phi, n) - Math.pow(-phi, -n))/squareRootOf5); + return nthTerm; + } +} diff --git a/java-numbers-2/src/test/java/com/baeldung/fibonacci/FibonacciSeriesUtilsUnitTest.java b/java-numbers-2/src/test/java/com/baeldung/fibonacci/FibonacciSeriesUtilsUnitTest.java new file mode 100644 index 0000000000..60f79d0c78 --- /dev/null +++ b/java-numbers-2/src/test/java/com/baeldung/fibonacci/FibonacciSeriesUtilsUnitTest.java @@ -0,0 +1,29 @@ +package com.baeldung.fibonacci; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +public class FibonacciSeriesUtilsUnitTest { + + @Test + public void givenTermToCalculate_thenReturnThatTermUsingRecursion() { + int term = 10; + int expectedValue = 55; + assertEquals(FibonacciSeriesUtils.nthFibonacciTermRecursiveMethod(term), expectedValue); + } + + @Test + public void givenTermToCalculate_thenReturnThatTermUsingIteration() { + int term = 10; + int expectedValue = 55; + assertEquals(FibonacciSeriesUtils.nthFibonacciTermIterativeMethod(term), expectedValue); + } + + @Test + public void givenTermToCalculate_thenReturnThatTermUsingBinetsFormula() { + int term = 10; + int expectedValue = 55; + assertEquals(FibonacciSeriesUtils.nthFibonacciTermUsingBinetsFormula(term), expectedValue); + } +} diff --git a/java-numbers/pom.xml b/java-numbers/pom.xml index 3fc7134be2..fc904c5747 100644 --- a/java-numbers/pom.xml +++ b/java-numbers/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 java-numbers 0.1.0-SNAPSHOT @@ -52,4 +53,5 @@ 1.0.3 3.6.1 + diff --git a/java-rmi/README.md b/java-rmi/README.md index 244f986639..6d2d144cdf 100644 --- a/java-rmi/README.md +++ b/java-rmi/README.md @@ -1,6 +1,6 @@ ## Java RMI -This module contains articles about RMI (Remote Method Invocation) in Java. +This module contains articles about Remote Method Invocation (RMI) in Java. ### Relevant articles diff --git a/java-rmi/pom.xml b/java-rmi/pom.xml index ad413b66ab..5fa3ac8845 100644 --- a/java-rmi/pom.xml +++ b/java-rmi/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/java-spi/README.md b/java-spi/README.md index 2ccef98a10..35567ab4dc 100644 --- a/java-spi/README.md +++ b/java-spi/README.md @@ -1,6 +1,6 @@ ## Java SPI -This module contains articles about the SPI (Service Provider Interface) in Java. +This module contains articles about the Service Provider Interface (SPI) in Java. ### Relevant Articles: diff --git a/java-spi/exchange-rate-api/pom.xml b/java-spi/exchange-rate-api/pom.xml index fd3a7ae0a7..1630dbf699 100644 --- a/java-spi/exchange-rate-api/pom.xml +++ b/java-spi/exchange-rate-api/pom.xml @@ -1,5 +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 exchange-rate-api exchange-rate-api diff --git a/java-spi/exchange-rate-app/pom.xml b/java-spi/exchange-rate-app/pom.xml index 7a076d560c..fea9ebe8d9 100644 --- a/java-spi/exchange-rate-app/pom.xml +++ b/java-spi/exchange-rate-app/pom.xml @@ -1,5 +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 exchange-rate-app exchange-rate-app diff --git a/java-spi/exchange-rate-impl/pom.xml b/java-spi/exchange-rate-impl/pom.xml index 8a77b51793..553a9e3377 100644 --- a/java-spi/exchange-rate-impl/pom.xml +++ b/java-spi/exchange-rate-impl/pom.xml @@ -1,5 +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 exchange-rate-impl exchange-rate-impl diff --git a/java-spi/pom.xml b/java-spi/pom.xml index 97a22024bd..6d4874083d 100644 --- a/java-spi/pom.xml +++ b/java-spi/pom.xml @@ -1,5 +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 java-spi java-spi diff --git a/java-vavr-stream/pom.xml b/java-vavr-stream/pom.xml index c92f3c8742..94520f299d 100644 --- a/java-vavr-stream/pom.xml +++ b/java-vavr-stream/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.samples java-vavr-stream diff --git a/java-websocket/pom.xml b/java-websocket/pom.xml index 7ba3ca61d0..ddf10c4457 100644 --- a/java-websocket/pom.xml +++ b/java-websocket/pom.xml @@ -1,5 +1,6 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 java-websocket 0.0.1-SNAPSHOT diff --git a/javafx/pom.xml b/javafx/pom.xml index 44e6f7e8da..50b9e7135c 100644 --- a/javafx/pom.xml +++ b/javafx/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 javafx javafx - + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/javax-servlets/pom.xml b/javax-servlets/pom.xml index 214cfd9218..5fc9fef24a 100644 --- a/javax-servlets/pom.xml +++ b/javax-servlets/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 com.baeldung.javax-servlets javax-servlets 1.0-SNAPSHOT javax-servlets war - + com.baeldung parent-modules 1.0.0-SNAPSHOT - + org.assertj @@ -54,7 +54,7 @@ ${gson.version} - + 4.5.3 2.8.2 @@ -62,4 +62,5 @@ 1.3.3 4.0.1 + diff --git a/javaxval/pom.xml b/javaxval/pom.xml index 9484399874..2655d1fe3e 100644 --- a/javaxval/pom.xml +++ b/javaxval/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 javaxval 0.1-SNAPSHOT javaxval - + com.baeldung parent-modules @@ -39,11 +40,11 @@ test - + 6.0.13.Final - 3.0.0 + 3.0.0 5.0.2.RELEASE 3.11.1 - + diff --git a/jaxb/pom.xml b/jaxb/pom.xml index e5c842d7f0..dc13cf75bc 100644 --- a/jaxb/pom.xml +++ b/jaxb/pom.xml @@ -1,5 +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 jaxb 0.0.1-SNAPSHOT @@ -54,7 +55,7 @@ - + diff --git a/jee-7-security/pom.xml b/jee-7-security/pom.xml index 0637bf65cf..e47df7aae9 100644 --- a/jee-7-security/pom.xml +++ b/jee-7-security/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 jee-7-security 1.0-SNAPSHOT @@ -55,7 +55,7 @@ 7.0 4.2.3.RELEASE - 1.0-pr + 1.0-pr diff --git a/jee-7/pom.xml b/jee-7/pom.xml index 9432801fd9..635d820c2b 100644 --- a/jee-7/pom.xml +++ b/jee-7/pom.xml @@ -1,540 +1,540 @@ - 4.0.0 - jee-7 - 1.0-SNAPSHOT + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + jee-7 + 1.0-SNAPSHOT jee-7 - war - JavaEE 7 Arquillian Archetype Sample + war + JavaEE 7 Arquillian Archetype Sample - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - javax - javaee-api - ${javaee_api.version} - provided - + + + + org.jboss.arquillian + arquillian-bom + ${arquillian_core.version} + import + pom + + + org.jboss.arquillian.extension + arquillian-drone-bom + ${arquillian-drone-bom.version} + pom + import + + + - - 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 - + + + javax + javaee-api + ${javaee_api.version} + provided + - - org.jboss.shrinkwrap.resolver - shrinkwrap-resolver-impl-maven - test - jar - + + 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 + - - 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.shrinkwrap.resolver + shrinkwrap-resolver-impl-maven + test + jar + - - javax.mvc - javax.mvc-api - 20160715 - - - org.glassfish.ozark - ozark - ${ozark.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.springframework.security - spring-security-web - ${org.springframework.security.version} - + + javax.mvc + javax.mvc-api + 20160715 + + + org.glassfish.ozark + ozark + ${ozark.version} + - - org.springframework.security - spring-security-config - ${org.springframework.security.version} - - - org.springframework.security - spring-security-taglibs - ${org.springframework.security.version} - - + + org.springframework.security + spring-security-web + ${org.springframework.security.version} + - - org.jboss.spec.javax.batch - jboss-batch-api_1.0_spec - ${jboss-batch-api.version} - - - org.jberet - jberet-core - ${jberet.version} - - - org.jberet - jberet-support - ${jberet.version} - - - org.jboss.spec.javax.transaction - jboss-transaction-api_1.2_spec - ${jboss-transaction-api.version} - - - org.jboss.marshalling - jboss-marshalling - ${jboss-marshalling.version} - - - org.jboss.weld - weld-core - ${weld.version} - - - org.jboss.weld.se - weld-se - ${weld.version} - - - org.jberet - jberet-se - ${jberet.version} - - - com.h2database - h2 - ${h2.version} - - - org.glassfish.jersey.containers - jersey-container-jetty-servlet - ${jersey-container-jetty-servlet.version} - - + + org.springframework.security + spring-security-config + ${org.springframework.security.version} + + + org.springframework.security + spring-security-taglibs + ${org.springframework.security.version} + + - - - - org.apache.maven.plugins - maven-war-plugin - ${maven-war-plugin.version} - - src/main/webapp - false - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.maven.plugins - - - maven-pmd-plugin - - - [3.8,) - - - check - - - - - - - - - - - - - + + org.jboss.spec.javax.batch + jboss-batch-api_1.0_spec + ${jboss-batch-api.version} + + + org.jberet + jberet-core + ${jberet.version} + + + org.jberet + jberet-support + ${jberet.version} + + + org.jboss.spec.javax.transaction + jboss-transaction-api_1.2_spec + ${jboss-transaction-api.version} + + + org.jboss.marshalling + jboss-marshalling + ${jboss-marshalling.version} + + + org.jboss.weld + weld-core + ${weld.version} + + + org.jboss.weld.se + weld-se + ${weld.version} + + + org.jberet + jberet-se + ${jberet.version} + + + com.h2database + h2 + ${h2.version} + + + org.glassfish.jersey.containers + jersey-container-jetty-servlet + ${jersey-container-jetty-servlet.version} + + - - - - org.jboss.arquillian - arquillian-bom - ${arquillian_core.version} - import - pom - - - org.jboss.arquillian.extension - arquillian-drone-bom - ${arquillian-drone-bom.version} - pom - import - - - + + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + src/main/webapp + false + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-pmd-plugin + + + [3.8,) + + + check + + + + + + + + + + + + + - - - 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 - - - sun.jdk - jconsole - - - - + + + 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 + + + sun.jdk + jconsole + + + + - - - - - 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} - - - sun.jdk - jconsole - - - - - - - - - - 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 - - - sun.jdk - jconsole - - - - - - - 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 - - - + + + + + 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} + + + sun.jdk + jconsole + + + + + + + + + + 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 + + + sun.jdk + jconsole + + + + + + + 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 - - - + + + bintray-mvc-spec-maven + bintray + http://dl.bintray.com/mvc-spec/maven + + true + + + false + + + - - 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 - 4.2.3.RELEASE - 2.21.0 - 1.1.2 - 2.2.14 - 4.5 - 2.0.1.Final - 2.1.0.Final - 2.8 - 2.2 - 20160715 - 1.0.0.Final - 1.0.2.Final - 1.0.0.Final - 1.4.2.Final - 2.1.1.Final - 2.22.1 - + + 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 + 4.2.3.RELEASE + 2.21.0 + 1.1.2 + 2.2.14 + 4.5 + 2.0.1.Final + 2.1.0.Final + 2.8 + 2.2 + 20160715 + 1.0.0.Final + 1.0.2.Final + 1.0.0.Final + 1.4.2.Final + 2.1.1.Final + 2.22.1 + diff --git a/jee-kotlin/pom.xml b/jee-kotlin/pom.xml index 60765f6bc2..80c5ea4e22 100644 --- a/jee-kotlin/pom.xml +++ b/jee-kotlin/pom.xml @@ -1,17 +1,36 @@ - - + 4.0.0 jee-kotlin jee-kotlin war - + - parent-modules 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 + + + + org.jetbrains.kotlin @@ -144,25 +163,6 @@ - - - - org.jboss.arquillian - arquillian-bom - ${arquillian_core.version} - import - pom - - - org.jboss.arquillian.extension - arquillian-drone-bom - ${arquillian-drone-bom.version} - pom - import - - - - wildfly-managed-arquillian @@ -265,12 +265,10 @@ false 8.0 - 1.3.41 official true - 8.2.1.Final 2.21.0 3.1.1 @@ -283,4 +281,5 @@ 3.1.3 + diff --git a/jenkins/plugins/pom.xml b/jenkins/plugins/pom.xml index 1db7cec394..c4caf5567f 100644 --- a/jenkins/plugins/pom.xml +++ b/jenkins/plugins/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 plugins 1.0-SNAPSHOT @@ -12,7 +12,7 @@ org.jenkins-ci.plugins plugin 2.33 - + @@ -91,6 +91,6 @@ 2.13 2.20 2.14 - + diff --git a/jersey/pom.xml b/jersey/pom.xml index 0b4d469e3a..065e2230a2 100644 --- a/jersey/pom.xml +++ b/jersey/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 jersey 0.0.1-SNAPSHOT diff --git a/jgit/pom.xml b/jgit/pom.xml index b79a56315f..eef3c9b8e8 100644 --- a/jgit/pom.xml +++ b/jgit/pom.xml @@ -1,10 +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 JGit 1.0-SNAPSHOT - JGit + JGit jar http://maven.apache.org diff --git a/jgroups/pom.xml b/jgroups/pom.xml index e95fe2be3c..494de2fb4f 100644 --- a/jgroups/pom.xml +++ b/jgroups/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 jgroups 0.1-SNAPSHOT jgroups - Reliable Messaging with JGroups Tutorial jar + Reliable Messaging with JGroups Tutorial com.baeldung diff --git a/jib/pom.xml b/jib/pom.xml index 2341fcca0c..1d7413cc18 100644 --- a/jib/pom.xml +++ b/jib/pom.xml @@ -1,13 +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 jib 0.1-SNAPSHOT jib - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -18,7 +19,7 @@ spring-boot-starter-web - + @@ -39,6 +40,6 @@ - 0.9.10 + 0.9.10 diff --git a/jjwt/pom.xml b/jjwt/pom.xml index 7459853155..073f12a922 100644 --- a/jjwt/pom.xml +++ b/jjwt/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 io.jsonwebtoken jjwt @@ -9,8 +9,8 @@ Exercising the JJWT - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/jmeter/pom.xml b/jmeter/pom.xml index 4bc828f106..64642695ff 100644 --- a/jmeter/pom.xml +++ b/jmeter/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 jmeter jmeter - Intro to Performance testing using JMeter jar + Intro to Performance testing using JMeter - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/jmh/pom.xml b/jmh/pom.xml index 61222da71c..735198036e 100644 --- a/jmh/pom.xml +++ b/jmh/pom.xml @@ -1,5 +1,6 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 jmh 1.0-SNAPSHOT diff --git a/jni/pom.xml b/jni/pom.xml index 4850e07ed7..d64fa12c5a 100644 --- a/jni/pom.xml +++ b/jni/pom.xml @@ -1,13 +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 jni jni - - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + \ No newline at end of file diff --git a/jooby/pom.xml b/jooby/pom.xml index 83dd650701..fe26f9a4c6 100644 --- a/jooby/pom.xml +++ b/jooby/pom.xml @@ -1,63 +1,63 @@ - 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 + com.baeldung.jooby + jooby + 1.0 + jooby - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - - org.jooby - modules - ${jooby.version} - pom - - - + + + + org.jooby + modules + ${jooby.version} + pom + + + - - - org.jooby - jooby-netty - ${jooby.version} - - - org.jooby - jooby-jedis - ${jooby.version} - - - io.rest-assured - rest-assured - test - ${rest-assured.version} - - + + + org.jooby + jooby-netty + ${jooby.version} + + + org.jooby + jooby-jedis + ${jooby.version} + + + io.rest-assured + rest-assured + test + ${rest-assured.version} + + - - - - org.apache.maven.plugins - maven-shade-plugin - ${maven-shade-plugin.version} - - - + + + + org.apache.maven.plugins + maven-shade-plugin + ${maven-shade-plugin.version} + + + - - 1.1.3 - 3.1.1 - com.baeldung.jooby.App - 2.4.3 - + + 1.1.3 + 3.1.1 + com.baeldung.jooby.App + 2.4.3 + diff --git a/jsf/pom.xml b/jsf/pom.xml index 0298036dac..dc110b9fd5 100644 --- a/jsf/pom.xml +++ b/jsf/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 jsf 0.1-SNAPSHOT @@ -8,8 +8,8 @@ war - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/json-path/pom.xml b/json-path/pom.xml index 0f8ff3bd31..8756ffee7b 100644 --- a/json-path/pom.xml +++ b/json-path/pom.xml @@ -1,5 +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 json-path 0.0.1-SNAPSHOT diff --git a/json/pom.xml b/json/pom.xml index 3ed13d0800..bd901b526e 100644 --- a/json/pom.xml +++ b/json/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 org.baeldung json 0.0.1-SNAPSHOT json - + com.baeldung parent-modules @@ -44,7 +45,7 @@ jackson-databind ${jackson.version} - + javax.json.bind javax.json.bind-api ${jsonb-api.version} @@ -54,12 +55,12 @@ javax.json ${javax.version} - - org.eclipse - yasson - ${yasson.version} + + org.eclipse + yasson + ${yasson.version} - + org.apache.commons commons-collections4 @@ -80,10 +81,10 @@ 1.0 4.1 1.0.1 - 20171018 - 2.8.5 - 1.1.2 - 3.11.1 + 20171018 + 2.8.5 + 1.1.2 + 3.11.1 diff --git a/jsoup/pom.xml b/jsoup/pom.xml index f6e25e7a23..d2b59476f3 100644 --- a/jsoup/pom.xml +++ b/jsoup/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 jsoup jsoup diff --git a/jta/pom.xml b/jta/pom.xml index b6f1371629..8f90f74d43 100644 --- a/jta/pom.xml +++ b/jta/pom.xml @@ -9,8 +9,8 @@ JEE JTA demo - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/jws/pom.xml b/jws/pom.xml index 5c19c887d3..e6ab7e05ec 100644 --- a/jws/pom.xml +++ b/jws/pom.xml @@ -1,5 +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.example jws @@ -13,12 +14,12 @@ 1.0.0-SNAPSHOT - - - OpenNMS Repository - http://repo.opennms.org/maven2/ - - + + + OpenNMS Repository + http://repo.opennms.org/maven2/ + + diff --git a/kotlin-libraries/pom.xml b/kotlin-libraries/pom.xml index 5fb8049a8e..dfd1dc363f 100644 --- a/kotlin-libraries/pom.xml +++ b/kotlin-libraries/pom.xml @@ -92,7 +92,7 @@ com.h2database h2 - + io.arrow-kt diff --git a/kotlin-quasar/pom.xml b/kotlin-quasar/pom.xml index 231b02b0c7..a12d27c565 100644 --- a/kotlin-quasar/pom.xml +++ b/kotlin-quasar/pom.xml @@ -2,15 +2,14 @@ 4.0.0 - com.baeldung kotlin-quasar 1.0.0-SNAPSHOT kotlin-quasar jar - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -51,27 +50,27 @@ junit 4.12 - - - org.slf4j - slf4j-api - ${org.slf4j.version} - - - ch.qos.logback - logback-classic - ${logback.version} - - - ch.qos.logback - logback-core - ${logback.version} - - - org.slf4j - jcl-over-slf4j - ${org.slf4j.version} - + + + org.slf4j + slf4j-api + ${org.slf4j.version} + + + ch.qos.logback + logback-classic + ${logback.version} + + + ch.qos.logback + logback-core + ${logback.version} + + + org.slf4j + jcl-over-slf4j + ${org.slf4j.version} + @@ -132,7 +131,8 @@ echo -javaagent:${co.paralleluniverse:quasar-core:jar} - -classpath + -classpath + com.baeldung.quasar.QuasarHelloWorldKt @@ -143,7 +143,8 @@ 0.8.0 1.3.31 - 1.7.21 - 1.1.7 + 1.7.21 + 1.1.7 + diff --git a/libraries-2/pom.xml b/libraries-2/pom.xml index 1ffaf0bbd7..474ff563c2 100644 --- a/libraries-2/pom.xml +++ b/libraries-2/pom.xml @@ -159,4 +159,5 @@ 5.1.9.RELEASE 2.5.0 + diff --git a/libraries-apache-commons-collections/pom.xml b/libraries-apache-commons-collections/pom.xml index eba0ad331e..2209874c66 100644 --- a/libraries-apache-commons-collections/pom.xml +++ b/libraries-apache-commons-collections/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 libraries-apache-commons-collections libraries-apache-commons-collections - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/libraries-apache-commons-io/pom.xml b/libraries-apache-commons-io/pom.xml index 7ec71d8264..21f3f16cd3 100644 --- a/libraries-apache-commons-io/pom.xml +++ b/libraries-apache-commons-io/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 libraries-apache-commons-io libraries-apache-commons-io - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/libraries-apache-commons/pom.xml b/libraries-apache-commons/pom.xml index a6dc82b479..688a500c4a 100644 --- a/libraries-apache-commons/pom.xml +++ b/libraries-apache-commons/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 libraries-apache-commons libraries-apache-commons - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -51,7 +51,7 @@ com.h2database h2 ${h2.version} - + org.knowm.xchart xchart diff --git a/libraries-data-2/pom.xml b/libraries-data-2/pom.xml index 00c6f1b4fc..e6106c0fe3 100644 --- a/libraries-data-2/pom.xml +++ b/libraries-data-2/pom.xml @@ -2,7 +2,6 @@ - 4.0.0 libraries-data-2 libraries-data-2 @@ -155,4 +154,5 @@ 1.7.25 3.0.0 + \ No newline at end of file diff --git a/libraries-data-db/pom.xml b/libraries-data-db/pom.xml index 767b8b79ba..682a6ed185 100644 --- a/libraries-data-db/pom.xml +++ b/libraries-data-db/pom.xml @@ -95,16 +95,16 @@ - - + + + generatedDir="${project.build.directory}/generated-sources/reladomo" nonGeneratedDir="${project.basedir}/src/main/java"/> - + + generatedDir="${project.build.directory}/generated-db/sql" databaseType="postgres"/> @@ -213,4 +213,5 @@ 2.7.2 11.22.4 + \ No newline at end of file diff --git a/libraries-data-io/pom.xml b/libraries-data-io/pom.xml index dcc8fee3ad..e15e188d10 100644 --- a/libraries-data-io/pom.xml +++ b/libraries-data-io/pom.xml @@ -74,4 +74,5 @@ 3.3.5 2.1 + \ No newline at end of file diff --git a/libraries-data/pom.xml b/libraries-data/pom.xml index 6f9b6388fc..2086ecb614 100644 --- a/libraries-data/pom.xml +++ b/libraries-data/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 libraries-data libraries-data @@ -166,7 +166,7 @@ 1.5.0 3.8.4 0.15.0 - 2.2.0 + 2.2.0 1.7.25 diff --git a/libraries-http/pom.xml b/libraries-http/pom.xml index 86f5390c3a..6261456486 100644 --- a/libraries-http/pom.xml +++ b/libraries-http/pom.xml @@ -1,31 +1,30 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + libraries-http + libraries-http - 4.0.0 - libraries-http - libraries-http + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + + org.assertj + assertj-core + ${assertj.version} + - - - org.assertj - assertj-core - ${assertj.version} - - - - - com.squareup.okhttp3 - okhttp + + + com.squareup.okhttp3 + okhttp ${com.squareup.okhttp3.version} - + @@ -39,22 +38,22 @@ ${googleclient.version} - - - com.squareup.retrofit2 - retrofit - ${retrofit.version} - - - com.squareup.retrofit2 - converter-gson - ${retrofit.version} - - - com.squareup.retrofit2 - adapter-rxjava - ${retrofit.version} - + + + com.squareup.retrofit2 + retrofit + ${retrofit.version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit.version} + + + com.squareup.retrofit2 + adapter-rxjava + ${retrofit.version} + @@ -63,70 +62,70 @@ ${async.http.client.version} - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + - - com.google.code.gson - gson - 2.8.5 - + + com.google.code.gson + gson + 2.8.5 + - - com.squareup.okhttp3 - mockwebserver + + com.squareup.okhttp3 + mockwebserver ${com.squareup.okhttp3.version} - test - + test + - - com.mashape.unirest - unirest-java - ${unirest.version} - - - - io.javalin - javalin - ${javalin.version} - - - com.squareup.okhttp3 - logging-interceptor - ${logging-interceptor.version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson.version} - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - commons-logging - commons-logging - - - - - + + com.mashape.unirest + unirest-java + ${unirest.version} + + + + io.javalin + javalin + ${javalin.version} + + + com.squareup.okhttp3 + logging-interceptor + ${logging-interceptor.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + org.apache.httpcomponents + httpclient + ${httpclient.version} + + + commons-logging + commons-logging + + + + - - 4.5.3 - 2.9.8 - 3.6.2 + + 4.5.3 + 2.9.8 + 3.6.2 3.14.2 1.23.0 2.2.0 - 2.3.0 - 1.4.9 - 1.6.0 - 3.9.0 - + 2.3.0 + 1.4.9 + 1.6.0 + 3.9.0 + + diff --git a/libraries-http/src/test/java/com/baeldung/okhttp/OkHttpPostingLiveTest.java b/libraries-http/src/test/java/com/baeldung/okhttp/post/OkHttpPostingLiveTest.java similarity index 63% rename from libraries-http/src/test/java/com/baeldung/okhttp/OkHttpPostingLiveTest.java rename to libraries-http/src/test/java/com/baeldung/okhttp/post/OkHttpPostingLiveTest.java index 19e689c093..94ab344060 100644 --- a/libraries-http/src/test/java/com/baeldung/okhttp/OkHttpPostingLiveTest.java +++ b/libraries-http/src/test/java/com/baeldung/okhttp/post/OkHttpPostingLiveTest.java @@ -1,88 +1,122 @@ -package com.baeldung.okhttp; - -import static com.baeldung.client.Consts.APPLICATION_PORT; -import static org.hamcrest.Matchers.equalTo; -import static org.junit.Assert.assertThat; - -import java.io.File; -import java.io.IOException; - -import okhttp3.Call; -import okhttp3.Credentials; -import okhttp3.FormBody; -import okhttp3.MediaType; -import okhttp3.MultipartBody; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; - -import org.junit.Before; -import org.junit.Test; - -/** - * Execute spring-rest module before running this live test - */ -public class OkHttpPostingLiveTest { - - private static final String BASE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest"; - private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://browserspy.dk/password-ok.php"; - - OkHttpClient client; - - @Before - public void init() { - - client = new OkHttpClient(); - } - - @Test - public void whenSendPostRequest_thenCorrect() throws IOException { - final RequestBody formBody = new FormBody.Builder().add("username", "test").add("password", "test").build(); - - final Request request = new Request.Builder().url(BASE_URL + "/users").post(formBody).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } - - @Test - public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException { - final String postBody = "test post"; - - final Request request = new Request.Builder().url(URL_SECURED_BY_BASIC_AUTHENTICATION).addHeader("Authorization", Credentials.basic("test", "test")).post(RequestBody.create(MediaType.parse("text/x-markdown; charset=utf-8"), "test post")).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } - - @Test - public void whenPostJson_thenCorrect() throws IOException { - final String json = "{\"id\":1,\"name\":\"John\"}"; - - final RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), "{\"id\":1,\"name\":\"John\"}"); - final Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } - - @Test - public void whenSendMultipartRequest_thenCorrect() throws IOException { - final RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM).addFormDataPart("username", "test").addFormDataPart("password", "test") - .addFormDataPart("file", "file.txt", RequestBody.create(MediaType.parse("application/octet-stream"), new File("src/test/resources/test.txt"))).build(); - - final Request request = new Request.Builder().url(BASE_URL + "/users/multipart").post(requestBody).build(); - - final Call call = client.newCall(request); - final Response response = call.execute(); - - assertThat(response.code(), equalTo(200)); - } -} +package com.baeldung.okhttp.post; + +import static com.baeldung.client.Consts.APPLICATION_PORT; +import static org.hamcrest.Matchers.equalTo; +import static org.junit.Assert.assertThat; + +import java.io.File; +import java.io.IOException; + +import okhttp3.Call; +import okhttp3.Credentials; +import okhttp3.FormBody; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +import org.junit.Before; +import org.junit.Test; + +/** + * Execute spring-rest module before running this live test + */ +public class OkHttpPostingLiveTest { + + private static final String BASE_URL = "http://localhost:" + APPLICATION_PORT + "/spring-rest"; + private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://browserspy.dk/password-ok.php"; + + OkHttpClient client; + + @Before + public void init() { + + client = new OkHttpClient(); + } + + @Test + public void whenSendPostRequest_thenCorrect() throws IOException { + final RequestBody formBody = new FormBody.Builder() + .add("username", "test") + .add("password", "test") + .build(); + + final Request request = new Request.Builder() + .url(BASE_URL + "/users") + .post(formBody) + .build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } + + @Test + public void whenSendPostRequestWithAuthorization_thenCorrect() throws IOException { + final String postBody = "test post"; + + final Request request = new Request.Builder() + .url(URL_SECURED_BY_BASIC_AUTHENTICATION) + .addHeader("Authorization", Credentials.basic("test", "test")) + .post(RequestBody.create(MediaType.parse("text/x-markdown"), "test post")) + .build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } + + @Test + public void whenPostJson_thenCorrect() throws IOException { + final String json = "{\"id\":1,\"name\":\"John\"}"; + + final RequestBody body = RequestBody.create(MediaType.parse("application/json"), "{\"id\":1,\"name\":\"John\"}"); + final Request request = new Request.Builder().url(BASE_URL + "/users/detail").post(body).build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } + + @Test + public void whenPostJsonWithoutCharset_thenCharsetIsUtf8() throws IOException { + final String json = "{\"id\":1,\"name\":\"John\"}"; + + final RequestBody body = RequestBody.create( + MediaType.parse("application/json"), json); + + String charset = body.contentType().charset().displayName(); + + assertThat(charset, equalTo("UTF-8")); + } + + @Test + public void whenPostJsonWithUtf16Charset_thenCharsetIsUtf16() throws IOException { + final String json = "{\"id\":1,\"name\":\"John\"}"; + + final RequestBody body = RequestBody.create( + MediaType.parse("application/json; charset=utf-16"), json); + + String charset = body.contentType().charset().displayName(); + + assertThat(charset, equalTo("UTF-16")); + } + + @Test + public void whenSendMultipartRequest_thenCorrect() throws IOException { + final RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM).addFormDataPart("username", "test").addFormDataPart("password", "test") + .addFormDataPart("file", "file.txt", RequestBody.create(MediaType.parse("application/octet-stream"), new File("src/test/resources/test.txt"))).build(); + + final Request request = new Request.Builder().url(BASE_URL + "/users/multipart").post(requestBody).build(); + + final Call call = client.newCall(request); + final Response response = call.execute(); + + assertThat(response.code(), equalTo(200)); + } +} diff --git a/libraries-io/pom.xml b/libraries-io/pom.xml index 5b78ae9442..8c2e841630 100644 --- a/libraries-io/pom.xml +++ b/libraries-io/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 libraries-io libraries-io @@ -37,4 +37,5 @@ 0.27.0 2.4 + diff --git a/libraries-primitive/pom.xml b/libraries-primitive/pom.xml index 9eecda2a22..1370468e76 100644 --- a/libraries-primitive/pom.xml +++ b/libraries-primitive/pom.xml @@ -49,6 +49,7 @@ 1.19 10.0.0 1.8 - 1.8 + 1.8 + \ No newline at end of file diff --git a/libraries-security/pom.xml b/libraries-security/pom.xml index ae08de9a4d..e287de4527 100644 --- a/libraries-security/pom.xml +++ b/libraries-security/pom.xml @@ -74,10 +74,11 @@ 5.6.0 - 1.3.1 + 1.3.1 1.2.2 - 1.2.2 + 1.2.2 1.9.2 1.58 + diff --git a/libraries-server/pom.xml b/libraries-server/pom.xml index 45069fe4f7..a849708cd8 100644 --- a/libraries-server/pom.xml +++ b/libraries-server/pom.xml @@ -1,16 +1,17 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 libraries-server 0.0.1-SNAPSHOT libraries-server - + com.baeldung parent-modules 1.0.0-SNAPSHOT - + org.eclipse.paho @@ -73,23 +74,23 @@ ${tomcat.version} - - org.igniterealtime.smack - smack-tcp - ${smack.version} - + + org.igniterealtime.smack + smack-tcp + ${smack.version} + - - org.igniterealtime.smack - smack-extensions - ${smack.version} - + + org.igniterealtime.smack + smack-extensions + ${smack.version} + - - org.igniterealtime.smack - smack-java7 - ${smack.version} - + + org.igniterealtime.smack + smack-java7 + ${smack.version} + diff --git a/libraries-server/src/main/java/com/baeldung/tomcat/ProgrammaticTomcat.java b/libraries-server/src/main/java/com/baeldung/tomcat/ProgrammaticTomcat.java index 6c4fed6d07..f42db2d3de 100644 --- a/libraries-server/src/main/java/com/baeldung/tomcat/ProgrammaticTomcat.java +++ b/libraries-server/src/main/java/com/baeldung/tomcat/ProgrammaticTomcat.java @@ -7,22 +7,50 @@ import org.apache.tomcat.util.descriptor.web.FilterDef; import org.apache.tomcat.util.descriptor.web.FilterMap; import java.io.File; +import java.io.IOException; +import java.net.ServerSocket; +import java.util.Random; /** * Created by adi on 1/10/18. */ public class ProgrammaticTomcat { + private static boolean isFree(int port) { + try { + new ServerSocket(port).close(); + return true; + } catch (IOException e) { + return false; + } + } + private Tomcat tomcat = null; + private int randomPort; + + public ProgrammaticTomcat() { + // Get a random port number in range 6000 (inclusive) - 9000 (exclusive) + this.randomPort = new Random() + .ints(6000, 9000) + .filter(ProgrammaticTomcat::isFree) + .findFirst() + .orElse(8080); + } + // uncomment for live test // public static void main(String[] args) throws LifecycleException, ServletException, URISyntaxException, IOException { // startTomcat(); // } + + public int getPort() { + return randomPort; + } + public void startTomcat() throws LifecycleException { tomcat = new Tomcat(); - tomcat.setPort(8080); + tomcat.setPort(randomPort); tomcat.setHostname("localhost"); String appBase = "."; tomcat.getHost().setAppBase(appBase); diff --git a/libraries-server/src/test/java/com/baeldung/tomcat/ProgrammaticTomcatIntegrationTest.java b/libraries-server/src/test/java/com/baeldung/tomcat/ProgrammaticTomcatIntegrationTest.java index 9224561341..888fb8e366 100644 --- a/libraries-server/src/test/java/com/baeldung/tomcat/ProgrammaticTomcatIntegrationTest.java +++ b/libraries-server/src/test/java/com/baeldung/tomcat/ProgrammaticTomcatIntegrationTest.java @@ -37,7 +37,8 @@ public class ProgrammaticTomcatIntegrationTest { @Test public void givenTomcatStarted_whenAccessServlet_responseIsTestAndResponseHeaderIsSet() throws Exception { CloseableHttpClient httpClient = HttpClientBuilder.create().build(); - HttpGet getServlet = new HttpGet("http://localhost:8080/my-servlet"); + String uri = "http://localhost:" + tomcat.getPort() + "/my-servlet"; + HttpGet getServlet = new HttpGet(uri); HttpResponse response = httpClient.execute(getServlet); assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode()); diff --git a/libraries-testing/pom.xml b/libraries-testing/pom.xml index 86c9bd52e1..c84f8dda76 100644 --- a/libraries-testing/pom.xml +++ b/libraries-testing/pom.xml @@ -1,171 +1,170 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + libraries-testing + libraries-testing - 4.0.0 - libraries-testing - libraries-testing + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + + net.serenity-bdd + serenity-core + ${serenity.version} + test + + + org.asciidoctor + asciidoctorj + + + + + net.serenity-bdd + serenity-junit + ${serenity.version} + test + + + net.serenity-bdd + serenity-jbehave + ${serenity.jbehave.version} + test + + + net.serenity-bdd + serenity-rest-assured + ${serenity.version} + test + + + io.rest-assured + rest-assured + + + + + net.serenity-bdd + serenity-jira-requirements-provider + ${serenity.jira.version} + test + + + net.serenity-bdd + serenity-spring + ${serenity.version} + test + + + org.springframework + spring-test + + + + + net.serenity-bdd + serenity-screenplay + ${serenity.version} + test + + + net.serenity-bdd + serenity-screenplay-webdriver + ${serenity.version} + test + + + org.skyscreamer + jsonassert + ${jsonassert.version} + + + org.awaitility + awaitility + ${awaitility.version} + test + + + org.awaitility + awaitility-proxy + ${awaitility.version} + test + + + io.specto + hoverfly-java + ${hoverfly-java.version} + + + org.springframework + spring-web + ${spring.version} + + + io.rest-assured + spring-mock-mvc + ${spring-mock-mvc.version} + test + + + org.assertj + assertj-core + ${assertj.version} + + + + org.hamcrest + java-hamcrest + ${java-hamcrest.version} + test + + + org.asciidoctor + asciidoctor-maven-plugin + 1.5.7.1 + - - - net.serenity-bdd - serenity-core - ${serenity.version} - test - - - org.asciidoctor - asciidoctorj - - - - - net.serenity-bdd - serenity-junit - ${serenity.version} - test - - - net.serenity-bdd - serenity-jbehave - ${serenity.jbehave.version} - test - - - net.serenity-bdd - serenity-rest-assured - ${serenity.version} - test - - - io.rest-assured - rest-assured - - - - - net.serenity-bdd - serenity-jira-requirements-provider - ${serenity.jira.version} - test - - - net.serenity-bdd - serenity-spring - ${serenity.version} - test - - - org.springframework - spring-test - - - - - net.serenity-bdd - serenity-screenplay - ${serenity.version} - test - - - net.serenity-bdd - serenity-screenplay-webdriver - ${serenity.version} - test - - - org.skyscreamer - jsonassert - ${jsonassert.version} - - - org.awaitility - awaitility - ${awaitility.version} - test - - - org.awaitility - awaitility-proxy - ${awaitility.version} - test - - - io.specto - hoverfly-java - ${hoverfly-java.version} - - - org.springframework - spring-web - ${spring.version} - - - io.rest-assured - spring-mock-mvc - ${spring-mock-mvc.version} - test - - - org.assertj - assertj-core - ${assertj.version} - - - - org.hamcrest - java-hamcrest - ${java-hamcrest.version} - test - - - org.asciidoctor - asciidoctor-maven-plugin - 1.5.7.1 - + - + + - - + + net.serenity-bdd.maven.plugins + serenity-maven-plugin + ${serenity.plugin.version} + + + serenity-reports + post-integration-test + + aggregate + + + + - - net.serenity-bdd.maven.plugins - serenity-maven-plugin - ${serenity.plugin.version} - - - serenity-reports - post-integration-test - - aggregate - - - - + + - - + + 1.9.9 + 1.9.0 + 1.9.0 + 1.9.27 + 1.5.0 + 3.0.0 + 0.8.1 + 4.3.8.RELEASE + 4.1.1 + 3.6.2 + 2.0.0.0 + - - 1.9.9 - 1.9.0 - 1.9.0 - 1.9.27 - 1.5.0 - 3.0.0 - 0.8.1 - 4.3.8.RELEASE - 4.1.1 - 3.6.2 - 2.0.0.0 - - diff --git a/libraries/pom.xml b/libraries/pom.xml index 7d20f1778a..13f91711fd 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 libraries libraries - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -76,17 +76,17 @@ ${rome.version} - net.serenity-bdd - serenity-core - ${serenity.version} - test - - - org.asciidoctor - asciidoctorj - - - + net.serenity-bdd + serenity-core + ${serenity.version} + test + + + org.asciidoctor + asciidoctorj + + + net.serenity-bdd serenity-junit @@ -377,8 +377,6 @@ test - - io.atlassian.fugue @@ -431,12 +429,12 @@ ${mockftpserver.version} test - - - org.reflections - reflections - ${reflections.version} - + + + org.reflections + reflections + ${reflections.version} + @@ -457,7 +455,6 @@ - @@ -559,7 +556,6 @@ - 0.7.0 3.2.7 1.2 @@ -567,7 +563,6 @@ 3.1.0 1.0 - 2.92 1.9.26 1.41.0 @@ -618,7 +613,6 @@ 2.7.1 3.6 0.9.11 - diff --git a/linkrest/pom.xml b/linkrest/pom.xml index c40cad41c8..89af27d50c 100644 --- a/linkrest/pom.xml +++ b/linkrest/pom.xml @@ -1,5 +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 linkrest 0.0.1-SNAPSHOT diff --git a/logging-modules/flogger/pom.xml b/logging-modules/flogger/pom.xml index 20201af179..c27e2c8d7a 100644 --- a/logging-modules/flogger/pom.xml +++ b/logging-modules/flogger/pom.xml @@ -6,8 +6,8 @@ flogger - logging-modules com.baeldung + logging-modules 1.0.0-SNAPSHOT @@ -61,6 +61,6 @@ apache-log4j-extras 1.2.17 - + \ No newline at end of file diff --git a/logging-modules/log-mdc/pom.xml b/logging-modules/log-mdc/pom.xml index ce58f43e4e..e367a63de6 100644 --- a/logging-modules/log-mdc/pom.xml +++ b/logging-modules/log-mdc/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"> 4.0.0 - com.baeldung log-mdc 0.0.1-SNAPSHOT log-mdc @@ -76,7 +76,6 @@ ${spring.version} test - diff --git a/logging-modules/log4j/pom.xml b/logging-modules/log4j/pom.xml index af97d812de..cc0996a45a 100644 --- a/logging-modules/log4j/pom.xml +++ b/logging-modules/log4j/pom.xml @@ -1,12 +1,11 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung log4j 1.0-SNAPSHOT - log4j + log4j com.baeldung diff --git a/logging-modules/log4j2/pom.xml b/logging-modules/log4j2/pom.xml index db0c6eb659..03a4fd8ab0 100644 --- a/logging-modules/log4j2/pom.xml +++ b/logging-modules/log4j2/pom.xml @@ -1,10 +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 log4j2 - log4j2 - + log4j2 + com.baeldung parent-modules @@ -19,12 +19,12 @@ log4j-core ${log4j-core.version} - + - org.apache.logging.log4j - log4j-api - ${log4j-core.version} + org.apache.logging.log4j + log4j-api + ${log4j-core.version} diff --git a/logging-modules/logback/pom.xml b/logging-modules/logback/pom.xml index 22a89124b5..6ffc9e1235 100644 --- a/logging-modules/logback/pom.xml +++ b/logging-modules/logback/pom.xml @@ -1,8 +1,7 @@ - 4.0.0 logback 0.1-SNAPSHOT @@ -16,7 +15,6 @@ - ch.qos.logback logback-classic @@ -52,7 +50,6 @@ - diff --git a/logging-modules/pom.xml b/logging-modules/pom.xml index 927afb6ca9..b9a1fe77c6 100644 --- a/logging-modules/pom.xml +++ b/logging-modules/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 logging-modules logging-modules diff --git a/lombok-custom/pom.xml b/lombok-custom/pom.xml index cfbe629945..1455a4f6c6 100644 --- a/lombok-custom/pom.xml +++ b/lombok-custom/pom.xml @@ -2,18 +2,17 @@ - 4.0.0 lombok-custom - lombok-custom + lombok-custom 0.1-SNAPSHOT - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT - + org.projectlombok @@ -59,9 +58,8 @@ 1.14.8 - 1.8 - 3.3.0-v_771 + 1.8 + 3.3.0-v_771 - diff --git a/lombok/pom.xml b/lombok/pom.xml index 5e2ad33f66..e347515b40 100644 --- a/lombok/pom.xml +++ b/lombok/pom.xml @@ -1,12 +1,11 @@ - 4.0.0 - lombok lombok 0.1-SNAPSHOT + lombok com.baeldung diff --git a/lucene/pom.xml b/lucene/pom.xml index 921832e280..0a0e09f724 100644 --- a/lucene/pom.xml +++ b/lucene/pom.xml @@ -1,5 +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 lucene 0.0.1-SNAPSHOT @@ -28,7 +29,6 @@ lucene-analyzers-common ${lucene.version} - diff --git a/machine-learning/README.md b/machine-learning/README.md new file mode 100644 index 0000000000..80f2d2c6cd --- /dev/null +++ b/machine-learning/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Introduction to Supervised Learning in Kotlin](https://www.baeldung.com/kotlin-supervised-learning) diff --git a/machine-learning/pom.xml b/machine-learning/pom.xml index bb64470c74..7bc0332012 100644 --- a/machine-learning/pom.xml +++ b/machine-learning/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - machine-learning 1.0-SNAPSHOT Supervised Learning @@ -54,6 +54,7 @@ ${kotlin.version} + src/main/kotlin src/test @@ -147,4 +148,5 @@ + diff --git a/mapstruct/pom.xml b/mapstruct/pom.xml index e98c4a318b..11c8d9b41e 100644 --- a/mapstruct/pom.xml +++ b/mapstruct/pom.xml @@ -1,10 +1,10 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 mapstruct - mapstruct 1.0 + mapstruct jar diff --git a/maven-all/compiler-plugin-java-9/pom.xml b/maven-all/compiler-plugin-java-9/pom.xml index 5303cee82e..1975e1f7cd 100644 --- a/maven-all/compiler-plugin-java-9/pom.xml +++ b/maven-all/compiler-plugin-java-9/pom.xml @@ -1,22 +1,24 @@ + - 4.0.0 - com.baeldung - compiler-plugin-java-9 - 0.0.1-SNAPSHOT - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 9 - 9 - - - - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung + compiler-plugin-java-9 + 0.0.1-SNAPSHOT + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 9 + 9 + + + + + \ No newline at end of file diff --git a/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml b/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml index 8cf79bcacb..7ddf5b739c 100644 --- a/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml +++ b/maven-all/maven-custom-plugin/counter-maven-plugin/pom.xml @@ -1,81 +1,80 @@ + - 4.0.0 - com.baeldung - counter-maven-plugin - maven-plugin - 0.0.1-SNAPSHOT + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + com.baeldung + counter-maven-plugin + 0.0.1-SNAPSHOT + counter-maven-plugin Maven Mojo + maven-plugin + http://maven.apache.org - counter-maven-plugin Maven Mojo - http://maven.apache.org + + Baeldung + https://www.baeldung.com/ + - - Baeldung - https://www.baeldung.com/ - + + + org.apache.maven + maven-plugin-api + ${maven-plugin-api.version} + + + org.apache.maven.plugin-tools + maven-plugin-annotations + ${maven-plugin-annotations.version} + provided + + + org.apache.maven + maven-project + ${maven-project.version} + + - - 1.8 - 1.8 + + + + + org.apache.maven.plugins + maven-plugin-plugin + ${maven-plugin-plugin.version} + + + org.apache.maven.plugins + maven-site-plugin + ${maven-site-plugin.version} + + + + - 3.6.2 - 3.6.0 - 2.2.1 - 3.6.0 - 3.8.2 - + + + + org.apache.maven.plugins + maven-plugin-plugin + + + + report + + + + + + - - - org.apache.maven - maven-plugin-api - ${maven-plugin-api.version} - - - org.apache.maven.plugin-tools - maven-plugin-annotations - ${maven-plugin-annotations.version} - provided - - - org.apache.maven - maven-project - ${maven-project.version} - - - - - - - - org.apache.maven.plugins - maven-plugin-plugin - ${maven-plugin-plugin.version} - - - org.apache.maven.plugins - maven-site-plugin - ${maven-site-plugin.version} - - - - - - - - - org.apache.maven.plugins - maven-plugin-plugin - - - - report - - - - - - + + 1.8 + 1.8 + 3.6.2 + 3.6.0 + 2.2.1 + 3.6.0 + 3.8.2 + \ No newline at end of file diff --git a/maven-all/maven-custom-plugin/usage-example/pom.xml b/maven-all/maven-custom-plugin/usage-example/pom.xml index 62c5a64a44..542a02b3eb 100644 --- a/maven-all/maven-custom-plugin/usage-example/pom.xml +++ b/maven-all/maven-custom-plugin/usage-example/pom.xml @@ -1,45 +1,45 @@ + + 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 + example + 0.0.1-SNAPSHOT + pom - 4.0.0 - com.baeldung - example - pom - 0.0.1-SNAPSHOT + + + org.apache.commons + commons-lang3 + 3.9 + + + junit + junit + 4.12 + test + + - - - org.apache.commons - commons-lang3 - 3.9 - - - junit - junit - 4.12 - test - - - - - - - com.baeldung - counter-maven-plugin - 0.0.1-SNAPSHOT - - - - dependency-counter - - - - - test - - - - + + + + com.baeldung + counter-maven-plugin + 0.0.1-SNAPSHOT + + + + dependency-counter + + + + + test + + + + diff --git a/maven-all/maven-war-plugin/pom.xml b/maven-all/maven-war-plugin/pom.xml index 25c2e1ba1b..233a9f3571 100644 --- a/maven-all/maven-war-plugin/pom.xml +++ b/maven-all/maven-war-plugin/pom.xml @@ -1,12 +1,13 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung maven-war-plugin 0.0.1-SNAPSHOT - war maven-war-plugin + war @@ -21,9 +22,10 @@ - + false + \ No newline at end of file diff --git a/maven-all/maven/custom-rule/README.md b/maven-all/maven/custom-rule/README.md new file mode 100644 index 0000000000..44d43050e7 --- /dev/null +++ b/maven-all/maven/custom-rule/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Maven Enforcer Plugin](https://www.baeldung.com/maven-enforcer-plugin) diff --git a/maven-all/maven/custom-rule/pom.xml b/maven-all/maven/custom-rule/pom.xml index 2fbeb18922..6ff984cb85 100644 --- a/maven-all/maven/custom-rule/pom.xml +++ b/maven-all/maven/custom-rule/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 custom-rule - custom-rule - + custom-rule + - maven com.baeldung + maven 0.0.1-SNAPSHOT @@ -64,4 +64,5 @@ 2.0.9 1.0-alpha-9 + diff --git a/maven-all/maven/maven-enforcer/pom.xml b/maven-all/maven/maven-enforcer/pom.xml index b18be4f43d..cde37eabd1 100644 --- a/maven-all/maven/maven-enforcer/pom.xml +++ b/maven-all/maven/maven-enforcer/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 maven-enforcer - maven-enforcer - + maven-enforcer + - maven com.baeldung + maven 0.0.1-SNAPSHOT @@ -19,11 +19,11 @@ maven-enforcer-plugin 3.0.0-M2 - - - - - + + + + + @@ -72,5 +72,4 @@ - \ No newline at end of file diff --git a/maven-all/maven/pom.xml b/maven-all/maven/pom.xml index 117a8a7002..0220cf8dfc 100644 --- a/maven-all/maven/pom.xml +++ b/maven-all/maven/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,8 +8,8 @@ pom - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../.. @@ -309,4 +310,5 @@ 9.4.11.v20180605 2.27 + \ No newline at end of file diff --git a/maven-all/maven/proxy/settings.xml b/maven-all/maven/proxy/settings.xml new file mode 100644 index 0000000000..55a850a6bc --- /dev/null +++ b/maven-all/maven/proxy/settings.xml @@ -0,0 +1,43 @@ + + + + + + + BaeldungProxy_Encrypted + true + http + proxy.baeldung.com + 80 + baeldung + {U2iMf+7aJXQHRquuQq6MX+n7GOeh97zB9/4e7kkEQYs=} + internal.baeldung.com|localhost|127.*|[::1] + + + + BaeldungProxy_Authenticated + true + http + proxy.baeldung.com + 80 + baeldung + changeme + internal.baeldung.com|localhost|127.*|[::1] + + + + BaeldungProxy + proxy.baeldung.com + 80 + internal.baeldung.com|localhost|127.*|[::1] + + + + + \ No newline at end of file diff --git a/maven-all/maven/security/redirect/settings-security.xml b/maven-all/maven/security/redirect/settings-security.xml new file mode 100644 index 0000000000..37e91bd1a4 --- /dev/null +++ b/maven-all/maven/security/redirect/settings-security.xml @@ -0,0 +1,6 @@ + + + R:\config\settings-security.xml + diff --git a/maven-all/maven/security/settings-security.xml b/maven-all/maven/security/settings-security.xml new file mode 100644 index 0000000000..3ac258e8a5 --- /dev/null +++ b/maven-all/maven/security/settings-security.xml @@ -0,0 +1,7 @@ + + + {QFMlh/6WjF8H9po9UD\}0Nv18e527jqWb6mUgIB798n4=} + diff --git a/maven-all/profiles/pom.xml b/maven-all/profiles/pom.xml index 110016f3a2..01b191c7d6 100644 --- a/maven-all/profiles/pom.xml +++ b/maven-all/profiles/pom.xml @@ -1,11 +1,12 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung profiles 0.0.1-SNAPSHOT - profiles + profiles @@ -85,4 +86,5 @@ + \ No newline at end of file diff --git a/maven-all/versions-maven-plugin/original/README.md b/maven-all/versions-maven-plugin/original/README.md new file mode 100644 index 0000000000..5652a9b7e4 --- /dev/null +++ b/maven-all/versions-maven-plugin/original/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Use the Latest Version of a Dependency in Maven](https://www.baeldung.com/maven-dependency-latest-version) diff --git a/maven-all/versions-maven-plugin/original/pom.xml b/maven-all/versions-maven-plugin/original/pom.xml index df8ee9a20e..c6c1657b25 100644 --- a/maven-all/versions-maven-plugin/original/pom.xml +++ b/maven-all/versions-maven-plugin/original/pom.xml @@ -1,3 +1,4 @@ + diff --git a/maven-all/versions-maven-plugin/pom.xml b/maven-all/versions-maven-plugin/pom.xml index c9f63a46f1..3ce25d16f9 100644 --- a/maven-all/versions-maven-plugin/pom.xml +++ b/maven-all/versions-maven-plugin/pom.xml @@ -1,14 +1,14 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung versions-maven-plugin 0.0.1-SNAPSHOT - versions-maven-plugin + versions-maven-plugin - commons-io commons-io @@ -38,7 +38,6 @@ commons-beanutils 1.9.1 - @@ -69,8 +68,8 @@ - - + + 1.15 diff --git a/maven-archetype/pom.xml b/maven-archetype/pom.xml index 73ddc78fc7..be616ac299 100644 --- a/maven-archetype/pom.xml +++ b/maven-archetype/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 com.baeldung.archetypes maven-archetype 1.0-SNAPSHOT - maven-archetype + maven-archetype maven-archetype Archetype used to generate rest application based on jaxrs 2.1 - + diff --git a/maven-java-11/multimodule-maven-project/daomodule/pom.xml b/maven-java-11/multimodule-maven-project/daomodule/pom.xml index 5520c5a90a..cbe0b4cb95 100644 --- a/maven-java-11/multimodule-maven-project/daomodule/pom.xml +++ b/maven-java-11/multimodule-maven-project/daomodule/pom.xml @@ -1,15 +1,17 @@ - + 4.0.0 com.baeldung.daomodule daomodule - jar 1.0 daomodule - + jar + com.baeldung.multimodule-maven-project multimodule-maven-project 1.0 + diff --git a/maven-java-11/multimodule-maven-project/entitiymodule/pom.xml b/maven-java-11/multimodule-maven-project/entitiymodule/pom.xml index 747722e912..228619ed74 100644 --- a/maven-java-11/multimodule-maven-project/entitiymodule/pom.xml +++ b/maven-java-11/multimodule-maven-project/entitiymodule/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 com.baeldung.entitymodule entitymodule - jar 1.0 entitymodule + jar com.baeldung.multimodule-maven-project @@ -17,4 +18,5 @@ 11 11 + diff --git a/maven-java-11/multimodule-maven-project/mainppmodule/pom.xml b/maven-java-11/multimodule-maven-project/mainppmodule/pom.xml index 3e5ec122ff..42b06bbebd 100644 --- a/maven-java-11/multimodule-maven-project/mainppmodule/pom.xml +++ b/maven-java-11/multimodule-maven-project/mainppmodule/pom.xml @@ -1,18 +1,19 @@ - + 4.0.0 com.baeldung.mainappmodule mainappmodule 1.0 - jar mainappmodule + jar com.baeldung.multimodule-maven-project multimodule-maven-project 1.0 - + com.baeldung.entitymodule @@ -30,4 +31,5 @@ 1.0 + diff --git a/maven-java-11/multimodule-maven-project/pom.xml b/maven-java-11/multimodule-maven-project/pom.xml index 7e2eb0dd7b..a79dff93d3 100644 --- a/maven-java-11/multimodule-maven-project/pom.xml +++ b/maven-java-11/multimodule-maven-project/pom.xml @@ -1,25 +1,26 @@ - + 4.0.0 com.baeldung.multimodule-maven-project multimodule-maven-project 1.0 - pom multimodule-maven-project + pom com.baeldung.maven-java-11 maven-java-11 1.0 - + entitymodule daomodule userdaomodule mainappmodule - + @@ -36,7 +37,7 @@ - + @@ -52,8 +53,9 @@ - + UTF-8 + diff --git a/maven-java-11/multimodule-maven-project/userdaomodule/pom.xml b/maven-java-11/multimodule-maven-project/userdaomodule/pom.xml index 68e7ae9b82..3eb5897f8b 100644 --- a/maven-java-11/multimodule-maven-project/userdaomodule/pom.xml +++ b/maven-java-11/multimodule-maven-project/userdaomodule/pom.xml @@ -1,18 +1,19 @@ - + 4.0.0 com.baeldung.userdaomodule userdaomodule 1.0 - jar userdaomodule - + jar + com.baeldung.multimodule-maven-project multimodule-maven-project 1.0 - + com.baeldung.entitymodule @@ -30,4 +31,5 @@ test + diff --git a/maven-java-11/pom.xml b/maven-java-11/pom.xml index 5ae4c00892..10e80365c8 100644 --- a/maven-java-11/pom.xml +++ b/maven-java-11/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 com.baeldung.maven-java-11 maven-java-11 1.0 - pom maven-java-11 + pom - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -22,4 +23,5 @@ 11 11 + diff --git a/maven-polyglot/maven-polyglot-json-extension/pom.xml b/maven-polyglot/maven-polyglot-json-extension/pom.xml index 13f05c743f..0043bae151 100644 --- a/maven-polyglot/maven-polyglot-json-extension/pom.xml +++ b/maven-polyglot/maven-polyglot-json-extension/pom.xml @@ -6,7 +6,7 @@ com.baeldung.maven.polyglot maven-polyglot-json-extension 1.0-SNAPSHOT - maven-polyglot-json-extension + maven-polyglot-json-extension com.baeldung @@ -45,7 +45,7 @@ - + 3.5.4 diff --git a/mesos-marathon/pom.xml b/mesos-marathon/pom.xml index 0e9bc321ef..4fb819c434 100644 --- a/mesos-marathon/pom.xml +++ b/mesos-marathon/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 mesos-marathon mesos-marathon - + - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/metrics/pom.xml b/metrics/pom.xml index 49adb088d8..92699c3fb8 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 metrics metrics - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -73,7 +73,7 @@ jackson-dataformat-smile ${fasterxml.jackson.version} - + io.astefanutti.metrics.aspectj metrics-aspectj-deps @@ -86,7 +86,6 @@ ${assertj-core.version} test - @@ -95,8 +94,8 @@ 0.12.17 0.12.0.RELEASE 2.9.1 - 2.0.7.RELEASE - 3.11.1 + 2.0.7.RELEASE + 3.11.1 1.1.0 diff --git a/micronaut/pom.xml b/micronaut/pom.xml index 02ac36218d..13639c11ff 100644 --- a/micronaut/pom.xml +++ b/micronaut/pom.xml @@ -1,4 +1,6 @@ - + + 4.0.0 com.baeldung.micronaut micronaut @@ -22,6 +24,7 @@ + io.micronaut @@ -72,6 +75,7 @@ 3.1.6.RELEASE + @@ -133,10 +137,11 @@ - + com.baeldung.micronaut.helloworld.server.ServerApplication 1.0.0.RC2 1.8 + diff --git a/microprofile/pom.xml b/microprofile/pom.xml index 9150a6adb1..5a32ad8dba 100644 --- a/microprofile/pom.xml +++ b/microprofile/pom.xml @@ -1,10 +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 microprofile 1.0-SNAPSHOT - microprofile + microprofile war diff --git a/msf4j/pom.xml b/msf4j/pom.xml index 2a862ac289..a220ce0229 100644 --- a/msf4j/pom.xml +++ b/msf4j/pom.xml @@ -1,45 +1,46 @@ + - 4.0.0 - com.baeldung.msf4j - msf4j - 0.0.1-SNAPSHOT - msf4j + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + com.baeldung.msf4j + msf4j + 0.0.1-SNAPSHOT + msf4j - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT - - - - org.wso2.msf4j - msf4j-service - ${msf4j.version} - pom - - - - - - - org.wso2.msf4j - msf4j-spring - ${msf4j.version} - - - org.wso2.msf4j - msf4j-mustache-template - ${msf4j.version} - - + + + + org.wso2.msf4j + msf4j-service + ${msf4j.version} + pom + + + - - com.baeldung.msf4j.msf4jintro.Application - 2.6.3 - + + + org.wso2.msf4j + msf4j-spring + ${msf4j.version} + + + org.wso2.msf4j + msf4j-mustache-template + ${msf4j.version} + + + + + com.baeldung.msf4j.msf4jintro.Application + 2.6.3 + \ No newline at end of file diff --git a/muleesb/pom.xml b/muleesb/pom.xml index 4b74b6d4f4..c8468c1e00 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -1,14 +1,13 @@ - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.mycompany muleesb 1.0.0-SNAPSHOT muleesb - mule - + mule + com.baeldung parent-modules diff --git a/mustache/pom.xml b/mustache/pom.xml index 0e382ae14b..9f2402f353 100644 --- a/mustache/pom.xml +++ b/mustache/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 mustache mustache jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -24,7 +24,7 @@ org.assertj assertj-core - + org.springframework.boot spring-boot-starter-web @@ -50,7 +50,6 @@ datafactory ${datafactory.version} - diff --git a/mybatis/pom.xml b/mybatis/pom.xml index b3149dc342..3b4695fb58 100644 --- a/mybatis/pom.xml +++ b/mybatis/pom.xml @@ -1,10 +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 mybatis mybatis - + com.baeldung parent-modules diff --git a/netflix/genie/pom.xml b/netflix/genie/pom.xml index 9c78a11464..2288c5338a 100644 --- a/netflix/genie/pom.xml +++ b/netflix/genie/pom.xml @@ -1,13 +1,11 @@ + 4.0.0 - - com.baeldung genie - jar 1.0.0-SNAPSHOT - Genie + jar Sample project for Netflix Genie @@ -15,4 +13,5 @@ netflix 1.0.0-SNAPSHOT + \ No newline at end of file diff --git a/netflix/pom.xml b/netflix/pom.xml index 4b0954d777..6cf81cd7ab 100644 --- a/netflix/pom.xml +++ b/netflix/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 netflix - pom 1.0.0-SNAPSHOT - Netflix + pom Module for Netflix projects @@ -19,4 +17,5 @@ genie + \ No newline at end of file diff --git a/oauth2-framework-impl/oauth2-authorization-server/README.md b/oauth2-framework-impl/oauth2-authorization-server/README.md new file mode 100644 index 0000000000..4bcb9790b1 --- /dev/null +++ b/oauth2-framework-impl/oauth2-authorization-server/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Implementing The OAuth 2.0 Authorization Framework Using Jakarta EE](https://www.baeldung.com/java-ee-oauth2-implementation) diff --git a/oauth2-framework-impl/oauth2-authorization-server/pom.xml b/oauth2-framework-impl/oauth2-authorization-server/pom.xml index 8793eefe78..e608c09188 100644 --- a/oauth2-framework-impl/oauth2-authorization-server/pom.xml +++ b/oauth2-framework-impl/oauth2-authorization-server/pom.xml @@ -4,8 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 oauth2-authorization-server - war oauth2-authorization-server + war com.baeldung.oauth2 @@ -30,6 +30,7 @@ ${bcpkix-jdk15on.version} + @@ -72,4 +73,5 @@ 1.62 1.62 + diff --git a/oauth2-framework-impl/oauth2-client/README.md b/oauth2-framework-impl/oauth2-client/README.md new file mode 100644 index 0000000000..4bcb9790b1 --- /dev/null +++ b/oauth2-framework-impl/oauth2-client/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Implementing The OAuth 2.0 Authorization Framework Using Jakarta EE](https://www.baeldung.com/java-ee-oauth2-implementation) diff --git a/oauth2-framework-impl/oauth2-client/pom.xml b/oauth2-framework-impl/oauth2-client/pom.xml index 4f12095d30..febfe8dd27 100644 --- a/oauth2-framework-impl/oauth2-client/pom.xml +++ b/oauth2-framework-impl/oauth2-client/pom.xml @@ -4,8 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 oauth2-client - war oauth2-client + war com.baeldung.oauth2 @@ -26,4 +26,5 @@ 9180 9543 + diff --git a/oauth2-framework-impl/oauth2-resource-server/README.md b/oauth2-framework-impl/oauth2-resource-server/README.md new file mode 100644 index 0000000000..4bcb9790b1 --- /dev/null +++ b/oauth2-framework-impl/oauth2-resource-server/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Implementing The OAuth 2.0 Authorization Framework Using Jakarta EE](https://www.baeldung.com/java-ee-oauth2-implementation) diff --git a/oauth2-framework-impl/oauth2-resource-server/pom.xml b/oauth2-framework-impl/oauth2-resource-server/pom.xml index 4c82668547..62f5889290 100644 --- a/oauth2-framework-impl/oauth2-resource-server/pom.xml +++ b/oauth2-framework-impl/oauth2-resource-server/pom.xml @@ -4,8 +4,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 oauth2-resource-server - war oauth2-resource-server + war com.baeldung.oauth2 diff --git a/oauth2-framework-impl/pom.xml b/oauth2-framework-impl/pom.xml index 3c98b45112..24559d3c4d 100644 --- a/oauth2-framework-impl/pom.xml +++ b/oauth2-framework-impl/pom.xml @@ -6,8 +6,8 @@ com.baeldung.oauth2 oauth2-framework-impl 1.0-SNAPSHOT - pom oauth2-framework-impl + pom oauth2-authorization-server @@ -94,4 +94,5 @@ 8.0 1.3 + diff --git a/optaplanner/pom.xml b/optaplanner/pom.xml index bcf7080a1e..d907cfc830 100644 --- a/optaplanner/pom.xml +++ b/optaplanner/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 optaplanner - optaplanner + optaplanner - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -20,8 +20,8 @@ - - 7.9.0.Final - + + 7.9.0.Final + \ No newline at end of file diff --git a/orika/pom.xml b/orika/pom.xml index e4da5955bf..6974bd296e 100644 --- a/orika/pom.xml +++ b/orika/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 - com.baeldung orika 1.0 orika diff --git a/osgi/osgi-intro-sample-activator/pom.xml b/osgi/osgi-intro-sample-activator/pom.xml index 2bc1c20eed..e6611dcf7d 100644 --- a/osgi/osgi-intro-sample-activator/pom.xml +++ b/osgi/osgi-intro-sample-activator/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 osgi-intro-sample-activator osgi-intro-sample-activator @@ -9,8 +9,8 @@ - osgi com.baeldung + osgi 1.0-SNAPSHOT diff --git a/osgi/osgi-intro-sample-client/pom.xml b/osgi/osgi-intro-sample-client/pom.xml index a630625ed2..e91b831db1 100644 --- a/osgi/osgi-intro-sample-client/pom.xml +++ b/osgi/osgi-intro-sample-client/pom.xml @@ -9,8 +9,8 @@ bundle - osgi com.baeldung + osgi 1.0-SNAPSHOT @@ -49,4 +49,5 @@ 1.0-SNAPSHOT + \ No newline at end of file diff --git a/osgi/osgi-intro-sample-service/pom.xml b/osgi/osgi-intro-sample-service/pom.xml index 4f0b108837..b44e1f9be3 100644 --- a/osgi/osgi-intro-sample-service/pom.xml +++ b/osgi/osgi-intro-sample-service/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 osgi-intro-sample-service osgi-intro-sample-service @@ -9,8 +9,8 @@ - osgi com.baeldung + osgi 1.0-SNAPSHOT diff --git a/osgi/pom.xml b/osgi/pom.xml index 9ebcb09091..ed708e8004 100644 --- a/osgi/pom.xml +++ b/osgi/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 osgi - pom 1.0-SNAPSHOT - osgi + osgi + pom com.baeldung diff --git a/parent-boot-1/pom.xml b/parent-boot-1/pom.xml index 8f1af24466..df2a7f8400 100644 --- a/parent-boot-1/pom.xml +++ b/parent-boot-1/pom.xml @@ -1,61 +1,62 @@ + - 4.0.0 - parent-boot-1 - 0.0.1-SNAPSHOT - parent-boot-1 - pom - Parent for all Spring Boot 1.x modules + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + parent-boot-1 + 0.0.1-SNAPSHOT + parent-boot-1 + pom + Parent for all Spring Boot 1.x modules - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - - - - io.rest-assured - rest-assured - ${rest-assured.version} - - - org.springframework.boot - spring-boot-starter-test - test - - + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + io.rest-assured + rest-assured + ${rest-assured.version} + + + org.springframework.boot + spring-boot-starter-test + test + + - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - ${start-class} - - - - - - + + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + ${start-class} + + + + + + + + + 3.1.0 + 1.5.22.RELEASE + - - 3.1.0 - 1.5.22.RELEASE - - diff --git a/parent-boot-2/pom.xml b/parent-boot-2/pom.xml index fe272b56a3..881a0f1d67 100644 --- a/parent-boot-2/pom.xml +++ b/parent-boot-2/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -80,4 +81,5 @@ 1.0.22.RELEASE 2.1.9.RELEASE + diff --git a/parent-java/pom.xml b/parent-java/pom.xml index 5b8b7ceb9b..47965fc36d 100644 --- a/parent-java/pom.xml +++ b/parent-java/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 parent-java 0.0.1-SNAPSHOT parent-java - Parent for all java modules pom + Parent for all java modules com.baeldung @@ -21,7 +22,7 @@ guava ${guava.version} - + commons-io commons-io ${commons.io.version} diff --git a/parent-kotlin/pom.xml b/parent-kotlin/pom.xml index 84844dbb8b..a180343378 100644 --- a/parent-kotlin/pom.xml +++ b/parent-kotlin/pom.xml @@ -1,219 +1,220 @@ - 4.0.0 - parent-kotlin - parent-kotlin - pom - Parent for all kotlin modules + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + 4.0.0 + parent-kotlin + parent-kotlin + pom + Parent for all kotlin modules - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - jcenter - http://jcenter.bintray.com - - - kotlin-ktor - https://dl.bintray.com/kotlin/ktor/ - - - kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap - - - spring-milestone - Spring Milestone Repository - http://repo.spring.io/milestone - - + + + jcenter + http://jcenter.bintray.com + + + kotlin-ktor + https://dl.bintray.com/kotlin/ktor/ + + + kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap + + + spring-milestone + Spring Milestone Repository + http://repo.spring.io/milestone + + - - - kotlin-eap - http://dl.bintray.com/kotlin/kotlin-eap - - + + + kotlin-eap + http://dl.bintray.com/kotlin/kotlin-eap + + - - - - org.springframework.boot - spring-boot-dependencies - 2.2.0.M4 - pom - import - - - + + + + org.springframework.boot + spring-boot-dependencies + 2.2.0.M4 + pom + import + + + - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - - - org.jetbrains.kotlin - kotlin-stdlib - - - org.jetbrains.kotlin - kotlin-reflect - + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + + + org.jetbrains.kotlin + kotlin-stdlib + + + org.jetbrains.kotlin + kotlin-reflect + - - org.jetbrains.kotlinx - kotlinx-coroutines-core - ${kotlinx.version} - + + org.jetbrains.kotlinx + kotlinx-coroutines-core + ${kotlinx.version} + - - io.ktor - ktor-server-netty - ${ktor.io.version} - - - io.ktor - ktor-gson - ${ktor.io.version} - - - com.fasterxml.jackson.module - jackson-module-kotlin - + + io.ktor + ktor-server-netty + ${ktor.io.version} + + + io.ktor + ktor-gson + ${ktor.io.version} + + + com.fasterxml.jackson.module + jackson-module-kotlin + - - org.jetbrains.kotlin - kotlin-test-junit - test - + + org.jetbrains.kotlin + kotlin-test-junit + test + - + - - - - org.jetbrains.kotlin - kotlin-maven-plugin - ${kotlin.version} - - - compile - - compile - - - - ${project.basedir}/src/main/kotlin - ${project.basedir}/src/main/java - - ${java.version} - - -Xjvm-default=enable - - - - - test-compile - - test-compile - - - - ${project.basedir}/src/test/kotlin - ${project.basedir}/src/test/java - - ${java.version} - - - - - - spring - - - - - org.jetbrains.kotlin - kotlin-maven-allopen - ${kotlin.version} - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - - - - - default-compile - none - - - - default-testCompile - none - - - java-compile - compile - - compile - - - - java-test-compile - test-compile - - testCompile - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${maven-failsafe-plugin.version} - - - org.junit.platform - junit-platform-surefire-provider - ${junit.platform.version} - - - - - junit5 - - integration-test - verify - - - - **/*Test5.java - - - - - - - + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + + compile + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/main/java + + ${java.version} + + -Xjvm-default=enable + + + + + test-compile + + test-compile + + + + ${project.basedir}/src/test/kotlin + ${project.basedir}/src/test/java + + ${java.version} + + + + + + spring + + + + + org.jetbrains.kotlin + kotlin-maven-allopen + ${kotlin.version} + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + default-compile + none + + + + default-testCompile + none + + + java-compile + compile + + compile + + + + java-test-compile + test-compile + + testCompile + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + org.junit.platform + junit-platform-surefire-provider + ${junit.platform.version} + + + + + junit5 + + integration-test + verify + + + + **/*Test5.java + + + + + + + + + + 1.3.30 + 1.0.0 + 0.9.5 + 3.12.0 + 1.3.2 + - - 1.3.30 - 1.0.0 - 0.9.5 - 3.12.0 - 1.3.2 - diff --git a/parent-spring-4/pom.xml b/parent-spring-4/pom.xml index b98d962580..671ca7db6b 100644 --- a/parent-spring-4/pom.xml +++ b/parent-spring-4/pom.xml @@ -1,5 +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 parent-spring-4 0.0.1-SNAPSHOT diff --git a/parent-spring-5/pom.xml b/parent-spring-5/pom.xml index f126006bcb..9260f88de5 100644 --- a/parent-spring-5/pom.xml +++ b/parent-spring-5/pom.xml @@ -1,12 +1,13 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 parent-spring-5 0.0.1-SNAPSHOT parent-spring-5 - Parent for all spring 5 core modules pom + Parent for all spring 5 core modules com.baeldung diff --git a/patterns/design-patterns-architectural/pom.xml b/patterns/design-patterns-architectural/pom.xml index cf99919e7c..81cc55aa21 100644 --- a/patterns/design-patterns-architectural/pom.xml +++ b/patterns/design-patterns-architectural/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 design-patterns-architectural 1.0 design-patterns-architectural - jar - + jar + com.baeldung patterns @@ -21,8 +21,8 @@ ${assertj-core.version} test - - + + javax javaee-api ${javaee.version} @@ -39,16 +39,15 @@ jar - + UTF-8 1.8 1.8 - 3.9.1 - 8.0 5.2.16.Final 6.0.6 + diff --git a/patterns/design-patterns-behavioral-2/pom.xml b/patterns/design-patterns-behavioral-2/pom.xml index 7e73c0ad19..4cbe6e32b9 100644 --- a/patterns/design-patterns-behavioral-2/pom.xml +++ b/patterns/design-patterns-behavioral-2/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 design-patterns-behavioral-2 1.0 design-patterns-behavioral-2 - jar - + jar + com.baeldung patterns @@ -22,12 +22,12 @@ test - + UTF-8 1.8 1.8 - 3.12.2 + diff --git a/patterns/design-patterns-behavioral/pom.xml b/patterns/design-patterns-behavioral/pom.xml index d6603f94ec..c4ae00435e 100644 --- a/patterns/design-patterns-behavioral/pom.xml +++ b/patterns/design-patterns-behavioral/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 design-patterns-behavioral 1.0 design-patterns-behavioral - jar - + jar + com.baeldung patterns @@ -31,7 +31,7 @@ commons-lang3 ${commons-lang3.version} - + org.assertj assertj-core @@ -39,13 +39,13 @@ test - + UTF-8 1.8 1.8 - 16.0.2 3.9.1 + diff --git a/patterns/design-patterns-cloud/pom.xml b/patterns/design-patterns-cloud/pom.xml index b5265a1f94..51f6a42f76 100644 --- a/patterns/design-patterns-cloud/pom.xml +++ b/patterns/design-patterns-cloud/pom.xml @@ -6,8 +6,8 @@ com.baeldung design-patterns-cloud 1.0.0-SNAPSHOT - pom design-patterns-cloud + pom diff --git a/patterns/design-patterns-creational/pom.xml b/patterns/design-patterns-creational/pom.xml index 351f69f749..aa20c1c085 100644 --- a/patterns/design-patterns-creational/pom.xml +++ b/patterns/design-patterns-creational/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 design-patterns-creational 1.0 design-patterns-creational - jar - + jar + com.baeldung patterns @@ -26,7 +26,7 @@ jsr305 ${javax.annotations.version} - + org.assertj assertj-core @@ -34,14 +34,15 @@ test - + UTF-8 1.8 1.8 - + 2.4.1 3.0.2 3.9.1 + diff --git a/patterns/design-patterns-functional/pom.xml b/patterns/design-patterns-functional/pom.xml index 5df7cc0cb9..ec37ad1e8d 100644 --- a/patterns/design-patterns-functional/pom.xml +++ b/patterns/design-patterns-functional/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 design-patterns-functional 1.0 design-patterns-functional - jar - + jar + com.baeldung patterns @@ -14,12 +14,10 @@ .. - - - UTF-8 1.8 1.8 + diff --git a/patterns/design-patterns-structural/pom.xml b/patterns/design-patterns-structural/pom.xml index 63806058c9..97e0b9b38b 100644 --- a/patterns/design-patterns-structural/pom.xml +++ b/patterns/design-patterns-structural/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 design-patterns-structural 1.0 design-patterns-structural - jar - + jar + com.baeldung patterns @@ -21,10 +21,11 @@ ${log4j.version} - + UTF-8 1.8 1.8 + diff --git a/patterns/dip/pom.xml b/patterns/dip/pom.xml index bc793c0090..37c980f2e3 100644 --- a/patterns/dip/pom.xml +++ b/patterns/dip/pom.xml @@ -5,8 +5,8 @@ 4.0.0 com.baeldung.dip dip - dip 1.0-SNAPSHOT + dip com.baeldung @@ -29,7 +29,7 @@ test - + UTF-8 11 diff --git a/patterns/front-controller/pom.xml b/patterns/front-controller/pom.xml index bb003dd00a..1de3b82fcd 100644 --- a/patterns/front-controller/pom.xml +++ b/patterns/front-controller/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 front-controller - front-controller + front-controller war - patterns com.baeldung + patterns 1.0.0-SNAPSHOT .. @@ -37,4 +37,5 @@ + diff --git a/patterns/intercepting-filter/pom.xml b/patterns/intercepting-filter/pom.xml index 33589dc242..435c1e13cf 100644 --- a/patterns/intercepting-filter/pom.xml +++ b/patterns/intercepting-filter/pom.xml @@ -3,7 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 intercepting-filter - intercepting-filter + intercepting-filter war diff --git a/patterns/pom.xml b/patterns/pom.xml index 331415bf5b..8a510769a9 100644 --- a/patterns/pom.xml +++ b/patterns/pom.xml @@ -3,8 +3,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 patterns - pom patterns + pom com.baeldung diff --git a/patterns/solid/pom.xml b/patterns/solid/pom.xml index faf8bdc8d9..1b0e35339d 100644 --- a/patterns/solid/pom.xml +++ b/patterns/solid/pom.xml @@ -3,10 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung solid - solid 1.0-SNAPSHOT + solid com.baeldung diff --git a/pdf/pom.xml b/pdf/pom.xml index bf5d475163..d148aa1670 100644 --- a/pdf/pom.xml +++ b/pdf/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 pdf pdf diff --git a/performance-tests/pom.xml b/performance-tests/pom.xml index 4dc480ef86..94588c99d4 100644 --- a/performance-tests/pom.xml +++ b/performance-tests/pom.xml @@ -1,15 +1,14 @@ 4.0.0 - com.baeldung performance-tests 1.0 - jar performance-tests + jar - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/persistence-modules/activejdbc/pom.xml b/persistence-modules/activejdbc/pom.xml index 45a618b840..47643cd639 100644 --- a/persistence-modules/activejdbc/pom.xml +++ b/persistence-modules/activejdbc/pom.xml @@ -1,5 +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 activejdbc 1.0-SNAPSHOT @@ -8,8 +9,8 @@ http://maven.apache.org - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ diff --git a/persistence-modules/apache-cayenne/pom.xml b/persistence-modules/apache-cayenne/pom.xml index 776b2b5233..7c94c5ba39 100644 --- a/persistence-modules/apache-cayenne/pom.xml +++ b/persistence-modules/apache-cayenne/pom.xml @@ -27,7 +27,6 @@ ${mysql.connector.version} runtime - diff --git a/persistence-modules/core-java-persistence/pom.xml b/persistence-modules/core-java-persistence/pom.xml index 2760489ce1..80c4053743 100644 --- a/persistence-modules/core-java-persistence/pom.xml +++ b/persistence-modules/core-java-persistence/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/persistence-modules/deltaspike/pom.xml b/persistence-modules/deltaspike/pom.xml index 46e774edff..141412654f 100644 --- a/persistence-modules/deltaspike/pom.xml +++ b/persistence-modules/deltaspike/pom.xml @@ -1,8 +1,7 @@ + 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 1.0 deltaspike diff --git a/persistence-modules/elasticsearch/pom.xml b/persistence-modules/elasticsearch/pom.xml index 943cfa6a23..878dd5847b 100644 --- a/persistence-modules/elasticsearch/pom.xml +++ b/persistence-modules/elasticsearch/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.baeldung elasticsearch 0.0.1-SNAPSHOT elasticsearch @@ -31,4 +30,5 @@ 6.3.1 + diff --git a/persistence-modules/flyway/pom.xml b/persistence-modules/flyway/pom.xml index 99549ee3fc..01b3dab6ee 100644 --- a/persistence-modules/flyway/pom.xml +++ b/persistence-modules/flyway/pom.xml @@ -8,8 +8,8 @@ Flyway Callbacks Demo - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 diff --git a/persistence-modules/hbase/pom.xml b/persistence-modules/hbase/pom.xml index daf0db5291..9403239fb2 100644 --- a/persistence-modules/hbase/pom.xml +++ b/persistence-modules/hbase/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 hbase - hbase + hbase - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ diff --git a/persistence-modules/hibernate-mapping/pom.xml b/persistence-modules/hibernate-mapping/pom.xml index 98c946a6e9..a0a2a047e3 100644 --- a/persistence-modules/hibernate-mapping/pom.xml +++ b/persistence-modules/hibernate-mapping/pom.xml @@ -2,9 +2,9 @@ + 4.0.0 hibernate-mapping 1.0.0-SNAPSHOT - 4.0.0 hibernate-mapping diff --git a/persistence-modules/hibernate5-2/src/main/java/com/baeldung/fetchMode/Customer.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Customer.java similarity index 100% rename from persistence-modules/hibernate5-2/src/main/java/com/baeldung/fetchMode/Customer.java rename to persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Customer.java diff --git a/persistence-modules/hibernate5-2/src/main/java/com/baeldung/fetchMode/Order.java b/persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Order.java similarity index 100% rename from persistence-modules/hibernate5-2/src/main/java/com/baeldung/fetchMode/Order.java rename to persistence-modules/hibernate-mapping/src/main/java/com/baeldung/hibernate/fetchMode/Order.java diff --git a/persistence-modules/hibernate-ogm/pom.xml b/persistence-modules/hibernate-ogm/pom.xml index 7ac29b1720..bb15881788 100644 --- a/persistence-modules/hibernate-ogm/pom.xml +++ b/persistence-modules/hibernate-ogm/pom.xml @@ -1,11 +1,10 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung hibernate-ogm 0.0.1-SNAPSHOT - hibernate-ogm + hibernate-ogm com.baeldung @@ -15,37 +14,37 @@ - - - org.hibernate.ogm - hibernate-ogm-mongodb - ${hibernate.version} - - - - org.hibernate.ogm - hibernate-ogm-neo4j - ${hibernate.version} - - - - org.jboss.narayana.jta - narayana-jta - ${narayana-jta.version} - - - - junit - junit - ${junit.version} - test - - - org.easytesting - fest-assert - ${fest-assert.version} - test - + + + org.hibernate.ogm + hibernate-ogm-mongodb + ${hibernate.version} + + + + org.hibernate.ogm + hibernate-ogm-neo4j + ${hibernate.version} + + + + org.jboss.narayana.jta + narayana-jta + ${narayana-jta.version} + + + + junit + junit + ${junit.version} + test + + + org.easytesting + fest-assert + ${fest-assert.version} + test + @@ -63,4 +62,5 @@ 1.4 5.5.23.Final + \ No newline at end of file diff --git a/persistence-modules/hibernate5-2/README.md b/persistence-modules/hibernate5-2/README.md index 75d50cd0b4..0b6be27410 100644 --- a/persistence-modules/hibernate5-2/README.md +++ b/persistence-modules/hibernate5-2/README.md @@ -1,3 +1,8 @@ +## Hibernate 5 + +This module contains articles about Hibernate 5. + ### Relevant Articles: - [Hibernate Error “Not all named parameters have been set”](https://www.baeldung.com/hibernate-error-named-parameters-not-set) - [FetchMode in Spring Data JPA](https://www.baeldung.com/spring-data-jpa-fetchmode) +- [[<-- Prev]](/hibernate5) \ No newline at end of file diff --git a/persistence-modules/hibernate5-2/pom.xml b/persistence-modules/hibernate5-2/pom.xml index ef091c331e..dfee4bb81e 100644 --- a/persistence-modules/hibernate5-2/pom.xml +++ b/persistence-modules/hibernate5-2/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.baeldung hibernate5-2 0.1-SNAPSHOT hibernate5-2 @@ -22,16 +21,49 @@ hibernate-core 5.4.7.Final + + org.springframework.boot + spring-boot-starter-web + ${spring-boot.version} + + + org.springframework.boot + spring-boot-starter-thymeleaf + ${spring-boot.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring-boot.version} + + + com.zaxxer + HikariCP + + + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + com.h2database h2 1.4.200 + + + org.apache.commons + commons-lang3 + 3.8.1 + true + 2.1.7.RELEASE diff --git a/persistence-modules/hibernate5-2/src/main/java/com/baeldung/hibernate/logging/Employee.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/hibernate/logging/Employee.java new file mode 100644 index 0000000000..9dcf4058a7 --- /dev/null +++ b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/hibernate/logging/Employee.java @@ -0,0 +1,59 @@ +package com.baeldung.hibernate.logging; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class Employee { + @Id + @GeneratedValue(strategy = GenerationType.SEQUENCE) + private long id; + + private String employeeNumber; + + private String title; + + private String name; + + public Employee() { + } + + public Employee(String name, String employeeNumber) { + this.name = name; + this.employeeNumber = employeeNumber; + } + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public String getEmployeeNumber() { + return employeeNumber; + } + + public void setEmployeeNumber(String employeeNumber) { + this.employeeNumber = employeeNumber; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/PersistenceContextDemoApplication.java diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/entity/User.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/entity/User.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/entity/User.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/entity/User.java diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/ExtendedPersistenceContextUserService.java diff --git a/persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java b/persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java rename to persistence-modules/hibernate5-2/src/main/java/com/baeldung/persistencecontext/service/TransctionPersistenceContextUserService.java diff --git a/persistence-modules/hibernate5-2/src/main/resources/hibernate-logging.cfg.xml b/persistence-modules/hibernate5-2/src/main/resources/hibernate-logging.cfg.xml new file mode 100644 index 0000000000..52ef1ee685 --- /dev/null +++ b/persistence-modules/hibernate5-2/src/main/resources/hibernate-logging.cfg.xml @@ -0,0 +1,27 @@ + + + + + + + org.h2.Driver + jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1 + sa + + + 1 + + org.hibernate.dialect.H2Dialect + + org.hibernate.cache.internal.NoCacheProvider + + true + + create + + + + + \ No newline at end of file diff --git a/persistence-modules/hibernate5-2/src/test/java/com/baeldung/hibernatelogging/HibernateLoggingIntegrationTest.java b/persistence-modules/hibernate5-2/src/test/java/com/baeldung/hibernatelogging/HibernateLoggingIntegrationTest.java new file mode 100644 index 0000000000..8ec722671d --- /dev/null +++ b/persistence-modules/hibernate5-2/src/test/java/com/baeldung/hibernatelogging/HibernateLoggingIntegrationTest.java @@ -0,0 +1,50 @@ +package com.baeldung.hibernatelogging; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + +import java.io.IOException; +import java.util.List; + +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.StandardServiceRegistry; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.query.Query; +import org.junit.Before; +import org.junit.Test; + +import com.baeldung.hibernate.logging.Employee; + +public class HibernateLoggingIntegrationTest { + + private SessionFactory sessionFactory; + + @Before + public void setUp() throws IOException { + final StandardServiceRegistry registry = new StandardServiceRegistryBuilder().configure("hibernate-logging.cfg.xml") + .build(); + try { + sessionFactory = new MetadataSources(registry).buildMetadata() + .buildSessionFactory(); + Session session = sessionFactory.openSession(); + session.beginTransaction(); + session.save(new Employee("John Smith", "001")); + session.getTransaction() + .commit(); + session.close(); + } catch (Exception e) { + fail(e); + StandardServiceRegistryBuilder.destroy(registry); + } + } + + @Test + public void whenAllEmployeesAreSelected_ThenSuccess() { + Query query = sessionFactory.openSession().createQuery("from com.baeldung.hibernate.logging.Employee", Employee.class); + List deptEmployees = query.list(); + Employee deptEmployee = deptEmployees.get(0); + assertEquals("John Smith", deptEmployee.getName()); + } +} diff --git a/persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java b/persistence-modules/hibernate5-2/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java similarity index 100% rename from persistence-modules/spring-boot-persistence/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java rename to persistence-modules/hibernate5-2/src/test/java/com/baeldung/persistencecontext/PersistenceContextIntegrationTest.java diff --git a/persistence-modules/hibernate5-2/src/test/resources/log4j.xml b/persistence-modules/hibernate5-2/src/test/resources/log4j.xml new file mode 100644 index 0000000000..2d153af124 --- /dev/null +++ b/persistence-modules/hibernate5-2/src/test/resources/log4j.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/hibernate5-2/src/test/resources/log4j2.xml b/persistence-modules/hibernate5-2/src/test/resources/log4j2.xml new file mode 100644 index 0000000000..c5d0f12462 --- /dev/null +++ b/persistence-modules/hibernate5-2/src/test/resources/log4j2.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/hibernate5-2/src/test/resources/logback.xml b/persistence-modules/hibernate5-2/src/test/resources/logback.xml new file mode 100644 index 0000000000..9e591977d7 --- /dev/null +++ b/persistence-modules/hibernate5-2/src/test/resources/logback.xml @@ -0,0 +1,18 @@ + + + + + + %d{yyyy-MM-dd HH:mm:ss} | %-5p | [%thread] %logger{5}:%L - %msg%n + + + + + + + + + + + + \ No newline at end of file diff --git a/persistence-modules/hibernate5/README.md b/persistence-modules/hibernate5/README.md index a8e2eae38b..d1bfe897f6 100644 --- a/persistence-modules/hibernate5/README.md +++ b/persistence-modules/hibernate5/README.md @@ -38,3 +38,4 @@ This module contains articles about Hibernate 5. - [Hibernate Query Plan Cache](https://www.baeldung.com/hibernate-query-plan-cache) - [TransactionRequiredException Error](https://www.baeldung.com/jpa-transaction-required-exception) - [Enabling Transaction Locks in Spring Data JPA](https://www.baeldung.com/java-jpa-transaction-locks) +- [[Next -->]](/hibernate5-2) \ No newline at end of file diff --git a/persistence-modules/hibernate5/pom.xml b/persistence-modules/hibernate5/pom.xml index bf4b2d27ec..ec06136f9c 100644 --- a/persistence-modules/hibernate5/pom.xml +++ b/persistence-modules/hibernate5/pom.xml @@ -3,7 +3,6 @@ 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 @@ -104,7 +103,7 @@ - + geodb-repo diff --git a/persistence-modules/influxdb/pom.xml b/persistence-modules/influxdb/pom.xml index a8ecaadd62..7531ad8217 100644 --- a/persistence-modules/influxdb/pom.xml +++ b/persistence-modules/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 diff --git a/persistence-modules/java-cassandra/pom.xml b/persistence-modules/java-cassandra/pom.xml index 3f8367d130..6628a393fa 100644 --- a/persistence-modules/java-cassandra/pom.xml +++ b/persistence-modules/java-cassandra/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung java-cassandra 1.0.0-SNAPSHOT java-cassandra diff --git a/persistence-modules/java-cockroachdb/pom.xml b/persistence-modules/java-cockroachdb/pom.xml index 2738ef85ff..750cbfce4c 100644 --- a/persistence-modules/java-cockroachdb/pom.xml +++ b/persistence-modules/java-cockroachdb/pom.xml @@ -1,15 +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 - com.baeldung java-cockroachdb 1.0-SNAPSHOT java-cockroachdb - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ diff --git a/persistence-modules/java-jdbi/pom.xml b/persistence-modules/java-jdbi/pom.xml index dfb31b26e8..0d978dc164 100644 --- a/persistence-modules/java-jdbi/pom.xml +++ b/persistence-modules/java-jdbi/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 java-jdbi 1.0-SNAPSHOT - java-jdbi + java-jdbi - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ diff --git a/persistence-modules/java-jpa-2/pom.xml b/persistence-modules/java-jpa-2/pom.xml index 2488c5ccdf..cc9e69fcaa 100644 --- a/persistence-modules/java-jpa-2/pom.xml +++ b/persistence-modules/java-jpa-2/pom.xml @@ -1,5 +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 java-jpa-2 java-jpa-2 diff --git a/persistence-modules/java-jpa/pom.xml b/persistence-modules/java-jpa/pom.xml index 7ce8262ba5..a979cf7e65 100644 --- a/persistence-modules/java-jpa/pom.xml +++ b/persistence-modules/java-jpa/pom.xml @@ -7,8 +7,8 @@ java-jpa - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../pom.xml @@ -19,11 +19,11 @@ hibernate-core ${hibernate.version} - - org.hibernate - hibernate-jpamodelgen - ${hibernate.version} - + + org.hibernate + hibernate-jpamodelgen + ${hibernate.version} + com.h2database h2 @@ -52,8 +52,8 @@ - - + + org.apache.maven.plugins maven-compiler-plugin @@ -62,48 +62,48 @@ -proc:none - - org.bsc.maven - maven-processor-plugin - ${maven-processor-plugin.version} - - - process - - process - - generate-sources - - target/metamodel - - org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor - - - - - + + org.bsc.maven + maven-processor-plugin + ${maven-processor-plugin.version} + + + process + + process + + generate-sources + + target/metamodel + + org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - ${build-helper-maven-plugin.version} - - - add-source - generate-sources - - add-source - - - - target/metamodel - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + ${build-helper-maven-plugin.version} + + + add-source + generate-sources + + add-source + + + + target/metamodel + + + + + + + 5.4.0.Final diff --git a/persistence-modules/java-mongodb/pom.xml b/persistence-modules/java-mongodb/pom.xml index 35e59e60c6..1e59bd9064 100644 --- a/persistence-modules/java-mongodb/pom.xml +++ b/persistence-modules/java-mongodb/pom.xml @@ -1,49 +1,45 @@ - - - 4.0.0 - com.baeldung - java-mongodb - 1.0-SNAPSHOT - java-mongodb + + + 4.0.0 + java-mongodb + 1.0-SNAPSHOT + java-mongodb - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - ../../ - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + - + + + de.flapdoodle.embedmongo + de.flapdoodle.embedmongo + ${flapdoodle.version} + test + + + org.mongodb + mongo-java-driver + ${mongo.version} + - - de.flapdoodle.embedmongo - de.flapdoodle.embedmongo - ${flapdoodle.version} - test - - - org.mongodb - mongo-java-driver - ${mongo.version} - + + dev.morphia.morphia + core + ${morphia.version} + + - - dev.morphia.morphia - core - ${morphia.version} - - - - - - 1.8 - 1.8 - 3.10.1 - 1.11 - 1.5.3 - + + 1.8 + 1.8 + 3.10.1 + 1.11 + 1.5.3 + diff --git a/persistence-modules/jnosql/jnosql-artemis/pom.xml b/persistence-modules/jnosql/jnosql-artemis/pom.xml index 09d6af13df..8570d1072f 100644 --- a/persistence-modules/jnosql/jnosql-artemis/pom.xml +++ b/persistence-modules/jnosql/jnosql-artemis/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jnosql-artemis - jnosql-artemis + jnosql-artemis war @@ -12,7 +12,7 @@ jnosql 1.0-SNAPSHOT - + javax diff --git a/persistence-modules/jnosql/jnosql-diana/pom.xml b/persistence-modules/jnosql/jnosql-diana/pom.xml index a4951761d8..22e066d36d 100644 --- a/persistence-modules/jnosql/jnosql-diana/pom.xml +++ b/persistence-modules/jnosql/jnosql-diana/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 jnosql-diana - jnosql-diana - + jnosql-diana + com.baeldung.jnosql jnosql @@ -13,7 +13,6 @@ - org.jnosql.diana diff --git a/persistence-modules/jnosql/pom.xml b/persistence-modules/jnosql/pom.xml index 8773456285..b96722de18 100644 --- a/persistence-modules/jnosql/pom.xml +++ b/persistence-modules/jnosql/pom.xml @@ -6,7 +6,7 @@ com.baeldung.jnosql jnosql 1.0-SNAPSHOT - jnosql + jnosql pom @@ -19,11 +19,12 @@ jnosql-artemis jnosql-diana - + 1.8 1.8 0.0.5 + diff --git a/persistence-modules/jpa-hibernate-cascade-type/pom.xml b/persistence-modules/jpa-hibernate-cascade-type/pom.xml index bc6307efb0..a545723746 100644 --- a/persistence-modules/jpa-hibernate-cascade-type/pom.xml +++ b/persistence-modules/jpa-hibernate-cascade-type/pom.xml @@ -2,8 +2,8 @@ - jpa-hibernate-cascade-type 4.0.0 + jpa-hibernate-cascade-type 1.0.0-SNAPSHOT diff --git a/persistence-modules/liquibase/pom.xml b/persistence-modules/liquibase/pom.xml index b06d38e6a0..39e86b5186 100644 --- a/persistence-modules/liquibase/pom.xml +++ b/persistence-modules/liquibase/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 liquibase - liquibase + liquibase - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ diff --git a/persistence-modules/orientdb/pom.xml b/persistence-modules/orientdb/pom.xml index a8ac3fb789..7b0bef7fc5 100644 --- a/persistence-modules/orientdb/pom.xml +++ b/persistence-modules/orientdb/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 orientdb 0.0.1-SNAPSHOT @@ -36,8 +36,7 @@ blueprints-core ${blueprints.version} - - + 2.2.31 diff --git a/persistence-modules/persistence-libraries/pom.xml b/persistence-modules/persistence-libraries/pom.xml index 273db34ec4..74ff262637 100644 --- a/persistence-modules/persistence-libraries/pom.xml +++ b/persistence-modules/persistence-libraries/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 persistence-libraries 1.0-SNAPSHOT java-sql2o - persistence-modules com.baeldung + persistence-modules 1.0.0-SNAPSHOT .. diff --git a/persistence-modules/pom.xml b/persistence-modules/pom.xml index ce1f0d2163..c0f7c07b70 100644 --- a/persistence-modules/pom.xml +++ b/persistence-modules/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 persistence-modules persistence-modules @@ -38,9 +38,9 @@ orientdb persistence-libraries querydsl - r2dbc + r2dbc redis - + solr spring-boot-jdbi spring-boot-mysql @@ -68,8 +68,8 @@ spring-hibernate-5 spring-hibernate4 spring-jpa - + spring-persistence-simple - + diff --git a/persistence-modules/querydsl/pom.xml b/persistence-modules/querydsl/pom.xml index 4d4347e909..690e65d737 100644 --- a/persistence-modules/querydsl/pom.xml +++ b/persistence-modules/querydsl/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 querydsl 0.1-SNAPSHOT querydsl @@ -18,7 +17,6 @@ - com.querydsl querydsl-jpa diff --git a/persistence-modules/r2dbc/pom.xml b/persistence-modules/r2dbc/pom.xml index 4256da659e..3b2a57401c 100644 --- a/persistence-modules/r2dbc/pom.xml +++ b/persistence-modules/r2dbc/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.examples.r2dbc r2dbc-example @@ -13,7 +13,7 @@ org.springframework.boot spring-boot-starter-parent 2.1.6.RELEASE - + diff --git a/persistence-modules/redis/pom.xml b/persistence-modules/redis/pom.xml index e5a39d6eac..c4a928bb4a 100644 --- a/persistence-modules/redis/pom.xml +++ b/persistence-modules/redis/pom.xml @@ -1,8 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung redis 0.1-SNAPSHOT redis @@ -44,4 +43,5 @@ 3.3.0 5.0.1.RELEASE + diff --git a/persistence-modules/sirix/pom.xml b/persistence-modules/sirix/pom.xml index 8de961120f..ccaec79775 100644 --- a/persistence-modules/sirix/pom.xml +++ b/persistence-modules/sirix/pom.xml @@ -1,53 +1,55 @@ + - 4.0.0 - io.sirix - core-api-tutorial - jar - 1.0-SNAPSHOT - core-api-tutorial - http://maven.apache.org + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.sirix + core-api-tutorial + 1.0-SNAPSHOT + core-api-tutorial + jar + http://maven.apache.org - - com.baeldung - parent-java - 0.0.1-SNAPSHOT - ../../parent-java - + + com.baeldung + parent-java + 0.0.1-SNAPSHOT + ../../parent-java + - - - io.sirix - sirix-core - ${sirix-core.version} - - + + + io.sirix + sirix-core + ${sirix-core.version} + + - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - ${maven.release.version} - ${project.build.sourceEncoding} - - - - org.ow2.asm - asm - 6.1 - - - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + ${maven.release.version} + ${project.build.sourceEncoding} + + + + org.ow2.asm + asm + 6.1 + + + + + + + + UTF-8 + 11 + 0.9.3 + - - UTF-8 - 11 - 0.9.3 - diff --git a/persistence-modules/solr/pom.xml b/persistence-modules/solr/pom.xml index 1c14c06315..5902d42a82 100644 --- a/persistence-modules/solr/pom.xml +++ b/persistence-modules/solr/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung solr 0.0.1-SNAPSHOT solr diff --git a/persistence-modules/spring-boot-jdbi/pom.xml b/persistence-modules/spring-boot-jdbi/pom.xml index e8904492ac..db36185acd 100644 --- a/persistence-modules/spring-boot-jdbi/pom.xml +++ b/persistence-modules/spring-boot-jdbi/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.boot.jdbi spring-boot-jdbi @@ -10,8 +10,8 @@ Sample SpringBoot JDBI Project - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../pom.xml @@ -41,12 +41,12 @@ - + org.springframework.boot spring-boot-starter-jdbc - + org.jdbi jdbi3-spring4 diff --git a/persistence-modules/spring-boot-mysql/pom.xml b/persistence-modules/spring-boot-mysql/pom.xml index 29374ec116..e4456b2eaf 100644 --- a/persistence-modules/spring-boot-mysql/pom.xml +++ b/persistence-modules/spring-boot-mysql/pom.xml @@ -1,14 +1,14 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 spring-boot-mysql 0.1.0 spring-boot-mysql - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -38,16 +38,13 @@ - spring-boot-mysql-timezone + spring-boot-mysql src/main/resources true - - - diff --git a/persistence-modules/spring-boot-persistence-h2/README.md b/persistence-modules/spring-boot-persistence-h2/README.md index 377b7c8939..a0f9c67a33 100644 --- a/persistence-modules/spring-boot-persistence-h2/README.md +++ b/persistence-modules/spring-boot-persistence-h2/README.md @@ -1,3 +1,4 @@ ### Relevant Articles: - [Access the Same In-Memory H2 Database in Multiple Spring Boot Applications](https://www.baeldung.com/spring-boot-access-h2-database-multiple-apps) -- [Spring Boot With H2 Database](https://www.baeldung.com/spring-boot-h2-database) \ No newline at end of file +- [Spring Boot With H2 Database](https://www.baeldung.com/spring-boot-h2-database) +- [Hibernate @NotNull vs @Column(nullable = false)](https://www.baeldung.com/hibernate-notnull-vs-nullable) \ No newline at end of file diff --git a/persistence-modules/spring-boot-persistence-h2/pom.xml b/persistence-modules/spring-boot-persistence-h2/pom.xml index d1fd5b0170..9a0a72ba23 100644 --- a/persistence-modules/spring-boot-persistence-h2/pom.xml +++ b/persistence-modules/spring-boot-persistence-h2/pom.xml @@ -6,13 +6,13 @@ com.baeldung.h2db spring-boot-persistence-h2 0.0.1-SNAPSHOT - spring-boot-persistence-h2 + spring-boot-persistence-h2 jar Demo Spring Boot applications that starts H2 in memory database - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -49,5 +49,5 @@ com.baeldung.h2db.demo.server.SpringBootApp 2.0.4.RELEASE - + diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/NotNullVsNullableApplication.java b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/NotNullVsNullableApplication.java new file mode 100644 index 0000000000..5e8d69e3a1 --- /dev/null +++ b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/NotNullVsNullableApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.h2db.notnull; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class NotNullVsNullableApplication { + + public static void main(String... args) { + SpringApplication.run(NotNullVsNullableApplication.class, args); + } +} diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/daos/ItemRepository.java b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/daos/ItemRepository.java similarity index 64% rename from persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/daos/ItemRepository.java rename to persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/daos/ItemRepository.java index 3007f56208..c1efc96d71 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/daos/ItemRepository.java +++ b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/daos/ItemRepository.java @@ -1,6 +1,6 @@ -package com.baeldung.h2db.springboot.daos; +package com.baeldung.h2db.notnull.daos; -import com.baeldung.h2db.springboot.models.Item; +import com.baeldung.h2db.notnull.models.Item; import org.springframework.data.repository.CrudRepository; import java.math.BigDecimal; diff --git a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/models/Item.java b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/models/Item.java similarity index 87% rename from persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/models/Item.java rename to persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/models/Item.java index a5c5b0d3cb..d2c4015b86 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/springboot/models/Item.java +++ b/persistence-modules/spring-boot-persistence-h2/src/main/java/com/baeldung/h2db/notnull/models/Item.java @@ -1,4 +1,4 @@ -package com.baeldung.h2db.springboot.models; +package com.baeldung.h2db.notnull.models; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/ItemIntegrationTest.java b/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/h2db/notnull/ItemIntegrationTest.java similarity index 75% rename from persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/ItemIntegrationTest.java rename to persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/h2db/notnull/ItemIntegrationTest.java index 839dd87b7e..0e2e5e3319 100644 --- a/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/ItemIntegrationTest.java +++ b/persistence-modules/spring-boot-persistence-h2/src/test/java/com/baeldung/h2db/notnull/ItemIntegrationTest.java @@ -1,8 +1,7 @@ -package com.baeldung; +package com.baeldung.h2db.notnull; -import com.baeldung.h2db.springboot.SpringBootH2Application; -import com.baeldung.h2db.springboot.daos.ItemRepository; -import com.baeldung.h2db.springboot.models.Item; +import com.baeldung.h2db.notnull.daos.ItemRepository; +import com.baeldung.h2db.notnull.models.Item; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -14,7 +13,7 @@ import javax.validation.ConstraintViolationException; import static org.assertj.core.api.Assertions.assertThatThrownBy; @RunWith(SpringRunner.class) -@SpringBootTest(classes = SpringBootH2Application.class) +@SpringBootTest(classes = NotNullVsNullableApplication.class) public class ItemIntegrationTest { @Autowired diff --git a/persistence-modules/spring-boot-persistence-mongodb/pom.xml b/persistence-modules/spring-boot-persistence-mongodb/pom.xml index dae5efa6d0..da48f066f9 100644 --- a/persistence-modules/spring-boot-persistence-mongodb/pom.xml +++ b/persistence-modules/spring-boot-persistence-mongodb/pom.xml @@ -9,8 +9,8 @@ This is simple boot application for Spring boot persistence mongodb test - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -23,7 +23,7 @@ org.springframework.boot spring-boot-starter-thymeleaf - + org.springframework.boot @@ -61,7 +61,7 @@ - spring-boot-persistence + spring-boot-persistence-mongodb src/main/resources @@ -110,5 +110,4 @@ - diff --git a/persistence-modules/spring-boot-persistence/pom.xml b/persistence-modules/spring-boot-persistence/pom.xml index 3ad925f16b..049e7225ac 100644 --- a/persistence-modules/spring-boot-persistence/pom.xml +++ b/persistence-modules/spring-boot-persistence/pom.xml @@ -1,14 +1,14 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 spring-boot-persistence 0.1.0 spring-boot-persistence - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 diff --git a/persistence-modules/spring-data-cassandra-reactive/pom.xml b/persistence-modules/spring-data-cassandra-reactive/pom.xml index 288f842201..a57ebbe703 100644 --- a/persistence-modules/spring-data-cassandra-reactive/pom.xml +++ b/persistence-modules/spring-data-cassandra-reactive/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 spring-data-cassandra-reactive 0.0.1-SNAPSHOT spring-data-cassandra-reactive @@ -52,7 +51,6 @@ ${cassandra-unit-spring.version} test - diff --git a/persistence-modules/spring-data-cassandra/pom.xml b/persistence-modules/spring-data-cassandra/pom.xml index 4f323a72d8..9ea39f3f55 100644 --- a/persistence-modules/spring-data-cassandra/pom.xml +++ b/persistence-modules/spring-data-cassandra/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"> 4.0.0 - com.baeldung spring-data-cassandra 0.0.1-SNAPSHOT spring-data-cassandra diff --git a/persistence-modules/spring-data-couchbase-2/pom.xml b/persistence-modules/spring-data-couchbase-2/pom.xml index f57d9aaa62..56456fc04b 100644 --- a/persistence-modules/spring-data-couchbase-2/pom.xml +++ b/persistence-modules/spring-data-couchbase-2/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung spring-data-couchbase-2 @@ -16,7 +17,6 @@ - org.springframework diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index e8bf9b8c1e..7b936817d1 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -1,14 +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 spring-data-dynamodb - jar spring-data-dynamodb + jar This is simple boot application for Spring boot dynamodb test - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 @@ -134,11 +135,10 @@ so test - - spring-boot + spring-data-dynamodb src/main/resources diff --git a/persistence-modules/spring-data-eclipselink/pom.xml b/persistence-modules/spring-data-eclipselink/pom.xml index 5ca827db7b..bb596d4a8a 100644 --- a/persistence-modules/spring-data-eclipselink/pom.xml +++ b/persistence-modules/spring-data-eclipselink/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-data-eclipselink spring-data-eclipselink diff --git a/persistence-modules/spring-data-elasticsearch/pom.xml b/persistence-modules/spring-data-elasticsearch/pom.xml index 9495d56798..ccd2f94e59 100644 --- a/persistence-modules/spring-data-elasticsearch/pom.xml +++ b/persistence-modules/spring-data-elasticsearch/pom.xml @@ -1,7 +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-data-elasticsearch 0.0.1-SNAPSHOT spring-data-elasticsearch @@ -20,13 +19,13 @@ spring-core ${spring.version} - + org.springframework spring-context ${spring.version} - + org.springframework.data spring-data-elasticsearch @@ -43,12 +42,12 @@ fastjson ${fastjson.version} - + - org.locationtech.spatial4j - spatial4j - ${spatial4j.version} - + org.locationtech.spatial4j + spatial4j + ${spatial4j.version} + com.vividsolutions @@ -61,26 +60,26 @@ - + org.apache.logging.log4j log4j-core ${log4j.version} - + org.elasticsearch.client transport ${elasticsearch.version} - + org.springframework spring-test ${spring.version} test - + net.java.dev.jna jna diff --git a/persistence-modules/spring-data-gemfire/pom.xml b/persistence-modules/spring-data-gemfire/pom.xml index dbb869acf0..6bd689192c 100644 --- a/persistence-modules/spring-data-gemfire/pom.xml +++ b/persistence-modules/spring-data-gemfire/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-data-gemfire spring-data-gemfire diff --git a/persistence-modules/spring-data-geode/pom.xml b/persistence-modules/spring-data-geode/pom.xml index abd3049755..2a9cbe35e9 100644 --- a/persistence-modules/spring-data-geode/pom.xml +++ b/persistence-modules/spring-data-geode/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-data-geode spring-data-geode @@ -42,7 +42,7 @@ spring-geode-starter ${spring-geode-starter-version} - + org.springframework.boot spring-boot-autoconfigure @@ -85,7 +85,7 @@ - 2.1.9.RELEASE + 2.1.9.RELEASE UTF-8 com.baeldung.springdatageode.app.ClientCacheApp 1.1.1.RELEASE diff --git a/persistence-modules/spring-data-jpa-2/pom.xml b/persistence-modules/spring-data-jpa-2/pom.xml index 3616b5ce18..838327de89 100644 --- a/persistence-modules/spring-data-jpa-2/pom.xml +++ b/persistence-modules/spring-data-jpa-2/pom.xml @@ -1,16 +1,14 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - com.baeldung spring-data-jpa-2 spring-data-jpa-2 - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -42,8 +40,9 @@ spring-oxm - + 1.4.1 + \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa-3/pom.xml b/persistence-modules/spring-data-jpa-3/pom.xml index 351279f60e..8a949b3008 100644 --- a/persistence-modules/spring-data-jpa-3/pom.xml +++ b/persistence-modules/spring-data-jpa-3/pom.xml @@ -3,20 +3,18 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 4.0.0 spring-data-jpa-3 spring-data-jpa-3 - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - org.springframework.boot @@ -81,7 +79,7 @@ junit-platform-launcher test - + org.testcontainers @@ -100,4 +98,5 @@ 1.12.2 1.4.200 + diff --git a/persistence-modules/spring-data-jpa-4/pom.xml b/persistence-modules/spring-data-jpa-4/pom.xml index c74119c1f7..44b7c3c268 100644 --- a/persistence-modules/spring-data-jpa-4/pom.xml +++ b/persistence-modules/spring-data-jpa-4/pom.xml @@ -1,25 +1,23 @@ + 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-jpa-4 spring-data-jpa-4 - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - + org.springframework.boot spring-boot-starter-web - + org.springframework.boot spring-boot-starter-data-jpa @@ -37,6 +35,4 @@ - - \ No newline at end of file diff --git a/persistence-modules/spring-data-jpa/pom.xml b/persistence-modules/spring-data-jpa/pom.xml index af92f331d1..27b8ce5eaf 100644 --- a/persistence-modules/spring-data-jpa/pom.xml +++ b/persistence-modules/spring-data-jpa/pom.xml @@ -3,13 +3,12 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-data-jpa - spring-data-jpa - + spring-data-jpa + - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -58,9 +57,9 @@ spring-boot-starter-web - org.springframework.boot - spring-boot-starter-test - test + org.springframework.boot + spring-boot-starter-test + test @@ -68,7 +67,7 @@ guava ${guava.version} - + org.junit.jupiter @@ -89,12 +88,12 @@ test - + - com.baeldung.boot.Application - 1.10.6 - 42.2.5 - 21.0 + com.baeldung.boot.Application + 1.10.6 + 42.2.5 + 21.0 \ No newline at end of file diff --git a/persistence-modules/spring-data-keyvalue/pom.xml b/persistence-modules/spring-data-keyvalue/pom.xml index 1fee0a88d4..b28773c414 100644 --- a/persistence-modules/spring-data-keyvalue/pom.xml +++ b/persistence-modules/spring-data-keyvalue/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 spring-data-keyvalue - spring-data-keyvalue + spring-data-keyvalue - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 diff --git a/persistence-modules/spring-data-mongodb/pom.xml b/persistence-modules/spring-data-mongodb/pom.xml index 33ad3a5267..3f7c1cbcb9 100644 --- a/persistence-modules/spring-data-mongodb/pom.xml +++ b/persistence-modules/spring-data-mongodb/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -100,7 +101,6 @@ 1.1.3 1.9.2 3.2.0.RELEASE - diff --git a/persistence-modules/spring-data-neo4j/pom.xml b/persistence-modules/spring-data-neo4j/pom.xml index 1e5d51ddf2..625e2c5fc1 100644 --- a/persistence-modules/spring-data-neo4j/pom.xml +++ b/persistence-modules/spring-data-neo4j/pom.xml @@ -1,10 +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 spring-data-neo4j 1.0 - spring-data-neo4j - + spring-data-neo4j + com.baeldung parent-modules diff --git a/persistence-modules/spring-data-redis/pom.xml b/persistence-modules/spring-data-redis/pom.xml index cd8c729844..a304108fee 100644 --- a/persistence-modules/spring-data-redis/pom.xml +++ b/persistence-modules/spring-data-redis/pom.xml @@ -1,15 +1,15 @@ + 4.0.0 - com.baeldung spring-data-redis 1.0 spring-data-redis jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 diff --git a/persistence-modules/spring-data-solr/pom.xml b/persistence-modules/spring-data-solr/pom.xml index 82539b0ca8..1a17a2e321 100644 --- a/persistence-modules/spring-data-solr/pom.xml +++ b/persistence-modules/spring-data-solr/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-data-solr 0.0.1-SNAPSHOT spring-data-solr diff --git a/persistence-modules/spring-hibernate-3/pom.xml b/persistence-modules/spring-hibernate-3/pom.xml index 4349492370..e677776a95 100644 --- a/persistence-modules/spring-hibernate-3/pom.xml +++ b/persistence-modules/spring-hibernate-3/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-hibernate-3 0.1-SNAPSHOT spring-hibernate-3 diff --git a/persistence-modules/spring-hibernate-5/pom.xml b/persistence-modules/spring-hibernate-5/pom.xml index 694ab570a5..546dcb1ce0 100644 --- a/persistence-modules/spring-hibernate-5/pom.xml +++ b/persistence-modules/spring-hibernate-5/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-hibernate-5 0.1-SNAPSHOT spring-hibernate-5 @@ -151,7 +151,6 @@ 21.0 - diff --git a/persistence-modules/spring-hibernate4/pom.xml b/persistence-modules/spring-hibernate4/pom.xml index c22342a34a..41c7fdb098 100644 --- a/persistence-modules/spring-hibernate4/pom.xml +++ b/persistence-modules/spring-hibernate4/pom.xml @@ -1,20 +1,19 @@ + 4.0.0 - com.baeldung spring-hibernate4 0.1-SNAPSHOT spring-hibernate4 - parent-spring-4 com.baeldung + parent-spring-4 0.0.1-SNAPSHOT ../../parent-spring-4 - diff --git a/persistence-modules/spring-jpa/pom.xml b/persistence-modules/spring-jpa/pom.xml index 792f3918b6..4972a20cf6 100644 --- a/persistence-modules/spring-jpa/pom.xml +++ b/persistence-modules/spring-jpa/pom.xml @@ -1,5 +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-jpa 0.1-SNAPSHOT diff --git a/persistence-modules/spring-mybatis/pom.xml b/persistence-modules/spring-mybatis/pom.xml index 9946c937c8..40d4d915ab 100644 --- a/persistence-modules/spring-mybatis/pom.xml +++ b/persistence-modules/spring-mybatis/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-mybatis 0.1-SNAPSHOT spring-mybatis @@ -108,7 +108,6 @@ 3.8.0 - diff --git a/persistence-modules/spring-persistence-simple/pom.xml b/persistence-modules/spring-persistence-simple/pom.xml index f0cf8e49d5..3ecb9c3d7d 100644 --- a/persistence-modules/spring-persistence-simple/pom.xml +++ b/persistence-modules/spring-persistence-simple/pom.xml @@ -1,5 +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-persistence-simple 0.1-SNAPSHOT @@ -130,7 +131,7 @@ - + diff --git a/podman/Dockerfile b/podman/Dockerfile new file mode 100644 index 0000000000..8eee766e42 --- /dev/null +++ b/podman/Dockerfile @@ -0,0 +1,4 @@ +FROM centos:latest +RUN yum -y install httpd +CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"] +EXPOSE 80 diff --git a/pom.xml b/pom.xml index 7c46f29c74..cfb3fe1889 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,8 @@ + 4.0.0 - com.baeldung parent-modules 1.0.0-SNAPSHOT @@ -454,6 +454,7 @@ core-java-modules/core-java core-java-modules/core-java-jar core-java-modules/core-java-jvm + core-kotlin-modules core-scala couchbase custom-pmd @@ -499,18 +500,17 @@ immutables jackson - jackson-2 jackson-simple jackson-annotations jackson-exceptions jackson-conversions jackson-conversions-2 + jackson-custom-conversions java-collections-conversions java-collections-conversions-2 java-collections-maps java-collections-maps-2 java-jdi - java-lite java-math @@ -629,12 +629,13 @@ spring-boot-performance spring-boot-properties - spring-security-kerberos + spring-security-modules/spring-security-kerberos oauth2-framework-impl spring-boot-nashorn java-blockchain machine-learning + webrtc wildfly quarkus-extension @@ -805,7 +806,7 @@ spring-reactive-kotlin spring-reactor spring-remoting - spring-rest + spring-rest-http spring-rest-angular spring-rest-compress spring-rest-testing @@ -815,29 +816,29 @@ spring-rest-simple spring-resttemplate spring-roo - spring-schedulingspring-security-acl - spring-security-angular/server - spring-security-cache-control - - spring-security-core - spring-security-mvc-boot - spring-security-mvc-custom - spring-security-mvc-digest-auth - spring-security-mvc-jsonview - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc - spring-security-mvc-socket - spring-security-openid + spring-scheduling + spring-security-modules/spring-security-acl + spring-security-modules/spring-security-angular/server + spring-security-modules/spring-security-cache-control + spring-security-modules/spring-security-core + spring-security-modules/spring-security-mvc + spring-security-modules/spring-security-mvc-boot + spring-security-modules/spring-security-mvc-custom + spring-security-modules/spring-security-mvc-digest-auth + spring-security-modules/spring-security-mvc-jsonview + spring-security-modules/spring-security-mvc-ldap + spring-security-modules/spring-security-mvc-login + spring-security-modules/spring-security-mvc-persisted-remember-me + spring-security-modules/spring-security-mvc-socket + spring-security-modules/spring-security-openid - spring-security-rest - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-sso - spring-security-stormpath - spring-security-thymeleaf - spring-security-x509 + spring-security-modules/spring-security-rest + spring-security-modules/spring-security-rest-basic-auth + spring-security-modules/spring-security-rest-custom + spring-security-modules/spring-security-sso + spring-security-modules/spring-security-stormpath + spring-security-modules/spring-security-thymeleaf + spring-security-modules/spring-security-x509 spring-session spring-shell spring-sleuth @@ -879,11 +880,10 @@ tensorflow-java spring-boot-flowable - spring-security-kerberos + spring-security-modules/spring-security-kerberos spring-boot-nashorn java-blockchain - @@ -931,7 +931,6 @@ core-java-modules/core-java-concurrency-advanced-3 core-kotlin core-kotlin-2 - core-kotlin-io jenkins/plugins jhipster @@ -1093,6 +1092,7 @@ core-java-modules/core-java-string-algorithms-2 core-java-modules/core-java-string-apis core-java-modules/core-java-strings + core-kotlin-modules core-scala couchbase custom-pmd @@ -1138,18 +1138,17 @@ immutables jackson - jackson-2 jackson-simple jackson-annotations jackson-exceptions jackson-conversions jackson-conversions-2 + jackson-custom-conversions java-collections-conversions java-collections-conversions-2 java-collections-maps java-collections-maps-2 java-jdi - java-ee-8-security-api java-lite java-math @@ -1410,7 +1409,7 @@ spring-reactive-kotlin spring-reactor spring-remoting - spring-rest + spring-rest-http spring-rest-angular spring-rest-compress spring-rest-testing @@ -1422,27 +1421,27 @@ spring-roo spring-scheduling - spring-security-acl - spring-security-angular/server - spring-security-cache-control - spring-security-core - spring-security-mvc-boot - spring-security-mvc-custom - spring-security-mvc-digest-auth - spring-security-mvc-ldap - spring-security-mvc-login - spring-security-mvc-persisted-remember-me - spring-security-mvc - spring-security-mvc-socket - spring-security-openid + spring-security-modules/spring-security-acl + spring-security-modules/spring-security-angular/server + spring-security-modules/spring-security-cache-control + spring-security-modules/spring-security-core + spring-security-modules/spring-security-mvc + spring-security-modules/spring-security-mvc-boot + spring-security-modules/spring-security-mvc-custom + spring-security-modules/spring-security-mvc-digest-auth + spring-security-modules/spring-security-mvc-ldap + spring-security-modules/spring-security-mvc-login + spring-security-modules/spring-security-mvc-persisted-remember-me + spring-security-modules/spring-security-mvc-socket + spring-security-modules/spring-security-openid - spring-security-rest - spring-security-rest-basic-auth - spring-security-rest-custom - spring-security-sso - spring-security-stormpath - spring-security-thymeleaf - spring-security-x509 + spring-security-modules/spring-security-rest + spring-security-modules/spring-security-rest-basic-auth + spring-security-modules/spring-security-rest-custom + spring-security-modules/spring-security-sso + spring-security-modules/spring-security-stormpath + spring-security-modules/spring-security-thymeleaf + spring-security-modules/spring-security-x509 spring-session spring-shell spring-sleuth @@ -1542,7 +1541,6 @@ - diff --git a/protobuffer/pom.xml b/protobuffer/pom.xml index d9e6cb26e4..e57495e93c 100644 --- a/protobuffer/pom.xml +++ b/protobuffer/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 protobuffer - protobuffer - + protobuffer + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/quarkus-extension/pom.xml b/quarkus-extension/pom.xml index 1a4f7b96fb..38d7c3d548 100644 --- a/quarkus-extension/pom.xml +++ b/quarkus-extension/pom.xml @@ -3,11 +3,10 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.quarkus.extension quarkus-extension 1.0-SNAPSHOT - Quarkus - Liquibase Extension + quarkus-extension pom diff --git a/quarkus-extension/quarkus-app/pom.xml b/quarkus-extension/quarkus-app/pom.xml index c4ce802418..6e4cce3ae7 100644 --- a/quarkus-extension/quarkus-app/pom.xml +++ b/quarkus-extension/quarkus-app/pom.xml @@ -6,16 +6,7 @@ com.baeldung.quarkus.app quarkus-app 1.0-SNAPSHOT - - UTF-8 - 2.22.0 - true - 1.0.0.Final - 3.8.1 - 1.8 - UTF-8 - 1.8 - + @@ -27,6 +18,7 @@ + com.baeldung.quarkus.liquibase @@ -39,6 +31,7 @@ ${quarkus.version} + @@ -68,4 +61,16 @@ + + + UTF-8 + 2.22.0 + true + 1.0.0.Final + 3.8.1 + 1.8 + UTF-8 + 1.8 + + diff --git a/quarkus-extension/quarkus-liquibase/deployment/pom.xml b/quarkus-extension/quarkus-liquibase/deployment/pom.xml index b439a35a28..f005ac4e8c 100644 --- a/quarkus-extension/quarkus-liquibase/deployment/pom.xml +++ b/quarkus-extension/quarkus-liquibase/deployment/pom.xml @@ -2,18 +2,17 @@ + 4.0.0 + quarkus-liquibase-deployment + quarkus-liquibase-deployment + - quarkus-liquibase-parent com.baeldung.quarkus.liquibase + quarkus-liquibase-parent 1.0-SNAPSHOT - 4.0.0 - Quarkus - Liquibase - Deployment - - quarkus-liquibase-deployment - io.quarkus quarkus-core-deployment @@ -29,13 +28,11 @@ quarkus-agroal-deployment ${quarkus.version} - com.baeldung.quarkus.liquibase quarkus-liquibase ${project.version} - @@ -57,5 +54,4 @@ - \ No newline at end of file diff --git a/quarkus-extension/quarkus-liquibase/pom.xml b/quarkus-extension/quarkus-liquibase/pom.xml index 3b036f0658..e1f3e243ab 100644 --- a/quarkus-extension/quarkus-liquibase/pom.xml +++ b/quarkus-extension/quarkus-liquibase/pom.xml @@ -3,13 +3,17 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung.quarkus.liquibase quarkus-liquibase-parent 1.0-SNAPSHOT - Quarkus - Liquibase + quarkus-liquibase-parent pom + + runtime + deployment + + 1.8 1.8 @@ -17,9 +21,4 @@ 1.0.0.Final - - runtime - deployment - - \ No newline at end of file diff --git a/quarkus-extension/quarkus-liquibase/runtime/pom.xml b/quarkus-extension/quarkus-liquibase/runtime/pom.xml index de570dc27d..a1d705c691 100644 --- a/quarkus-extension/quarkus-liquibase/runtime/pom.xml +++ b/quarkus-extension/quarkus-liquibase/runtime/pom.xml @@ -2,15 +2,15 @@ + 4.0.0 + quarkus-liquibase-runtime + quarkus-liquibase-runtime + com.baeldung.quarkus.liquibase quarkus-liquibase-parent 1.0-SNAPSHOT - 4.0.0 - Quarkus - Liquibase - Runtime - - quarkus-liquibase @@ -29,6 +29,7 @@ 3.8.1 + diff --git a/quarkus/pom.xml b/quarkus/pom.xml index 31e3c8f8a0..de4c2ca9a3 100644 --- a/quarkus/pom.xml +++ b/quarkus/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.baeldung.quarkus quarkus @@ -12,14 +12,7 @@ parent-modules 1.0.0-SNAPSHOT - - - 2.22.0 - 0.15.0 - 1.8 - UTF-8 - 1.8 - + @@ -31,6 +24,7 @@ + io.quarkus @@ -47,6 +41,7 @@ test + @@ -72,6 +67,7 @@ + native @@ -118,4 +114,13 @@ + + + 2.22.0 + 0.15.0 + 1.8 + UTF-8 + 1.8 + + diff --git a/rabbitmq/pom.xml b/rabbitmq/pom.xml index b620248cfc..b544da4c44 100644 --- a/rabbitmq/pom.xml +++ b/rabbitmq/pom.xml @@ -1,9 +1,7 @@ - + - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung rabbitmq 0.1-SNAPSHOT rabbitmq diff --git a/ratpack/pom.xml b/ratpack/pom.xml index 0df313c05e..a00be905ee 100644 --- a/ratpack/pom.xml +++ b/ratpack/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 - com.baeldung ratpack 1.0-SNAPSHOT ratpack @@ -27,17 +27,17 @@ ${ratpack.version} - org.codehaus.groovy - groovy-sql - ${groovy.sql.version} - + org.codehaus.groovy + groovy-sql + ${groovy.sql.version} + io.ratpack ratpack-hikari ${ratpack.version} - io.ratpack + io.ratpack ratpack-groovy-test ${ratpack.test.latest.version} @@ -104,4 +104,5 @@ 2.4.15 1.6.1 + diff --git a/reactor-core/pom.xml b/reactor-core/pom.xml index 66c634e113..c9917d14df 100644 --- a/reactor-core/pom.xml +++ b/reactor-core/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 org.baeldung reactor-core 0.0.1-SNAPSHOT - reactor-core - + reactor-core + com.baeldung parent-modules diff --git a/resteasy/pom.xml b/resteasy/pom.xml index 8aea8077f9..ffb6adb3df 100644 --- a/resteasy/pom.xml +++ b/resteasy/pom.xml @@ -2,10 +2,9 @@ 4.0.0 - com.baeldung resteasy 1.0 - resteasy + resteasy war @@ -28,7 +27,6 @@ - org.jboss.resteasy resteasy-client @@ -49,17 +47,15 @@ ${resteasy.version} - commons-io commons-io ${commons-io.version} - - RestEasyTutorial + resteasy org.codehaus.cargo @@ -98,7 +94,7 @@ **/*IntegrationTest.java - **/*IntTest.java + **/*IntTest.java **/*LiveTest.java diff --git a/restx/pom.xml b/restx/pom.xml index 10c843a208..17c25fcdc0 100644 --- a/restx/pom.xml +++ b/restx/pom.xml @@ -7,8 +7,8 @@ 0.1-SNAPSHOT restx war - - + + com.baeldung parent-modules 1.0.0-SNAPSHOT @@ -114,7 +114,7 @@ test - + @@ -153,4 +153,5 @@ 0.35-rc4 1.2.3 + diff --git a/rsocket/pom.xml b/rsocket/pom.xml index d2182719c2..70f21064b6 100644 --- a/rsocket/pom.xml +++ b/rsocket/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 rsocket 0.0.1-SNAPSHOT @@ -56,9 +57,10 @@ 1.8 1.8 3.0.1 - 0.11.13 - 1.3 - 1.2.3 - 1.7.25 + 0.11.13 + 1.3 + 1.2.3 + 1.7.25 + diff --git a/rule-engines/easy-rules/pom.xml b/rule-engines/easy-rules/pom.xml index 369451c56c..c1ba829045 100644 --- a/rule-engines/easy-rules/pom.xml +++ b/rule-engines/easy-rules/pom.xml @@ -1,5 +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.easyrules easy-rules @@ -24,4 +25,5 @@ 3.0.0 + diff --git a/rule-engines/openl-tablets/pom.xml b/rule-engines/openl-tablets/pom.xml index b19ec8d3f1..d1c7baabcc 100644 --- a/rule-engines/openl-tablets/pom.xml +++ b/rule-engines/openl-tablets/pom.xml @@ -1,5 +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.openltablets openl-tablets diff --git a/rule-engines/pom.xml b/rule-engines/pom.xml index 2ce82ed22b..cc015c600b 100644 --- a/rule-engines/pom.xml +++ b/rule-engines/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 rule-engines rule-engines diff --git a/rule-engines/rulebook/pom.xml b/rule-engines/rulebook/pom.xml index 5e0b900bd9..b021adea10 100644 --- a/rule-engines/rulebook/pom.xml +++ b/rule-engines/rulebook/pom.xml @@ -1,5 +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.rulebook rulebook diff --git a/rxjava-core/pom.xml b/rxjava-core/pom.xml index 401ad83808..daec1f783f 100644 --- a/rxjava-core/pom.xml +++ b/rxjava-core/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 rxjava-core 1.0-SNAPSHOT - rxjava-core - + rxjava-core + com.baeldung parent-java diff --git a/rxjava-libraries/pom.xml b/rxjava-libraries/pom.xml index 541d9116c8..45c1907a58 100644 --- a/rxjava-libraries/pom.xml +++ b/rxjava-libraries/pom.xml @@ -45,7 +45,6 @@ assertj-core ${assertj.version} - diff --git a/rxjava-observables/pom.xml b/rxjava-observables/pom.xml index c2bf0bcd88..3cedfc4afc 100644 --- a/rxjava-observables/pom.xml +++ b/rxjava-observables/pom.xml @@ -29,7 +29,6 @@ assertj-core ${assertj.version} - diff --git a/saas/pom.xml b/saas/pom.xml index 35de34ea72..be5d18f020 100644 --- a/saas/pom.xml +++ b/saas/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung saas 0.1.0-SNAPSHOT saas @@ -10,8 +10,8 @@ com.baeldung parent-java - 0.0.1-SNAPSHOT - ../parent-java + 0.0.1-SNAPSHOT + ../parent-java diff --git a/software-security/sql-injection-samples/pom.xml b/software-security/sql-injection-samples/pom.xml index 5c3256319e..6cacaa4ad0 100644 --- a/software-security/sql-injection-samples/pom.xml +++ b/software-security/sql-injection-samples/pom.xml @@ -1,66 +1,65 @@ - 4.0.0 - com.baeldung - sql-injection-samples - 0.0.1-SNAPSHOT - sql-injection-samples - Sample SQL Injection tests + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + sql-injection-samples + 0.0.1-SNAPSHOT + sql-injection-samples + Sample SQL Injection tests - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - + - - - org.springframework.boot - spring-boot-starter-jdbc - - - org.apache.derby - derby - runtime - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.projectlombok - lombok - provided - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.hibernate - hibernate-jpamodelgen - - - org.springframework.boot - spring-boot-devtools - - + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.apache.derby + derby + runtime + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.projectlombok + lombok + provided + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.hibernate + hibernate-jpamodelgen + + + org.springframework.boot + spring-boot-devtools + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + \ No newline at end of file diff --git a/spark-java/pom.xml b/spark-java/pom.xml index ef33f4cbe0..686cf75058 100644 --- a/spark-java/pom.xml +++ b/spark-java/pom.xml @@ -1,8 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung spark-java 0.1.0-SNAPSHOT spark-java diff --git a/spf4j/pom.xml b/spf4j/pom.xml index 43a8028dc4..b0568e9f7a 100644 --- a/spf4j/pom.xml +++ b/spf4j/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 com.baeldung.spf4j spf4j spf4j pom - + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT @@ -17,5 +17,5 @@ spf4j-core-app spf4j-aspects-app - + diff --git a/spf4j/spf4j-aspects-app/pom.xml b/spf4j/spf4j-aspects-app/pom.xml index 1c707f4d87..2458e2d8ad 100644 --- a/spf4j/spf4j-aspects-app/pom.xml +++ b/spf4j/spf4j-aspects-app/pom.xml @@ -1,15 +1,16 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spf4j-aspects-app 0.0.1-SNAPSHOT - jar spf4j-aspects-app + jar - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ @@ -78,10 +79,11 @@ - + UTF-8 8.6.10 1.7.21 + diff --git a/spf4j/spf4j-core-app/pom.xml b/spf4j/spf4j-core-app/pom.xml index 9f490d9f06..45300fd4a4 100644 --- a/spf4j/spf4j-core-app/pom.xml +++ b/spf4j/spf4j-core-app/pom.xml @@ -1,15 +1,16 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spf4j-core-app 0.0.1-SNAPSHOT - jar spf4j-core-app + jar - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ @@ -84,4 +85,5 @@ 8.6.10 1.7.21 + diff --git a/spring-4/pom.xml b/spring-4/pom.xml index 6c282b76a0..b6b8deb273 100644 --- a/spring-4/pom.xml +++ b/spring-4/pom.xml @@ -1,5 +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-4 spring-4 @@ -7,8 +8,8 @@ jar - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 @@ -36,7 +37,7 @@ com.zaxxer HikariCP - + org.springframework.boot spring-boot-starter-test diff --git a/spring-5-data-reactive/pom.xml b/spring-5-data-reactive/pom.xml index 296da87529..230f25768e 100644 --- a/spring-5-data-reactive/pom.xml +++ b/spring-5-data-reactive/pom.xml @@ -7,8 +7,8 @@ jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -119,7 +119,6 @@ ${couchbaseMock.version} test - diff --git a/spring-5-mvc/pom.xml b/spring-5-mvc/pom.xml index 7417f39c21..2f8ef05bff 100644 --- a/spring-5-mvc/pom.xml +++ b/spring-5-mvc/pom.xml @@ -1,12 +1,12 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-5-mvc spring-5-mvc - spring 5 MVC sample project about new features jar + spring 5 MVC sample project about new features com.baeldung @@ -178,4 +178,5 @@ com.baeldung.Spring5Application 4.5.8 + diff --git a/spring-5-reactive-2/pom.xml b/spring-5-reactive-2/pom.xml index 37c9ad3579..fdeebd1dfd 100644 --- a/spring-5-reactive-2/pom.xml +++ b/spring-5-reactive-2/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-5-reactive-2 0.0.1-SNAPSHOT spring-5-reactive-2 @@ -30,24 +29,24 @@ reactor-spring ${reactor-spring.version} - + org.projectlombok lombok provided - + org.springframework.boot spring-boot-starter-test test - - - com.github.tomakehurst - wiremock-jre8 - ${wiremock.version} - test + + + com.github.tomakehurst + wiremock-jre8 + ${wiremock.version} + test io.projectreactor @@ -68,10 +67,10 @@ - + 1.0.1.RELEASE - 2.24.0 + 2.24.0 diff --git a/spring-5-reactive-client/pom.xml b/spring-5-reactive-client/pom.xml index 994239fa9b..2981fc4f77 100644 --- a/spring-5-reactive-client/pom.xml +++ b/spring-5-reactive-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-5-reactive-client spring-5-reactive-client @@ -124,7 +124,6 @@ ${jetty-reactive-httpclient.version} test - diff --git a/spring-5-reactive-oauth/pom.xml b/spring-5-reactive-oauth/pom.xml index 06ce817a02..e286e821b2 100644 --- a/spring-5-reactive-oauth/pom.xml +++ b/spring-5-reactive-oauth/pom.xml @@ -1,75 +1,73 @@ - 4.0.0 - com.baeldung.reactive.oauth - spring-5-reactive-oauth - 1.0.0-SNAPSHOT - spring-5-reactive-oauth - jar - WebFluc and Spring Security OAuth + 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.reactive.oauth + spring-5-reactive-oauth + 1.0.0-SNAPSHOT + spring-5-reactive-oauth + jar + WebFluc and Spring Security OAuth - - parent-boot-2 + com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-webflux - + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-webflux + org.springframework.security spring-security-oauth2-client - - org.springframework.boot - spring-boot-starter-test - test - - - io.projectreactor - reactor-test - test - - - org.springframework.security - spring-security-test - test - - + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + org.springframework.security + spring-security-test + test + + - - + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + **/*IntegrationTest.java + **/*LiveTest.java + + + + + - - org.apache.maven.plugins - maven-surefire-plugin - - true - - **/*IntegrationTest.java - **/*LiveTest.java - - - - - - - - - UTF-8 - UTF-8 + + UTF-8 + UTF-8 2.1.0.RELEASE - + diff --git a/spring-5-reactive-security/pom.xml b/spring-5-reactive-security/pom.xml index 72a73a86ce..2f4a31241b 100644 --- a/spring-5-reactive-security/pom.xml +++ b/spring-5-reactive-security/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-5-reactive-security 0.0.1-SNAPSHOT spring-5-reactive-security @@ -97,15 +96,15 @@ ${project-reactor-test} test - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.security - spring-security-test - test - + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.security + spring-security-test + test + @@ -129,6 +128,7 @@ 1.0 4.1 3.1.6.RELEASE + 2.2.1.RELEASE diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverApplication.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverApplication.java new file mode 100644 index 0000000000..bad5768c20 --- /dev/null +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverApplication.java @@ -0,0 +1,15 @@ +package com.baeldung.reactive.authresolver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.web.reactive.config.EnableWebFlux; + +@EnableWebFlux +@SpringBootApplication +public class AuthResolverApplication { + + public static void main(String[] args) { + SpringApplication.run(AuthResolverApplication.class, args); + } + +} diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverController.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverController.java new file mode 100644 index 0000000000..1d70ded5e4 --- /dev/null +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/AuthResolverController.java @@ -0,0 +1,25 @@ +package com.baeldung.reactive.authresolver; + +import java.security.Principal; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import reactor.core.publisher.Mono; + +@RestController +public class AuthResolverController { + + @GetMapping("/customer/welcome") + public Mono sayWelcomeToCustomer(Mono principal) { + return principal + .map(Principal::getName) + .map(name -> String.format("Welcome to our site, %s!", name)); + } + + @GetMapping("/employee/welcome") + public Mono sayWelcomeToEmployee(Mono principal) { + return principal + .map(Principal::getName) + .map(name -> String.format("Welcome to our company, %s!", name)); + } + +} diff --git a/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/CustomWebSecurityConfig.java b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/CustomWebSecurityConfig.java new file mode 100644 index 0000000000..d07a991089 --- /dev/null +++ b/spring-5-reactive-security/src/main/java/com/baeldung/reactive/authresolver/CustomWebSecurityConfig.java @@ -0,0 +1,96 @@ +package com.baeldung.reactive.authresolver; + +import java.util.Collections; +import org.springframework.context.annotation.Bean; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.security.authentication.ReactiveAuthenticationManager; +import org.springframework.security.authentication.ReactiveAuthenticationManagerResolver; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.config.annotation.method.configuration.EnableReactiveMethodSecurity; +import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; +import org.springframework.security.config.web.server.SecurityWebFiltersOrder; +import org.springframework.security.config.web.server.ServerHttpSecurity; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.web.server.SecurityWebFilterChain; +import org.springframework.security.web.server.authentication.AuthenticationWebFilter; +import reactor.core.publisher.Mono; + +@EnableWebFluxSecurity +@EnableReactiveMethodSecurity +public class CustomWebSecurityConfig { + + @Bean + public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { + return http + .authorizeExchange() + .pathMatchers("/**") + .authenticated() + .and() + .httpBasic() + .disable() + .addFilterAfter(authenticationWebFilter(), SecurityWebFiltersOrder.REACTOR_CONTEXT) + .build(); + } + + public AuthenticationWebFilter authenticationWebFilter() { + return new AuthenticationWebFilter(resolver()); + } + + public ReactiveAuthenticationManagerResolver resolver() { + return request -> { + if (request + .getPath() + .subPath(0) + .value() + .startsWith("/employee")) { + return Mono.just(employeesAuthenticationManager()); + } + return Mono.just(customersAuthenticationManager()); + }; + } + + public ReactiveAuthenticationManager customersAuthenticationManager() { + return authentication -> customer(authentication) + .switchIfEmpty(Mono.error(new UsernameNotFoundException(authentication + .getPrincipal() + .toString()))) + .map(b -> new UsernamePasswordAuthenticationToken(authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ) + ); + } + + public ReactiveAuthenticationManager employeesAuthenticationManager() { + return authentication -> employee(authentication) + .switchIfEmpty(Mono.error(new UsernameNotFoundException(authentication + .getPrincipal() + .toString()))) + .map( + b -> new UsernamePasswordAuthenticationToken(authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ) + ); + } + + public Mono customer(Authentication authentication) { + return Mono.justOrEmpty(authentication + .getPrincipal() + .toString() + .startsWith("customer") ? authentication + .getPrincipal() + .toString() : null); + } + + public Mono employee(Authentication authentication) { + return Mono.justOrEmpty(authentication + .getPrincipal() + .toString() + .startsWith("employee") ? authentication + .getPrincipal() + .toString() : null); + } +} diff --git a/spring-5-reactive-security/src/test/java/com/baeldung/reactive/authresolver/AuthResolverIntegrationTest.java b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/authresolver/AuthResolverIntegrationTest.java new file mode 100644 index 0000000000..691243b3ea --- /dev/null +++ b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/authresolver/AuthResolverIntegrationTest.java @@ -0,0 +1,63 @@ +package com.baeldung.reactive.authresolver; + +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.MethodSorters; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.WebTestClient; +import org.springframework.util.Base64Utils; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AuthResolverApplication.class) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class AuthResolverIntegrationTest { + @Autowired + private WebTestClient testClient; + + @Test + public void givenCustomerCredential_whenWelcomeCustomer_thenExpectOk() { + testClient + .get() + .uri("/customer/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("customer1:pass1".getBytes())) + .exchange() + .expectStatus() + .isOk(); + } + + @Test + public void givenEmployeeCredential_whenWelcomeCustomer_thenExpect401Status() { + testClient + .get() + .uri("/customer/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + .exchange() + .expectStatus() + .isUnauthorized(); + } + + @Test + public void givenEmployeeCredential_whenWelcomeEmployee_thenExpectOk() { + testClient + .get() + .uri("/employee/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + .exchange() + .expectStatus() + .isOk(); + } + + @Test + public void givenCustomerCredential_whenWelcomeEmployee_thenExpect401Status() { + testClient + .get() + .uri("/employee/welcome") + .header("Authorization", "Basic " + Base64Utils.encodeToString("customer1:pass1".getBytes())) + .exchange() + .expectStatus() + .isUnauthorized(); + } +} diff --git a/spring-5-reactive/pom.xml b/spring-5-reactive/pom.xml index e6690baf54..3b7383f726 100644 --- a/spring-5-reactive/pom.xml +++ b/spring-5-reactive/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-5-reactive 0.0.1-SNAPSHOT spring-5-reactive @@ -75,7 +74,7 @@ test - + org.springframework.boot spring-boot-starter-webflux @@ -112,7 +111,6 @@ org.apache.httpcomponents httpclient - diff --git a/spring-5-security-cognito/pom.xml b/spring-5-security-cognito/pom.xml index cc6a4a56fb..8d03b91ce0 100644 --- a/spring-5-security-cognito/pom.xml +++ b/spring-5-security-cognito/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-5-security-cognito 0.0.1-SNAPSHOT spring-5-security-cognito diff --git a/spring-5-security-oauth/pom.xml b/spring-5-security-oauth/pom.xml index d9a1e3094e..40d54bf668 100644 --- a/spring-5-security-oauth/pom.xml +++ b/spring-5-security-oauth/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-5-security-oauth 0.0.1-SNAPSHOT spring-5-security-oauth @@ -16,7 +16,6 @@ - org.springframework.boot spring-boot-starter-security diff --git a/spring-5-security/pom.xml b/spring-5-security/pom.xml index 413337633f..3fd31c8bc5 100644 --- a/spring-5-security/pom.xml +++ b/spring-5-security/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"> 4.0.0 - com.baeldung spring-5-security 0.0.1-SNAPSHOT spring-5-security @@ -60,5 +60,8 @@ + + 2.2.1.RELEASE + diff --git a/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverApplication.java b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverApplication.java new file mode 100644 index 0000000000..96ee674b15 --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverApplication.java @@ -0,0 +1,11 @@ +package com.baeldung.authresolver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class AuthResolverApplication { + public static void main(String[] args) { + SpringApplication.run(AuthResolverApplication.class, args); + } +} diff --git a/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverController.java b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverController.java new file mode 100644 index 0000000000..7dc6900b5a --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/authresolver/AuthResolverController.java @@ -0,0 +1,18 @@ +package com.baeldung.authresolver; + +import org.springframework.security.core.Authentication; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class AuthResolverController { + @GetMapping("/customer/welcome") + public String sayWelcomeToCustomer(Authentication authentication) { + return String.format("Welcome to our site, %s!", authentication.getPrincipal()); + } + + @GetMapping("/employee/welcome") + public String sayWelcomeToEmployee(Authentication authentication) { + return String.format("Welcome to our company, %s!", authentication.getPrincipal()); + } +} diff --git a/spring-5-security/src/main/java/com/baeldung/authresolver/CustomWebSecurityConfigurer.java b/spring-5-security/src/main/java/com/baeldung/authresolver/CustomWebSecurityConfigurer.java new file mode 100644 index 0000000000..33ef692173 --- /dev/null +++ b/spring-5-security/src/main/java/com/baeldung/authresolver/CustomWebSecurityConfigurer.java @@ -0,0 +1,96 @@ +package com.baeldung.authresolver; + +import java.util.Collections; +import javax.servlet.http.HttpServletRequest; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.AuthenticationManagerResolver; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.web.authentication.AuthenticationConverter; +import org.springframework.security.web.authentication.AuthenticationFilter; +import org.springframework.security.web.authentication.www.BasicAuthenticationConverter; +import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; + +@Configuration +public class CustomWebSecurityConfigurer extends WebSecurityConfigurerAdapter { + + public AuthenticationConverter authenticationConverter() { + return new BasicAuthenticationConverter(); + } + + public AuthenticationManagerResolver resolver() { + return request -> { + if (request + .getPathInfo() + .startsWith("/employee")) { + return employeesAuthenticationManager(); + } + return customersAuthenticationManager(); + }; + } + + public AuthenticationManager customersAuthenticationManager() { + return authentication -> { + if (isCustomer(authentication)) { + return new UsernamePasswordAuthenticationToken( + authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ); + } + throw new UsernameNotFoundException(authentication + .getPrincipal() + .toString()); + }; + } + + private boolean isCustomer(Authentication authentication) { + return (authentication + .getPrincipal() + .toString() + .startsWith("customer")); + } + + private boolean isEmployee(Authentication authentication) { + return (authentication + .getPrincipal() + .toString() + .startsWith("employee")); + } + + private AuthenticationFilter authenticationFilter() { + AuthenticationFilter filter = new AuthenticationFilter( + resolver(), authenticationConverter()); + filter.setSuccessHandler((request, response, auth) -> {}); + return filter; + } + + private AuthenticationManager employeesAuthenticationManager() { + return authentication -> { + if (isEmployee(authentication)) { + return new UsernamePasswordAuthenticationToken( + authentication.getPrincipal(), + authentication.getCredentials(), + Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER")) + ); + } + throw new UsernameNotFoundException(authentication + .getPrincipal() + .toString()); + }; + } + + @Override + protected void configure(HttpSecurity http) { + http.addFilterBefore( + authenticationFilter(), + BasicAuthenticationFilter.class + ); + } + +} diff --git a/spring-5-security/src/test/java/com/baeldung/authresolver/AuthResolverIntegrationTest.java b/spring-5-security/src/test/java/com/baeldung/authresolver/AuthResolverIntegrationTest.java new file mode 100644 index 0000000000..c87f8c1a3a --- /dev/null +++ b/spring-5-security/src/test/java/com/baeldung/authresolver/AuthResolverIntegrationTest.java @@ -0,0 +1,82 @@ +package com.baeldung.authresolver; + +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.MethodSorters; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.security.web.FilterChainProxy; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.util.Base64Utils; +import org.springframework.web.context.WebApplicationContext; + +import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = AuthResolverApplication.class) +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class AuthResolverIntegrationTest { + + @Autowired + private FilterChainProxy springSecurityFilterChain; + + @Autowired + private WebApplicationContext wac; + + private MockMvc mockMvc; + + @Before + public void setup() { + this.mockMvc = MockMvcBuilders + .webAppContextSetup(wac) + .apply(springSecurity(springSecurityFilterChain)) + .build(); + } + + @Test + public void givenCustomerCredential_whenWelcomeCustomer_thenExpectOk() throws Exception { + this.mockMvc + .perform(get("/customer/welcome") + .header( + "Authorization", String.format("Basic %s", Base64Utils.encodeToString("customer1:pass1".getBytes())) + ) + ) + .andExpect(status().is2xxSuccessful()); + } + + @Test + public void givenEmployeeCredential_whenWelcomeCustomer_thenExpect401Status() throws Exception { + this.mockMvc + .perform(get("/customer/welcome") + .header( + "Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + ) + .andExpect(status().isUnauthorized()); + } + + @Test + public void givenEmployeeCredential_whenWelcomeEmployee_thenExpectOk() throws Exception { + this.mockMvc + .perform(get("/employee/welcome") + .header( + "Authorization", "Basic " + Base64Utils.encodeToString("employee1:pass1".getBytes())) + ) + .andExpect(status().is2xxSuccessful()); + } + + @Test + public void givenCustomerCredential_whenWelcomeEmployee_thenExpect401Status() throws Exception { + this.mockMvc + .perform(get("/employee/welcome") + .header( + "Authorization", "Basic " + Base64Utils.encodeToString("customer1:pass1".getBytes())) + ) + .andExpect(status().isUnauthorized()); + } +} diff --git a/spring-5-webflux/pom.xml b/spring-5-webflux/pom.xml index 91272593d3..84ee3e332c 100644 --- a/spring-5-webflux/pom.xml +++ b/spring-5-webflux/pom.xml @@ -1,9 +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-5-webflux 1.0-SNAPSHOT spring-5-webflux diff --git a/spring-5/pom.xml b/spring-5/pom.xml index 6e4162fbcc..eadfb5e512 100644 --- a/spring-5/pom.xml +++ b/spring-5/pom.xml @@ -1,9 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-5 0.0.1-SNAPSHOT spring-5 @@ -147,7 +146,6 @@ - diff --git a/spring-activiti/pom.xml b/spring-activiti/pom.xml index e0196e807d..eef4d37ff8 100644 --- a/spring-activiti/pom.xml +++ b/spring-activiti/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-activiti spring-activiti @@ -8,8 +8,8 @@ Demo project for Spring Boot - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 @@ -41,7 +41,7 @@ test - + diff --git a/spring-akka/pom.xml b/spring-akka/pom.xml index d8b943b5ae..23535a8ccc 100644 --- a/spring-akka/pom.xml +++ b/spring-akka/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"> 4.0.0 - com.baeldung spring-akka 0.1-SNAPSHOT spring-akka diff --git a/spring-all/README.md b/spring-all/README.md index 2b9f61c76d..d71b8569cf 100644 --- a/spring-all/README.md +++ b/spring-all/README.md @@ -1,3 +1,7 @@ +## Spring All + +This module contains articles about Spring + ### Relevant Articles: - [The @Scheduled Annotation in Spring](https://www.baeldung.com/spring-scheduled-tasks) diff --git a/spring-amqp/pom.xml b/spring-amqp/pom.xml index 3e6789dcb6..f32db5b8b4 100755 --- a/spring-amqp/pom.xml +++ b/spring-amqp/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 - com.baeldung spring-amqp 1.0.0-SNAPSHOT spring-amqp Introduction to Spring-AMQP - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-aop/pom.xml b/spring-aop/pom.xml index a1e2ffd534..69de2d66fd 100644 --- a/spring-aop/pom.xml +++ b/spring-aop/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -6,8 +7,8 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-apache-camel/pom.xml b/spring-apache-camel/pom.xml index 3e76c0c7f1..2d0d632546 100644 --- a/spring-apache-camel/pom.xml +++ b/spring-apache-camel/pom.xml @@ -1,5 +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.apache.camel spring-apache-camel @@ -48,7 +49,6 @@ - 2.18.1 4.3.4.RELEASE diff --git a/spring-batch/pom.xml b/spring-batch/pom.xml index e6d7cee6f2..9edf8ad3be 100644 --- a/spring-batch/pom.xml +++ b/spring-batch/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-batch 0.1-SNAPSHOT spring-batch @@ -16,7 +16,6 @@ - diff --git a/spring-bom/pom.xml b/spring-bom/pom.xml index f974eb2334..e82c650fa9 100644 --- a/spring-bom/pom.xml +++ b/spring-bom/pom.xml @@ -1,8 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung spring-bom 1.0.0-SNAPSHOT spring-bom diff --git a/spring-boot-admin/pom.xml b/spring-boot-admin/pom.xml index c553790359..ab2b92102c 100644 --- a/spring-boot-admin/pom.xml +++ b/spring-boot-admin/pom.xml @@ -1,9 +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-boot-admin 0.0.1-SNAPSHOT - spring-boot-admin + spring-boot-admin pom diff --git a/spring-boot-admin/spring-boot-admin-client/pom.xml b/spring-boot-admin/spring-boot-admin-client/pom.xml index aa2daf8d45..47abfdddc2 100644 --- a/spring-boot-admin/spring-boot-admin-client/pom.xml +++ b/spring-boot-admin/spring-boot-admin-client/pom.xml @@ -1,16 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-admin-client 0.0.1-SNAPSHOT spring-boot-admin-client - Spring Boot Admin Client jar + Spring Boot Admin Client - spring-boot-admin com.baeldung + spring-boot-admin 0.0.1-SNAPSHOT ../../spring-boot-admin diff --git a/spring-boot-admin/spring-boot-admin-server/pom.xml b/spring-boot-admin/spring-boot-admin-server/pom.xml index 5ef99976c8..d0d2d7a1ef 100644 --- a/spring-boot-admin/spring-boot-admin-server/pom.xml +++ b/spring-boot-admin/spring-boot-admin-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 spring-boot-admin-server 0.0.1-SNAPSHOT @@ -9,8 +9,8 @@ jar - spring-boot-admin com.baeldung + spring-boot-admin 0.0.1-SNAPSHOT ../../spring-boot-admin @@ -51,12 +51,12 @@ ${spring-boot-admin-starter-client.version} - + org.springframework.boot spring-boot-starter-mail - + org.springframework.boot spring-boot-starter-test @@ -67,7 +67,6 @@ spring-security-test test - diff --git a/spring-boot-angular/pom.xml b/spring-boot-angular/pom.xml index 8c26668752..d78761e921 100644 --- a/spring-boot-angular/pom.xml +++ b/spring-boot-angular/pom.xml @@ -1,18 +1,18 @@ - + 4.0.0 com.baeldung.springbootangular spring-boot-angular - spring-boot-angular 1.0 + spring-boot-angular jar - + com.baeldung parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 @@ -45,4 +45,5 @@ + diff --git a/spring-boot-artifacts/pom.xml b/spring-boot-artifacts/pom.xml index 8301533606..97d3c53b49 100644 --- a/spring-boot-artifacts/pom.xml +++ b/spring-boot-artifacts/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-boot-artifacts spring-boot-artifacts @@ -8,8 +8,8 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -90,7 +90,7 @@ spring-cloud-context ${springcloud.version} - + org.apache.httpcomponents httpclient @@ -132,9 +132,9 @@ - - **/ExternalPropertyFileLoaderIntegrationTest.java - + + **/ExternalPropertyFileLoaderIntegrationTest.java + @@ -178,7 +178,7 @@ - + org.baeldung.boot.Application diff --git a/spring-boot-autoconfiguration/pom.xml b/spring-boot-autoconfiguration/pom.xml index 5b3b0eb86c..a39bf0f071 100644 --- a/spring-boot-autoconfiguration/pom.xml +++ b/spring-boot-autoconfiguration/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-boot-autoconfiguration 0.0.1-SNAPSHOT spring-boot-autoconfiguration @@ -9,8 +9,8 @@ This is simple boot application demonstrating a custom auto-configuration - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-boot-bootstrap/pom.xml b/spring-boot-bootstrap/pom.xml index 70ebb225c8..a81908d8b6 100644 --- a/spring-boot-bootstrap/pom.xml +++ b/spring-boot-bootstrap/pom.xml @@ -1,336 +1,335 @@ - 4.0.0 - com.baeldung - spring-boot-bootstrap - spring-boot-bootstrap - Demo project for Spring Boot - jar - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-data-jpa - - - com.h2database - h2 - - - mysql - mysql-connector-java - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-test - test - - - io.rest-assured - rest-assured - ${rest-assured.version} - test - - - javax.servlet - javax.servlet-api - ${servlet.version} - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-boot-bootstrap + spring-boot-bootstrap + jar + Demo project for Spring Boot + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + + + mysql + mysql-connector-java + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-test + test + + + io.rest-assured + rest-assured + ${rest-assured.version} + test + + + javax.servlet + javax.servlet-api + ${servlet.version} + + + + + + beanstalk + + ${project.name}-eb + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/cloud/config/*.java + + + + + + + + openshift + + 0.3.0.RELEASE + Greenwich.RELEASE + 3.5.37 + + + + + org.springframework.cloud + spring-cloud-kubernetes-dependencies + ${spring-cloud-k8s.version} + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + org.springframework.cloud + spring-cloud-starter-kubernetes-config + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-actuator + + + + + + src/main/resources + + **/logback.xml + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/cloud/config/*.java + + + + + org.springframework.boot + spring-boot-maven-plugin + + + io.fabric8 + fabric8-maven-plugin + ${fabric8.maven.plugin.version} + + + fmp + + resource + build + + + + + + + + + cloud-gcp + + + + org.springframework.cloud + spring-cloud-dependencies + Greenwich.RELEASE + pom + import + + + + + + org.springframework.cloud + spring-cloud-gcp-starter + 1.0.0.RELEASE + + + org.springframework.cloud + spring-cloud-gcp-starter-sql-mysql + 1.0.0.RELEASE + + + + ${project.name}-gcp + + + src/main/resources + + **/logback.xml + + + + + + com.google.cloud.tools + appengine-maven-plugin + 1.3.2 + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + cloudfoundry + + + + org.springframework.cloud + spring-cloud-dependencies + Greenwich.RELEASE + pom + import + + + + + + org.springframework.cloud + spring-cloud-starter + + + org.springframework.boot + spring-boot-starter-cloud-connectors + + + + ${project.name}-cf + + + src/main/resources + + **/logback.xml + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/cloud/config/*.java + + + + + + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + thin-jar + + + + org.springframework.boot.experimental + spring-boot-thin-maven-plugin + ${thin.version} + + + + resolve + + resolve + + false + + + + + + + - - - beanstalk - - ${project.name}-eb - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - - - **/cloud/config/*.java - - - - - - - - openshift - - 0.3.0.RELEASE - Greenwich.RELEASE - 3.5.37 - - - - - org.springframework.cloud - spring-cloud-kubernetes-dependencies - ${spring-cloud-k8s.version} - pom - import - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - - org.springframework.cloud - spring-cloud-starter-kubernetes-config - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-actuator - - - - - - src/main/resources - - **/logback.xml - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - **/cloud/config/*.java - - - - - org.springframework.boot - spring-boot-maven-plugin - - - io.fabric8 - fabric8-maven-plugin - ${fabric8.maven.plugin.version} - - - fmp - - resource - build - - - - - - - - - cloud-gcp - - - - org.springframework.cloud - spring-cloud-dependencies - Greenwich.RELEASE - pom - import - - - - - - org.springframework.cloud - spring-cloud-gcp-starter - 1.0.0.RELEASE - - - org.springframework.cloud - spring-cloud-gcp-starter-sql-mysql - 1.0.0.RELEASE - - - - ${project.name}-gcp - - - src/main/resources - - **/logback.xml - - - - - - com.google.cloud.tools - appengine-maven-plugin - 1.3.2 - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - cloudfoundry - - - - org.springframework.cloud - spring-cloud-dependencies - Greenwich.RELEASE - pom - import - - - - - - org.springframework.cloud - spring-cloud-starter - - - org.springframework.boot - spring-boot-starter-cloud-connectors - - - - ${project.name}-cf - - - src/main/resources - - **/logback.xml - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-compiler-plugin - - - **/cloud/config/*.java - - - - - - - - autoconfiguration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*IntTest.java - - - **/AutoconfigurationTest.java - - - - - - - json - - - - - - - - thin-jar - - - - org.springframework.boot.experimental - spring-boot-thin-maven-plugin - ${thin.version} - - - - resolve - - resolve - - false - - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - **/cloud/config/*.java - - - - - - + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/cloud/config/*.java + + + + + + - 4.0.0 - + 4.0.0 + diff --git a/spring-boot-client/pom.xml b/spring-boot-client/pom.xml index 4850849039..2cfd413e93 100644 --- a/spring-boot-client/pom.xml +++ b/spring-boot-client/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-boot-client 0.0.1-SNAPSHOT spring-boot-client @@ -9,8 +9,8 @@ This is simple boot client application for Spring boot actuator test - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-boot-config-jpa-error/data-jpa-application/README.md b/spring-boot-config-jpa-error/data-jpa-application/README.md new file mode 100644 index 0000000000..443ec07183 --- /dev/null +++ b/spring-boot-config-jpa-error/data-jpa-application/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Unable to Find @SpringBootConfiguration with @DataJpaTest](https://www.baeldung.com/spring-boot-unable-to-find-springbootconfiguration-with-datajpatest) diff --git a/spring-boot-config-jpa-error/data-jpa-application/pom.xml b/spring-boot-config-jpa-error/data-jpa-application/pom.xml index 2952ff4c4c..9a311adfec 100644 --- a/spring-boot-config-jpa-error/data-jpa-application/pom.xml +++ b/spring-boot-config-jpa-error/data-jpa-application/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -9,4 +10,5 @@ spring-boot-config-jpa-error 0.0.1-SNAPSHOT + \ No newline at end of file diff --git a/spring-boot-config-jpa-error/data-jpa-library/README.md b/spring-boot-config-jpa-error/data-jpa-library/README.md new file mode 100644 index 0000000000..4e852f8a90 --- /dev/null +++ b/spring-boot-config-jpa-error/data-jpa-library/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Unable to Find @SpringBootConfiguration with @DataJpaTest](https://www.baeldung.com/spring-boot-unable-to-find-springbootconfiguration-with-datajpatest) diff --git a/spring-boot-config-jpa-error/data-jpa-library/pom.xml b/spring-boot-config-jpa-error/data-jpa-library/pom.xml index f8b876b65b..2da9e5aa2c 100644 --- a/spring-boot-config-jpa-error/data-jpa-library/pom.xml +++ b/spring-boot-config-jpa-error/data-jpa-library/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -9,4 +10,5 @@ spring-boot-config-jpa-error 0.0.1-SNAPSHOT + \ No newline at end of file diff --git a/spring-boot-config-jpa-error/pom.xml b/spring-boot-config-jpa-error/pom.xml index 12087aa610..4b99f9be93 100644 --- a/spring-boot-config-jpa-error/pom.xml +++ b/spring-boot-config-jpa-error/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -58,4 +59,5 @@ + \ No newline at end of file diff --git a/spring-boot-crud/pom.xml b/spring-boot-crud/pom.xml index 1d956bdba6..e78e939f0c 100644 --- a/spring-boot-crud/pom.xml +++ b/spring-boot-crud/pom.xml @@ -4,15 +4,15 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 spring-boot-crud - spring-boot-crud - + spring-boot-crud + - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 - + org.springframework.boot @@ -39,9 +39,9 @@ com.h2database h2 runtime - + - + spring-boot-crud @@ -54,11 +54,11 @@ org.springframework.boot spring-boot-maven-plugin - - exec - + + exec + - + org.apache.maven.plugins maven-assembly-plugin @@ -75,12 +75,12 @@ - + - + UTF-8 - + diff --git a/spring-boot-ctx-fluent/pom.xml b/spring-boot-ctx-fluent/pom.xml index b238374612..782e1fd7f6 100644 --- a/spring-boot-ctx-fluent/pom.xml +++ b/spring-boot-ctx-fluent/pom.xml @@ -1,15 +1,15 @@ + 4.0.0 - com.baeldung spring-boot-ctx-fluent 0.0.1-SNAPSHOT spring-boot-ctx-fluent jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-boot-custom-starter/greeter-library/pom.xml b/spring-boot-custom-starter/greeter-library/pom.xml index 7e0c5c4d22..da30f2e4be 100644 --- a/spring-boot-custom-starter/greeter-library/pom.xml +++ b/spring-boot-custom-starter/greeter-library/pom.xml @@ -1,15 +1,16 @@ + 4.0.0 - com.baeldung greeter-library 0.0.1-SNAPSHOT greeter-library - spring-boot-custom-starter com.baeldung + spring-boot-custom-starter 0.0.1-SNAPSHOT ../../spring-boot-custom-starter + \ No newline at end of file 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 4fe92e8e45..58dd683131 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml @@ -1,14 +1,14 @@ + 4.0.0 - com.baeldung greeter-spring-boot-autoconfigure 0.0.1-SNAPSHOT greeter-spring-boot-autoconfigure - spring-boot-custom-starter com.baeldung + spring-boot-custom-starter 0.0.1-SNAPSHOT ../../spring-boot-custom-starter @@ -39,7 +39,7 @@ ${greeter.version} true - + org.springframework.boot spring-boot-starter-test 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 1528853b0c..bb1e656963 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,14 +1,14 @@ + 4.0.0 - com.baeldung greeter-spring-boot-sample-app 0.0.1-SNAPSHOT greeter-spring-boot-sample-app - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml index 560d6fa79b..d298756b8e 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml @@ -1,14 +1,14 @@ + 4.0.0 - com.baeldung greeter-spring-boot-starter 0.0.1-SNAPSHOT greeter-spring-boot-starter - spring-boot-custom-starter com.baeldung + spring-boot-custom-starter 0.0.1-SNAPSHOT ../../spring-boot-custom-starter diff --git a/spring-boot-custom-starter/greeter/pom.xml b/spring-boot-custom-starter/greeter/pom.xml index 95fcaa66c8..3117cfa355 100644 --- a/spring-boot-custom-starter/greeter/pom.xml +++ b/spring-boot-custom-starter/greeter/pom.xml @@ -1,15 +1,16 @@ + 4.0.0 - com.baeldung greeter 0.0.1-SNAPSHOT greeter - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 + \ No newline at end of file diff --git a/spring-boot-custom-starter/pom.xml b/spring-boot-custom-starter/pom.xml index 9c03cfdd0e..96c0d0a585 100644 --- a/spring-boot-custom-starter/pom.xml +++ b/spring-boot-custom-starter/pom.xml @@ -1,10 +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-boot-custom-starter 0.0.1-SNAPSHOT - spring-boot-custom-starter + spring-boot-custom-starter pom @@ -19,6 +19,5 @@ greeter-spring-boot-starter greeter-spring-boot-sample-app - \ No newline at end of file diff --git a/spring-boot-data/pom.xml b/spring-boot-data/pom.xml index 4c41eb8e3c..663ee640f3 100644 --- a/spring-boot-data/pom.xml +++ b/spring-boot-data/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-data - war spring-boot-data + war Spring Boot Data Module - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -54,7 +54,7 @@ - spring-boot + spring-boot-data src/main/resources @@ -169,4 +169,5 @@ 5.6.3 2.2.4 + diff --git a/spring-boot-deployment/pom.xml b/spring-boot-deployment/pom.xml index 69a54fd482..6f724f312b 100644 --- a/spring-boot-deployment/pom.xml +++ b/spring-boot-deployment/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-boot-deployment spring-boot-deployment @@ -8,8 +8,8 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -90,7 +90,7 @@ spring-cloud-context ${springcloud.version} - + org.apache.httpcomponents httpclient @@ -141,9 +141,9 @@ - - **/ExternalPropertyFileLoaderIntegrationTest.java - + + **/ExternalPropertyFileLoaderIntegrationTest.java + @@ -187,7 +187,7 @@ - + org.baeldung.boot.Application diff --git a/spring-boot-di/pom.xml b/spring-boot-di/pom.xml index 31ccff03da..61059630c4 100644 --- a/spring-boot-di/pom.xml +++ b/spring-boot-di/pom.xml @@ -1,64 +1,64 @@ - 4.0.0 - spring-boot-di - spring-boot-di - jar - Module For Spring Boot DI + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-boot-di + spring-boot-di + jar + Module For Spring Boot DI - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + - - - org.aspectj - aspectjweaver - + + + org.aspectj + aspectjweaver + - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - provided - + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + provided + - - org.apache.tomcat.embed - tomcat-embed-jasper - provided - - + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + org.springframework.boot spring-boot-starter-test test - + - - - - org.springframework.boot - spring-boot-maven-plugin - - com.baeldung.SpringBootDiApplication - JAR - - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + com.baeldung.SpringBootDiApplication + JAR + + + + - - com.baeldung.SpringBootDiApplication - + + com.baeldung.SpringBootDiApplication + diff --git a/spring-boot-environment/pom.xml b/spring-boot-environment/pom.xml index 4e4a363fee..531ef697d7 100644 --- a/spring-boot-environment/pom.xml +++ b/spring-boot-environment/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-boot-environment spring-boot-environment @@ -8,8 +8,8 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -78,7 +78,7 @@ spring-cloud-context ${springcloud.version} - + org.apache.httpcomponents httpclient @@ -136,7 +136,7 @@ - + 2.2 18.0 diff --git a/spring-boot-flowable/pom.xml b/spring-boot-flowable/pom.xml index f7fc943389..96558b8595 100644 --- a/spring-boot-flowable/pom.xml +++ b/spring-boot-flowable/pom.xml @@ -1,62 +1,62 @@ - 4.0.0 - spring-boot-flowable - war - spring-boot-flowable - Spring Boot Flowable Module - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - org.springframework.boot - spring-boot-starter-web - - - com.h2database - h2 - runtime - - - org.flowable - flowable-spring-boot-starter-rest - ${flowable.version} - - - org.flowable - flowable-spring-boot-starter-actuator - ${flowable.version} - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.jupiter - junit-jupiter-engine - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - 6.4.1 - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-boot-flowable + spring-boot-flowable + war + Spring Boot Flowable Module + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-web + + + com.h2database + h2 + runtime + + + org.flowable + flowable-spring-boot-starter-rest + ${flowable.version} + + + org.flowable + flowable-spring-boot-starter-actuator + ${flowable.version} + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + 6.4.1 + \ No newline at end of file diff --git a/spring-boot-jasypt/pom.xml b/spring-boot-jasypt/pom.xml index ae0483f107..76a501c455 100644 --- a/spring-boot-jasypt/pom.xml +++ b/spring-boot-jasypt/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.example.jasypt spring-boot-jasypt @@ -9,8 +9,8 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-boot-keycloak/pom.xml b/spring-boot-keycloak/pom.xml index b13805b4bf..609b4d1dec 100644 --- a/spring-boot-keycloak/pom.xml +++ b/spring-boot-keycloak/pom.xml @@ -1,13 +1,13 @@ + 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 spring-boot-keycloak - This is a simple application demonstrating integration between Keycloak and Spring Boot. jar + This is a simple application demonstrating integration between Keycloak and Spring Boot. com.baeldung @@ -16,6 +16,18 @@ ../parent-boot-1 + + + + org.keycloak.bom + keycloak-adapter-bom + ${keycloak-adapter-bom.version} + pom + import + + + + org.springframework.boot @@ -53,17 +65,6 @@ spring-boot-starter-thymeleaf - - - - org.keycloak.bom - keycloak-adapter-bom - ${keycloak-adapter-bom.version} - pom - import - - - diff --git a/spring-boot-kotlin/pom.xml b/spring-boot-kotlin/pom.xml index ccb1585a75..a98d76a398 100644 --- a/spring-boot-kotlin/pom.xml +++ b/spring-boot-kotlin/pom.xml @@ -8,8 +8,8 @@ Demo project showing how to use non-blocking in Kotlin with Spring Boot - parent-kotlin com.baeldung + parent-kotlin 1.0.0-SNAPSHOT ../parent-kotlin diff --git a/spring-boot-libraries/pom.xml b/spring-boot-libraries/pom.xml index b448d6fd66..d9c9073542 100644 --- a/spring-boot-libraries/pom.xml +++ b/spring-boot-libraries/pom.xml @@ -1,157 +1,158 @@ + - 4.0.0 - spring-boot-libraries - spring-boot-libraries - war - This is simple boot application for Spring boot actuator test + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-boot-libraries + spring-boot-libraries + war + This is simple boot application for Spring boot actuator test - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-security - - - org.springframework.boot - spring-boot-starter-tomcat - - - org.springframework.boot - spring-boot-starter-test - test - - - - - org.zalando - problem-spring-web - ${problem-spring-web.version} - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-tomcat + + + org.springframework.boot + spring-boot-starter-test + test + - - - net.javacrumbs.shedlock - shedlock-spring - ${shedlock.version} - - - net.javacrumbs.shedlock - shedlock-provider-jdbc-template - ${shedlock.version} - + + + org.zalando + problem-spring-web + ${problem-spring-web.version} + - + + + net.javacrumbs.shedlock + shedlock-spring + ${shedlock.version} + + + net.javacrumbs.shedlock + shedlock-provider-jdbc-template + ${shedlock.version} + - - spring-boot - - - src/main/resources - true - - + - + + spring-boot-libraries + + + src/main/resources + true + + - - org.apache.maven.plugins - maven-war-plugin - + - - pl.project13.maven - git-commit-id-plugin - ${git-commit-id-plugin.version} - - - get-the-git-infos - - revision - - initialize - - - validate-the-git-infos - - validateRevision - - package - - - - true - ${project.build.outputDirectory}/git.properties - - + + org.apache.maven.plugins + maven-war-plugin + - + + pl.project13.maven + git-commit-id-plugin + ${git-commit-id-plugin.version} + + + get-the-git-infos + + revision + + initialize + + + validate-the-git-infos + + validateRevision + + package + + + + true + ${project.build.outputDirectory}/git.properties + + - + - - - autoconfiguration - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration-test - - test - - - - **/*LiveTest.java - **/*IntegrationTest.java - **/*IntTest.java - - - **/AutoconfigurationTest.java - - - - - - - json - - - - - - - + - - - com.baeldung.intro.App - 8.5.11 - 2.4.1.Final - 1.9.0 - 2.0.0 - 5.0.2 - 5.0.2 - 5.2.4 - 18.0 - 2.2.4 - 2.3.2 - 0.23.0 - 2.1.0 - + + + autoconfiguration + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + + test + + + + **/*LiveTest.java + **/*IntegrationTest.java + **/*IntTest.java + + + **/AutoconfigurationTest.java + + + + + + + json + + + + + + + + + + + com.baeldung.intro.App + 8.5.11 + 2.4.1.Final + 1.9.0 + 2.0.0 + 5.0.2 + 5.0.2 + 5.2.4 + 18.0 + 2.2.4 + 2.3.2 + 0.23.0 + 2.1.0 + diff --git a/spring-boot-logging-log4j2/pom.xml b/spring-boot-logging-log4j2/pom.xml index 0bc8c2dd08..a7065bc925 100644 --- a/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-logging-log4j2/pom.xml @@ -1,17 +1,17 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-logging-log4j2 - spring-boot-logging-log4j2 + spring-boot-logging-log4j2 jar Demo project for Spring Boot Logging with Log4J2 - - + + - spring-boot-starter-parent org.springframework.boot + spring-boot-starter-parent 2.2.1.RELEASE @@ -35,12 +35,12 @@ spring-boot-starter-log4j2 - org.projectlombok - lombok - ${lombok.version} - provided - - + org.projectlombok + lombok + ${lombok.version} + provided + + @@ -55,30 +55,31 @@ compile - + - - - org.apache.maven.plugins - maven-surefire-plugin - - 3 - true - - **/*IntegrationTest.java - **/*IntTest.java - **/*ManualTest.java - **/*LiveTest.java - - - - + + + org.apache.maven.plugins + maven-surefire-plugin + + 3 + true + + **/*IntegrationTest.java + **/*IntTest.java + **/*ManualTest.java + **/*LiveTest.java + + + + - + com.baeldung.springbootlogging.SpringBootLoggingApplication - 1.3.8.RELEASE - 1.1.16 - 1.18.4 + 1.3.8.RELEASE + 1.1.16 + 1.18.4 + diff --git a/spring-boot-mvc-2/pom.xml b/spring-boot-mvc-2/pom.xml index 18121325a5..e6538c4418 100644 --- a/spring-boot-mvc-2/pom.xml +++ b/spring-boot-mvc-2/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-mvc-2 spring-boot-mvc-2 @@ -12,7 +12,7 @@ org.springframework.boot spring-boot-starter-parent 2.2.0.BUILD-SNAPSHOT - + @@ -50,6 +50,7 @@ https://repo.spring.io/milestone + spring-snapshots @@ -65,4 +66,5 @@ https://repo.spring.io/milestone + \ No newline at end of file diff --git a/spring-boot-mvc-birt/pom.xml b/spring-boot-mvc-birt/pom.xml index 3532b20c15..76760e661b 100644 --- a/spring-boot-mvc-birt/pom.xml +++ b/spring-boot-mvc-birt/pom.xml @@ -1,18 +1,17 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-boot-mvc-birt - spring-boot-mvc-birt 0.0.1-SNAPSHOT + spring-boot-mvc-birt jar Module For Spring Boot Integration with BIRT - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-boot-mvc/pom.xml b/spring-boot-mvc/pom.xml index a414ed7bb2..1c79a423bf 100644 --- a/spring-boot-mvc/pom.xml +++ b/spring-boot-mvc/pom.xml @@ -9,11 +9,20 @@ Module For Spring Boot MVC - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 + + + + + jcenter-snapshots + jcenter + http://oss.jfrog.org/artifactory/oss-snapshot-local/ + + @@ -34,7 +43,14 @@ org.springframework.boot spring-boot-starter-thymeleaf - + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + @@ -82,6 +98,18 @@ springfox-swagger-ui ${spring.fox.version} + + + io.springfox + springfox-data-rest + ${spring.fox.version} + + + + io.springfox + springfox-bean-validators + ${spring.fox.version} + org.apache.tomcat.embed @@ -117,7 +145,7 @@ - 2.9.2 + 3.0.0-SNAPSHOT 1.10.0 2.3.7 diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java index 68e2c55deb..434a8d77cb 100644 --- a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java +++ b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/configuration/SpringFoxConfig.java @@ -1,22 +1,29 @@ package com.baeldung.swagger2boot.configuration; +import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +import com.baeldung.swagger2boot.plugin.EmailAnnotationPlugin; + +import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration; import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.data.rest.configuration.SpringDataRestConfiguration; import springfox.documentation.spring.web.plugins.Docket; import springfox.documentation.swagger.web.*; -import springfox.documentation.swagger2.annotations.EnableSwagger2; +import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; import java.util.Collections; @Configuration -@EnableSwagger2 -@ComponentScan("com.baeldung.swaggerboot.controller") +@EnableSwagger2WebMvc +@Import({SpringDataRestConfiguration.class, BeanValidatorPluginsConfiguration.class}) public class SpringFoxConfig { private ApiInfo apiInfo() { @@ -65,4 +72,8 @@ public class SpringFoxConfig { .build(); } + @Bean + public EmailAnnotationPlugin emailPlugin() { + return new EmailAnnotationPlugin(); + } } diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/model/User.java b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/model/User.java new file mode 100644 index 0000000000..b724031536 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/model/User.java @@ -0,0 +1,58 @@ +package com.baeldung.swagger2boot.model; + +import javax.persistence.Id; +import javax.validation.constraints.Email; +import javax.validation.constraints.Max; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotNull; +import javax.persistence.Entity; + +@Entity +public class User { + + @Id + private Long id; + + @NotNull(message = "First Name cannot be null") + private String firstName; + + @Min(value = 15, message = "Age should not be less than 15") + @Max(value = 65, message = "Age should not be greater than 65") + private int age; + + @Email(regexp=".@.\\..*", message = "Email should be valid") + private String email; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + +} diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/plugin/EmailAnnotationPlugin.java b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/plugin/EmailAnnotationPlugin.java new file mode 100644 index 0000000000..22ca144fb4 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/plugin/EmailAnnotationPlugin.java @@ -0,0 +1,39 @@ +package com.baeldung.swagger2boot.plugin; + +import static springfox.bean.validators.plugins.Validators.annotationFromBean; + +import java.util.Optional; + +import javax.validation.constraints.Email; + +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; + +import springfox.bean.validators.plugins.Validators; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spi.schema.ModelPropertyBuilderPlugin; +import springfox.documentation.spi.schema.contexts.ModelPropertyContext; + +@Component +@Order(Validators.BEAN_VALIDATOR_PLUGIN_ORDER) +public class EmailAnnotationPlugin implements ModelPropertyBuilderPlugin { + + @Override + public boolean supports(DocumentationType delimiter) { + return true; + } + + /** + * read Email annotation + */ + @Override + public void apply(ModelPropertyContext context) { + Optional email = annotationFromBean(context, Email.class); + if (email.isPresent()) { + context.getBuilder().pattern(email.get().regexp()); + context.getBuilder().example("email@email.com"); + } + } + +} + diff --git a/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/repository/UserRepository.java b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/repository/UserRepository.java new file mode 100644 index 0000000000..0cbffa06d4 --- /dev/null +++ b/spring-boot-mvc/src/main/java/com/baeldung/swagger2boot/repository/UserRepository.java @@ -0,0 +1,11 @@ +package com.baeldung.swagger2boot.repository; + +import org.springframework.data.repository.CrudRepository; +import org.springframework.stereotype.Repository; + +import com.baeldung.swagger2boot.model.User; + +@Repository +public interface UserRepository extends CrudRepository { + +} diff --git a/spring-boot-nashorn/pom.xml b/spring-boot-nashorn/pom.xml index 0f43752993..af11f14fdc 100644 --- a/spring-boot-nashorn/pom.xml +++ b/spring-boot-nashorn/pom.xml @@ -1,17 +1,17 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.nashorn spring-boot-nashorn - spring-boot-nashorn 1.0 + spring-boot-nashorn jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -48,4 +48,5 @@ + \ No newline at end of file diff --git a/spring-boot-parent/pom.xml b/spring-boot-parent/pom.xml index 0924917505..7ce5bdc428 100644 --- a/spring-boot-parent/pom.xml +++ b/spring-boot-parent/pom.xml @@ -1,15 +1,13 @@ - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-boot-parent 1.0.0-SNAPSHOT spring-boot-parent - spring-boot-parent pom + spring-boot-parent com.baeldung diff --git a/spring-boot-parent/spring-boot-with-custom-parent/pom.xml b/spring-boot-parent/spring-boot-with-custom-parent/pom.xml index a64ebc246a..8a55f252d6 100644 --- a/spring-boot-parent/spring-boot-with-custom-parent/pom.xml +++ b/spring-boot-parent/spring-boot-with-custom-parent/pom.xml @@ -1,8 +1,7 @@ - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-with-custom-parent 1.0.0-SNAPSHOT diff --git a/spring-boot-parent/spring-boot-with-starter-parent/pom.xml b/spring-boot-parent/spring-boot-with-starter-parent/pom.xml index 1c6479ca60..9ea26e49fe 100644 --- a/spring-boot-parent/spring-boot-with-starter-parent/pom.xml +++ b/spring-boot-parent/spring-boot-with-starter-parent/pom.xml @@ -1,8 +1,7 @@ - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung spring-boot-with-starter-parent diff --git a/spring-boot-performance/pom.xml b/spring-boot-performance/pom.xml index a4efa4a8d7..7bf3885618 100644 --- a/spring-boot-performance/pom.xml +++ b/spring-boot-performance/pom.xml @@ -8,8 +8,8 @@ This is a simple Spring Boot application taking advantage of the latest Spring Boot improvements/features. Current version: 2.2 - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-boot-properties/pom.xml b/spring-boot-properties/pom.xml index 5e65aadc28..705a0eb786 100644 --- a/spring-boot-properties/pom.xml +++ b/spring-boot-properties/pom.xml @@ -3,13 +3,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-properties - jar spring-boot-properties + jar Spring Boot Properties Module - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-boot-property-exp/pom.xml b/spring-boot-property-exp/pom.xml index 7d8f2480ac..b16fcd1c22 100644 --- a/spring-boot-property-exp/pom.xml +++ b/spring-boot-property-exp/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 spring-boot-property-exp - com.baeldung spring-boot-property-exp 0.0.1-SNAPSHOT pom - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/spring-boot-property-exp/property-exp-custom-config/pom.xml b/spring-boot-property-exp/property-exp-custom-config/pom.xml index 9988924408..f9c3d6ef62 100644 --- a/spring-boot-property-exp/property-exp-custom-config/pom.xml +++ b/spring-boot-property-exp/property-exp-custom-config/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 - com.baeldung property-exp-custom-config 0.0.1-SNAPSHOT - property-exp-custom-config + property-exp-custom-config jar - spring-boot-property-exp com.baeldung + spring-boot-property-exp 0.0.1-SNAPSHOT @@ -26,7 +26,6 @@ test - 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 7892288f45..9cb1de33f6 100644 --- a/spring-boot-property-exp/property-exp-default-config/pom.xml +++ b/spring-boot-property-exp/property-exp-default-config/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 - com.baeldung property-exp-default-config 0.0.1-SNAPSHOT - property-exp-default-config + property-exp-default-config jar - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 diff --git a/spring-boot-rest/pom.xml b/spring-boot-rest/pom.xml index 598b589ea0..3787e21493 100644 --- a/spring-boot-rest/pom.xml +++ b/spring-boot-rest/pom.xml @@ -1,17 +1,17 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.web spring-boot-rest spring-boot-rest - Spring Boot Rest Module war + Spring Boot Rest Module - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -44,7 +44,7 @@ org.springframework.boot spring-boot-starter-data-jpa - + org.springframework.boot @@ -89,6 +89,7 @@ com.baeldung.SpringBootRestApplication 27.0.1-jre 1.4.11.1 - 2.3.3 + 2.3.5 + diff --git a/spring-boot-rest/src/main/java/com/baeldung/modelmapper/controller/PostRestController.java b/spring-boot-rest/src/main/java/com/baeldung/modelmapper/controller/PostRestController.java index 68c17975d4..e2def62466 100644 --- a/spring-boot-rest/src/main/java/com/baeldung/modelmapper/controller/PostRestController.java +++ b/spring-boot-rest/src/main/java/com/baeldung/modelmapper/controller/PostRestController.java @@ -1,24 +1,25 @@ package com.baeldung.modelmapper.controller; -import java.text.ParseException; -import java.util.List; -import java.util.stream.Collectors; - -import org.modelmapper.ModelMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ResponseStatus; - import com.baeldung.modelmapper.dto.PostDto; import com.baeldung.modelmapper.model.Post; import com.baeldung.modelmapper.service.IPostService; import com.baeldung.modelmapper.service.IUserService; +import org.modelmapper.ModelMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.ResponseStatus; + +import java.text.ParseException; +import java.util.List; +import java.util.stream.Collectors; @Controller @RequestMapping("/posts") @@ -33,7 +34,7 @@ public class PostRestController { @Autowired private ModelMapper modelMapper; - @RequestMapping(method = RequestMethod.GET) + @GetMapping @ResponseBody public List getPosts( @PathVariable("page") int page, @@ -43,11 +44,11 @@ public class PostRestController { List posts = postService.getPostsList(page, size, sortDir, sort); return posts.stream() - .map(post -> convertToDto(post)) + .map(this::convertToDto) .collect(Collectors.toList()); } - @RequestMapping(method = RequestMethod.POST) + @PostMapping @ResponseStatus(HttpStatus.CREATED) @ResponseBody public PostDto createPost(@RequestBody PostDto postDto) throws ParseException { @@ -56,13 +57,13 @@ public class PostRestController { return convertToDto(postCreated); } - @RequestMapping(value = "/{id}", method = RequestMethod.GET) + @GetMapping(value = "/{id}") @ResponseBody public PostDto getPost(@PathVariable("id") Long id) { return convertToDto(postService.getPostById(id)); } - @RequestMapping(value = "/{id}", method = RequestMethod.PUT) + @PutMapping(value = "/{id}") @ResponseStatus(HttpStatus.OK) public void updatePost(@RequestBody PostDto postDto) throws ParseException { Post post = convertToEntity(postDto); diff --git a/spring-boot-rest/src/test/java/com/baeldung/modelmapper/PostDtoUnitTest.java b/spring-boot-rest/src/test/java/com/baeldung/modelmapper/PostDtoUnitTest.java index 34ec4db783..6e94cc4289 100644 --- a/spring-boot-rest/src/test/java/com/baeldung/modelmapper/PostDtoUnitTest.java +++ b/spring-boot-rest/src/test/java/com/baeldung/modelmapper/PostDtoUnitTest.java @@ -15,7 +15,7 @@ public class PostDtoUnitTest { @Test public void whenConvertPostEntityToPostDto_thenCorrect() { Post post = new Post(); - post.setId(Long.valueOf(1)); + post.setId(1L); post.setTitle(randomAlphabetic(6)); post.setUrl("www.test.com"); @@ -28,7 +28,7 @@ public class PostDtoUnitTest { @Test public void whenConvertPostDtoToPostEntity_thenCorrect() { PostDto postDto = new PostDto(); - postDto.setId(Long.valueOf(1)); + postDto.setId(1L); postDto.setTitle(randomAlphabetic(6)); postDto.setUrl("www.test.com"); diff --git a/spring-boot-runtime/disabling-console-jul/README.md b/spring-boot-runtime/disabling-console-jul/README.md new file mode 100644 index 0000000000..554f051b41 --- /dev/null +++ b/spring-boot-runtime/disabling-console-jul/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) diff --git a/spring-boot-runtime/disabling-console-jul/pom.xml b/spring-boot-runtime/disabling-console-jul/pom.xml index f6f7890df1..2dc1a834b6 100644 --- a/spring-boot-runtime/disabling-console-jul/pom.xml +++ b/spring-boot-runtime/disabling-console-jul/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 disabling-console-jul - disabling-console-jul - - - + disabling-console-jul + + + org.springframework.boot spring-boot-starter-parent 2.1.1.RELEASE diff --git a/spring-boot-runtime/disabling-console-log4j2/README.md b/spring-boot-runtime/disabling-console-log4j2/README.md new file mode 100644 index 0000000000..554f051b41 --- /dev/null +++ b/spring-boot-runtime/disabling-console-log4j2/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) diff --git a/spring-boot-runtime/disabling-console-log4j2/pom.xml b/spring-boot-runtime/disabling-console-log4j2/pom.xml index 1cf3eb3e68..b743c4bdac 100644 --- a/spring-boot-runtime/disabling-console-log4j2/pom.xml +++ b/spring-boot-runtime/disabling-console-log4j2/pom.xml @@ -1,44 +1,45 @@ + - 4.0.0 - disabling-console-log4j2 - disabling-console-log4j2 - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + disabling-console-log4j2 + disabling-console-log4j2 + - + org.springframework.boot spring-boot-starter-parent 2.1.1.RELEASE - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-logging - - - - - org.springframework.boot - spring-boot-starter-log4j2 - - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-logging + + + + + org.springframework.boot + spring-boot-starter-log4j2 + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + \ No newline at end of file diff --git a/spring-boot-runtime/disabling-console-logback/README.md b/spring-boot-runtime/disabling-console-logback/README.md new file mode 100644 index 0000000000..554f051b41 --- /dev/null +++ b/spring-boot-runtime/disabling-console-logback/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) diff --git a/spring-boot-runtime/disabling-console-logback/pom.xml b/spring-boot-runtime/disabling-console-logback/pom.xml index 4b64885c66..1a415328b6 100644 --- a/spring-boot-runtime/disabling-console-logback/pom.xml +++ b/spring-boot-runtime/disabling-console-logback/pom.xml @@ -1,13 +1,14 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 disabling-console-logback disabling-console-logback - spring-boot-disable-console-logging com.baeldung + spring-boot-disable-console-logging 0.0.1-SNAPSHOT ../ diff --git a/spring-boot-runtime/pom.xml b/spring-boot-runtime/pom.xml index 772fd20d9e..baa7faebf8 100644 --- a/spring-boot-runtime/pom.xml +++ b/spring-boot-runtime/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-boot-runtime spring-boot-runtime @@ -8,8 +8,8 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -98,7 +98,7 @@ spring-cloud-context ${springcloud.version} - + org.apache.httpcomponents httpclient @@ -156,7 +156,7 @@ - + 2.2 18.0 diff --git a/spring-boot-security/pom.xml b/spring-boot-security/pom.xml index 79a77775de..62c04b4dc3 100644 --- a/spring-boot-security/pom.xml +++ b/spring-boot-security/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-boot-security spring-boot-security @@ -8,8 +8,8 @@ jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -25,9 +25,9 @@ 2.3.3.RELEASE - org.springframework.security.oauth.boot - spring-security-oauth2-autoconfigure - 2.1.2.RELEASE + org.springframework.security.oauth.boot + spring-security-oauth2-autoconfigure + 2.1.2.RELEASE org.springframework.boot @@ -66,7 +66,6 @@ spring-boot-autoconfigure 2.1.1.RELEASE - diff --git a/spring-boot-springdoc/pom.xml b/spring-boot-springdoc/pom.xml index a818db6e53..8c35e38ae6 100644 --- a/spring-boot-springdoc/pom.xml +++ b/spring-boot-springdoc/pom.xml @@ -1,18 +1,17 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-boot-springdoc 0.0.1-SNAPSHOT spring-boot-springdoc - Project for Springdoc integration jar + Project for Springdoc integration - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -102,5 +101,4 @@ - \ No newline at end of file diff --git a/spring-boot-testing/pom.xml b/spring-boot-testing/pom.xml index 12fb14b366..ebe87fdd70 100644 --- a/spring-boot-testing/pom.xml +++ b/spring-boot-testing/pom.xml @@ -1,15 +1,16 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot-testing spring-boot-testing - This is simple boot application for demonstrating testing features. war + This is simple boot application for demonstrating testing features. - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -58,17 +59,17 @@ ${spock.version} test - + io.rest-assured rest-assured test - + - spring-boot + spring-boot-testing src/main/resources @@ -120,9 +121,8 @@ - + - diff --git a/spring-boot-vue/pom.xml b/spring-boot-vue/pom.xml index 5d19f01d1e..98bba784d2 100644 --- a/spring-boot-vue/pom.xml +++ b/spring-boot-vue/pom.xml @@ -1,52 +1,51 @@ - 4.0.0 - com.baeldung - spring-boot-vue - 0.0.1-SNAPSHOT - spring-boot-vue - jar - Demo project for Spring Boot Vue project + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-boot-vue + 0.0.1-SNAPSHOT + spring-boot-vue + jar + Demo project for Spring Boot Vue project - - parent-boot-2 + com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 - - - org.springframework.boot - spring-boot-starter-web - + + + org.springframework.boot + spring-boot-starter-web + - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-test + test + org.springframework.boot spring-boot-starter-thymeleaf - + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + - - UTF-8 - UTF-8 - + + UTF-8 + UTF-8 + diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index 401e0289e8..2152a0a00d 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-boot spring-boot @@ -8,14 +9,14 @@ This is simple boot application for Spring boot actuator test - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 - + org.junit.jupiter diff --git a/spring-caching/pom.xml b/spring-caching/pom.xml index 3329cd5f77..c3ededbd14 100644 --- a/spring-caching/pom.xml +++ b/spring-caching/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,8 +8,8 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -40,4 +41,5 @@ 3.5.2 + \ No newline at end of file diff --git a/spring-cloud-bus/pom.xml b/spring-cloud-bus/pom.xml index fdaf8c024f..513c8bade6 100644 --- a/spring-cloud-bus/pom.xml +++ b/spring-cloud-bus/pom.xml @@ -1,40 +1,40 @@ - 4.0.0 - com.baeldung.spring.cloud - spring-cloud-bus - 1.0.0-SNAPSHOT - spring-cloud-bus - pom + 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-bus + 1.0.0-SNAPSHOT + spring-cloud-bus + pom - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-1 - + + com.baeldung + parent-boot-1 + 0.0.1-SNAPSHOT + ../parent-boot-1 + - - spring-cloud-config-client - spring-cloud-config-server - + + spring-cloud-config-client + spring-cloud-config-server + - - - - 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 + diff --git a/spring-cloud-bus/spring-cloud-config-client/pom.xml b/spring-cloud-bus/spring-cloud-config-client/pom.xml index 4994626ba5..7e1185415b 100644 --- a/spring-cloud-bus/spring-cloud-config-client/pom.xml +++ b/spring-cloud-bus/spring-cloud-config-client/pom.xml @@ -1,52 +1,52 @@ - 4.0.0 - spring-cloud-config-client - spring-cloud-config-client - jar - Demo Spring Cloud Config Client + 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-config-client + spring-cloud-config-client + jar + Demo Spring Cloud Config Client - - spring-cloud-bus - com.baeldung.spring.cloud - 1.0.0-SNAPSHOT - + + com.baeldung.spring.cloud + spring-cloud-bus + 1.0.0-SNAPSHOT + - - - org.springframework.cloud - spring-cloud-starter-config - - - org.springframework.boot - spring-boot-starter-web - + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.boot + spring-boot-starter-web + - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-test + test + - - org.springframework.boot - spring-boot-actuator - + + org.springframework.boot + spring-boot-actuator + - - org.springframework.cloud - spring-cloud-starter-bus-amqp - - + + org.springframework.cloud + spring-cloud-starter-bus-amqp + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/spring-cloud-bus/spring-cloud-config-server/pom.xml b/spring-cloud-bus/spring-cloud-config-server/pom.xml index 51b447161e..a61008f3dd 100644 --- a/spring-cloud-bus/spring-cloud-config-server/pom.xml +++ b/spring-cloud-bus/spring-cloud-config-server/pom.xml @@ -1,53 +1,53 @@ - 4.0.0 - spring-cloud-config-server - spring-cloud-config-server - jar - Demo Spring Cloud Config Server + 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-config-server + spring-cloud-config-server + jar + Demo Spring Cloud Config Server - - spring-cloud-bus - com.baeldung.spring.cloud - 1.0.0-SNAPSHOT - + + com.baeldung.spring.cloud + spring-cloud-bus + 1.0.0-SNAPSHOT + - - - org.springframework.cloud - spring-cloud-config-server - + + + org.springframework.cloud + spring-cloud-config-server + - - org.springframework.boot - spring-boot-starter-security - + + org.springframework.boot + spring-boot-starter-security + - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-test + test + - - org.springframework.cloud - spring-cloud-config-monitor - + + org.springframework.cloud + spring-cloud-config-monitor + - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/spring-cloud-data-flow/apache-spark-job/pom.xml b/spring-cloud-data-flow/apache-spark-job/pom.xml index 306b23c60a..65a57671ea 100644 --- a/spring-cloud-data-flow/apache-spark-job/pom.xml +++ b/spring-cloud-data-flow/apache-spark-job/pom.xml @@ -5,18 +5,18 @@ 4.0.0 apache-spark-job apache-spark-job - + - spring-cloud-data-flow com.baeldung + spring-cloud-data-flow 0.0.1-SNAPSHOT - + org.springframework.cloud spring-cloud-task-core - ${spring-cloud-task-core.version} + ${spring-cloud-task-core.version} org.apache.spark diff --git a/spring-cloud-data-flow/batch-job/pom.xml b/spring-cloud-data-flow/batch-job/pom.xml index 04187badb4..1ed0017bc0 100644 --- a/spring-cloud-data-flow/batch-job/pom.xml +++ b/spring-cloud-data-flow/batch-job/pom.xml @@ -1,21 +1,33 @@ + 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 batch-job 0.0.1-SNAPSHOT batch-job - Demo project for Spring Boot jar + Demo project for Spring Boot - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + Brixton.SR5 + pom + import + + + + org.springframework.cloud @@ -35,18 +47,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - Brixton.SR5 - pom - import - - - - 1.0.3.RELEASE diff --git a/spring-cloud-data-flow/pom.xml b/spring-cloud-data-flow/pom.xml index 32e16c72fc..e2a0664f30 100644 --- a/spring-cloud-data-flow/pom.xml +++ b/spring-cloud-data-flow/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 spring-cloud-data-flow 0.0.1-SNAPSHOT spring-cloud-data-flow pom - + com.baeldung parent-modules diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml index 409db34829..9fd378b171 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-sink/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-mongodb-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 customer-mongodb-sink customer-mongodb-sink @@ -8,12 +8,24 @@ Example ETL Load Project - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../../parent-boot-2 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.cloud @@ -39,18 +51,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml index 66f1d5e0d7..fdec22f3b3 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/customer-transform/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 customer-transform customer-transform @@ -8,12 +8,24 @@ Example transform ETL step - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../../parent-boot-2 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.cloud @@ -31,18 +43,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-etl/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-etl/pom.xml index 0274b5fed1..91abdf3442 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-etl/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-etl/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 spring-cloud-data-flow-etl 0.0.1-SNAPSHOT spring-cloud-data-flow-etl pom - + com.baeldung spring-cloud-data-flow diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml index 7166b0fd32..ba108dc5c7 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 data-flow-server 0.0.1-SNAPSHOT @@ -10,29 +10,12 @@ Demo project for Spring Boot - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 - - - org.springframework.cloud - spring-cloud-starter-dataflow-server-local - - - org.hibernate - hibernate-core - ${hibernate.compatible.version} - - - org.hibernate - hibernate-entitymanager - ${hibernate.compatible.version} - - - @@ -52,6 +35,23 @@ + + + org.springframework.cloud + spring-cloud-starter-dataflow-server-local + + + org.hibernate + hibernate-core + ${hibernate.compatible.version} + + + org.hibernate + hibernate-entitymanager + ${hibernate.compatible.version} + + + 1.3.1.RELEASE Edgware.SR6 diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/pom.xml index 9c379624d3..cc37e76aa4 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-shell/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/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 data-flow-shell 0.0.1-SNAPSHOT @@ -9,19 +9,12 @@ Demo project for Spring Boot - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 - - - org.springframework.cloud - spring-cloud-dataflow-shell - - - @@ -41,6 +34,13 @@ + + + org.springframework.cloud + spring-cloud-dataflow-shell + + + Brixton.SR7 1.1.0.RELEASE diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/log-sink/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/log-sink/pom.xml index 73fb82d79f..02d572aeb7 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/log-sink/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/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 log-sink 0.0.1-SNAPSHOT @@ -9,19 +9,12 @@ Demo project for Spring Boot - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 - - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - - @@ -33,6 +26,13 @@ + + + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + + Brixton.SR7 diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/pom.xml index bcb0ace973..5342049d73 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/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 spring-cloud-data-flow-stream-processing 0.0.1-SNAPSHOT spring-cloud-data-flow-stream-processing pom - + com.baeldung parent-modules diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-processor/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-processor/pom.xml index 28a9d3e6e0..f8db434423 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-processor/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/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 time-processor 0.0.1-SNAPSHOT @@ -9,19 +9,12 @@ Demo project for Spring Boot - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 - - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - - @@ -34,6 +27,13 @@ + + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + + + Brixton.SR7 diff --git a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml index 3b748fd7df..8194755814 100644 --- a/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml +++ b/spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/time-source/pom.xml @@ -1,27 +1,20 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 time-source 0.0.1-SNAPSHOT - jar time-source + jar Demo project for Spring Boot - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 - - - org.springframework.cloud - spring-cloud-starter-stream-rabbit - - - @@ -34,6 +27,13 @@ + + + org.springframework.cloud + spring-cloud-starter-stream-rabbit + + + Brixton.SR7 diff --git a/spring-cloud/pom.xml b/spring-cloud/pom.xml index 7138efc128..23ad11b03f 100644 --- a/spring-cloud/pom.xml +++ b/spring-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 com.baeldung.spring.cloud spring-cloud @@ -33,7 +33,7 @@ spring-cloud-contract spring-cloud-kubernetes spring-cloud-archaius - spring-cloud-functions + spring-cloud-functions spring-cloud-vault spring-cloud-task diff --git a/spring-cloud/spring-cloud-archaius/additional-sources-simple/pom.xml b/spring-cloud/spring-cloud-archaius/additional-sources-simple/pom.xml index cc100833cd..cc20511fc6 100644 --- a/spring-cloud/spring-cloud-archaius/additional-sources-simple/pom.xml +++ b/spring-cloud/spring-cloud-archaius/additional-sources-simple/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 additional-sources-simple 1.0.0-SNAPSHOT @@ -21,4 +21,5 @@ spring-boot-starter-web + diff --git a/spring-cloud/spring-cloud-archaius/basic-config/pom.xml b/spring-cloud/spring-cloud-archaius/basic-config/pom.xml index be77eeb71c..a13fff2f9d 100644 --- a/spring-cloud/spring-cloud-archaius/basic-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/basic-config/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-config 1.0.0-SNAPSHOT @@ -21,4 +21,5 @@ spring-boot-starter-web + diff --git a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml index 96f6c8711e..9ff267425c 100644 --- a/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/dynamodb-config/pom.xml @@ -1,9 +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 dynamodb-config - dynamodb-config + dynamodb-config jar @@ -45,4 +45,5 @@ 5.0.3 0.7.6 + diff --git a/spring-cloud/spring-cloud-archaius/extra-configs/pom.xml b/spring-cloud/spring-cloud-archaius/extra-configs/pom.xml index f7e5807f43..70f736642c 100644 --- a/spring-cloud/spring-cloud-archaius/extra-configs/pom.xml +++ b/spring-cloud/spring-cloud-archaius/extra-configs/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 extra-configs 1.0.0-SNAPSHOT @@ -41,4 +41,5 @@ 2.0.1.RELEASE + diff --git a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml index 59dea4890e..b7e4917bea 100644 --- a/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/jdbc-config/pom.xml @@ -1,9 +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 jdbc-config - jdbc-config + jdbc-config jar @@ -28,4 +28,5 @@ runtime + diff --git a/spring-cloud/spring-cloud-archaius/pom.xml b/spring-cloud/spring-cloud-archaius/pom.xml index fd3e34e463..df8162efa5 100644 --- a/spring-cloud/spring-cloud-archaius/pom.xml +++ b/spring-cloud/spring-cloud-archaius/pom.xml @@ -1,14 +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-archaius 1.0.0-SNAPSHOT spring-cloud-archaius - Spring Cloud Archaius Pom parent pom + Spring Cloud Archaius Pom parent com.baeldung.spring.cloud @@ -26,6 +25,18 @@ zookeeper-config + + + + org.springframework.cloud + spring-cloud-netflix + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -48,20 +59,9 @@ - - - - org.springframework.cloud - spring-cloud-netflix - ${spring-cloud-dependencies.version} - pom - import - - - - 2.0.1.RELEASE 1.2.0 + diff --git a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml index 51010eefb2..25eaf4435c 100644 --- a/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml +++ b/spring-cloud/spring-cloud-archaius/zookeeper-config/pom.xml @@ -1,9 +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 zookeeper-config - zookeeper-config + zookeeper-config jar @@ -46,4 +46,5 @@ 2.0.0.RELEASE 3.4.13 + diff --git a/spring-cloud/spring-cloud-aws/pom.xml b/spring-cloud/spring-cloud-aws/pom.xml index 26c407a77e..c1fc458a24 100644 --- a/spring-cloud/spring-cloud-aws/pom.xml +++ b/spring-cloud/spring-cloud-aws/pom.xml @@ -1,16 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.spring.cloud spring-cloud-aws spring-cloud-aws - Spring Cloud AWS Examples jar + Spring Cloud AWS Examples - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 @@ -61,4 +61,5 @@ com.baeldung.spring.cloud.aws.SpringCloudAwsApplication Dalston.SR4 + diff --git a/spring-cloud/spring-cloud-bootstrap/config/pom.xml b/spring-cloud/spring-cloud-bootstrap/config/pom.xml index 1379af0b05..67831d0c7f 100644 --- a/spring-cloud/spring-cloud-bootstrap/config/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/config/pom.xml @@ -4,11 +4,11 @@ 4.0.0 config 1.0.0-SNAPSHOT - config + config - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml index 09bea4864a..46550031e1 100644 --- a/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/discovery/pom.xml @@ -4,15 +4,27 @@ 4.0.0 discovery 1.0.0-SNAPSHOT - discovery + discovery - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -37,19 +49,8 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} - pom - import - - - - Edgware.SR5 + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml index 6cbaa5ac2d..10a04db197 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/gateway/pom.xml @@ -4,15 +4,27 @@ 4.0.0 gateway 1.0.0-SNAPSHOT - gateway + gateway - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -51,18 +63,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} - pom - import - - - - @@ -101,4 +101,5 @@ Dalston.RELEASE + \ No newline at end of file diff --git a/spring-cloud/spring-cloud-bootstrap/pom.xml b/spring-cloud/spring-cloud-bootstrap/pom.xml index 46460c0d74..2447b90538 100644 --- a/spring-cloud/spring-cloud-bootstrap/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/pom.xml @@ -1,10 +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-cloud-bootstrap 1.0.0-SNAPSHOT - spring-cloud-bootstrap + spring-cloud-bootstrap pom diff --git a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml index a88b77dda0..36227f93c6 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-book/pom.xml @@ -5,15 +5,27 @@ com.baeldung.spring.cloud svc-book 1.0.0-SNAPSHOT - svc-book + svc-book - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -59,18 +71,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} - pom - import - - - - Dalston.RELEASE diff --git a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml index f0b19922d8..0a01488628 100644 --- a/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/svc-rating/pom.xml @@ -5,11 +5,11 @@ com.baeldung.spring.cloud svc-rating 1.0.0-SNAPSHOT - svc-rating + svc-rating - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 diff --git a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml index 1bf9ecb9e7..bf7525a8e4 100644 --- a/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml +++ b/spring-cloud/spring-cloud-bootstrap/zipkin/pom.xml @@ -4,11 +4,11 @@ 4.0.0 zipkin 1.0.0-SNAPSHOT - zipkin + zipkin - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 diff --git a/spring-cloud/spring-cloud-config/client/pom.xml b/spring-cloud/spring-cloud-config/client/pom.xml index 14b0d2f9b1..4f4a420238 100644 --- a/spring-cloud/spring-cloud-config/client/pom.xml +++ b/spring-cloud/spring-cloud-config/client/pom.xml @@ -4,8 +4,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 client - client - + client + com.baeldung.spring.cloud spring-cloud-config @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-starter-config - + org.springframework.boot spring-boot-starter-web diff --git a/spring-cloud/spring-cloud-config/client/src/main/java/com/baeldung/spring/cloud/config/client/ConfigClient.java b/spring-cloud/spring-cloud-config/client/src/main/java/com/baeldung/spring/cloud/config/client/ConfigClient.java index 1dd3bbdab0..57d6606469 100644 --- a/spring-cloud/spring-cloud-config/client/src/main/java/com/baeldung/spring/cloud/config/client/ConfigClient.java +++ b/spring-cloud/spring-cloud-config/client/src/main/java/com/baeldung/spring/cloud/config/client/ConfigClient.java @@ -4,9 +4,8 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @SpringBootApplication @@ -22,7 +21,7 @@ public class ConfigClient { SpringApplication.run(ConfigClient.class, args); } - @RequestMapping(value = "/whoami/{username}", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE) + @GetMapping(value = "/whoami/{username}", produces = MediaType.TEXT_PLAIN_VALUE) public String whoami(@PathVariable("username") String username) { return String.format("Hello %s! You are a(n) %s and your password is '%s'.\n", username, role, password); } diff --git a/spring-cloud/spring-cloud-config/pom.xml b/spring-cloud/spring-cloud-config/pom.xml index 1a4efc7a60..5097a63092 100644 --- a/spring-cloud/spring-cloud-config/pom.xml +++ b/spring-cloud/spring-cloud-config/pom.xml @@ -1,18 +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.spring.cloud spring-cloud-config 1.0-SNAPSHOT - spring-cloud-config + spring-cloud-config pom - parent-boot-1 + parent-boot-2 com.baeldung 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../parent-boot-2 @@ -33,7 +33,8 @@ - Brixton.SR7 + Hoxton.RELEASE + 2.2.2.RELEASE diff --git a/spring-cloud/spring-cloud-config/server/pom.xml b/spring-cloud/spring-cloud-config/server/pom.xml index 674749a48d..9574834457 100644 --- a/spring-cloud/spring-cloud-config/server/pom.xml +++ b/spring-cloud/spring-cloud-config/server/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 server - server + server com.baeldung.spring.cloud @@ -16,11 +16,11 @@ org.springframework.cloud spring-cloud-config-server - + org.springframework.boot spring-boot-starter-security - + org.springframework.boot spring-boot-starter-web @@ -37,7 +37,7 @@ org.springframework.boot spring-boot-maven-plugin - + diff --git a/spring-cloud/spring-cloud-config/server/src/main/java/com/baeldung/spring/cloud/config/server/SecurityConfiguration.java b/spring-cloud/spring-cloud-config/server/src/main/java/com/baeldung/spring/cloud/config/server/SecurityConfiguration.java new file mode 100644 index 0000000000..b50184f296 --- /dev/null +++ b/spring-cloud/spring-cloud-config/server/src/main/java/com/baeldung/spring/cloud/config/server/SecurityConfiguration.java @@ -0,0 +1,18 @@ +package com.baeldung.spring.cloud.config.server; + +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; + +@Configuration +public class SecurityConfiguration extends WebSecurityConfigurerAdapter { + + @Override + public void configure(HttpSecurity http) throws Exception { + http.csrf() + .ignoringAntMatchers("/encrypt/**") + .ignoringAntMatchers("/decrypt/**"); + + super.configure(http); + } +} diff --git a/spring-cloud/spring-cloud-config/server/src/main/resources/application.properties b/spring-cloud/spring-cloud-config/server/src/main/resources/application.properties index 3d4f3bcd47..18d4b3596a 100644 --- a/spring-cloud/spring-cloud-config/server/src/main/resources/application.properties +++ b/spring-cloud/spring-cloud-config/server/src/main/resources/application.properties @@ -1,9 +1,5 @@ server.port=8888 spring.cloud.config.server.git.uri= spring.cloud.config.server.git.clone-on-start=true -security.user.name=root -security.user.password=s3cr3t -encrypt.key-store.location=classpath:/config-server.jks -encrypt.key-store.password=my-s70r3-s3cr3t -encrypt.key-store.alias=config-server-key -encrypt.key-store.secret=my-k34-s3cr3t +spring.security.user.name=root +spring.security.user.password=s3cr3t diff --git a/spring-cloud/spring-cloud-config/server/src/main/resources/bootstrap.properties b/spring-cloud/spring-cloud-config/server/src/main/resources/bootstrap.properties new file mode 100644 index 0000000000..f2d75f5846 --- /dev/null +++ b/spring-cloud/spring-cloud-config/server/src/main/resources/bootstrap.properties @@ -0,0 +1,4 @@ +encrypt.keyStore.location=classpath:/config-server.jks +encrypt.keyStore.password=my-s70r3-s3cr3t +encrypt.keyStore.alias=config-server-key +encrypt.keyStore.secret=my-k34-s3cr3t diff --git a/spring-cloud/spring-cloud-connectors-heroku/pom.xml b/spring-cloud/spring-cloud-connectors-heroku/pom.xml index d2e9292511..1dad3ddcb7 100644 --- a/spring-cloud/spring-cloud-connectors-heroku/pom.xml +++ b/spring-cloud/spring-cloud-connectors-heroku/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 com.baeldung.spring.cloud spring-cloud-connectors-heroku 1.0.0-SNAPSHOT - spring-cloud-connectors-heroku + spring-cloud-connectors-heroku - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 @@ -34,7 +34,7 @@ org.postgresql postgresql - + com.h2database h2 @@ -58,4 +58,5 @@ Brixton.SR7 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 456a7ec302..b1f6acd9fe 100644 --- a/spring-cloud/spring-cloud-consul/pom.xml +++ b/spring-cloud/spring-cloud-consul/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-consul @@ -25,7 +25,7 @@ spring-cloud-starter-consul-config ${spring-cloud-starter-consul.version} - + org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud/spring-cloud-contract/pom.xml b/spring-cloud/spring-cloud-contract/pom.xml index a7ee52e954..2f868980db 100644 --- a/spring-cloud/spring-cloud-contract/pom.xml +++ b/spring-cloud/spring-cloud-contract/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.spring.cloud spring-cloud-contract 1.0.0-SNAPSHOT - spring-cloud-contract + spring-cloud-contract pom @@ -59,4 +58,5 @@ 2.1.1.RELEASE 2.1.4.RELEASE + \ 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 3b711c58d9..7616032320 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 @@ -2,12 +2,11 @@ 4.0.0 - com.baeldung.spring.cloud spring-cloud-contract-consumer 1.0.0-SNAPSHOT spring-cloud-contract-consumer - Spring Cloud Consumer Sample jar + Spring Cloud Consumer Sample com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml b/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml index 7a0fa7db10..c41ad687ed 100644 --- a/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml +++ b/spring-cloud/spring-cloud-contract/spring-cloud-contract-producer/pom.xml @@ -2,12 +2,11 @@ 4.0.0 - com.baeldung.spring.cloud spring-cloud-contract-producer 1.0.0-SNAPSHOT spring-cloud-contract-producer - Spring Cloud Producer Sample jar + Spring Cloud Producer Sample com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-eureka-self-preservation/pom.xml b/spring-cloud/spring-cloud-eureka-self-preservation/pom.xml index ce9272ed59..41ebba7d79 100644 --- a/spring-cloud/spring-cloud-eureka-self-preservation/pom.xml +++ b/spring-cloud/spring-cloud-eureka-self-preservation/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.baeldung.spring.cloud.eureka spring-cloud-eureka-self-preservation spring-cloud-eureka-self-preservation - Spring Cloud Eureka Server Self Preservation pom + Spring Cloud Eureka Server Self Preservation com.baeldung.spring.cloud @@ -19,7 +19,7 @@ spring-cloud-eureka-server spring-cloud-eureka-client - + org.springframework.boot diff --git a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/pom.xml b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/pom.xml index 2c522a8d9d..fc7d8bec33 100644 --- a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/pom.xml +++ b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-client/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 spring-cloud-eureka-client spring-cloud-eureka-client - Spring Cloud Eureka Sample Client jar + Spring Cloud Eureka Sample Client com.baeldung.spring.cloud.eureka @@ -14,17 +14,6 @@ .. - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - org.springframework.boot - spring-boot-starter-web - - - @@ -37,4 +26,15 @@ + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.boot + spring-boot-starter-web + + + diff --git a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/pom.xml b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/pom.xml index 7d9d9d33a8..02d1c8c354 100644 --- a/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/pom.xml +++ b/spring-cloud/spring-cloud-eureka-self-preservation/spring-cloud-eureka-server/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 spring-cloud-eureka-server spring-cloud-eureka-server - Spring Cloud Eureka Server jar + Spring Cloud Eureka Server com.baeldung.spring.cloud.eureka @@ -14,13 +14,6 @@ .. - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-server - - - @@ -33,4 +26,11 @@ + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-server + + + diff --git a/spring-cloud/spring-cloud-eureka/pom.xml b/spring-cloud/spring-cloud-eureka/pom.xml index 5afb006d41..7af0c15352 100644 --- a/spring-cloud/spring-cloud-eureka/pom.xml +++ b/spring-cloud/spring-cloud-eureka/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"> 4.0.0 - com.baeldung.spring.cloud spring-cloud-eureka 1.0.0-SNAPSHOT spring-cloud-eureka - Spring Cloud Eureka Server and Sample Clients pom + Spring Cloud Eureka Server and Sample Clients com.baeldung.spring.cloud @@ -21,7 +20,7 @@ spring-cloud-eureka-client spring-cloud-eureka-feign-client - + org.springframework.boot 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 04a5bd3e58..d82ee6566d 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,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 spring-cloud-eureka-client 1.0.0-SNAPSHOT spring-cloud-eureka-client - Spring Cloud Eureka Sample Client jar + Spring Cloud Eureka Sample Client com.baeldung.spring.cloud @@ -15,17 +15,6 @@ .. - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - - - org.springframework.boot - spring-boot-starter-web - - - @@ -38,4 +27,15 @@ + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + org.springframework.boot + spring-boot-starter-web + + + 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 acc436c574..1ecc50a81f 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,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 spring-cloud-eureka-feign-client 1.0.0-SNAPSHOT spring-cloud-eureka-feign-client - Spring Cloud Eureka - Sample Feign Client jar + Spring Cloud Eureka - Sample Feign Client com.baeldung.spring.cloud @@ -15,6 +15,18 @@ .. + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -34,15 +46,4 @@ - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - 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 95edba29f9..627be513ba 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,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 spring-cloud-eureka-server 1.0.0-SNAPSHOT spring-cloud-eureka-server - Spring Cloud Eureka Server Demo jar + Spring Cloud Eureka Server Demo com.baeldung.spring.cloud @@ -15,13 +15,6 @@ .. - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-server - - - @@ -34,4 +27,11 @@ + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-server + + + diff --git a/spring-cloud/spring-cloud-functions/pom.xml b/spring-cloud/spring-cloud-functions/pom.xml index 82147cea28..2e1b747c2e 100644 --- a/spring-cloud/spring-cloud-functions/pom.xml +++ b/spring-cloud/spring-cloud-functions/pom.xml @@ -7,17 +7,16 @@ spring-cloud-functions 0.0.1-SNAPSHOT spring-cloud-functions - Demo project for Spring Cloud Function jar + Demo project for Spring Cloud Function - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - - + org.springframework.cloud @@ -26,7 +25,7 @@ - + org.springframework.cloud spring-cloud-starter-function-web ${spring-cloud-function.version} diff --git a/spring-cloud/spring-cloud-gateway/pom.xml b/spring-cloud/spring-cloud-gateway/pom.xml index 61f0267ba0..10cd49cc04 100644 --- a/spring-cloud/spring-cloud-gateway/pom.xml +++ b/spring-cloud/spring-cloud-gateway/pom.xml @@ -1,11 +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-gateway - jar spring-cloud-gateway + jar com.baeldung.spring.cloud diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/CustomFiltersGatewayApplication.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/CustomFiltersGatewayApplication.java similarity index 87% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/CustomFiltersGatewayApplication.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/CustomFiltersGatewayApplication.java index a9f18e71fd..fae25bb7cc 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/CustomFiltersGatewayApplication.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/CustomFiltersGatewayApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters; +package com.baeldung.springcloudgateway.customfilters.gatewayapp; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/config/WebClientConfig.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/config/WebClientConfig.java similarity index 81% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/config/WebClientConfig.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/config/WebClientConfig.java index 8a7771f0e3..0589d8c321 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/config/WebClientConfig.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/config/WebClientConfig.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.config; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ChainRequestGatewayFilterFactory.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ChainRequestGatewayFilterFactory.java similarity index 97% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ChainRequestGatewayFilterFactory.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ChainRequestGatewayFilterFactory.java index 1f4e2a96cb..f53b0a3c93 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ChainRequestGatewayFilterFactory.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ChainRequestGatewayFilterFactory.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.filters.factories; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.factories; import java.util.Arrays; import java.util.List; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/LoggingGatewayFilterFactory.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/LoggingGatewayFilterFactory.java similarity index 96% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/LoggingGatewayFilterFactory.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/LoggingGatewayFilterFactory.java index 18532e34a8..900d36cc02 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/LoggingGatewayFilterFactory.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/LoggingGatewayFilterFactory.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.filters.factories; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.factories; import java.util.Arrays; import java.util.List; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ModifyRequestGatewayFilterFactory.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ModifyRequestGatewayFilterFactory.java similarity index 97% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ModifyRequestGatewayFilterFactory.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ModifyRequestGatewayFilterFactory.java index e03b7eebb3..5828f35a36 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ModifyRequestGatewayFilterFactory.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ModifyRequestGatewayFilterFactory.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.filters.factories; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.factories; import java.util.Arrays; import java.util.Collections; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ModifyResponseGatewayFilterFactory.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ModifyResponseGatewayFilterFactory.java similarity index 95% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ModifyResponseGatewayFilterFactory.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ModifyResponseGatewayFilterFactory.java index 55b39fce29..f5efa69402 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/factories/ModifyResponseGatewayFilterFactory.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/factories/ModifyResponseGatewayFilterFactory.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.filters.factories; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.factories; import java.util.Optional; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/FirstPreLastPostGlobalFilter.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/FirstPreLastPostGlobalFilter.java similarity index 91% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/FirstPreLastPostGlobalFilter.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/FirstPreLastPostGlobalFilter.java index 5b58eee8a6..687f3fe685 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/FirstPreLastPostGlobalFilter.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/FirstPreLastPostGlobalFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.filters.global; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.global; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/LoggingGlobalFiltersConfigurations.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/LoggingGlobalFiltersConfigurations.java similarity index 89% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/LoggingGlobalFiltersConfigurations.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/LoggingGlobalFiltersConfigurations.java index 8edcf2a073..2dead8da3b 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/LoggingGlobalFiltersConfigurations.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/LoggingGlobalFiltersConfigurations.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.filters.global; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.global; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/LoggingGlobalPreFilter.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/LoggingGlobalPreFilter.java similarity index 89% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/LoggingGlobalPreFilter.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/LoggingGlobalPreFilter.java index bd29499868..2bacf033db 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/filters/global/LoggingGlobalPreFilter.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/filters/global/LoggingGlobalPreFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.filters.global; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.global; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/routes/ServiceRouteConfiguration.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/routes/ServiceRouteConfiguration.java similarity index 74% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/routes/ServiceRouteConfiguration.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/routes/ServiceRouteConfiguration.java index b4f6eda374..17d4827d93 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/routes/ServiceRouteConfiguration.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/routes/ServiceRouteConfiguration.java @@ -1,11 +1,11 @@ -package com.baeldung.springcloudgateway.customfilters.routes; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.routes; import org.springframework.cloud.gateway.route.RouteLocator; import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; import org.springframework.context.annotation.Bean; -import com.baeldung.springcloudgateway.customfilters.filters.factories.LoggingGatewayFilterFactory; -import com.baeldung.springcloudgateway.customfilters.filters.factories.LoggingGatewayFilterFactory.Config; +import com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.factories.LoggingGatewayFilterFactory; +import com.baeldung.springcloudgateway.customfilters.gatewayapp.filters.factories.LoggingGatewayFilterFactory.Config; /** * Note: We want to keep this as an example of configuring a Route with a custom filter diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/secondservice/SecondServiceApplication.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceApplication.java similarity index 86% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/secondservice/SecondServiceApplication.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceApplication.java index 69be1be9ca..b65d0efbd6 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/secondservice/SecondServiceApplication.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.secondservice; +package com.baeldung.springcloudgateway.customfilters.secondservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/secondservice/web/SecondServiceRestController.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/secondservice/web/SecondServiceRestController.java similarity index 85% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/secondservice/web/SecondServiceRestController.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/secondservice/web/SecondServiceRestController.java index f047b123ef..1ac44ba6b1 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/secondservice/web/SecondServiceRestController.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/secondservice/web/SecondServiceRestController.java @@ -1,4 +1,4 @@ -package com.baeldung.secondservice.web; +package com.baeldung.springcloudgateway.customfilters.secondservice.web; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/service/ServiceApplication.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/service/ServiceApplication.java similarity index 86% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/service/ServiceApplication.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/service/ServiceApplication.java index 9853b78088..1e2ffb63c2 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/service/ServiceApplication.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/service/ServiceApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.service; +package com.baeldung.springcloudgateway.customfilters.service; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/service/web/ServiceRestController.java b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/service/web/ServiceRestController.java similarity index 89% rename from spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/service/web/ServiceRestController.java rename to spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/service/web/ServiceRestController.java index 12f7151e59..3ca09f6853 100644 --- a/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/service/web/ServiceRestController.java +++ b/spring-cloud/spring-cloud-gateway/src/main/java/com/baeldung/springcloudgateway/customfilters/service/web/ServiceRestController.java @@ -1,4 +1,4 @@ -package com.baeldung.service.web; +package com.baeldung.springcloudgateway.customfilters.service.web; import java.util.Locale; diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/CustomFiltersLiveTest.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/CustomFiltersLiveTest.java similarity index 96% rename from spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/CustomFiltersLiveTest.java rename to spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/CustomFiltersLiveTest.java index b24db70e4f..a4bb3f8068 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/CustomFiltersLiveTest.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/CustomFiltersLiveTest.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters; +package com.baeldung.springcloudgateway.customfilters.gatewayapp; import static org.assertj.core.api.Assertions.assertThat; @@ -11,7 +11,7 @@ import org.springframework.boot.web.server.LocalServerPort; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec; -import com.baeldung.springcloudgateway.customfilters.utils.LoggerListAppender; +import com.baeldung.springcloudgateway.customfilters.gatewayapp.utils.LoggerListAppender; import ch.qos.logback.classic.spi.ILoggingEvent; diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/utils/LoggerListAppender.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/utils/LoggerListAppender.java similarity index 88% rename from spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/utils/LoggerListAppender.java rename to spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/utils/LoggerListAppender.java index b6337dabb6..8e113b417b 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/utils/LoggerListAppender.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/gatewayapp/utils/LoggerListAppender.java @@ -1,4 +1,4 @@ -package com.baeldung.springcloudgateway.customfilters.utils; +package com.baeldung.springcloudgateway.customfilters.gatewayapp.utils; import java.util.ArrayList; import java.util.List; diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/secondservice/SecondServiceIntegrationTest.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceIntegrationTest.java similarity index 81% rename from spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/secondservice/SecondServiceIntegrationTest.java rename to spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceIntegrationTest.java index 9a1e0b0712..6b2a432d20 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/secondservice/SecondServiceIntegrationTest.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SecondServiceIntegrationTest.java @@ -1,11 +1,11 @@ -package com.baeldung.secondservice; +package com.baeldung.springcloudgateway.customfilters.secondservice; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.test.web.reactive.server.WebTestClient; -import com.baeldung.secondservice.web.SecondServiceRestController; +import com.baeldung.springcloudgateway.customfilters.secondservice.web.SecondServiceRestController; @WebFluxTest(SecondServiceRestController.class) public class SecondServiceIntegrationTest { diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/secondservice/SpringContextTest.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SpringContextTest.java similarity index 80% rename from spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/secondservice/SpringContextTest.java rename to spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SpringContextTest.java index 127ef7fe32..eaf94c0a42 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/secondservice/SpringContextTest.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/secondservice/SpringContextTest.java @@ -1,4 +1,4 @@ -package com.baeldung.secondservice; +package com.baeldung.springcloudgateway.customfilters.secondservice; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/service/ServiceIntegrationTest.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/ServiceIntegrationTest.java similarity index 85% rename from spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/service/ServiceIntegrationTest.java rename to spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/ServiceIntegrationTest.java index cb65ac3a50..bfb3f23f0d 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/service/ServiceIntegrationTest.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/ServiceIntegrationTest.java @@ -1,4 +1,4 @@ -package com.baeldung.service; +package com.baeldung.springcloudgateway.customfilters.service; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -6,7 +6,7 @@ import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.http.HttpHeaders; import org.springframework.test.web.reactive.server.WebTestClient; -import com.baeldung.service.web.ServiceRestController; +import com.baeldung.springcloudgateway.customfilters.service.web.ServiceRestController; @WebFluxTest(ServiceRestController.class) public class ServiceIntegrationTest { diff --git a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/service/SpringContextTest.java b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/SpringContextTest.java similarity index 81% rename from spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/service/SpringContextTest.java rename to spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/SpringContextTest.java index 28216dca86..2a9b322d5e 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/service/SpringContextTest.java +++ b/spring-cloud/spring-cloud-gateway/src/test/java/com/baeldung/springcloudgateway/customfilters/service/SpringContextTest.java @@ -1,4 +1,4 @@ -package com.baeldung.service; +package com.baeldung.springcloudgateway.customfilters.service; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; diff --git a/spring-cloud/spring-cloud-gateway/src/test/resources/logback-test.xml b/spring-cloud/spring-cloud-gateway/src/test/resources/logback-test.xml index 8febdc8b1a..6fcdb6317f 100644 --- a/spring-cloud/spring-cloud-gateway/src/test/resources/logback-test.xml +++ b/spring-cloud/spring-cloud-gateway/src/test/resources/logback-test.xml @@ -1,7 +1,7 @@ + class="com.baeldung.springcloudgateway.customfilters.gatewayapp.utils.LoggerListAppender"> 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 a345d6856b..367b7c111e 100644 --- a/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/feign-rest-consumer/pom.xml @@ -15,6 +15,18 @@ .. + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + com.baeldung.spring.cloud @@ -46,25 +58,14 @@ spring-boot-starter-actuator - org.springframework.boot - spring-boot-starter-test - test - + org.springframework.boot + spring-boot-starter-test + test + - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - 1.0.0-SNAPSHOT + diff --git a/spring-cloud/spring-cloud-hystrix/pom.xml b/spring-cloud/spring-cloud-hystrix/pom.xml index 51f6a4e82b..4aec8050ff 100644 --- a/spring-cloud/spring-cloud-hystrix/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/pom.xml @@ -3,7 +3,6 @@ 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 spring-cloud-hystrix diff --git a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml index 43ccfcc26d..ba03ad3348 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-consumer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-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 rest-consumer 1.0.0-SNAPSHOT @@ -14,6 +14,18 @@ .. + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -40,7 +52,7 @@ spring-boot-starter-actuator ${spring-boot-starter-web.version} - + org.springframework.boot spring-boot-starter-test @@ -49,18 +61,6 @@ - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - 1.10.19 diff --git a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml b/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml index 07437634f5..cb7377d705 100644 --- a/spring-cloud/spring-cloud-hystrix/rest-producer/pom.xml +++ b/spring-cloud/spring-cloud-hystrix/rest-producer/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 rest-producer 1.0.0-SNAPSHOT @@ -20,7 +20,7 @@ spring-boot-starter-web ${spring-boot-starter-web.version} - + org.springframework.boot spring-boot-starter-test @@ -28,7 +28,7 @@ test - + 1.10.19 diff --git a/spring-cloud/spring-cloud-kubernetes/README.md b/spring-cloud/spring-cloud-kubernetes/README.md index b64ad65ef9..328b870a44 100644 --- a/spring-cloud/spring-cloud-kubernetes/README.md +++ b/spring-cloud/spring-cloud-kubernetes/README.md @@ -1,9 +1,9 @@ ## Spring Cloud Kubernetes -This moudle contains articles about Spring Cloud Kubernetes +This module contains articles about Spring Cloud Kubernetes. ### Relevant Articles: -- [Running Spring Boot Applications With Minikube](https://www.baeldung.com/spring-boot-minikube) +- [Running Spring Boot Applications with Minikube](https://www.baeldung.com/spring-boot-minikube) - [Self-Healing Applications with Kubernetes and Spring Boot](https://www.baeldung.com/spring-boot-kubernetes-self-healing-apps) - [Guide to Spring Cloud Kubernetes](https://www.baeldung.com/spring-cloud-kubernetes) diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/.gitignore b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/.gitignore similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/.gitignore rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/.gitignore diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/Dockerfile b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/Dockerfile similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/Dockerfile rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/Dockerfile diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/client-config.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/client-config.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/client-config.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/client-config.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/client-service-deployment.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/client-service-deployment.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/client-service-deployment.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/client-service-deployment.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml similarity index 94% rename from spring-cloud/spring-cloud-kubernetes/client-service/pom.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml index 41e09fa13b..e5f76d5d9c 100644 --- a/spring-cloud/spring-cloud-kubernetes/client-service/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/pom.xml @@ -1,15 +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 client-service - client-service + client-service 1.0-SNAPSHOT com.baeldung.spring.cloud spring-cloud-kubernetes 1.0-SNAPSHOT + ../../../spring-cloud-kubernetes diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/Application.java diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientConfig.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientConfig.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientConfig.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientConfig.java diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientController.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientController.java old mode 100755 new mode 100644 similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientController.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/ClientController.java diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/RibbonConfiguration.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/RibbonConfiguration.java old mode 100755 new mode 100644 similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/RibbonConfiguration.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/RibbonConfiguration.java diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/TravelAgencyService.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/TravelAgencyService.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/TravelAgencyService.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/java/com/baeldung/spring/cloud/kubernetes/client/TravelAgencyService.java diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/main/resources/application.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/main/resources/application.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/application.yaml diff --git a/jackson-2/src/main/resources/logback.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/logback.xml similarity index 100% rename from jackson-2/src/main/resources/logback.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/main/resources/logback.xml diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/test/java/org/baeldung/SpringContextTest.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/test/java/org/baeldung/SpringContextTest.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/client-service/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-cloud/spring-cloud-kubernetes/deployment-travel-client.sh b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/deployment-travel-client.sh old mode 100755 new mode 100644 similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/deployment-travel-client.sh rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/deployment-travel-client.sh diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/Dockerfile b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/Dockerfile old mode 100755 new mode 100644 similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/Dockerfile rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/Dockerfile diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/mongo-deployment.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/mongo-deployment.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/mongo-deployment.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/mongo-deployment.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/pom.xml old mode 100755 new mode 100644 similarity index 92% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/pom.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/pom.xml index 0d7639b179..93734a19a7 --- a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 travel-agency-service 1.0-SNAPSHOT @@ -8,6 +9,7 @@ com.baeldung.spring.cloud spring-cloud-kubernetes 1.0-SNAPSHOT + ../../../spring-cloud-kubernetes diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/secret.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/secret.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/secret.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/secret.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/Application.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/Application.java old mode 100755 new mode 100644 similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/Application.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/Application.java diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/controller/TravelAgencyController.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/controller/TravelAgencyController.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/controller/TravelAgencyController.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/controller/TravelAgencyController.java diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/model/TravelDeal.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/model/TravelDeal.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/model/TravelDeal.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/model/TravelDeal.java diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/repository/TravelDealRepository.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/repository/TravelDealRepository.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/repository/TravelDealRepository.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/java/com/baeldung/spring/cloud/kubernetes/travelagency/repository/TravelDealRepository.java diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/resources/application.properties b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/resources/application.properties similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/resources/application.properties rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/resources/application.properties diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/resources/logback-spring.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/resources/logback-spring.xml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/resources/logback-spring.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/resources/logback-spring.xml diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/resources/logback.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/resources/logback.xml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/main/resources/logback.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/main/resources/logback.xml diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/test/java/com/baeldung/spring/cloud/kubernetes/travelagency/SpringContextTest.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/test/java/com/baeldung/spring/cloud/kubernetes/travelagency/SpringContextTest.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/src/test/java/com/baeldung/spring/cloud/kubernetes/travelagency/SpringContextTest.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/src/test/java/com/baeldung/spring/cloud/kubernetes/travelagency/SpringContextTest.java diff --git a/spring-cloud/spring-cloud-kubernetes/travel-agency-service/travel-agency-deployment.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/travel-agency-deployment.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/travel-agency-service/travel-agency-deployment.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-guide/travel-agency-service/travel-agency-deployment.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/.gitignore b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/.gitignore similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-backend/.gitignore rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/.gitignore diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/Dockerfile b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/Dockerfile similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-backend/Dockerfile rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/Dockerfile diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/pom.xml similarity index 83% rename from spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/pom.xml index f7b04baec3..5bd7d3f5ea 100644 --- a/spring-cloud/spring-cloud-kubernetes/demo-backend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/pom.xml @@ -1,14 +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 demo-backend - demo-backend - + demo-backend + com.baeldung.spring.cloud spring-cloud-kubernetes 1.0-SNAPSHOT + ../../../spring-cloud-kubernetes 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/kubernetes-minikube/demo-backend/src/main/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplication.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplication.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/src/main/java/com/baeldung/spring/cloud/kubernetes/backend/KubernetesBackendApplication.java diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/resources/application.properties b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/src/main/resources/application.properties similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/resources/application.properties rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/src/main/resources/application.properties diff --git a/spring-cloud/spring-cloud-kubernetes/client-service/src/main/resources/logback.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/src/main/resources/logback.xml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/client-service/src/main/resources/logback.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/src/main/resources/logback.xml diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/src/test/java/org/baeldung/SpringContextTest.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-backend/src/test/java/org/baeldung/SpringContextTest.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-backend/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/.gitignore b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/.gitignore similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-frontend/.gitignore rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/.gitignore diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/Dockerfile b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/Dockerfile similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-frontend/Dockerfile rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/Dockerfile diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml similarity index 83% rename from spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml index da55ca5034..9a4924b903 100644 --- a/spring-cloud/spring-cloud-kubernetes/demo-frontend/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/pom.xml @@ -1,14 +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 demo-frontend - demo-frontend - + demo-frontend + com.baeldung.spring.cloud spring-cloud-kubernetes 1.0-SNAPSHOT + ../../../spring-cloud-kubernetes 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/kubernetes-minikube/demo-frontend/src/main/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplication.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplication.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/src/main/java/com/baeldung/spring/cloud/kubernetes/frontend/KubernetesFrontendApplication.java diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/resources/application.properties b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/src/main/resources/application.properties similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/resources/application.properties rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/src/main/resources/application.properties diff --git a/spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/resources/logback.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/src/main/resources/logback.xml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-backend/src/main/resources/logback.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/src/main/resources/logback.xml diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/test/java/org/baeldung/SpringContextTest.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-frontend/src/test/java/org/baeldung/SpringContextTest.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/demo-frontend/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-cloud/spring-cloud-kubernetes/object-configurations/backend-deployment.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/object-configurations/backend-deployment.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/object-configurations/backend-deployment.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/object-configurations/backend-deployment.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/object-configurations/frontend-deployment.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/object-configurations/frontend-deployment.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/object-configurations/frontend-deployment.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-minikube/object-configurations/frontend-deployment.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/liveness-example/Dockerfile b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/Dockerfile similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/liveness-example/Dockerfile rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/Dockerfile diff --git a/spring-cloud/spring-cloud-kubernetes/liveness-example/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/pom.xml similarity index 94% rename from spring-cloud/spring-cloud-kubernetes/liveness-example/pom.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/pom.xml index 293b215918..66d8f096ce 100644 --- a/spring-cloud/spring-cloud-kubernetes/liveness-example/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/pom.xml @@ -4,14 +4,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 liveness-example - liveness-example + liveness-example 1.0-SNAPSHOT - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT - ../../../parent-boot-1 + ../../../../parent-boot-1 diff --git a/spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/java/com/baeldung/liveness/Application.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/java/com/baeldung/liveness/Application.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/java/com/baeldung/liveness/Application.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/java/com/baeldung/liveness/Application.java diff --git a/spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/java/com/baeldung/liveness/health/CustomHealthIndicator.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/java/com/baeldung/liveness/health/CustomHealthIndicator.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/java/com/baeldung/liveness/health/CustomHealthIndicator.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/java/com/baeldung/liveness/health/CustomHealthIndicator.java diff --git a/spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/resources/resources/application.properties b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/resources/resources/application.properties similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/resources/resources/application.properties rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/resources/resources/application.properties diff --git a/spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/resources/logback.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/resources/resources/logback.xml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/demo-frontend/src/main/resources/logback.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/main/resources/resources/logback.xml diff --git a/spring-cloud/spring-cloud-kubernetes/liveness-example/src/test/java/com/baeldung/SpringContextTest.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/liveness-example/src/test/java/com/baeldung/SpringContextTest.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/liveness-example/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-cloud/spring-cloud-kubernetes/object-configurations/liveness-example-k8s-template.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/object-configurations/liveness-example-k8s-template.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/object-configurations/liveness-example-k8s-template.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/object-configurations/liveness-example-k8s-template.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/object-configurations/readiness-example-k8s-template.yaml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/object-configurations/readiness-example-k8s-template.yaml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/object-configurations/readiness-example-k8s-template.yaml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/object-configurations/readiness-example-k8s-template.yaml diff --git a/spring-cloud/spring-cloud-kubernetes/readiness-example/Dockerfile b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/Dockerfile similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/readiness-example/Dockerfile rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/Dockerfile diff --git a/spring-cloud/spring-cloud-kubernetes/readiness-example/pom.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/pom.xml similarity index 94% rename from spring-cloud/spring-cloud-kubernetes/readiness-example/pom.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/pom.xml index 07589e65b6..fbb9e09d07 100644 --- a/spring-cloud/spring-cloud-kubernetes/readiness-example/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/pom.xml @@ -4,14 +4,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 readiness-example - readiness-example + readiness-example 1.0-SNAPSHOT - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT - ../../../parent-boot-1 + ../../../../parent-boot-1 diff --git a/spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/java/com/baeldung/readiness/Application.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/java/com/baeldung/readiness/Application.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/java/com/baeldung/readiness/Application.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/java/com/baeldung/readiness/Application.java diff --git a/spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/java/com/baeldung/readiness/health/CustomHealthIndicator.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/java/com/baeldung/readiness/health/CustomHealthIndicator.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/java/com/baeldung/readiness/health/CustomHealthIndicator.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/java/com/baeldung/readiness/health/CustomHealthIndicator.java diff --git a/spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/resources/resources/application.properties b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/resources/resources/application.properties similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/resources/resources/application.properties rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/resources/resources/application.properties diff --git a/spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/resources/resources/logback.xml b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/resources/resources/logback.xml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/liveness-example/src/main/resources/resources/logback.xml rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/main/resources/resources/logback.xml diff --git a/spring-cloud/spring-cloud-kubernetes/readiness-example/src/test/java/com/baeldung/SpringContextTest.java b/spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/readiness-example/src/test/java/com/baeldung/SpringContextTest.java rename to spring-cloud/spring-cloud-kubernetes/kubernetes-selfhealing/readiness-example/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-cloud/spring-cloud-kubernetes/pom.xml b/spring-cloud/spring-cloud-kubernetes/pom.xml index a9563fc582..ed4bccbf78 100644 --- a/spring-cloud/spring-cloud-kubernetes/pom.xml +++ b/spring-cloud/spring-cloud-kubernetes/pom.xml @@ -1,27 +1,27 @@ + 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-kubernetes 1.0-SNAPSHOT - spring-cloud-kubernetes + spring-cloud-kubernetes pom - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - demo-frontend - demo-backend - liveness-example - readiness-example - client-service - travel-agency-service + kubernetes-minikube/demo-frontend + kubernetes-minikube/demo-backend + kubernetes-selfhealing/liveness-example + kubernetes-selfhealing/readiness-example + kubernetes-guide/client-service + kubernetes-guide/travel-agency-service \ No newline at end of file diff --git a/spring-cloud/spring-cloud-openfeign/pom.xml b/spring-cloud/spring-cloud-openfeign/pom.xml index 92de33572b..e20fe338c1 100644 --- a/spring-cloud/spring-cloud-openfeign/pom.xml +++ b/spring-cloud/spring-cloud-openfeign/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.baeldung.cloud openfeign 0.0.1-SNAPSHOT @@ -10,12 +9,24 @@ OpenFeign project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.cloud @@ -39,18 +50,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - 2.0.1.RELEASE Finchley.SR2 diff --git a/spring-cloud/spring-cloud-rest/pom.xml b/spring-cloud/spring-cloud-rest/pom.xml index 7f316f47fc..8677b742de 100644 --- a/spring-cloud/spring-cloud-rest/pom.xml +++ b/spring-cloud/spring-cloud-rest/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-rest 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 a196ed8531..b34e325eb8 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,21 +1,33 @@ + 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 spring-cloud-rest-books-api - Simple books API jar + Simple books API - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + Camden.SR4 + pom + import + + + + org.springframework.cloud @@ -56,16 +68,4 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - Camden.SR4 - pom - import - - - - 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 7a71cdb13b..b3bb6fafdc 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,21 +1,33 @@ + 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-config-server 0.0.1-SNAPSHOT spring-cloud-rest-config-server - Spring Cloud REST configuration server jar + Spring Cloud REST configuration server - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.cloud @@ -31,18 +43,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - Camden.SR4 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 7ce04f2815..aec51ca38a 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,21 +1,33 @@ + 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 spring-cloud-rest-discovery-server - Spring Cloud REST server jar + Spring Cloud REST server - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.cloud @@ -39,18 +51,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - Edgware.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 cd7749460e..161b996496 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,21 +1,33 @@ + 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 spring-cloud-rest-reviews-api - Simple reviews API jar + Simple reviews API - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 + + + + org.springframework.cloud + spring-cloud-dependencies + Camden.SR4 + pom + import + + + + org.springframework.cloud @@ -60,18 +72,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - Camden.SR4 - pom - import - - - - 3.0.1 0.6 diff --git a/spring-cloud/spring-cloud-ribbon-client/pom.xml b/spring-cloud/spring-cloud-ribbon-client/pom.xml index f677009a41..ac86447164 100644 --- a/spring-cloud/spring-cloud-ribbon-client/pom.xml +++ b/spring-cloud/spring-cloud-ribbon-client/pom.xml @@ -1,7 +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-ribbon-client 0.0.1-SNAPSHOT spring-cloud-ribbon-client @@ -9,23 +8,12 @@ Introduction to Spring Cloud Rest Client with Netflix Ribbon - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 - - - org.springframework.cloud - spring-cloud-starter-ribbon - - - org.springframework.boot - spring-boot-starter-web - - - @@ -38,6 +26,17 @@ + + + org.springframework.cloud + spring-cloud-starter-ribbon + + + org.springframework.boot + spring-boot-starter-web + + + Brixton.SR7 diff --git a/spring-cloud/spring-cloud-security/auth-client/pom.xml b/spring-cloud/spring-cloud-security/auth-client/pom.xml index c414e584e5..2852638c1a 100644 --- a/spring-cloud/spring-cloud-security/auth-client/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-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 auth-client auth-client @@ -8,8 +8,8 @@ Spring Cloud Security APP Client Module - spring-cloud-security com.baeldung + spring-cloud-security 1.0.0-SNAPSHOT diff --git a/spring-cloud/spring-cloud-security/auth-resource/pom.xml b/spring-cloud/spring-cloud-security/auth-resource/pom.xml index a60eca740c..0a642250e7 100644 --- a/spring-cloud/spring-cloud-security/auth-resource/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-resource/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 auth-resource auth-resource @@ -8,11 +8,23 @@ Spring Cloud Security APP Resource Module - spring-cloud-security com.baeldung + spring-cloud-security 1.0.0-SNAPSHOT + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.boot @@ -34,18 +46,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - diff --git a/spring-cloud/spring-cloud-security/auth-server/pom.xml b/spring-cloud/spring-cloud-security/auth-server/pom.xml index afd8dbef44..f6d0861552 100644 --- a/spring-cloud/spring-cloud-security/auth-server/pom.xml +++ b/spring-cloud/spring-cloud-security/auth-server/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 auth-server - auth-server + auth-server Spring Cloud Security APP Server Module - + - spring-cloud-security com.baeldung + spring-cloud-security 1.0.0-SNAPSHOT @@ -36,7 +36,7 @@ ${spring-cloud-starter-oauth2.version} - + 2.1.2.RELEASE diff --git a/spring-cloud/spring-cloud-security/pom.xml b/spring-cloud/spring-cloud-security/pom.xml index d65fd6520b..498c88ac48 100644 --- a/spring-cloud/spring-cloud-security/pom.xml +++ b/spring-cloud/spring-cloud-security/pom.xml @@ -1,23 +1,23 @@ + 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-security 1.0.0-SNAPSHOT spring-cloud-security pom - - parent-boot-2 + com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 - + auth-client - auth-resource - auth-server + auth-resource + auth-server diff --git a/spring-cloud/spring-cloud-stream-starters/twitterhdfs/pom.xml b/spring-cloud/spring-cloud-stream-starters/twitterhdfs/pom.xml index 8846773338..1cfbf7e7c8 100644 --- a/spring-cloud/spring-cloud-stream-starters/twitterhdfs/pom.xml +++ b/spring-cloud/spring-cloud-stream-starters/twitterhdfs/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.twitterhdfs twitterhdfs @@ -9,8 +9,8 @@ jar - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../../parent-boot-1 diff --git a/spring-cloud/spring-cloud-stream/pom.xml b/spring-cloud/spring-cloud-stream/pom.xml index 76a51cc3ca..df17b778da 100644 --- a/spring-cloud/spring-cloud-stream/pom.xml +++ b/spring-cloud/spring-cloud-stream/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-stream diff --git a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml index 2ba9d55358..3a4cf6c56e 100644 --- a/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml +++ b/spring-cloud/spring-cloud-stream/spring-cloud-stream-kafka/pom.xml @@ -1,11 +1,11 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-stream-kafka spring-cloud-stream-kafka - Simple Spring Cloud Stream jar + Simple Spring Cloud Stream org.springframework.boot @@ -13,6 +13,18 @@ 2.1.5.RELEASE + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + @@ -51,18 +63,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - 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 1649cfc0b5..4273bd8701 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 @@ -4,8 +4,8 @@ 4.0.0 spring-cloud-stream-rabbit spring-cloud-stream-rabbit - Simple Spring Cloud Stream jar + Simple Spring Cloud Stream org.baeldung diff --git a/spring-cloud/spring-cloud-task/pom.xml b/spring-cloud/spring-cloud-task/pom.xml index 7c2c0d17f2..377d16a999 100644 --- a/spring-cloud/spring-cloud-task/pom.xml +++ b/spring-cloud/spring-cloud-task/pom.xml @@ -1,16 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.baeldung.spring.cloud spring-cloud-task 1.0.0-SNAPSHOT - spring-cloud-task + spring-cloud-task pom - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 @@ -22,7 +22,7 @@ - + org.springframework.cloud spring-cloud-task-dependencies ${spring-cloud-task.version} diff --git a/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml b/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml index b6b5a1cf0f..be920bb93d 100644 --- a/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml +++ b/spring-cloud/spring-cloud-task/springcloudtaskbatch/pom.xml @@ -1,14 +1,15 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.baeldung.cloud springcloudtaskbatch springcloudtaskbatch - spring-cloud-task com.baeldung.spring.cloud + spring-cloud-task 1.0.0-SNAPSHOT diff --git a/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml b/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml index 03bfe7b1cb..441924f1d3 100644 --- a/spring-cloud/spring-cloud-task/springcloudtasksink/pom.xml +++ b/spring-cloud/spring-cloud-task/springcloudtasksink/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 SpringCloudTaskSink SpringCloudTaskSink jar Demo project for Spring Boot - - spring-cloud-task + com.baeldung.spring.cloud + spring-cloud-task 1.0.0-SNAPSHOT diff --git a/spring-cloud/spring-cloud-vault/pom.xml b/spring-cloud/spring-cloud-vault/pom.xml index faf27b6ac8..cbb32ac937 100644 --- a/spring-cloud/spring-cloud-vault/pom.xml +++ b/spring-cloud/spring-cloud-vault/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 spring-cloud-vault @@ -15,6 +15,18 @@ ../../parent-boot-2 + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + @@ -43,31 +55,19 @@ spring-boot-starter-jdbc - org.springframework.boot - spring-boot-devtools + org.springframework.boot + spring-boot-devtools - org.springframework.boot - spring-boot-starter-web + org.springframework.boot + spring-boot-starter-web - org.springframework.boot - spring-boot-starter-data-jpa + org.springframework.boot + spring-boot-starter-data-jpa - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml index 2da47cf40d..b0ee448e87 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 Greeting Greeting @@ -12,6 +12,18 @@ 1.0.0-SNAPSHOT + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.boot @@ -52,18 +64,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} - pom - import - - - - 1.2.5.RELEASE 1.3 diff --git a/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml b/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml index 0da0f7503e..3a263e4ded 100644 --- a/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/HelloWorld/pom.xml @@ -1,17 +1,29 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 HelloWorld - jar HelloWorld - + jar + com.baeldung.spring.cloud spring-cloud-zookeeper 1.0.0-SNAPSHOT + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.boot @@ -42,18 +54,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud-dependencies.version} - pom - import - - - - diff --git a/spring-cloud/spring-cloud-zookeeper/pom.xml b/spring-cloud/spring-cloud-zookeeper/pom.xml index 4ea9b22e9d..64d30b19a6 100644 --- a/spring-cloud/spring-cloud-zookeeper/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/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 spring-cloud-zookeeper - spring-cloud-zookeeper + spring-cloud-zookeeper pom - + com.baeldung.spring.cloud spring-cloud @@ -22,5 +22,5 @@ 4.3.7.RELEASE 1.0.3.RELEASE - + \ 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 9c075ebfe3..118a9e2c11 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,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 eureka-client 1.0.0-SNAPSHOT @@ -14,6 +14,18 @@ 1.0.0-SNAPSHOT + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -27,16 +39,4 @@ - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - 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 97933210de..08854b02fd 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,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 eureka-server 1.0.0-SNAPSHOT @@ -14,6 +14,18 @@ 1.0.0-SNAPSHOT + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.cloud @@ -27,16 +39,4 @@ - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - - 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 fbae051277..c7b35ef934 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/bin/pom.xml @@ -1,13 +1,12 @@ - 4.0.0 - com.baeldung.spring.cloud + 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-zuul-eureka-integration 1.0.0-SNAPSHOT Spring Cloud Zuul and Eureka Integration - Spring Cloud Zuul and Eureka Integration pom + Spring Cloud Zuul and Eureka Integration com.baeldung.spring.cloud @@ -28,4 +27,5 @@ 1.4.2.RELEASE 1.10 + 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 1c2cb85da5..2a899760dd 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,14 +1,27 @@ + 4.0.0 zuul-server - + 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.boot @@ -32,16 +45,5 @@ 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 af7df71d17..9cf96df60e 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,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 eureka-client 1.0.0-SNAPSHOT @@ -14,26 +14,6 @@ 1.0.0-SNAPSHOT - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-client - ${spring-cloud-starter-eureka.version} - - - org.springframework.boot - spring-boot-starter-web - ${spring-boot-starter-web.version} - - - - org.springframework.boot - spring-boot-starter-test - ${spring-boot-starter-web.version} - test - - - @@ -46,4 +26,24 @@ + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + ${spring-cloud-starter-eureka.version} + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-starter-web.version} + + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot-starter-web.version} + test + + + 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 d1f618507f..cd25f5f294 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,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 eureka-server 1.0.0-SNAPSHOT @@ -14,26 +14,6 @@ 1.0.0-SNAPSHOT - - - org.springframework.cloud - spring-cloud-starter-netflix-eureka-server - ${spring-cloud-starter-eureka.version} - - - commons-configuration - commons-configuration - ${commons-config.version} - - - - org.springframework.boot - spring-boot-starter-test - ${spring-boot-starter-web.version} - test - - - @@ -46,4 +26,24 @@ + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-server + ${spring-cloud-starter-eureka.version} + + + commons-configuration + commons-configuration + ${commons-config.version} + + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot-starter-web.version} + test + + + diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml index 7fe0cf6ac3..996110f875 100644 --- a/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml +++ b/spring-cloud/spring-cloud-zuul-eureka-integration/pom.xml @@ -3,7 +3,6 @@ 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 spring-cloud-zuul-eureka-integration diff --git a/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml b/spring-cloud/spring-cloud-zuul-eureka-integration/zuul-server/pom.xml index 57a11f3385..3d238d5d5f 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,15 +1,28 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 zuul-server - zuul-server - + zuul-server + 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.boot @@ -33,7 +46,7 @@ rxjava ${rxjava.version} - + org.springframework.boot spring-boot-starter-test @@ -41,17 +54,5 @@ test - - - - - 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-fallback/api-gateway/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml index ee0f607d8a..136461ccb9 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/api-gateway/pom.xml @@ -1,11 +1,12 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 api-gateway api-gateway - API Gateway using Zuul jar + API Gateway using Zuul com.baeldung.spring.cloud @@ -13,6 +14,18 @@ 1.0.0-SNAPSHOT + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.boot @@ -29,15 +42,4 @@ - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - diff --git a/spring-cloud/spring-cloud-zuul-fallback/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/pom.xml index 5bdd1d49ca..cb762eb099 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/pom.xml @@ -1,11 +1,11 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-cloud-zuul-fallback - pom spring-cloud-zuul-fallback + pom Spring Cloud Zuul Fallback @@ -25,4 +25,5 @@ Finchley.SR2 3.1.1 + diff --git a/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml b/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml index 611f1dcd4f..bafd4ffcd1 100644 --- a/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml +++ b/spring-cloud/spring-cloud-zuul-fallback/weather-service/pom.xml @@ -1,6 +1,7 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 weather-service Weather Service @@ -12,6 +13,18 @@ 1.0.0-SNAPSHOT + + + + org.springframework.cloud + spring-cloud-starter-parent + ${spring-cloud-dependencies.version} + pom + import + + + + org.springframework.boot @@ -25,15 +38,4 @@ - - - - org.springframework.cloud - spring-cloud-starter-parent - ${spring-cloud-dependencies.version} - pom - import - - - diff --git a/spring-cloud/spring-cloud-zuul/pom.xml b/spring-cloud/spring-cloud-zuul/pom.xml index fe28dd1299..b1f2e886de 100644 --- a/spring-cloud/spring-cloud-zuul/pom.xml +++ b/spring-cloud/spring-cloud-zuul/pom.xml @@ -9,8 +9,8 @@ pom - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -21,6 +21,18 @@ spring-zuul-rate-limiting + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + org.springframework.boot @@ -41,18 +53,6 @@ - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - @@ -73,8 +73,8 @@ UTF-8 UTF-8 - Finchley.SR1 - 2.0.6.RELEASE + Hoxton.RELEASE + 2.2.2.RELEASE diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml index 57e566657b..f5a8c3b613 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/pom.xml @@ -12,10 +12,6 @@ - - org.springframework.boot - spring-boot-starter-web - org.apache.commons commons-lang3 diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/controller/FooController.java b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/controller/FooController.java index 87f237b75c..f8f07342f6 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/controller/FooController.java +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/controller/FooController.java @@ -1,11 +1,9 @@ package com.baeldung.web.controller; import com.baeldung.web.dto.Foo; -import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -13,22 +11,15 @@ import javax.servlet.http.HttpServletResponse; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.apache.commons.lang3.RandomStringUtils.randomNumeric; -@Controller +@RestController public class FooController { - public FooController() { - super(); - } - - // API - read - @RequestMapping(method = RequestMethod.GET, value = "/foos/{id}") - @ResponseBody + @GetMapping("/foos/{id}") public Foo findById(@PathVariable final long id, HttpServletRequest req, HttpServletResponse res) { - // System.out.println(req.getHeaderNames()); - // System.out.println("------" + req.getHeader("Test")); if (req.getHeader("Test") != null) { res.addHeader("Test", req.getHeader("Test")); } + return new Foo(Long.parseLong(randomNumeric(2)), randomAlphabetic(4)); } diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/dto/Foo.java b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/dto/Foo.java index 107f982f98..b25aef266d 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/dto/Foo.java +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-foos-resource/src/main/java/com/baeldung/web/dto/Foo.java @@ -1,22 +1,15 @@ package com.baeldung.web.dto; public class Foo { + private long id; private String name; - public Foo() { - super(); - } - public Foo(final long id, final String name) { - super(); - this.id = id; this.name = name; } - // - public long getId() { return id; } diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml index af961537f9..34f0e6b7ae 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-rate-limiting/pom.xml @@ -13,18 +13,6 @@ 0.0.1-SNAPSHOT - - - com.marcosbarbero.cloud - spring-cloud-zuul-ratelimit - ${rate.limit.version} - - - org.springframework.boot - spring-boot-starter-data-jpa - - - @@ -37,6 +25,18 @@ + + + com.marcosbarbero.cloud + spring-cloud-zuul-ratelimit + ${rate.limit.version} + + + org.springframework.boot + spring-boot-starter-data-jpa + + + spring-zuul-rate-limiting diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml index c5854b5ba5..09c94663b1 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -47,4 +48,5 @@ + \ No newline at end of file diff --git a/spring-core-2/README.md b/spring-core-2/README.md index 027c049163..0ed303162d 100644 --- a/spring-core-2/README.md +++ b/spring-core-2/README.md @@ -17,4 +17,4 @@ This module contains articles about core Spring functionality - [Using @Autowired in Abstract Classes](https://www.baeldung.com/spring-autowired-abstract-class) - [Guide to the Spring BeanFactory](https://www.baeldung.com/spring-beanfactory) - [Read HttpServletRequest Multiple Times](https://www.baeldung.com/spring-reading-httpservletrequest-multiple-times) -- More articles: [[<-- prev]](/spring-core) \ No newline at end of file +- More articles: [[<-- prev]](/spring-core)[[next -->]](/spring-core-3) \ No newline at end of file diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index 21548d6984..f89a093f30 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,12 +8,34 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 + + + + org.springframework + spring-framework-bom + ${org.springframework.version} + pom + import + + + org.springframework + spring-core + ${org.springframework.version} + + + org.springframework.boot + spring-boot-starter-thymeleaf + ${org.springframework.version} + + + + com.fasterxml.jackson.core @@ -139,28 +162,6 @@ - - - - org.springframework - spring-framework-bom - ${org.springframework.version} - pom - import - - - org.springframework - spring-core - ${org.springframework.version} - - - org.springframework.boot - spring-boot-starter-thymeleaf - ${org.springframework.version} - - - - spring-core-2 @@ -180,6 +181,7 @@ + dev diff --git a/spring-core-3/README.md b/spring-core-3/README.md index 1c5d911402..ae2d33c196 100644 --- a/spring-core-3/README.md +++ b/spring-core-3/README.md @@ -1,3 +1,7 @@ +## Spring Core + +This module contains articles about core Spring functionality + ## Relevant Articles: - [Understanding getBean() in Spring](https://www.baeldung.com/spring-getbean) diff --git a/spring-core/pom.xml b/spring-core/pom.xml index 7e5a9b3feb..eb25bcd517 100644 --- a/spring-core/pom.xml +++ b/spring-core/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-core 0.0.1-SNAPSHOT spring-core @@ -57,7 +56,7 @@ ${mockito.spring.boot.version} test - + org.assertj assertj-core ${assertj.version} diff --git a/spring-cucumber/pom.xml b/spring-cucumber/pom.xml index 85980fbc60..245d10e77b 100644 --- a/spring-cucumber/pom.xml +++ b/spring-cucumber/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-cucumber 0.0.1-SNAPSHOT spring-cucumber - Demo project for Spring Boot jar + Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-data-rest-querydsl/pom.xml b/spring-data-rest-querydsl/pom.xml index 2c75990c65..9f53f6b55f 100644 --- a/spring-data-rest-querydsl/pom.xml +++ b/spring-data-rest-querydsl/pom.xml @@ -1,16 +1,15 @@ + 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-data-rest-querydsl 1.0 spring-data-rest-querydsl - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/spring-data-rest/pom.xml b/spring-data-rest/pom.xml index 8400993a38..05f2ccbbae 100644 --- a/spring-data-rest/pom.xml +++ b/spring-data-rest/pom.xml @@ -9,8 +9,8 @@ Intro to Spring Data REST - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -89,7 +89,7 @@ UTF-8 - com.baeldung.SpringDataRestApplication + com.baeldung.books.SpringDataRestApplication \ No newline at end of file diff --git a/spring-di/pom.xml b/spring-di/pom.xml index c865815753..48cdf60673 100644 --- a/spring-di/pom.xml +++ b/spring-di/pom.xml @@ -5,8 +5,8 @@ 4.0.0 spring-di 1.0-SNAPSHOT - war spring-di + war com.baeldung @@ -15,6 +15,23 @@ ../parent-spring-5 + + + + org.springframework + spring-framework-bom + ${org.springframework.version} + pom + import + + + org.springframework + spring-core + ${org.springframework.version} + + + + org.springframework @@ -68,11 +85,17 @@ commons-io ${commons.io.version} + + org.aspectj + aspectjweaver + ${aspectjweaver.version} + + - - - - + + + + javax.annotation @@ -80,32 +103,15 @@ ${annotation-api.version} - - - - - - + + + + + + - - - - org.springframework - spring-framework-bom - ${org.springframework.version} - pom - import - - - org.springframework - spring-core - ${org.springframework.version} - - - - spring-di @@ -157,6 +163,7 @@ 1.5.2.RELEASE 1.10.19 3.12.2 + 1.9.5 \ No newline at end of file diff --git a/spring-di/src/main/java/org/baeldung/store/AppConfig.java b/spring-di/src/main/java/org/baeldung/store/AppConfig.java new file mode 100644 index 0000000000..80b6733dff --- /dev/null +++ b/spring-di/src/main/java/org/baeldung/store/AppConfig.java @@ -0,0 +1,23 @@ +package org.baeldung.store; + +import org.springframework.context.annotation.Bean; + +public class AppConfig { + + @Bean + public Item item1() { + return new ItemImpl1(); + } + + @Bean + public Store storeThroughConstructorInjection() { + return new Store(item1()); + } + + @Bean + public Store storeThroughSetterInjection() { + Store store = new Store(); + store.setItem(item1()); + return store; + } +} diff --git a/spring-di/src/main/java/org/baeldung/store/Item.java b/spring-di/src/main/java/org/baeldung/store/Item.java new file mode 100644 index 0000000000..1d7292fc35 --- /dev/null +++ b/spring-di/src/main/java/org/baeldung/store/Item.java @@ -0,0 +1,5 @@ +package org.baeldung.store; + +public interface Item { + +} diff --git a/spring-di/src/main/java/org/baeldung/store/ItemImpl1.java b/spring-di/src/main/java/org/baeldung/store/ItemImpl1.java new file mode 100644 index 0000000000..8bda9f24c9 --- /dev/null +++ b/spring-di/src/main/java/org/baeldung/store/ItemImpl1.java @@ -0,0 +1,5 @@ +package org.baeldung.store; + +public class ItemImpl1 implements Item { + +} diff --git a/spring-di/src/main/java/org/baeldung/store/Store.java b/spring-di/src/main/java/org/baeldung/store/Store.java new file mode 100644 index 0000000000..dcc2c3be48 --- /dev/null +++ b/spring-di/src/main/java/org/baeldung/store/Store.java @@ -0,0 +1,23 @@ +package org.baeldung.store; + +import org.springframework.beans.factory.annotation.Autowired; + +public class Store { + + @Autowired + private Item item; + + public Store() {} + + public Store(Item item) { + this.item = item; + } + + public Item getItem() { + return item; + } + + public void setItem(Item item) { + this.item = item; + } +} diff --git a/spring-di/src/main/resources/ioc-context-by-type.xml b/spring-di/src/main/resources/ioc-context-by-type.xml new file mode 100644 index 0000000000..1249ce51af --- /dev/null +++ b/spring-di/src/main/resources/ioc-context-by-type.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/spring-di/src/main/resources/ioc-context.xml b/spring-di/src/main/resources/ioc-context.xml new file mode 100644 index 0000000000..0e1d0ac29c --- /dev/null +++ b/spring-di/src/main/resources/ioc-context.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java b/spring-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppUnitTest.java similarity index 95% rename from spring-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java rename to spring-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppUnitTest.java index 945a0085f6..a85c451299 100644 --- a/spring-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppIntegrationTest.java +++ b/spring-di/src/test/java/com/baeldung/componentscan/filter/aspectj/ComponentScanAspectJFilterAppUnitTest.java @@ -16,7 +16,7 @@ import static org.hamcrest.CoreMatchers.*; @RunWith(SpringRunner.class) @SpringBootTest(classes = ComponentScanAspectJFilterApp.class) -public class ComponentScanAspectJFilterAppIntegrationTest { +public class ComponentScanAspectJFilterAppUnitTest { @Test public void whenAspectJFilterIsUsed_thenComponentScanShouldRegisterBeanMatchingAspectJCreteria() { diff --git a/spring-di/src/test/java/org/baeldung/store/AppConfigUnitTest.java b/spring-di/src/test/java/org/baeldung/store/AppConfigUnitTest.java new file mode 100644 index 0000000000..3260114679 --- /dev/null +++ b/spring-di/src/test/java/org/baeldung/store/AppConfigUnitTest.java @@ -0,0 +1,35 @@ +package org.baeldung.store; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = AppConfig.class) +public class AppConfigUnitTest { + + @Autowired + @Qualifier("storeThroughConstructorInjection") + private Store storeByConstructorInjection; + + @Autowired + @Qualifier("storeThroughSetterInjection") + private Store storeBySetterInjection; + + @Test + public void givenValidXmlConfig_WhenInjectStoreByConstructorInjection_ThenBeanIsNotNull() { + assertNotNull(storeByConstructorInjection); + assertNotNull(storeByConstructorInjection.getItem()); + } + + @Test + public void givenValidXmlConfig_WhenInjectStoreBySetterInjection_ThenBeanIsNotNull() { + assertNotNull(storeBySetterInjection); + assertNotNull(storeByConstructorInjection.getItem()); + } +} diff --git a/spring-di/src/test/java/org/baeldung/store/XmlAppConfigByTypeUnitTest.java b/spring-di/src/test/java/org/baeldung/store/XmlAppConfigByTypeUnitTest.java new file mode 100644 index 0000000000..036399e537 --- /dev/null +++ b/spring-di/src/test/java/org/baeldung/store/XmlAppConfigByTypeUnitTest.java @@ -0,0 +1,30 @@ +package org.baeldung.store; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +/** + * Separate unit test class where only one Item object is available for + * autowiring. If the ioc-context.xml were used for autowiring by type, there + * would be multiple qualifying Item objects, causing a failure. + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("classpath:/ioc-context-by-type.xml") +public class XmlAppConfigByTypeUnitTest { + + @Autowired + @Qualifier("xml-store-by-autowire-type") + private Store storeByAutowireInjectionByType; + + @Test + public void givenValidXmlConfig_WhenInjectStoreByAutowireInjectionByType_ThenBeanIsNotNull() { + assertNotNull(storeByAutowireInjectionByType); + assertNotNull(storeByAutowireInjectionByType.getItem()); + } +} diff --git a/spring-di/src/test/java/org/baeldung/store/XmlAppConfigUnitTest.java b/spring-di/src/test/java/org/baeldung/store/XmlAppConfigUnitTest.java new file mode 100644 index 0000000000..2dd4d6ccd6 --- /dev/null +++ b/spring-di/src/test/java/org/baeldung/store/XmlAppConfigUnitTest.java @@ -0,0 +1,55 @@ +package org.baeldung.store; + +import static org.junit.Assert.assertNotNull; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("classpath:/ioc-context.xml") +public class XmlAppConfigUnitTest { + + @Autowired + @Qualifier("xml-store-by-constructor") + private Store storeByConstructorInjection; + + @Autowired + @Qualifier("xml-store-by-setter") + private Store storeBySetterInjection; + + @Autowired + @Qualifier("xml-store-by-autowire-name") + private Store storeByAutowireInjectionByName; + + @Autowired + @Qualifier("xml-store-by-setter-lazy") + private Store storeBySetterInjectionLazy; + + @Test + public void givenValidXmlConfig_WhenInjectStoreByConstructorInjection_ThenBeanIsNotNull() { + assertNotNull(storeByConstructorInjection); + assertNotNull(storeByConstructorInjection.getItem()); + } + + @Test + public void givenValidXmlConfig_WhenInjectStoreBySetterInjection_ThenBeanIsNotNull() { + assertNotNull(storeBySetterInjection); + assertNotNull(storeByConstructorInjection.getItem()); + } + + @Test + public void givenValidXmlConfig_WhenInjectStoreByAutowireInjectionByName_ThenBeanIsNotNull() { + assertNotNull(storeByAutowireInjectionByName); + assertNotNull(storeByAutowireInjectionByName.getItem()); + } + + @Test + public void givenValidXmlConfig_WhenInjectStoreBySetterInjectionLazy_ThenBeanIsNotNull() { + assertNotNull(storeBySetterInjectionLazy); + assertNotNull(storeByConstructorInjection.getItem()); + } +} diff --git a/spring-dispatcher-servlet/pom.xml b/spring-dispatcher-servlet/pom.xml index 6f816986be..9b9f7fb4c6 100644 --- a/spring-dispatcher-servlet/pom.xml +++ b/spring-dispatcher-servlet/pom.xml @@ -1,8 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung spring-dispatcher-servlet 1.0.0 spring-dispatcher-servlet @@ -62,11 +61,11 @@ ${commons-fileupload.version} - org.springframework.boot - spring-boot-starter-test - 1.5.10.RELEASE - test - + org.springframework.boot + spring-boot-starter-test + 1.5.10.RELEASE + test + diff --git a/spring-drools/pom.xml b/spring-drools/pom.xml index 5bb2d6a8e9..5adef4b2a9 100644 --- a/spring-drools/pom.xml +++ b/spring-drools/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 spring-drools 1.0.0-SNAPSHOT - spring-drools - + spring-drools + com.baeldung parent-modules diff --git a/spring-ehcache/pom.xml b/spring-ehcache/pom.xml index b8378617c5..bf78e1392c 100644 --- a/spring-ehcache/pom.xml +++ b/spring-ehcache/pom.xml @@ -1,5 +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-ehcache 0.1-SNAPSHOT @@ -7,14 +8,13 @@ jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 - org.springframework.boot spring-boot-starter-web diff --git a/spring-ejb/ejb-beans/pom.xml b/spring-ejb/ejb-beans/pom.xml index 168809ee6d..b8978a0cc3 100644 --- a/spring-ejb/ejb-beans/pom.xml +++ b/spring-ejb/ejb-beans/pom.xml @@ -1,5 +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.singletonsession ejb-beans @@ -42,6 +43,7 @@ test + arquillian-glassfish-embedded diff --git a/spring-ejb/pom.xml b/spring-ejb/pom.xml index 4422223c6f..1b3a52184e 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 spring-ejb @@ -74,10 +74,10 @@ spring-ejb-remote ejb-beans - spring-ejb-client - wildfly + spring-ejb-client + wildfly - + 1.0.0-SNAPSHOT 8.0 diff --git a/spring-ejb/spring-ejb-client/pom.xml b/spring-ejb/spring-ejb-client/pom.xml index 2dd3120532..6c335e8982 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 spring-ejb-client @@ -61,7 +61,7 @@ org.springframework.boot spring-boot-maven-plugin - ${spring-boot.version} + ${spring-boot.version} diff --git a/spring-ejb/spring-ejb-remote/pom.xml b/spring-ejb/spring-ejb-remote/pom.xml index 633e0387b0..28d5398b97 100644 --- a/spring-ejb/spring-ejb-remote/pom.xml +++ b/spring-ejb/spring-ejb-remote/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-ejb-remote spring-ejb-remote diff --git a/spring-ejb/wildfly/pom.xml b/spring-ejb/wildfly/pom.xml index e2c3ffb50c..fdf2517139 100644 --- a/spring-ejb/wildfly/pom.xml +++ b/spring-ejb/wildfly/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 com.baeldung.wildfly wildfly 0.0.1-SNAPSHOT - wildfly + wildfly pom diff --git a/spring-ejb/wildfly/widlfly-web/pom.xml b/spring-ejb/wildfly/widlfly-web/pom.xml index 5eefada2fc..79d0dca470 100644 --- a/spring-ejb/wildfly/widlfly-web/pom.xml +++ b/spring-ejb/wildfly/widlfly-web/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -38,4 +39,5 @@ ${wildlfy.version} + \ No newline at end of file diff --git a/spring-ejb/wildfly/wildfly-ear/pom.xml b/spring-ejb/wildfly/wildfly-ear/pom.xml index 62d15a53dc..9393820b12 100644 --- a/spring-ejb/wildfly/wildfly-ear/pom.xml +++ b/spring-ejb/wildfly/wildfly-ear/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 wildfly-ear - wildfly-ear + wildfly-ear ear - + com.baeldung.wildfly wildfly @@ -61,9 +62,10 @@ - + 2.10.1 1.2.0.Final + \ No newline at end of file diff --git a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml index 41c7012ea9..21fc26106a 100644 --- a/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb-interfaces/pom.xml @@ -1,9 +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 wildfly-ejb-interfaces - wildfly-ejb-interfaces - + wildfly-ejb-interfaces + com.baeldung.wildfly wildfly diff --git a/spring-ejb/wildfly/wildfly-ejb/pom.xml b/spring-ejb/wildfly/wildfly-ejb/pom.xml index f03bfb341c..c35e340ac9 100644 --- a/spring-ejb/wildfly/wildfly-ejb/pom.xml +++ b/spring-ejb/wildfly/wildfly-ejb/pom.xml @@ -1,10 +1,11 @@ + 4.0.0 wildfly-ejb - wildfly-ejb + wildfly-ejb ejb - + com.baeldung.wildfly wildfly @@ -48,8 +49,9 @@ - + 3.2 + \ No newline at end of file diff --git a/spring-ejb/wildfly/wildfly-jpa/pom.xml b/spring-ejb/wildfly/wildfly-jpa/pom.xml index 3005ab714c..1bc618a296 100644 --- a/spring-ejb/wildfly/wildfly-jpa/pom.xml +++ b/spring-ejb/wildfly/wildfly-jpa/pom.xml @@ -1,9 +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 wildfly-jpa - wildfly-jpa - + wildfly-jpa + com.baeldung.wildfly wildfly diff --git a/spring-ejb/wildfly/wildfly-mdb/pom.xml b/spring-ejb/wildfly/wildfly-mdb/pom.xml index a2ffca2fc5..109cff861b 100644 --- a/spring-ejb/wildfly/wildfly-mdb/pom.xml +++ b/spring-ejb/wildfly/wildfly-mdb/pom.xml @@ -1,9 +1,10 @@ + 4.0.0 wildfly-mdb - wildfly-mdb - + wildfly-mdb + com.baeldung.wildfly wildfly @@ -19,4 +20,5 @@ provided + \ No newline at end of file diff --git a/spring-exceptions/pom.xml b/spring-exceptions/pom.xml index 45c80f2c9f..29ed7d5caa 100644 --- a/spring-exceptions/pom.xml +++ b/spring-exceptions/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"> 4.0.0 - com.baeldung spring-exceptions 0.1-SNAPSHOT spring-exceptions diff --git a/spring-freemarker/pom.xml b/spring-freemarker/pom.xml index be34f84495..bdf7e97bce 100644 --- a/spring-freemarker/pom.xml +++ b/spring-freemarker/pom.xml @@ -1,5 +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.freemarker spring-freemarker @@ -46,12 +47,11 @@ - org.springframework.boot - spring-boot-starter-test - ${spring-boot.version} - test - - + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + test + diff --git a/spring-groovy/pom.xml b/spring-groovy/pom.xml index c26de0b6dd..ef5613adf6 100644 --- a/spring-groovy/pom.xml +++ b/spring-groovy/pom.xml @@ -1,5 +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.baeldug spring-groovy @@ -53,7 +54,6 @@ - diff --git a/spring-integration/pom.xml b/spring-integration/pom.xml index f06cb91ef6..ebdde5a1ee 100644 --- a/spring-integration/pom.xml +++ b/spring-integration/pom.xml @@ -1,5 +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.samples.spring.integration spring-integration diff --git a/spring-jenkins-pipeline/pom.xml b/spring-jenkins-pipeline/pom.xml index 54b4cc478c..aa6008162c 100644 --- a/spring-jenkins-pipeline/pom.xml +++ b/spring-jenkins-pipeline/pom.xml @@ -1,16 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-jenkins-pipeline 0.0.1-SNAPSHOT spring-jenkins-pipeline - Intro to Jenkins 2 and the power of pipelines jar + Intro to Jenkins 2 and the power of pipelines - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/spring-jersey/pom.xml b/spring-jersey/pom.xml index cf80ac4069..3c84e9c11e 100644 --- a/spring-jersey/pom.xml +++ b/spring-jersey/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"> 4.0.0 - com.baeldung spring-jersey 0.1-SNAPSHOT - spring-jersey + spring-jersey war - + com.baeldung parent-modules @@ -119,14 +118,14 @@ ${assertj-core.version} test - + - org.springframework.boot - spring-boot-starter-test - ${spring-boot.version} - test - + org.springframework.boot + spring-boot-starter-test + ${spring-boot.version} + test + diff --git a/spring-jinq/pom.xml b/spring-jinq/pom.xml index 1661614fa0..991401c4a1 100644 --- a/spring-jinq/pom.xml +++ b/spring-jinq/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-jinq 0.1-SNAPSHOT diff --git a/spring-jms/pom.xml b/spring-jms/pom.xml index ea4af32216..a0d2625477 100644 --- a/spring-jms/pom.xml +++ b/spring-jms/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung spring-jms 0.0.1-SNAPSHOT spring-jms diff --git a/spring-jooq/pom.xml b/spring-jooq/pom.xml index 8a1fa877da..620172f2a1 100644 --- a/spring-jooq/pom.xml +++ b/spring-jooq/pom.xml @@ -1,16 +1,30 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-jooq - spring-jooq - + spring-jooq + - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + @@ -129,7 +143,7 @@ com.baeldung.jooq.introduction.db src/main/java - + @@ -174,19 +188,6 @@ - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - - 3.11.7 1.0.0 diff --git a/spring-kafka/pom.xml b/spring-kafka/pom.xml index 3d08aaa928..d60a2ee506 100644 --- a/spring-kafka/pom.xml +++ b/spring-kafka/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 - com.baeldung spring-kafka 0.0.1-SNAPSHOT spring-kafka Intro to Kafka with Spring - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-katharsis/pom.xml b/spring-katharsis/pom.xml index 18bf198948..3aeaa973af 100644 --- a/spring-katharsis/pom.xml +++ b/spring-katharsis/pom.xml @@ -1,15 +1,16 @@ + 4.0.0 org.springframework.samples spring-katharsis 0.0.1-SNAPSHOT - spring-katharsis + spring-katharsis war - + - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/spring-ldap/pom.xml b/spring-ldap/pom.xml index 7399a84c2b..a9882ccb52 100644 --- a/spring-ldap/pom.xml +++ b/spring-ldap/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 spring-ldap 0.1-SNAPSHOT + spring-ldap jar - spring-ldap com.baeldung @@ -103,7 +103,6 @@ spring-ldap - live diff --git a/spring-mobile/pom.xml b/spring-mobile/pom.xml index 71d0d05933..ff90ac6ecb 100644 --- a/spring-mobile/pom.xml +++ b/spring-mobile/pom.xml @@ -1,8 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung spring-mobile 1.0-SNAPSHOT spring-mobile @@ -10,8 +9,8 @@ http://maven.apache.org - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/spring-mockito/pom.xml b/spring-mockito/pom.xml index 766234c41b..f3e0b04808 100644 --- a/spring-mockito/pom.xml +++ b/spring-mockito/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-mockito 0.0.1-SNAPSHOT spring-mockito - Injecting Mockito Mocks into Spring Beans jar + Injecting Mockito Mocks into Spring Beans - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-mvc-basics-2/README.md b/spring-mvc-basics-2/README.md index 7c88b1f2ff..4a5ea24283 100644 --- a/spring-mvc-basics-2/README.md +++ b/spring-mvc-basics-2/README.md @@ -1,6 +1,7 @@ -========= +## Spring MVC Basics -## Spring MVC Basics with Java Configuration Example Project +This module contains articles about the basics of Spring MVC. Articles about more specific areas of Spring MVC have +their own module. ### The Course The "REST With Spring" Classes: http://bit.ly/restwithspring @@ -10,3 +11,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [The Spring @Controller and @RestController Annotations](http://www.baeldung.com/spring-controller-vs-restcontroller) - [Model, ModelMap, and ModelView in Spring MVC](http://www.baeldung.com/spring-mvc-model-model-map-model-view) - [Spring Web Contexts](http://www.baeldung.com/spring-web-contexts) +- [[<-- Prev]](/spring-mvc-basics) \ No newline at end of file diff --git a/spring-mvc-basics-2/pom.xml b/spring-mvc-basics-2/pom.xml index 706459a268..8e36eb38d8 100644 --- a/spring-mvc-basics-2/pom.xml +++ b/spring-mvc-basics-2/pom.xml @@ -8,8 +8,8 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/model/Article.java b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/Article.java similarity index 87% rename from spring-mvc-basics-2/src/main/java/com/baeldung/model/Article.java rename to spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/Article.java index 141bd17db7..f6675295ed 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/model/Article.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/Article.java @@ -1,4 +1,4 @@ -package com.baeldung.model; +package com.baeldung.controller.optionalpathvars; public class Article { diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerController.java b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerController.java index 62c2502242..14b16e148b 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerController.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerController.java @@ -1,13 +1,11 @@ package com.baeldung.controller.optionalpathvars; -import static com.baeldung.model.Article.DEFAULT_ARTICLE; +import static com.baeldung.controller.optionalpathvars.Article.DEFAULT_ARTICLE; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.baeldung.model.Article; - @RestController public class ArticleViewerController { diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamController.java b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamController.java index d16cf4115c..50744b6067 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamController.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamController.java @@ -1,6 +1,6 @@ package com.baeldung.controller.optionalpathvars; -import static com.baeldung.model.Article.DEFAULT_ARTICLE; +import static com.baeldung.controller.optionalpathvars.Article.DEFAULT_ARTICLE; import java.util.Map; @@ -8,8 +8,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.baeldung.model.Article; - @RestController @RequestMapping(value = "/mapParam") public class ArticleViewerWithMapParamController { diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithOptionalParamController.java b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithOptionalParamController.java index fd7b900535..ff645fbcc7 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithOptionalParamController.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithOptionalParamController.java @@ -1,14 +1,12 @@ package com.baeldung.controller.optionalpathvars; -import static com.baeldung.model.Article.DEFAULT_ARTICLE; +import static com.baeldung.controller.optionalpathvars.Article.DEFAULT_ARTICLE; import java.util.Optional; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.baeldung.model.Article;; +import org.springframework.web.bind.annotation.RestController;; @RestController @RequestMapping("/optionalParam") diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithRequiredAttributeController.java b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithRequiredAttributeController.java index d9b36f93e8..8cd1539391 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithRequiredAttributeController.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithRequiredAttributeController.java @@ -1,12 +1,10 @@ package com.baeldung.controller.optionalpathvars; -import static com.baeldung.model.Article.DEFAULT_ARTICLE; +import static com.baeldung.controller.optionalpathvars.Article.DEFAULT_ARTICLE; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.baeldung.model.Article;; +import org.springframework.web.bind.annotation.RestController;; @RestController @RequestMapping(value = "/requiredAttribute") diff --git a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsController.java b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsController.java index 0b66b6cf43..0ea401a589 100644 --- a/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsController.java +++ b/spring-mvc-basics-2/src/main/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsController.java @@ -1,13 +1,11 @@ package com.baeldung.controller.optionalpathvars; -import static com.baeldung.model.Article.DEFAULT_ARTICLE; +import static com.baeldung.controller.optionalpathvars.Article.DEFAULT_ARTICLE; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import com.baeldung.model.Article; - @RestController @RequestMapping(value = "/seperateMethods") public class ArticleViewerWithTwoSeparateMethodsController { diff --git a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithOptionalParamIntegrationTest.java b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithOptionalParamIntegrationTest.java index 629e37f963..c7b568b68e 100644 --- a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithOptionalParamIntegrationTest.java +++ b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithOptionalParamIntegrationTest.java @@ -12,8 +12,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; - -import com.baeldung.model.Article; import org.baeldung.controller.config.WebConfig; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithRequiredAttributeIntegrationTest.java b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithRequiredAttributeIntegrationTest.java index 00494171c0..760d94af17 100644 --- a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithRequiredAttributeIntegrationTest.java +++ b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerControllerWithRequiredAttributeIntegrationTest.java @@ -12,8 +12,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; - -import com.baeldung.model.Article; import org.baeldung.controller.config.WebConfig; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamIntegrationTest.java b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamIntegrationTest.java index 3c82b11578..fca6bba5fd 100644 --- a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamIntegrationTest.java +++ b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithMapParamIntegrationTest.java @@ -12,8 +12,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; - -import com.baeldung.model.Article; import org.baeldung.controller.config.WebConfig; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsIntegrationTest.java b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsIntegrationTest.java index 9532270c43..5d2733ec92 100644 --- a/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsIntegrationTest.java +++ b/spring-mvc-basics-2/src/test/java/com/baeldung/controller/optionalpathvars/ArticleViewerWithTwoSeparateMethodsIntegrationTest.java @@ -12,8 +12,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import org.springframework.test.web.servlet.result.MockMvcResultMatchers; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; - -import com.baeldung.model.Article; import org.baeldung.controller.config.WebConfig; @RunWith(SpringJUnit4ClassRunner.class) diff --git a/spring-mvc-basics/README.md b/spring-mvc-basics/README.md index 0855015e70..a995c89a07 100644 --- a/spring-mvc-basics/README.md +++ b/spring-mvc-basics/README.md @@ -17,3 +17,4 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Using Spring @ResponseStatus to Set HTTP Status Code](https://www.baeldung.com/spring-response-status) - [Spring MVC and the @ModelAttribute Annotation](https://www.baeldung.com/spring-mvc-and-the-modelattribute-annotation) - [The HttpMediaTypeNotAcceptableException in Spring MVC](https://www.baeldung.com/spring-httpmediatypenotacceptable) +- [[Next -->]](/spring-mvc-basics-2) \ No newline at end of file diff --git a/spring-mvc-basics/pom.xml b/spring-mvc-basics/pom.xml index 8c52c60b65..ab6d200e67 100644 --- a/spring-mvc-basics/pom.xml +++ b/spring-mvc-basics/pom.xml @@ -1,17 +1,16 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-mvc-basics 0.1-SNAPSHOT spring-mvc-basics jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -50,5 +49,6 @@ + diff --git a/spring-mvc-forms-jsp/pom.xml b/spring-mvc-forms-jsp/pom.xml index 5ce2d19414..2bab93908f 100644 --- a/spring-mvc-forms-jsp/pom.xml +++ b/spring-mvc-forms-jsp/pom.xml @@ -1,9 +1,7 @@ - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung 0.1-SNAPSHOT spring-mvc-forms-jsp spring-mvc-forms-jsp @@ -64,11 +62,11 @@ ${jackson.version} - org.springframework.boot - spring-boot-starter-test - 1.5.10.RELEASE - test - + org.springframework.boot + spring-boot-starter-test + 1.5.10.RELEASE + test + diff --git a/spring-mvc-forms-thymeleaf/pom.xml b/spring-mvc-forms-thymeleaf/pom.xml index 99bf465b44..2aed7f70ad 100644 --- a/spring-mvc-forms-thymeleaf/pom.xml +++ b/spring-mvc-forms-thymeleaf/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-mvc-forms-thymeleaf spring-mvc-forms-thymeleaf @@ -8,8 +8,8 @@ spring forms examples using thymeleaf - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -41,4 +41,5 @@ 3.0.9.RELEASE com.baeldung.sessionattrs.SessionAttrsApplication + diff --git a/spring-mvc-java/pom.xml b/spring-mvc-java/pom.xml index ea0acdcb00..7d0afd85ec 100644 --- a/spring-mvc-java/pom.xml +++ b/spring-mvc-java/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 - com.baeldung spring-mvc-java 0.1-SNAPSHOT spring-mvc-java war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -46,7 +46,7 @@ com.fasterxml.jackson.core jackson-databind - ${jackson.version} + ${jackson.version} @@ -188,7 +188,6 @@ - live @@ -285,7 +284,6 @@ 3.0.1-b09 com.baeldung.SpringMVCApplication - diff --git a/spring-mvc-java/src/main/java/com/baeldung/web/controller/MultipartFileUploadStubController.java b/spring-mvc-java/src/main/java/com/baeldung/web/controller/MultipartFileUploadStubController.java new file mode 100644 index 0000000000..28c35e8603 --- /dev/null +++ b/spring-mvc-java/src/main/java/com/baeldung/web/controller/MultipartFileUploadStubController.java @@ -0,0 +1,58 @@ +package com.baeldung.web.controller; + +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.multipart.MultipartFile; + +@Controller +public class MultipartFileUploadStubController { + + @PostMapping("/stub/multipart") + public ResponseEntity uploadFile(MultipartFile file, String text, String text1, String text2, MultipartFile upstream) { + UploadResultResource result = new UploadResultResource(file, text, text1, text2, upstream); + return new ResponseEntity<>(result, HttpStatus.OK); + } + + public static class UploadResultResource { + + private final String file; + private final String text; + private final String text1; + private final String text2; + private final String upstream; + + public UploadResultResource(MultipartFile file, String text, String text1, String text2, MultipartFile upstream) { + this.file = format(file); + this.text = text; + this.text1 = text1; + this.text2 = text2; + this.upstream = format(upstream); + } + + private static String format(MultipartFile file) { + return file == null ? null : file.getOriginalFilename() + " (size: " + file.getSize() + " bytes)"; + } + + public String getFile() { + return file; + } + + public String getText() { + return text; + } + + public String getText1() { + return text1; + } + + public String getText2() { + return text2; + } + + public String getUpstream() { + return upstream; + } + } +} diff --git a/spring-mvc-kotlin/pom.xml b/spring-mvc-kotlin/pom.xml index fb1f242644..30d2c32ecf 100644 --- a/spring-mvc-kotlin/pom.xml +++ b/spring-mvc-kotlin/pom.xml @@ -1,82 +1,82 @@ - 4.0.0 - spring-mvc-kotlin - spring-mvc-kotlin - war + 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 + spring-mvc-kotlin + war - - parent-kotlin - com.baeldung - 1.0.0-SNAPSHOT - ../parent-kotlin - + + com.baeldung + parent-kotlin + 1.0.0-SNAPSHOT + ../parent-kotlin + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-json - - - org.thymeleaf - thymeleaf - - - org.thymeleaf - thymeleaf-spring4 - ${thymeleaf.version} - - - org.hibernate - hibernate-core - - - org.hibernate - hibernate-testing - test - - - com.h2database - h2 - test - - - org.springframework.boot - spring-boot-starter-test - test - - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-json + + + org.thymeleaf + thymeleaf + + + org.thymeleaf + thymeleaf-spring4 + ${thymeleaf.version} + + + org.hibernate + hibernate-core + + + org.hibernate + hibernate-testing + test + + + com.h2database + h2 + test + + + org.springframework.boot + spring-boot-starter-test + test + + - - - - kotlin-maven-plugin - org.jetbrains.kotlin - ${kotlin.version} - - - spring - jpa - - - - - org.jetbrains.kotlin - kotlin-maven-noarg - ${kotlin.version} - - - - - + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + spring + jpa + + + + + org.jetbrains.kotlin + kotlin-maven-noarg + ${kotlin.version} + + + + + - - 3.0.7.RELEASE - + + 3.0.7.RELEASE + \ No newline at end of file diff --git a/spring-mvc-simple-2/pom.xml b/spring-mvc-simple-2/pom.xml index 7faa832552..307e8bc94b 100644 --- a/spring-mvc-simple-2/pom.xml +++ b/spring-mvc-simple-2/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-mvc-simple-2 spring-mvc-simple-2 @@ -8,8 +8,8 @@ Demo project for Spring Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -20,7 +20,7 @@ org.springframework.boot spring-boot-starter-web - + org.springframework.boot spring-boot-starter-test @@ -78,7 +78,7 @@ spring-cloud-context ${springcloud.version} - + org.apache.httpcomponents httpclient @@ -135,7 +135,7 @@ - + org.baeldung.boot.Application diff --git a/spring-core-2/src/main/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequest.java b/spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequest.java similarity index 100% rename from spring-core-2/src/main/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequest.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequest.java diff --git a/spring-core-2/src/main/java/org/baeldung/cachedrequest/CachedBodyServletInputStream.java b/spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/CachedBodyServletInputStream.java similarity index 100% rename from spring-core-2/src/main/java/org/baeldung/cachedrequest/CachedBodyServletInputStream.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/CachedBodyServletInputStream.java diff --git a/spring-core-2/src/main/java/org/baeldung/cachedrequest/ContentCachingFilter.java b/spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/ContentCachingFilter.java similarity index 100% rename from spring-core-2/src/main/java/org/baeldung/cachedrequest/ContentCachingFilter.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/ContentCachingFilter.java diff --git a/spring-core-2/src/main/java/org/baeldung/cachedrequest/HttpRequestDemoConfig.java b/spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/HttpRequestDemoConfig.java similarity index 100% rename from spring-core-2/src/main/java/org/baeldung/cachedrequest/HttpRequestDemoConfig.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/HttpRequestDemoConfig.java diff --git a/spring-core-2/src/main/java/org/baeldung/cachedrequest/Person.java b/spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/Person.java similarity index 100% rename from spring-core-2/src/main/java/org/baeldung/cachedrequest/Person.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/Person.java diff --git a/spring-core-2/src/main/java/org/baeldung/cachedrequest/PersonController.java b/spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/PersonController.java similarity index 100% rename from spring-core-2/src/main/java/org/baeldung/cachedrequest/PersonController.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/PersonController.java diff --git a/spring-core-2/src/main/java/org/baeldung/cachedrequest/PrintRequestContentFilter.java b/spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/PrintRequestContentFilter.java similarity index 100% rename from spring-core-2/src/main/java/org/baeldung/cachedrequest/PrintRequestContentFilter.java rename to spring-mvc-simple-2/src/main/java/org/baeldung/cachedrequest/PrintRequestContentFilter.java diff --git a/spring-core-2/src/test/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequestUnitTest.java b/spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequestUnitTest.java similarity index 100% rename from spring-core-2/src/test/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequestUnitTest.java rename to spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/CachedBodyHttpServletRequestUnitTest.java diff --git a/spring-core-2/src/test/java/org/baeldung/cachedrequest/CachedBodyServletInputStreamUnitTest.java b/spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/CachedBodyServletInputStreamUnitTest.java similarity index 100% rename from spring-core-2/src/test/java/org/baeldung/cachedrequest/CachedBodyServletInputStreamUnitTest.java rename to spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/CachedBodyServletInputStreamUnitTest.java diff --git a/spring-core-2/src/test/java/org/baeldung/cachedrequest/ContentCachingFilterUnitTest.java b/spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/ContentCachingFilterUnitTest.java similarity index 100% rename from spring-core-2/src/test/java/org/baeldung/cachedrequest/ContentCachingFilterUnitTest.java rename to spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/ContentCachingFilterUnitTest.java diff --git a/spring-core-2/src/test/java/org/baeldung/cachedrequest/PersonControllerIntegrationTest.java b/spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/PersonControllerIntegrationTest.java similarity index 100% rename from spring-core-2/src/test/java/org/baeldung/cachedrequest/PersonControllerIntegrationTest.java rename to spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/PersonControllerIntegrationTest.java diff --git a/spring-core-2/src/test/java/org/baeldung/cachedrequest/PrintRequestContentFilterUnitTest.java b/spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/PrintRequestContentFilterUnitTest.java similarity index 100% rename from spring-core-2/src/test/java/org/baeldung/cachedrequest/PrintRequestContentFilterUnitTest.java rename to spring-mvc-simple-2/src/test/java/org/baeldung/cachedrequest/PrintRequestContentFilterUnitTest.java diff --git a/spring-mvc-simple/pom.xml b/spring-mvc-simple/pom.xml index 580a40e50b..539e81307a 100644 --- a/spring-mvc-simple/pom.xml +++ b/spring-mvc-simple/pom.xml @@ -1,10 +1,11 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 spring-mvc-simple - war 0.0.1-SNAPSHOT spring-mvc-simple + war com.baeldung @@ -131,15 +132,16 @@ json ${json.version} - - org.apache.maven.surefire - surefire-logger-api - ${maven-surefire-plugin.version} - - test - true - + + org.apache.maven.surefire + surefire-logger-api + ${maven-surefire-plugin.version} + + test + true + + diff --git a/spring-mvc-velocity/pom.xml b/spring-mvc-velocity/pom.xml index 5954e48e8f..2269f05fa4 100644 --- a/spring-mvc-velocity/pom.xml +++ b/spring-mvc-velocity/pom.xml @@ -1,5 +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-mvc-velocity 0.1-SNAPSHOT @@ -104,7 +105,6 @@ - 1.6.6 @@ -117,7 +117,6 @@ 2.7 1.6.1 - \ No newline at end of file diff --git a/spring-mvc-views/pom.xml b/spring-mvc-views/pom.xml index c3a3540fce..b23403fe31 100644 --- a/spring-mvc-views/pom.xml +++ b/spring-mvc-views/pom.xml @@ -14,20 +14,6 @@ ../parent-spring-5 - - - 1.8 - 2.3.3 - 4.0.1 - 5.2.1.RELEASE - 5.2.1.RELEASE - 2.2.2.RELEASE - 2.2.2 - 2.5.0 - 5.4.9.Final - enter-location-of-server - - org.springframework @@ -92,7 +78,7 @@ - spring-mvc-theme + spring-mvc-views org.apache.maven.plugins @@ -117,4 +103,18 @@ + + + 1.8 + 2.3.3 + 4.0.1 + 5.2.1.RELEASE + 5.2.1.RELEASE + 2.2.2.RELEASE + 2.2.2 + 2.5.0 + 5.4.9.Final + enter-location-of-server + + \ No newline at end of file diff --git a/spring-mvc-webflow/pom.xml b/spring-mvc-webflow/pom.xml index 219a2be689..5a6856385c 100644 --- a/spring-mvc-webflow/pom.xml +++ b/spring-mvc-webflow/pom.xml @@ -1,9 +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 - 0.1-SNAPSHOT spring-mvc-webflow + 0.1-SNAPSHOT spring-mvc-webflow war @@ -52,14 +52,14 @@ log4j-over-slf4j ${org.slf4j.version} - + - org.springframework.boot - spring-boot-starter-test - 1.5.10.RELEASE - test - + org.springframework.boot + spring-boot-starter-test + 1.5.10.RELEASE + test + @@ -96,7 +96,6 @@ 2.7 1.6.1 - \ No newline at end of file diff --git a/spring-mvc-xml/pom.xml b/spring-mvc-xml/pom.xml index 9f7a24b358..e93b426119 100644 --- a/spring-mvc-xml/pom.xml +++ b/spring-mvc-xml/pom.xml @@ -1,9 +1,10 @@ + 4.0.0 - 0.1-SNAPSHOT spring-mvc-xml + 0.1-SNAPSHOT spring-mvc-xml war @@ -111,7 +112,6 @@ - diff --git a/spring-protobuf/pom.xml b/spring-protobuf/pom.xml index 372f969bd7..f43faef0d1 100644 --- a/spring-protobuf/pom.xml +++ b/spring-protobuf/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 - com.baeldung spring-protobuf 0.1-SNAPSHOT spring-protobuf - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-quartz/pom.xml b/spring-quartz/pom.xml index 4c7ac6eee9..283d1a1734 100644 --- a/spring-quartz/pom.xml +++ b/spring-quartz/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-quartz spring-quartz 0.0.1-SNAPSHOT - Demo project for Scheduling in Spring with Quartz jar + Demo project for Scheduling in Spring with Quartz - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-reactive-kotlin/pom.xml b/spring-reactive-kotlin/pom.xml index 90764111cb..3a693837df 100644 --- a/spring-reactive-kotlin/pom.xml +++ b/spring-reactive-kotlin/pom.xml @@ -1,57 +1,58 @@ - 4.0.0 - spring-reactive-kotlin - spring-reactive-kotlin - jar - Demo project for Spring Boot + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-reactive-kotlin + spring-reactive-kotlin + Demo project for Spring Boot + jar - - parent-kotlin - com.baeldung - 1.0.0-SNAPSHOT - ../parent-kotlin - + + com.baeldung + parent-kotlin + 1.0.0-SNAPSHOT + ../parent-kotlin + - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-webflux - - - com.fasterxml.jackson.module - jackson-module-kotlin - - - - org.springframework.boot - spring-boot-starter-test - test - - - io.projectreactor - reactor-test - test - - + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-webflux + + + com.fasterxml.jackson.module + jackson-module-kotlin + + + + org.springframework.boot + spring-boot-starter-test + test + + + io.projectreactor + reactor-test + test + + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${kotlin.version} + + + -Xjsr305=strict + + + + + - - - - kotlin-maven-plugin - org.jetbrains.kotlin - ${kotlin.version} - - - -Xjsr305=strict - - - - - diff --git a/spring-reactor/pom.xml b/spring-reactor/pom.xml index 2d69096c58..0115826fd6 100644 --- a/spring-reactor/pom.xml +++ b/spring-reactor/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 - com.baeldung spring-reactor 1.0-SNAPSHOT spring-reactor @@ -9,8 +9,8 @@ http://maven.apache.org - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -40,4 +40,5 @@ 2.0.2.RELEASE 2.0.8.RELEASE + diff --git a/spring-remoting/pom.xml b/spring-remoting/pom.xml index e11c5b06f9..59cb9f863e 100644 --- a/spring-remoting/pom.xml +++ b/spring-remoting/pom.xml @@ -1,18 +1,17 @@ + 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-remoting 1.0-SNAPSHOT spring-remoting - Parent for all projects related to Spring Remoting, except remoting-hessian-burlap pom + Parent for all projects related to Spring Remoting, except remoting-hessian-burlap - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-remoting/remoting-amqp/pom.xml b/spring-remoting/remoting-amqp/pom.xml index 901ce69d6b..ea0b605980 100644 --- a/spring-remoting/remoting-amqp/pom.xml +++ b/spring-remoting/remoting-amqp/pom.xml @@ -1,13 +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 remoting-amqp - pom remoting-amqp + pom - spring-remoting com.baeldung + spring-remoting 1.0-SNAPSHOT diff --git a/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml b/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml index 40b2fa7965..17c5b31e62 100644 --- a/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml +++ b/spring-remoting/remoting-amqp/remoting-amqp-client/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,8 +8,8 @@ http://maven.apache.org - remoting-amqp com.baeldung + remoting-amqp 1.0-SNAPSHOT @@ -29,4 +30,5 @@ ${project.version} + diff --git a/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml b/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml index e8eb665815..13d0c0a6da 100644 --- a/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml +++ b/spring-remoting/remoting-amqp/remoting-amqp-server/pom.xml @@ -1,5 +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 remoting-amqp-server remoting-amqp-server @@ -7,8 +8,8 @@ http://maven.apache.org - remoting-amqp com.baeldung + remoting-amqp 1.0-SNAPSHOT diff --git a/spring-remoting/remoting-hessian-burlap/pom.xml b/spring-remoting/remoting-hessian-burlap/pom.xml index e94d1bee82..fac6e1cb2e 100644 --- a/spring-remoting/remoting-hessian-burlap/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/pom.xml @@ -4,13 +4,13 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-hessian-burlap - remoting-hessian-burlap 1.0-SNAPSHOT + remoting-hessian-burlap pom - - - parent-boot-1 + + com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 @@ -19,4 +19,5 @@ remoting-hessian-burlap-server remoting-hessian-burlap-client + \ No newline at end of file diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml index ec237ca815..1f6181a365 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-client/pom.xml @@ -5,13 +5,13 @@ 4.0.0 remoting-hessian-burlap-client remoting-hessian-burlap-client - - - remoting-hessian-burlap + + com.baeldung + remoting-hessian-burlap 1.0-SNAPSHOT - + org.springframework.boot @@ -58,4 +58,5 @@ + \ No newline at end of file diff --git a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml index fa16a9a9b1..6e4f2e81e4 100644 --- a/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml +++ b/spring-remoting/remoting-hessian-burlap/remoting-hessian-burlap-server/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-hessian-burlap-server - remoting-hessian-burlap-server - + remoting-hessian-burlap-server + - remoting-hessian-burlap com.baeldung + remoting-hessian-burlap 1.0-SNAPSHOT diff --git a/spring-remoting/remoting-http/pom.xml b/spring-remoting/remoting-http/pom.xml index c4ed511bb5..2e5195a909 100644 --- a/spring-remoting/remoting-http/pom.xml +++ b/spring-remoting/remoting-http/pom.xml @@ -4,10 +4,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http - remoting-http + remoting-http pom Parent for all modules related to HTTP Spring Remoting. - + com.baeldung spring-remoting @@ -19,4 +19,5 @@ remoting-http-client remoting-http-api + \ No newline at end of file diff --git a/spring-remoting/remoting-http/remoting-http-api/pom.xml b/spring-remoting/remoting-http/remoting-http-api/pom.xml index 579255060d..697c3f44e5 100644 --- a/spring-remoting/remoting-http/remoting-http-api/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-api/pom.xml @@ -6,10 +6,10 @@ remoting-http-api remoting-http-api API definition shared between client and server. - - - remoting-http + + com.baeldung + remoting-http 1.0-SNAPSHOT diff --git a/spring-remoting/remoting-http/remoting-http-client/pom.xml b/spring-remoting/remoting-http/remoting-http-client/pom.xml index 56412d3cdf..03de2d3e4d 100644 --- a/spring-remoting/remoting-http/remoting-http-client/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-client/pom.xml @@ -4,9 +4,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http-client - remoting-http-client + remoting-http-client Shows how to invoke a remote service using Spring Remoting HTTP. - + com.baeldung remoting-http @@ -30,4 +30,5 @@ ${project.version} + \ No newline at end of file diff --git a/spring-remoting/remoting-http/remoting-http-server/pom.xml b/spring-remoting/remoting-http/remoting-http-server/pom.xml index c3f87e776e..872688e683 100644 --- a/spring-remoting/remoting-http/remoting-http-server/pom.xml +++ b/spring-remoting/remoting-http/remoting-http-server/pom.xml @@ -4,9 +4,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-http-server - remoting-http-server + remoting-http-server Shows how to expose a service using Spring Remoting HTTP. - + com.baeldung remoting-http @@ -24,4 +24,5 @@ ${project.version} + \ No newline at end of file diff --git a/spring-remoting/remoting-jms/pom.xml b/spring-remoting/remoting-jms/pom.xml index e24b5b7929..33299cd2c5 100644 --- a/spring-remoting/remoting-jms/pom.xml +++ b/spring-remoting/remoting-jms/pom.xml @@ -4,12 +4,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-jms - remoting-jms + remoting-jms pom - spring-remoting com.baeldung + spring-remoting 1.0-SNAPSHOT diff --git a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml index 043ced8527..d8b9701600 100644 --- a/spring-remoting/remoting-jms/remoting-jms-client/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-client/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-jms-client - remoting-jms-client + remoting-jms-client - remoting-jms com.baeldung + remoting-jms 1.0-SNAPSHOT diff --git a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml index 13de66977a..5d6d63219d 100644 --- a/spring-remoting/remoting-jms/remoting-jms-server/pom.xml +++ b/spring-remoting/remoting-jms/remoting-jms-server/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-jms-server - remoting-jms-server - + remoting-jms-server + - remoting-jms com.baeldung + remoting-jms 1.0-SNAPSHOT diff --git a/spring-remoting/remoting-rmi/pom.xml b/spring-remoting/remoting-rmi/pom.xml index 7b6e807550..037e73658e 100644 --- a/spring-remoting/remoting-rmi/pom.xml +++ b/spring-remoting/remoting-rmi/pom.xml @@ -4,17 +4,18 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-rmi - remoting-rmi + remoting-rmi pom - - - spring-remoting + + com.baeldung + spring-remoting 1.0-SNAPSHOT - - + + remoting-rmi-server remoting-rmi-client + \ No newline at end of file diff --git a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml index 4ac0283e94..5d8d82d6ab 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-client/pom.xml @@ -4,14 +4,14 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-rmi-client - remoting-rmi-client + remoting-rmi-client - remoting-rmi com.baeldung + remoting-rmi 1.0-SNAPSHOT - + org.springframework.boot @@ -29,4 +29,5 @@ ${project.version} + \ No newline at end of file diff --git a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml index 2a19ebbbf6..94bdccd093 100644 --- a/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml +++ b/spring-remoting/remoting-rmi/remoting-rmi-server/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 remoting-rmi-server - remoting-rmi-server - + remoting-rmi-server + - remoting-rmi com.baeldung + remoting-rmi 1.0-SNAPSHOT diff --git a/spring-rest-angular/pom.xml b/spring-rest-angular/pom.xml index 69becfb4ae..1c6ab77a2d 100644 --- a/spring-rest-angular/pom.xml +++ b/spring-rest-angular/pom.xml @@ -1,15 +1,15 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 spring-rest-angular - spring-rest-angular 1.0 + spring-rest-angular war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -60,7 +60,7 @@ - angular-spring-rest-sample + spring-rest-angular org.apache.maven.plugins diff --git a/spring-rest-compress/pom.xml b/spring-rest-compress/pom.xml index ca00bdc659..9ff0be9682 100644 --- a/spring-rest-compress/pom.xml +++ b/spring-rest-compress/pom.xml @@ -1,15 +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 - com.baeldung spring-rest-compress 0.0.1-SNAPSHOT spring-rest-compress - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -62,4 +61,5 @@ 1.8 2.6 + diff --git a/spring-rest-hal-browser/pom.xml b/spring-rest-hal-browser/pom.xml index cc3b1b65fe..94ce837b27 100644 --- a/spring-rest-hal-browser/pom.xml +++ b/spring-rest-hal-browser/pom.xml @@ -1,58 +1,57 @@ - 4.0.0 - com.baeldung - spring-rest-hal-browser - 1.0-SNAPSHOT - spring-rest-hal-browser + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + spring-rest-hal-browser + 1.0-SNAPSHOT + spring-rest-hal-browser - - parent-boot-1 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-1 - + + com.baeldung + parent-boot-1 + 0.0.1-SNAPSHOT + ../parent-boot-1 + - - - - org.springframework.boot - spring-boot-starter-web - 2.0.3.RELEASE - - - - org.springframework.boot - spring-boot-starter-data-jpa - 2.0.3.RELEASE - - - - org.springframework.data - spring-data-rest-hal-browser - 3.0.8.RELEASE - - - - com.h2database - h2 - 1.4.197 - - + + + + org.springframework.boot + spring-boot-starter-web + 2.0.3.RELEASE + + + + org.springframework.boot + spring-boot-starter-data-jpa + 2.0.3.RELEASE + + + + org.springframework.data + spring-data-rest-hal-browser + 3.0.8.RELEASE + + + + com.h2database + h2 + 1.4.197 + + - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.8 - 1.8 - - - - + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + + + \ No newline at end of file diff --git a/spring-rest-http/README.md b/spring-rest-http/README.md new file mode 100644 index 0000000000..51f5ed4000 --- /dev/null +++ b/spring-rest-http/README.md @@ -0,0 +1,14 @@ +## Spring REST HTTP + +This module contains articles about HTTP in REST APIs with Spring + +### The Course +The "REST With Spring" Classes: http://bit.ly/restwithspring + +### Relevant Articles: + +- [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder) +- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) - The tests contained for this article rely on the sample application within the [spring-resttemplate](/spring-resttemplate) module +- [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code) +- [Spring @RequestMapping](https://www.baeldung.com/spring-requestmapping) +- [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result) \ No newline at end of file diff --git a/spring-rest-http/pom.xml b/spring-rest-http/pom.xml new file mode 100644 index 0000000000..c5c6b8d44c --- /dev/null +++ b/spring-rest-http/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + spring-rest-http + 0.1-SNAPSHOT + spring-rest-http + war + + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-oxm + + + com.thoughtworks.xstream + xstream + ${xstream.version} + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-devtools + + + org.springframework.boot + spring-boot-starter-test + + + + + + + 1.4.9 + + + diff --git a/spring-rest-http/src/main/java/com/baeldung/config/MvcConfig.java b/spring-rest-http/src/main/java/com/baeldung/config/MvcConfig.java new file mode 100644 index 0000000000..ea2c536757 --- /dev/null +++ b/spring-rest-http/src/main/java/com/baeldung/config/MvcConfig.java @@ -0,0 +1,51 @@ +package com.baeldung.config; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; +import org.springframework.http.converter.HttpMessageConverter; + +import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; + +import org.springframework.oxm.xstream.XStreamMarshaller; +import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import java.text.SimpleDateFormat; +import java.util.List; + +/* + * Please note that main web configuration is in src/main/webapp/WEB-INF/api-servlet.xml + */ +@Configuration +@EnableWebMvc +@ComponentScan({ "com.baeldung.web", "com.baeldung.requestmapping" }) +public class MvcConfig implements WebMvcConfigurer { + + public MvcConfig() { + super(); + } + + // + + @Override + public void configureMessageConverters(final List> messageConverters) { + final Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder(); + builder.indentOutput(true) + .dateFormat(new SimpleDateFormat("dd-MM-yyyy hh:mm")); + + } + + + @Override + public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { + configurer.defaultContentType(MediaType.APPLICATION_JSON); + } + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**"); + } +} diff --git a/spring-rest/src/main/java/com/baeldung/controllers/DeferredResultController.java b/spring-rest-http/src/main/java/com/baeldung/controllers/DeferredResultController.java similarity index 100% rename from spring-rest/src/main/java/com/baeldung/controllers/DeferredResultController.java rename to spring-rest-http/src/main/java/com/baeldung/controllers/DeferredResultController.java diff --git a/spring-rest-simple/src/main/java/com/baeldung/requestmapping/BarMappingExamplesController.java b/spring-rest-http/src/main/java/com/baeldung/requestmapping/BarMappingExamplesController.java similarity index 100% rename from spring-rest-simple/src/main/java/com/baeldung/requestmapping/BarMappingExamplesController.java rename to spring-rest-http/src/main/java/com/baeldung/requestmapping/BarMappingExamplesController.java diff --git a/spring-rest-simple/src/main/java/com/baeldung/requestmapping/BazzNewMappingsExampleController.java b/spring-rest-http/src/main/java/com/baeldung/requestmapping/BazzNewMappingsExampleController.java similarity index 100% rename from spring-rest-simple/src/main/java/com/baeldung/requestmapping/BazzNewMappingsExampleController.java rename to spring-rest-http/src/main/java/com/baeldung/requestmapping/BazzNewMappingsExampleController.java diff --git a/spring-rest-simple/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java b/spring-rest-http/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java similarity index 100% rename from spring-rest-simple/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java rename to spring-rest-http/src/main/java/com/baeldung/requestmapping/FooMappingExamplesController.java diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ExampleController.java b/spring-rest-http/src/main/java/com/baeldung/web/controller/status/ExampleController.java similarity index 100% rename from spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ExampleController.java rename to spring-rest-http/src/main/java/com/baeldung/web/controller/status/ExampleController.java diff --git a/spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ForbiddenException.java b/spring-rest-http/src/main/java/com/baeldung/web/controller/status/ForbiddenException.java similarity index 100% rename from spring-rest-simple/src/main/java/com/baeldung/web/controller/status/ForbiddenException.java rename to spring-rest-http/src/main/java/com/baeldung/web/controller/status/ForbiddenException.java diff --git a/spring-rest-http/src/main/java/com/baeldung/web/dto/Bazz.java b/spring-rest-http/src/main/java/com/baeldung/web/dto/Bazz.java new file mode 100644 index 0000000000..861b4009b5 --- /dev/null +++ b/spring-rest-http/src/main/java/com/baeldung/web/dto/Bazz.java @@ -0,0 +1,22 @@ +package com.baeldung.web.dto; + +public class Bazz { + + + public String id; + public String name; + + public Bazz(String id){ + this.id = id; + } + public Bazz(String id, String name) { + this.id = id; + this.name = name; + } + + @Override + public String toString() { + return "Bazz [id=" + id + ", name=" + name + "]"; + } + +} diff --git a/spring-rest-http/src/main/java/com/baeldung/web/dto/Foo.java b/spring-rest-http/src/main/java/com/baeldung/web/dto/Foo.java new file mode 100644 index 0000000000..5a54539927 --- /dev/null +++ b/spring-rest-http/src/main/java/com/baeldung/web/dto/Foo.java @@ -0,0 +1,45 @@ +package com.baeldung.web.dto; + +import com.thoughtworks.xstream.annotations.XStreamAlias; + +@XStreamAlias("Foo") +public class Foo { + private long id; + private String name; + + public Foo() { + super(); + } + + public Foo(final String name) { + super(); + + this.name = name; + } + + public Foo(final long id, final String name) { + super(); + + this.id = id; + this.name = name; + } + + // API + + public long getId() { + return id; + } + + public void setId(final long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } + +} \ No newline at end of file diff --git a/spring-rest-simple/src/test/java/com/baeldung/requestmapping/BazzNewMappingsExampleIntegrationTest.java b/spring-rest-http/src/test/java/com/baeldung/requestmapping/BazzNewMappingsExampleIntegrationTest.java similarity index 100% rename from spring-rest-simple/src/test/java/com/baeldung/requestmapping/BazzNewMappingsExampleIntegrationTest.java rename to spring-rest-http/src/test/java/com/baeldung/requestmapping/BazzNewMappingsExampleIntegrationTest.java diff --git a/spring-rest/src/test/java/com/baeldung/responseheaders/ResponseHeaderLiveTest.java b/spring-rest-http/src/test/java/com/baeldung/responseheaders/ResponseHeaderLiveTest.java similarity index 100% rename from spring-rest/src/test/java/com/baeldung/responseheaders/ResponseHeaderLiveTest.java rename to spring-rest-http/src/test/java/com/baeldung/responseheaders/ResponseHeaderLiveTest.java diff --git a/spring-rest/src/test/java/com/baeldung/uribuilder/SpringUriBuilderIntegrationTest.java b/spring-rest-http/src/test/java/com/baeldung/uribuilder/SpringUriBuilderIntegrationTest.java similarity index 100% rename from spring-rest/src/test/java/com/baeldung/uribuilder/SpringUriBuilderIntegrationTest.java rename to spring-rest-http/src/test/java/com/baeldung/uribuilder/SpringUriBuilderIntegrationTest.java diff --git a/spring-rest-simple/src/test/java/com/baeldung/web/controller/status/ExampleControllerIntegrationTest.java b/spring-rest-http/src/test/java/com/baeldung/web/controller/status/ExampleControllerIntegrationTest.java similarity index 100% rename from spring-rest-simple/src/test/java/com/baeldung/web/controller/status/ExampleControllerIntegrationTest.java rename to spring-rest-http/src/test/java/com/baeldung/web/controller/status/ExampleControllerIntegrationTest.java diff --git a/spring-rest-query-language/pom.xml b/spring-rest-query-language/pom.xml index 293bac9479..25b149367e 100644 --- a/spring-rest-query-language/pom.xml +++ b/spring-rest-query-language/pom.xml @@ -1,5 +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-rest-query-language 0.1-SNAPSHOT @@ -7,8 +8,8 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -149,7 +150,7 @@ org.javassist javassist - ${javassist.version} + ${javassist.version} mysql @@ -352,10 +353,10 @@ 1.4.9 3.21.0-GA 1.4.01 - + 19.0 - + 1.7.0 1.1.3 diff --git a/spring-rest-shell/pom.xml b/spring-rest-shell/pom.xml index acf33cf98f..1148a5c093 100644 --- a/spring-rest-shell/pom.xml +++ b/spring-rest-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 spring-rest-shell spring-rest-shell @@ -8,8 +8,8 @@ A simple project to demonstrate Spring REST Shell features. - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-rest-simple/README.md b/spring-rest-simple/README.md index 5e92865cfa..1ceb83b7a7 100644 --- a/spring-rest-simple/README.md +++ b/spring-rest-simple/README.md @@ -4,12 +4,10 @@ This module contains articles about REST APIs in Spring ## Relevant articles: -- [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder) -- [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code) -- [Spring RequestMapping](https://www.baeldung.com/spring-requestmapping) - [Spring and Apache FileUpload](https://www.baeldung.com/spring-apache-file-upload) - [Test a REST API with curl](https://www.baeldung.com/curl-rest) - [Best Practices for REST API Error Handling](https://www.baeldung.com/rest-api-error-handling-best-practices) +- [Binary Data Formats in a Spring REST API](https://www.baeldung.com/spring-rest-api-with-binary-data-formats) ### NOTE: diff --git a/spring-rest-simple/pom.xml b/spring-rest-simple/pom.xml index 263e451c62..59f7a94b8d 100644 --- a/spring-rest-simple/pom.xml +++ b/spring-rest-simple/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 - com.baeldung spring-rest-simple 0.1-SNAPSHOT spring-rest-simple war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -183,7 +183,7 @@ - spring-rest + spring-rest-simple src/main/resources @@ -263,7 +263,7 @@ - + live diff --git a/spring-rest-testing/pom.xml b/spring-rest-testing/pom.xml index 6475281d18..dcd8b677be 100644 --- a/spring-rest-testing/pom.xml +++ b/spring-rest-testing/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 - com.baeldung spring-rest-testing 0.1-SNAPSHOT spring-rest-testing war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 @@ -197,7 +197,7 @@ - spring-rest-full + spring-rest-testing src/main/resources diff --git a/spring-rest/.gitignore b/spring-rest/.gitignore deleted file mode 100644 index 2661c0de1e..0000000000 --- a/spring-rest/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/spring-boot-runtime/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/spring-rest/README.md b/spring-rest/README.md deleted file mode 100644 index 3ea9361169..0000000000 --- a/spring-rest/README.md +++ /dev/null @@ -1,17 +0,0 @@ -## Spring REST - -This module contains articles about REST APIs with Spring - -### The Course -The "REST With Spring" Classes: http://bit.ly/restwithspring - -### Relevant Articles: -- [Spring @RequestMapping](https://www.baeldung.com/spring-requestmapping) -- [Returning Custom Status Codes from Spring Controllers](https://www.baeldung.com/spring-mvc-controller-custom-http-status-code) -- [Binary Data Formats in a Spring REST API](https://www.baeldung.com/spring-rest-api-with-binary-data-formats) -- [Guide to UriComponentsBuilder in Spring](https://www.baeldung.com/spring-uricomponentsbuilder) -- [A Custom Media Type for a Spring REST API](https://www.baeldung.com/spring-rest-custom-media-type) -- [HTTP PUT vs HTTP PATCH in a REST API](https://www.baeldung.com/http-put-patch-difference-spring) -- [Guide to DeferredResult in Spring](https://www.baeldung.com/spring-deferred-result) -- [How to Set a Header on a Response with Spring 5](https://www.baeldung.com/spring-response-header) -- [Download an Image or a File with Spring MVC](https://www.baeldung.com/spring-controller-return-image-file) diff --git a/spring-rest/pom.xml b/spring-rest/pom.xml deleted file mode 100644 index fce04a8f2d..0000000000 --- a/spring-rest/pom.xml +++ /dev/null @@ -1,256 +0,0 @@ - - 4.0.0 - spring-rest - 0.1-SNAPSHOT - spring-rest - war - - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - - - - - - - org.springframework.boot - spring-boot-starter-web - - - - 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 - - - commons-fileupload - commons-fileupload - ${commons-fileupload.version} - - - - - javax.servlet - javax.servlet-api - provided - - - - javax.servlet - jstl - runtime - - - - - com.fasterxml.jackson.core - jackson-databind - - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - - - - - com.google.guava - guava - ${guava.version} - - - org.apache.commons - commons-lang3 - - - - - org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library - test - - - org.mockito - mockito-core - 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.esotericsoftware - kryo - ${kryo.version} - - - com.jayway.jsonpath - json-path - - - - - commons-io - commons-io - ${commons-io.version} - - - - io.rest-assured - rest-assured - - - org.apache.httpcomponents - httpclient - ${httpclient.version} - - - - - - spring-rest - - - src/main/resources - true - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-war-plugin - - - - - - - - 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 - - - - - - - - - - - - - - - - 1.3.2 - 4.0.0 - 1.4 - 3.1.0 - - - 20.0 - - - 1.6.0 - 3.0.4 - - false - - 2.2.0 - 3.5.11 - 3.1.0 - 4.5.2 - com.baeldung.sampleapp.config.MainApplication - - - diff --git a/spring-rest/src/main/java/com/baeldung/controllers/ViewController.java b/spring-rest/src/main/java/com/baeldung/controllers/ViewController.java deleted file mode 100644 index 8eab0ce6da..0000000000 --- a/spring-rest/src/main/java/com/baeldung/controllers/ViewController.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.baeldung.controllers; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; - -@Controller -public class ViewController { - - @GetMapping("/") - public String welcome() { - return "index"; - } - -} diff --git a/spring-rest/src/main/resources/application.properties b/spring-rest/src/main/resources/application.properties deleted file mode 100644 index dd7e4e2f2d..0000000000 --- a/spring-rest/src/main/resources/application.properties +++ /dev/null @@ -1,2 +0,0 @@ -server.port= 8082 -server.servlet.context-path=/spring-rest \ No newline at end of file diff --git a/spring-rest/src/main/resources/com/baeldung/produceimage/data.txt b/spring-rest/src/main/resources/com/baeldung/produceimage/data.txt deleted file mode 100644 index 3cd18170c0..0000000000 --- a/spring-rest/src/main/resources/com/baeldung/produceimage/data.txt +++ /dev/null @@ -1 +0,0 @@ -This is a sample file containing text data \ No newline at end of file diff --git a/spring-rest/src/main/resources/com/baeldung/produceimage/image.jpg b/spring-rest/src/main/resources/com/baeldung/produceimage/image.jpg deleted file mode 100644 index 0262656a33..0000000000 Binary files a/spring-rest/src/main/resources/com/baeldung/produceimage/image.jpg and /dev/null differ diff --git a/spring-rest/src/main/resources/com/baeldung/produceimage/images/favicon.ico b/spring-rest/src/main/resources/com/baeldung/produceimage/images/favicon.ico deleted file mode 100644 index 64105ac11c..0000000000 Binary files a/spring-rest/src/main/resources/com/baeldung/produceimage/images/favicon.ico and /dev/null differ diff --git a/spring-rest/src/main/resources/logback.xml b/spring-rest/src/main/resources/logback.xml deleted file mode 100644 index 9f48d36486..0000000000 --- a/spring-rest/src/main/resources/logback.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/spring-rest/src/main/resources/pacts/test_consumer-test_provider.json b/spring-rest/src/main/resources/pacts/test_consumer-test_provider.json deleted file mode 100644 index c8082798f4..0000000000 --- a/spring-rest/src/main/resources/pacts/test_consumer-test_provider.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "provider": { - "name": "test_provider" - }, - "consumer": { - "name": "test_consumer" - }, - "interactions": [ - { - "description": "GET REQUEST", - "request": { - "method": "GET", - "path": "/pact" - }, - "response": { - "status": 200, - "headers": { - "Content-Type": "application/json" - }, - "body": { - "condition": true, - "name": "tom" - } - }, - "providerStates": [ - { - "name": "test GET" - } - ] - }, - { - "description": "POST REQUEST", - "request": { - "method": "POST", - "path": "/pact", - "headers": { - "Content-Type": "application/json" - }, - "body": { - "name": "Michael" - } - }, - "response": { - "status": 201 - }, - "providerStates": [ - { - "name": "test POST" - } - ] - } - ], - "metadata": { - "pact-specification": { - "version": "3.0.0" - }, - "pact-jvm": { - "version": "3.5.0" - } - } -} \ No newline at end of file diff --git a/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.0 b/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.0 deleted file mode 100644 index e6cfcabe71..0000000000 --- a/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.0 +++ /dev/null @@ -1,24 +0,0 @@ -https://publicobject.com/helloworld.txt -GET -0 -HTTP/1.1 200 OK -10 -Content-Type: text/plain -Content-Length: 1759 -Connection: keep-alive -Accept-Ranges: bytes -Server: nginx/1.10.0 (Ubuntu) -Date: Sat, 08 Dec 2018 13:02:07 GMT -Last-Modified: Tue, 27 May 2014 02:35:47 GMT -ETag: "5383fa03-6df" -OkHttp-Sent-Millis: 1489054646765 -OkHttp-Received-Millis: 1489054646966 - -TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 -4 -MIIFVTCCBD2gAwIBAgIRAKgHBM+t9Yx3v9G9tGZECWkwDQYJKoZIhvcNAQELBQAwgZAxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTYwNAYDVQQDEy1DT01PRE8gUlNBIERvbWFpbiBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIgQ0EwHhcNMTQxMDExMDAwMDAwWhcNMTkxMDEwMjM1OTU5WjBUMSEwHwYDVQQLExhEb21haW4gQ29udHJvbCBWYWxpZGF0ZWQxFDASBgNVBAsTC1Bvc2l0aXZlU1NMMRkwFwYDVQQDExBwdWJsaWNvYmplY3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjtgQtvL2kUr6ooHMOq7cxQLGycBW+ri9TGyQkO1lTb66RmcAujENxMh51wKodrveUdbqwpL4g1P49o/Y1fK5IHWAf3vpE8p3RyELY0NRlclRM24dgif/+dgRUUk+0kF3NH6MbB/kve07FMF2FyNDLxtbwJvmrn1MI5c52cpxI24vGcpOZ0VIW7+nS3V+QSrEinvrugAtu8b6Gpg+I8w6rAvmjpfCLmLP0zbjz5ExJzMC0TnR6JMgiqo2TUIyuDM2OuNJpyiluNvlUnzFrlRieg7xexoJxCbqqiOSm076fdT9qNzBp+4MzQ8w8Ofm8tsOnM4FNsz3ifX6KpJdIXfsAQIDAQABo4IB4zCCAd8wHwYDVR0jBBgwFoAUkK9qOpRaC9iQ6hJWc99DtDoo2ucwHQYDVR0OBBYEFAmSn3icQLzlRnBujuf7Y+i7/6HbMA4GA1UdDwEB/wQEAwIFoDAMBgNVHRMBAf8EAjAAMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBPBgNVHSAESDBGMDoGCysGAQQBsjEBAgIHMCswKQYIKwYBBQUHAgEWHWh0dHBzOi8vc2VjdXJlLmNvbW9kby5jb20vQ1BTMAgGBmeBDAECATBUBgNVHR8ETTBLMEmgR6BFhkNodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9SU0FEb21haW5WYWxpZGF0aW9uU2VjdXJlU2VydmVyQ0EuY3JsMIGFBggrBgEFBQcBAQR5MHcwTwYIKwYBBQUHMAKGQ2h0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JTQURvbWFpblZhbGlkYXRpb25TZWN1cmVTZXJ2ZXJDQS5jcnQwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLmNvbW9kb2NhLmNvbTAxBgNVHREEKjAoghBwdWJsaWNvYmplY3QuY29tghR3d3cucHVibGljb2JqZWN0LmNvbTANBgkqhkiG9w0BAQsFAAOCAQEATWNaqr7WgumGhxmAm7yluVhVZ/pxPabACY4HDLrYN61KB7XgI1PZIJhQkkreBtmDLIkOQqJxbhePp3z/nOil0QJT7ONcdnYBX0CO8xYhf8c0FM9z7XbLBLta1pkTF/bwgK3VUsGYOskyQ3YdTUrmZq5WrYJvdbP2G5F5eEVIHnXvjKcdFpEY5CmZagYPwVtSioiup+xUzrBibJxpOD9fB6GV8okLgVjIl29Hs1zC++9o3yWC3ep1qzU+m59Pwi7uPoqUA0LXHi4iIEUk8fRhkNlhkte9geOne+fVvm/Rj9MZD3Gtb5qKoqEld6bOSoMlYavj9GCBSNIx2+mGS0Tg6A== -MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQwMjEyMDAwMDAwWhcNMjkwMjExMjM1OTU5WjCBkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxNjA0BgNVBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAI7CAhnhoFmk6zg1jSz9AdDTScBkxwtiBUUWOqigwAwCfx3M28ShbXcDow+G+eMGnD4LgYqbSRutA776S9uMIO3Vzl5ljj4Nr0zCsLdFXlIvNN5IJGS0Qa4Al/e+Z96e0HqnU4A7fK31llVvl0cKfIWLIpeNs4TgllfQcBhglo/uLQeTnaG6ytHNe+nEKpooIZFNb5JPJaXyejXdJtxGpdCsWTWM/06RQ1A/WZMebFEh7lgUq/51UHg+TLAchhP6a5i84DuUHoVS3AOTJBhuyydRReZw3iVDpA3hSqXttn7IzW3uLh0nc13cRTCAquOyQQuvvUSH2rnlG51/ruWFgqUCAwEAAaOCAWUwggFhMB8GA1UdIwQYMBaAFLuvfgI9+qbxPISOre44mOzZMjLUMB0GA1UdDgQWBBSQr2o6lFoL2JDqElZz30O0Oija5zAOBgNVHQ8BAf8EBAMCAYYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwGwYDVR0gBBQwEjAGBgRVHSAAMAgGBmeBDAECATBMBgNVHR8ERTBDMEGgP6A9hjtodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9SU0FDZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDBxBggrBgEFBQcBAQRlMGMwOwYIKwYBBQUHMAKGL2h0dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET1JTQUFkZFRydXN0Q0EuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20wDQYJKoZIhvcNAQEMBQADggIBAE4rdk+SHGI2ibp3wScF9BzWRJ2pmj6q1WZmAT7qSeaiNbz69t2Vjpk1mA42GHWx3d1Qcnyu3HeIzg/3kCDKo2cuH1Z/e+FE6kKVxF0NAVBGFfKBiVlsit2M8RKhjTpCipj4SzR7JzsItG8kO3KdY3RYPBpsP0/HEZrIqPW1N+8QRcZs2eBelSaz662jue5/DJpmNXMyYE7l3YphLG5SEXdoltMYdVEVABt0iN3hxzgEQyjpFv3ZBdRdRydg1vs4O2xyopT4Qhrf7W8GjEXCBgCq5Ojc2bXhc3js9iPc0d1sjhqPpepUfJa3w/5Vjo1JXvxku88+vZbrac2/4EjxYoIQ5QxGV/Iz2tDIY+3GH5QFlkoakdH368+PUq4NCNk+qKBR6cGHdNXJ93SrLlP7u3r7l+L4HyaPs9Kg4DdbKDsx5Q5XLVq4rXmsXiBmGqW5prU5wfWYQ//u+aen/e7KJD2AFsQXj4rBYKEMrltDR5FL1ZoXX/nUh8HCjLfn4g8wGTeGrODcQgPmlKidrv0PJFGUzpII0fxQ8ANAe4hZ7Q7drNJ3gjTcBpUC2JD5Leo31Rpg0Gcg19hCC0Wvgmje3WYkN5AplBlGGSW4gNfL1IYoakRwJiNiqZ+Gb7+6kHDSVneFeO/qJakXzlByjAA6quPbYzSf+AZxAeKCINT+b72x -MIIFdDCCBFygAwIBAgIQJ2buVutJ846r13Ci/ITeIjANBgkqhkiG9w0BAQwFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowgYUxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMSswKQYDVQQDEyJDT01PRE8gUlNBIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAkehUktIKVrGsDSTdxc9EZ3SZKzejfSNwAHG8U9/E+ioSj0t/EFa9n3Byt2F/yUsPF6c947AEYe7/EZfH9IY+Cvo+XPmT5jR62RRr55yzhaCCenavcZDX7P0N+pxs+t+wgvQUfvm+xKYvT3+Zf7X8Z0NyvQwA1onrayzT7Y+YHBSrfuXjbvzYqOSSJNpDa2K4Vf3qwbxstovzDo2a5JtsaZn4eEgwRdWt4Q08RWD8MpZRJ7xnw8outmvqRsfHIKCxH2XeSAi6pE6p8oNGN4Tr6MyBSENnTnIqm1y9TBsoilwie7SrmNnu4FGDwwlGTm0+mfqVF9p8M1dBPI1R7Qu2XK8sYxrfV8g/vOldxJuvRZnio1oktLqpVj3Pb6r/SVi+8Kj/9Lit6Tf7urj0Czr56ENCHonYhMsT8dm74YlguIwoVqwUHZwK53Hrzw7dPamWoUi9PPevtQ0iTMARgexWO/bTouJbt7IEIlKVgJNp6I5MZfGRAy1wdALqi2cVKWlSArvX31BqVUa/oKMoYX9w0MOiqiwhqkfOKJwGRXa/ghgntNWutMtQ5mv0TIZxMOmm3xaG4Nj/QN370EKIf6MzOi5cHkERgWPOGHFrK+ymircxXDpqR+DDeVnWIBqv8mqYqnK8V0rSS527EPywTEHl7R09XiidnMy/s1Hap0flhFMCAwEAAaOB9DCB8TAfBgNVHSMEGDAWgBStvZh6NLQm9/rEJlTvA73gJMtUGjAdBgNVHQ4EFgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0gBAowCDAGBgRVHSAAMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9BZGRUcnVzdEV4dGVybmFsQ0FSb290LmNybDA1BggrBgEFBQcBAQQpMCcwJQYIKwYBBQUHMAGGGWh0dHA6Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAGS/g/FfmoXQzbihKVcN6Fr30ek+8nYEbvFScLsePP9NDXRqzIGCJdPDoCpdTPW6i6FtxFQJdcfjJw5dhHk3QBN39bSsHNA7qxcS1u80GH4r6XnTq1dFDK8o+tDb5VCViLvfhVdpfZLYUspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5B5a6SE2Q8pTIqXOi6wZ7I53eovNNVZ96YUWYGGjHXkBrI/V5eu+MtWuLt29G9HvxPUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vRpu/xO28QOG8= -MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw56wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= -0 -TLSv1.2 diff --git a/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.1 b/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.1 deleted file mode 100644 index 83db2312f0..0000000000 --- a/spring-rest/src/test/resources/cache/2d9345a30d2cc31bb3091d70a8ef6c18.1 +++ /dev/null @@ -1,39 +0,0 @@ - - \\ // - \\ .ooo. // - .@@@@@@@@@. - :@@@@@@@@@@@@@: - :@@. '@@@@@' .@@: - @@@@@@@@@@@@@@@@@ - @@@@@@@@@@@@@@@@@ - - :@@ :@@@@@@@@@@@@@@@@@. @@: - @@@ '@@@@@@@@@@@@@@@@@, @@@ - @@@ '@@@@@@@@@@@@@@@@@, @@@ - @@@ '@@@@@@@@@@@@@@@@@, @@@ - @@@ '@@@@@@@@@@@@@@@@@, @@@ - @@@ '@@@@@@@@@@@@@@@@@, @@@ - @@@ '@@@@@@@@@@@@@@@@@, @@@ - @@@@@@@@@@@@@@@@@ - '@@@@@@@@@@@@@@@' - @@@@ @@@@ - @@@@ @@@@ - @@@@ @@@@ - '@@' '@@' - - :@@@. - .@@@@@@@: +@@ `@@ @@` @@ @@ - .@@@@'@@@@: +@@ `@@ @@` @@ @@ - @@@ @@@ +@@ `@@ @@` @@ @@ - .@@ @@: +@@ @@@ `@@ @@` @@@@@@ @@@@@@ @@;@@@@@ - @@@ @@@ +@@ @@@ `@@ @@` @@@@@@ @@@@@@ @@@@@@@@@ - @@@ @@@ +@@ @@@ `@@@@@@@@@@` @@ @@ @@@ :@@ - @@@ @@@ +@@@@@ `@@@@@@@@@@` @@ @@ @@# @@+ - @@@ @@@ +@@@@@+ `@@ @@` @@ @@ @@: @@# - @@: .@@` +@@@+@@ `@@ @@` @@ @@ @@# @@+ - @@@. .@@@ +@@ @@@ `@@ @@` @@ @@ @@@ ,@@ - @@@@@@@@@ +@@ @@@ `@@ @@` @@@@ @@@@ @@@@#@@@@ - @@@@@@@ +@@ #@@ `@@ @@` @@@@: @@@@: @@'@@@@@ - @@: - @@: - @@: diff --git a/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.0 b/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.0 deleted file mode 100644 index 85fc22d658..0000000000 --- a/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.0 +++ /dev/null @@ -1,13 +0,0 @@ -http://publicobject.com/helloworld.txt -GET -0 -HTTP/1.1 301 Moved Permanently -8 -Server: nginx/1.10.0 (Ubuntu) -Date: Sat, 08 Dec 2018 13:02:04 GMT -Content-Type: text/html -Content-Length: 194 -Connection: keep-alive -Location: https://publicobject.com/helloworld.txt -OkHttp-Sent-Millis: 1544274128028 -OkHttp-Received-Millis: 1544274128386 diff --git a/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.1 b/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.1 deleted file mode 100644 index acf72eabe3..0000000000 --- a/spring-rest/src/test/resources/cache/4b217e04ba52215f3a6b64d28f6729c6.1 +++ /dev/null @@ -1,7 +0,0 @@ - -301 Moved Permanently - -

301 Moved Permanently

-
nginx/1.10.0 (Ubuntu)
- - diff --git a/spring-rest/src/test/resources/cache/journal b/spring-rest/src/test/resources/cache/journal deleted file mode 100644 index a139399103..0000000000 --- a/spring-rest/src/test/resources/cache/journal +++ /dev/null @@ -1,75 +0,0 @@ -libcore.io.DiskLruCache -1 -201105 -2 - -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18 -CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 2d9345a30d2cc31bb3091d70a8ef6c18 -DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18 -CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 2d9345a30d2cc31bb3091d70a8ef6c18 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 2d9345a30d2cc31bb3091d70a8ef6c18 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 2d9345a30d2cc31bb3091d70a8ef6c18 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 2d9345a30d2cc31bb3091d70a8ef6c18 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 2d9345a30d2cc31bb3091d70a8ef6c18 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -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 -READ 4b217e04ba52215f3a6b64d28f6729c6 -DIRTY 4b217e04ba52215f3a6b64d28f6729c6 -CLEAN 4b217e04ba52215f3a6b64d28f6729c6 333 194 -READ 2d9345a30d2cc31bb3091d70a8ef6c18 -DIRTY 2d9345a30d2cc31bb3091d70a8ef6c18 -CLEAN 2d9345a30d2cc31bb3091d70a8ef6c18 7618 1759 diff --git a/spring-rest/src/test/resources/test.txt b/spring-rest/src/test/resources/test.txt deleted file mode 100644 index 95d09f2b10..0000000000 --- a/spring-rest/src/test/resources/test.txt +++ /dev/null @@ -1 +0,0 @@ -hello world \ No newline at end of file diff --git a/spring-resttemplate/README.md b/spring-resttemplate/README.md index aee02416f4..eef85792ce 100644 --- a/spring-resttemplate/README.md +++ b/spring-resttemplate/README.md @@ -17,6 +17,9 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring - [Uploading MultipartFile with Spring RestTemplate](https://www.baeldung.com/spring-rest-template-multipart-upload) - [Get and Post Lists of Objects with RestTemplate](https://www.baeldung.com/spring-rest-template-list) - [Copy of RestTemplate Post Request with JSON](https://www.baeldung.com/spring-resttemplate-post-json-test) +- [HTTP PUT vs HTTP PATCH in a REST API](https://www.baeldung.com/http-put-patch-difference-spring) +- [A Custom Media Type for a Spring REST API](https://www.baeldung.com/spring-rest-custom-media-type) +- [Download an Image or a File with Spring MVC](https://www.baeldung.com/spring-controller-return-image-file) ### NOTE: diff --git a/spring-resttemplate/pom.xml b/spring-resttemplate/pom.xml index 26a3143d6d..0b5d0b20d0 100644 --- a/spring-resttemplate/pom.xml +++ b/spring-resttemplate/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 - com.baeldung spring-resttemplate 0.1-SNAPSHOT spring-resttemplate war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-roo/pom.xml b/spring-roo/pom.xml index eb3a680d93..456642b1f0 100644 --- a/spring-roo/pom.xml +++ b/spring-roo/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 @@ -13,7 +13,7 @@ io.spring.platform platform-bom Athens-RELEASE - +
@@ -238,7 +238,6 @@ - diff --git a/spring-scheduling/pom.xml b/spring-scheduling/pom.xml index 21327cf52f..a337de39b7 100644 --- a/spring-scheduling/pom.xml +++ b/spring-scheduling/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,8 +8,8 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-security-acl/README.md b/spring-security-modules/spring-security-acl/README.md similarity index 100% rename from spring-security-acl/README.md rename to spring-security-modules/spring-security-acl/README.md diff --git a/spring-security-acl/pom.xml b/spring-security-modules/spring-security-acl/pom.xml similarity index 92% rename from spring-security-acl/pom.xml rename to spring-security-modules/spring-security-acl/pom.xml index 8acc39b785..3c613f9d92 100644 --- a/spring-security-acl/pom.xml +++ b/spring-security-modules/spring-security-acl/pom.xml @@ -1,18 +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-security-acl 0.0.1-SNAPSHOT spring-security-acl - Spring Security ACL war + Spring Security ACL - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/Application.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/Application.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/Application.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/Application.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/ACLContext.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/AclMethodSecurityConfiguration.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/config/JPAPersistenceConfig.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/dao/NoticeMessageRepository.java diff --git a/spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java b/spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java similarity index 100% rename from spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java rename to spring-security-modules/spring-security-acl/src/main/java/org/baeldung/acl/persistence/entity/NoticeMessage.java diff --git a/spring-security-acl/src/main/resources/acl-data.sql b/spring-security-modules/spring-security-acl/src/main/resources/acl-data.sql similarity index 100% rename from spring-security-acl/src/main/resources/acl-data.sql rename to spring-security-modules/spring-security-acl/src/main/resources/acl-data.sql diff --git a/spring-security-acl/src/main/resources/acl-schema.sql b/spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql similarity index 100% rename from spring-security-acl/src/main/resources/acl-schema.sql rename to spring-security-modules/spring-security-acl/src/main/resources/acl-schema.sql diff --git a/spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/resources/resources/logback.xml b/spring-security-modules/spring-security-acl/src/main/resources/logback.xml similarity index 100% rename from spring-cloud/spring-cloud-kubernetes/readiness-example/src/main/resources/resources/logback.xml rename to spring-security-modules/spring-security-acl/src/main/resources/logback.xml diff --git a/spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties b/spring-security-modules/spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties similarity index 100% rename from spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties rename to spring-security-modules/spring-security-acl/src/main/resources/org.baeldung.acl.datasource.properties diff --git a/spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-acl/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java b/spring-security-modules/spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java similarity index 100% rename from spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java rename to spring-security-modules/spring-security-acl/src/test/java/org/baeldung/acl/SpringACLIntegrationTest.java diff --git a/spring-security-angular/README.md b/spring-security-modules/spring-security-angular/README.md similarity index 100% rename from spring-security-angular/README.md rename to spring-security-modules/spring-security-angular/README.md diff --git a/spring-security-angular/client/anguarjs/app.js b/spring-security-modules/spring-security-angular/client/anguarjs/app.js similarity index 100% rename from spring-security-angular/client/anguarjs/app.js rename to spring-security-modules/spring-security-angular/client/anguarjs/app.js diff --git a/spring-security-angular/client/anguarjs/home/home.controller.js b/spring-security-modules/spring-security-angular/client/anguarjs/home/home.controller.js similarity index 100% rename from spring-security-angular/client/anguarjs/home/home.controller.js rename to spring-security-modules/spring-security-angular/client/anguarjs/home/home.controller.js diff --git a/spring-security-angular/client/anguarjs/home/home.view.html b/spring-security-modules/spring-security-angular/client/anguarjs/home/home.view.html similarity index 100% rename from spring-security-angular/client/anguarjs/home/home.view.html rename to spring-security-modules/spring-security-angular/client/anguarjs/home/home.view.html diff --git a/spring-security-angular/client/anguarjs/index.html b/spring-security-modules/spring-security-angular/client/anguarjs/index.html similarity index 100% rename from spring-security-angular/client/anguarjs/index.html rename to spring-security-modules/spring-security-angular/client/anguarjs/index.html diff --git a/spring-security-angular/client/anguarjs/login/login.controller.js b/spring-security-modules/spring-security-angular/client/anguarjs/login/login.controller.js similarity index 100% rename from spring-security-angular/client/anguarjs/login/login.controller.js rename to spring-security-modules/spring-security-angular/client/anguarjs/login/login.controller.js diff --git a/spring-security-angular/client/anguarjs/login/login.view.html b/spring-security-modules/spring-security-angular/client/anguarjs/login/login.view.html similarity index 100% rename from spring-security-angular/client/anguarjs/login/login.view.html rename to spring-security-modules/spring-security-angular/client/anguarjs/login/login.view.html diff --git a/spring-security-angular/client/angular2/app.css b/spring-security-modules/spring-security-angular/client/angular2/app.css similarity index 100% rename from spring-security-angular/client/angular2/app.css rename to spring-security-modules/spring-security-angular/client/angular2/app.css diff --git a/spring-security-angular/client/angular2/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular2/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular2/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular2/app/app.component.html diff --git a/spring-security-angular/client/angular2/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular2/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular2/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/app.component.ts diff --git a/spring-security-angular/client/angular2/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular2/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular2/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/app.module.ts diff --git a/spring-security-angular/client/angular2/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular2/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular2/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/app.routing.ts diff --git a/spring-security-angular/client/angular2/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular2/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.html diff --git a/spring-security-angular/client/angular2/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular2/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/home/home.component.ts diff --git a/spring-security-angular/client/angular2/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular2/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.html diff --git a/spring-security-angular/client/angular2/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular2/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/login/login.component.ts diff --git a/spring-security-angular/client/angular2/app/main.ts b/spring-security-modules/spring-security-angular/client/angular2/app/main.ts similarity index 100% rename from spring-security-angular/client/angular2/app/main.ts rename to spring-security-modules/spring-security-angular/client/angular2/app/main.ts diff --git a/spring-security-angular/client/angular2/index.html b/spring-security-modules/spring-security-angular/client/angular2/index.html similarity index 100% rename from spring-security-angular/client/angular2/index.html rename to spring-security-modules/spring-security-angular/client/angular2/index.html diff --git a/spring-security-angular/client/angular2/package.json b/spring-security-modules/spring-security-angular/client/angular2/package.json similarity index 100% rename from spring-security-angular/client/angular2/package.json rename to spring-security-modules/spring-security-angular/client/angular2/package.json diff --git a/spring-security-angular/client/angular2/systemjs.config.js b/spring-security-modules/spring-security-angular/client/angular2/systemjs.config.js similarity index 100% rename from spring-security-angular/client/angular2/systemjs.config.js rename to spring-security-modules/spring-security-angular/client/angular2/systemjs.config.js diff --git a/spring-security-angular/client/angular2/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular2/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular2/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular2/tsconfig.json diff --git a/spring-security-angular/client/angular4/.angular-cli.json b/spring-security-modules/spring-security-angular/client/angular4/.angular-cli.json similarity index 95% rename from spring-security-angular/client/angular4/.angular-cli.json rename to spring-security-modules/spring-security-angular/client/angular4/.angular-cli.json index 967934b2f7..34274db4eb 100644 --- a/spring-security-angular/client/angular4/.angular-cli.json +++ b/spring-security-modules/spring-security-angular/client/angular4/.angular-cli.json @@ -1,65 +1,65 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "project": { - "name": "angular-crud" - }, - "apps": [ - { - "root": "src", - "outDir": "dist", - "assets": [ - "assets", - "favicon.ico" - ], - "index": "index.html", - "main": "main.ts", - "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.app.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "app", - "styles": [ - "../node_modules/bootstrap/dist/css/bootstrap.min.css", - "styles.css", - "../node_modules/font-awesome/css/font-awesome.min.css" - ], - "scripts": [ - "../node_modules/jquery/dist/jquery.js", - "../node_modules/bootstrap/dist/js/bootstrap.js" - ], - "environmentSource": "environments/environment.ts", - "environments": { - "dev": "environments/environment.ts", - "prod": "environments/environment.prod.ts" - } - } - ], - "e2e": { - "protractor": { - "config": "./protractor.conf.js" - } - }, - "lint": [ - { - "project": "src/tsconfig.app.json", - "exclude": "**/node_modules/**" - }, - { - "project": "src/tsconfig.spec.json", - "exclude": "**/node_modules/**" - }, - { - "project": "e2e/tsconfig.e2e.json", - "exclude": "**/node_modules/**" - } - ], - "test": { - "karma": { - "config": "./karma.conf.js" - } - }, - "defaults": { - "styleExt": "css", - "component": {} - } +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "angular-crud" + }, + "apps": [ + { + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "app", + "styles": [ + "../node_modules/bootstrap/dist/css/bootstrap.min.css", + "styles.css", + "../node_modules/font-awesome/css/font-awesome.min.css" + ], + "scripts": [ + "../node_modules/jquery/dist/jquery.js", + "../node_modules/bootstrap/dist/js/bootstrap.js" + ], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "lint": [ + { + "project": "src/tsconfig.app.json", + "exclude": "**/node_modules/**" + }, + { + "project": "src/tsconfig.spec.json", + "exclude": "**/node_modules/**" + }, + { + "project": "e2e/tsconfig.e2e.json", + "exclude": "**/node_modules/**" + } + ], + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "css", + "component": {} + } } \ No newline at end of file diff --git a/spring-security-angular/client/angular4/package.json b/spring-security-modules/spring-security-angular/client/angular4/package.json similarity index 100% rename from spring-security-angular/client/angular4/package.json rename to spring-security-modules/spring-security-angular/client/angular4/package.json diff --git a/spring-security-angular/client/angular4/src/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.html diff --git a/spring-security-angular/client/angular4/src/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.component.ts diff --git a/spring-security-angular/client/angular4/src/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.module.ts diff --git a/spring-security-angular/client/angular4/src/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/app.routing.ts diff --git a/spring-security-angular/client/angular4/src/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular4/src/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.html diff --git a/spring-security-angular/client/angular4/src/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/home/home.component.ts diff --git a/spring-security-angular/client/angular4/src/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular4/src/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.html diff --git a/spring-security-angular/client/angular4/src/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular4/src/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/app/login/login.component.ts diff --git a/spring-security-angular/client/angular4/src/index.html b/spring-security-modules/spring-security-angular/client/angular4/src/index.html similarity index 100% rename from spring-security-angular/client/angular4/src/index.html rename to spring-security-modules/spring-security-angular/client/angular4/src/index.html diff --git a/spring-security-angular/client/angular4/src/main.ts b/spring-security-modules/spring-security-angular/client/angular4/src/main.ts similarity index 100% rename from spring-security-angular/client/angular4/src/main.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/main.ts diff --git a/spring-security-angular/client/angular4/src/polyfills.ts b/spring-security-modules/spring-security-angular/client/angular4/src/polyfills.ts similarity index 97% rename from spring-security-angular/client/angular4/src/polyfills.ts rename to spring-security-modules/spring-security-angular/client/angular4/src/polyfills.ts index a4984ced57..ec50a75aeb 100644 --- a/spring-security-angular/client/angular4/src/polyfills.ts +++ b/spring-security-modules/spring-security-angular/client/angular4/src/polyfills.ts @@ -1,68 +1,68 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** - * Required to support Web Animations `@angular/animation`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. -/** - * Need to import at least one locale-data with intl. - */ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ // import 'intl/locale-data/jsonp/en'; \ No newline at end of file diff --git a/spring-security-angular/client/angular4/src/styles.css b/spring-security-modules/spring-security-angular/client/angular4/src/styles.css similarity index 100% rename from spring-security-angular/client/angular4/src/styles.css rename to spring-security-modules/spring-security-angular/client/angular4/src/styles.css diff --git a/spring-security-angular/client/angular4/src/tsconfig.app.json b/spring-security-modules/spring-security-angular/client/angular4/src/tsconfig.app.json similarity index 100% rename from spring-security-angular/client/angular4/src/tsconfig.app.json rename to spring-security-modules/spring-security-angular/client/angular4/src/tsconfig.app.json diff --git a/spring-security-angular/client/angular4/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular4/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular4/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular4/tsconfig.json diff --git a/spring-security-angular/client/angular4/tslint.json b/spring-security-modules/spring-security-angular/client/angular4/tslint.json similarity index 100% rename from spring-security-angular/client/angular4/tslint.json rename to spring-security-modules/spring-security-angular/client/angular4/tslint.json diff --git a/spring-security-angular/client/angular5/.angular-cli.json b/spring-security-modules/spring-security-angular/client/angular5/.angular-cli.json similarity index 100% rename from spring-security-angular/client/angular5/.angular-cli.json rename to spring-security-modules/spring-security-angular/client/angular5/.angular-cli.json diff --git a/spring-security-angular/client/angular5/package.json b/spring-security-modules/spring-security-angular/client/angular5/package.json similarity index 100% rename from spring-security-angular/client/angular5/package.json rename to spring-security-modules/spring-security-angular/client/angular5/package.json diff --git a/spring-security-angular/client/angular5/src/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.html diff --git a/spring-security-angular/client/angular5/src/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.component.ts diff --git a/spring-security-angular/client/angular5/src/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.module.ts diff --git a/spring-security-angular/client/angular5/src/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/app.routing.ts diff --git a/spring-security-angular/client/angular5/src/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular5/src/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.html diff --git a/spring-security-angular/client/angular5/src/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/home/home.component.ts diff --git a/spring-security-angular/client/angular5/src/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular5/src/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.html diff --git a/spring-security-angular/client/angular5/src/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular5/src/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/app/login/login.component.ts diff --git a/spring-security-angular/client/angular5/src/index.html b/spring-security-modules/spring-security-angular/client/angular5/src/index.html similarity index 100% rename from spring-security-angular/client/angular5/src/index.html rename to spring-security-modules/spring-security-angular/client/angular5/src/index.html diff --git a/spring-security-angular/client/angular5/src/main.ts b/spring-security-modules/spring-security-angular/client/angular5/src/main.ts similarity index 100% rename from spring-security-angular/client/angular5/src/main.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/main.ts diff --git a/spring-security-angular/client/angular5/src/polyfills.ts b/spring-security-modules/spring-security-angular/client/angular5/src/polyfills.ts similarity index 97% rename from spring-security-angular/client/angular5/src/polyfills.ts rename to spring-security-modules/spring-security-angular/client/angular5/src/polyfills.ts index a4984ced57..ec50a75aeb 100644 --- a/spring-security-angular/client/angular5/src/polyfills.ts +++ b/spring-security-modules/spring-security-angular/client/angular5/src/polyfills.ts @@ -1,68 +1,68 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** - * Required to support Web Animations `@angular/animation`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. -/** - * Need to import at least one locale-data with intl. - */ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ // import 'intl/locale-data/jsonp/en'; \ No newline at end of file diff --git a/spring-security-angular/client/angular5/src/styles.css b/spring-security-modules/spring-security-angular/client/angular5/src/styles.css similarity index 100% rename from spring-security-angular/client/angular5/src/styles.css rename to spring-security-modules/spring-security-angular/client/angular5/src/styles.css diff --git a/spring-security-angular/client/angular5/src/tsconfig.app.json b/spring-security-modules/spring-security-angular/client/angular5/src/tsconfig.app.json similarity index 100% rename from spring-security-angular/client/angular5/src/tsconfig.app.json rename to spring-security-modules/spring-security-angular/client/angular5/src/tsconfig.app.json diff --git a/spring-security-angular/client/angular5/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular5/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular5/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular5/tsconfig.json diff --git a/spring-security-angular/client/angular5/tslint.json b/spring-security-modules/spring-security-angular/client/angular5/tslint.json similarity index 100% rename from spring-security-angular/client/angular5/tslint.json rename to spring-security-modules/spring-security-angular/client/angular5/tslint.json diff --git a/spring-security-angular/client/angular6/angular.json b/spring-security-modules/spring-security-angular/client/angular6/angular.json similarity index 100% rename from spring-security-angular/client/angular6/angular.json rename to spring-security-modules/spring-security-angular/client/angular6/angular.json diff --git a/spring-security-angular/client/angular6/package.json b/spring-security-modules/spring-security-angular/client/angular6/package.json similarity index 100% rename from spring-security-angular/client/angular6/package.json rename to spring-security-modules/spring-security-angular/client/angular6/package.json diff --git a/spring-security-angular/client/angular6/src/app/app.component.html b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.html similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.component.html rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.html diff --git a/spring-security-angular/client/angular6/src/app/app.component.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.component.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.component.ts diff --git a/spring-security-angular/client/angular6/src/app/app.module.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.module.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.module.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.module.ts diff --git a/spring-security-angular/client/angular6/src/app/app.routing.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/app.routing.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/app.routing.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/app.routing.ts diff --git a/spring-security-angular/client/angular6/src/app/home/home.component.html b/spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.html similarity index 100% rename from spring-security-angular/client/angular6/src/app/home/home.component.html rename to spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.html diff --git a/spring-security-angular/client/angular6/src/app/home/home.component.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/home/home.component.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/home/home.component.ts diff --git a/spring-security-angular/client/angular6/src/app/login/login.component.html b/spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.html similarity index 100% rename from spring-security-angular/client/angular6/src/app/login/login.component.html rename to spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.html diff --git a/spring-security-angular/client/angular6/src/app/login/login.component.ts b/spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.ts similarity index 100% rename from spring-security-angular/client/angular6/src/app/login/login.component.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/app/login/login.component.ts diff --git a/spring-security-angular/client/angular6/src/index.html b/spring-security-modules/spring-security-angular/client/angular6/src/index.html similarity index 100% rename from spring-security-angular/client/angular6/src/index.html rename to spring-security-modules/spring-security-angular/client/angular6/src/index.html diff --git a/spring-security-angular/client/angular6/src/main.ts b/spring-security-modules/spring-security-angular/client/angular6/src/main.ts similarity index 100% rename from spring-security-angular/client/angular6/src/main.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/main.ts diff --git a/spring-security-angular/client/angular6/src/polyfills.ts b/spring-security-modules/spring-security-angular/client/angular6/src/polyfills.ts similarity index 97% rename from spring-security-angular/client/angular6/src/polyfills.ts rename to spring-security-modules/spring-security-angular/client/angular6/src/polyfills.ts index a4984ced57..ec50a75aeb 100644 --- a/spring-security-angular/client/angular6/src/polyfills.ts +++ b/spring-security-modules/spring-security-angular/client/angular6/src/polyfills.ts @@ -1,68 +1,68 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. -/** Evergreen browsers require these. **/ -import 'core-js/es6/reflect'; -import 'core-js/es7/reflect'; - - -/** - * Required to support Web Animations `@angular/animation`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. -/** - * Need to import at least one locale-data with intl. - */ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ // import 'intl/locale-data/jsonp/en'; \ No newline at end of file diff --git a/spring-security-angular/client/angular6/src/styles.css b/spring-security-modules/spring-security-angular/client/angular6/src/styles.css similarity index 100% rename from spring-security-angular/client/angular6/src/styles.css rename to spring-security-modules/spring-security-angular/client/angular6/src/styles.css diff --git a/spring-security-angular/client/angular6/src/tsconfig.app.json b/spring-security-modules/spring-security-angular/client/angular6/src/tsconfig.app.json similarity index 100% rename from spring-security-angular/client/angular6/src/tsconfig.app.json rename to spring-security-modules/spring-security-angular/client/angular6/src/tsconfig.app.json diff --git a/spring-security-angular/client/angular6/tsconfig.json b/spring-security-modules/spring-security-angular/client/angular6/tsconfig.json similarity index 100% rename from spring-security-angular/client/angular6/tsconfig.json rename to spring-security-modules/spring-security-angular/client/angular6/tsconfig.json diff --git a/spring-security-angular/client/angular6/tslint.json b/spring-security-modules/spring-security-angular/client/angular6/tslint.json similarity index 100% rename from spring-security-angular/client/angular6/tslint.json rename to spring-security-modules/spring-security-angular/client/angular6/tslint.json diff --git a/spring-security-angular/server/pom.xml b/spring-security-modules/spring-security-angular/server/pom.xml similarity index 96% rename from spring-security-angular/server/pom.xml rename to spring-security-modules/spring-security-angular/server/pom.xml index 6474bb5ed6..19d980062c 100644 --- a/spring-security-angular/server/pom.xml +++ b/spring-security-modules/spring-security-angular/server/pom.xml @@ -2,7 +2,6 @@ 4.0.0 - com.baeldung server 0.0.1-SNAPSHOT server @@ -13,7 +12,7 @@ com.baeldung parent-modules 1.0.0-SNAPSHOT - ../../ + ../../../
diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java similarity index 100% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/SpringBootSecurityApplication.java diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java similarity index 100% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/basicauth/config/BasicAuthConfiguration.java diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java similarity index 97% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java index ab66065b61..0eef4198a1 100644 --- a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java +++ b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/controller/UserController.java @@ -1,29 +1,29 @@ -package com.baeldung.springbootsecurityrest.controller; - -import java.security.Principal; -import java.util.Base64; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import com.baeldung.springbootsecurityrest.vo.User; - -@RestController -@CrossOrigin -public class UserController { - - @RequestMapping("/login") - public boolean login(@RequestBody User user) { - return user.getUserName().equals("user") && user.getPassword().equals("password"); - } - - @RequestMapping("/user") - public Principal user(HttpServletRequest request) { - String authToken = request.getHeader("Authorization").substring("Basic".length()).trim(); - return () -> new String(Base64.getDecoder().decode(authToken)).split(":")[0]; - } -} +package com.baeldung.springbootsecurityrest.controller; + +import java.security.Principal; +import java.util.Base64; + +import javax.servlet.http.HttpServletRequest; + +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.baeldung.springbootsecurityrest.vo.User; + +@RestController +@CrossOrigin +public class UserController { + + @RequestMapping("/login") + public boolean login(@RequestBody User user) { + return user.getUserName().equals("user") && user.getPassword().equals("password"); + } + + @RequestMapping("/user") + public Principal user(HttpServletRequest request) { + String authToken = request.getHeader("Authorization").substring("Basic".length()).trim(); + return () -> new String(Base64.getDecoder().decode(authToken)).split(":")[0]; + } +} diff --git a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java similarity index 94% rename from spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java rename to spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java index 0eda5ce9ec..52377ad741 100644 --- a/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java +++ b/spring-security-modules/spring-security-angular/server/src/main/java/com/baeldung/springbootsecurityrest/vo/User.java @@ -1,21 +1,21 @@ -package com.baeldung.springbootsecurityrest.vo; - - -public class User { - - private String userName; - private String password; - - public String getUserName() { - return userName; - } - public void setUserName(String userName) { - this.userName = userName; - } - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } -} +package com.baeldung.springbootsecurityrest.vo; + + +public class User { + + private String userName; + private String password; + + public String getUserName() { + return userName; + } + public void setUserName(String userName) { + this.userName = userName; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } +} diff --git a/spring-security-angular/server/src/main/resources/application.properties b/spring-security-modules/spring-security-angular/server/src/main/resources/application.properties similarity index 100% rename from spring-security-angular/server/src/main/resources/application.properties rename to spring-security-modules/spring-security-angular/server/src/main/resources/application.properties diff --git a/spring-security-acl/src/main/resources/logback.xml b/spring-security-modules/spring-security-angular/server/src/main/resources/logback.xml similarity index 100% rename from spring-security-acl/src/main/resources/logback.xml rename to spring-security-modules/spring-security-angular/server/src/main/resources/logback.xml diff --git a/spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java b/spring-security-modules/spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java similarity index 100% rename from spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java rename to spring-security-modules/spring-security-angular/server/src/test/java/com/baeldung/springbootsecurityrest/BasicAuthConfigurationIntegrationTest.java diff --git a/spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-angular/server/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-cache-control/README.md b/spring-security-modules/spring-security-cache-control/README.md similarity index 100% rename from spring-security-cache-control/README.md rename to spring-security-modules/spring-security-cache-control/README.md diff --git a/spring-security-cache-control/pom.xml b/spring-security-modules/spring-security-cache-control/pom.xml similarity index 90% rename from spring-security-cache-control/pom.xml rename to spring-security-modules/spring-security-cache-control/pom.xml index e68f92d2ee..ff96ae78dd 100644 --- a/spring-security-cache-control/pom.xml +++ b/spring-security-modules/spring-security-cache-control/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-security-cache-control 1.0-SNAPSHOT - spring-security-cache-control + spring-security-cache-control - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/AppRunner.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/SpringSecurityConfig.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/TimestampDto.java diff --git a/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java b/spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java similarity index 100% rename from spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java rename to spring-security-modules/spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/model/UserDto.java diff --git a/spring-security-angular/server/src/main/resources/logback.xml b/spring-security-modules/spring-security-cache-control/src/main/resources/logback.xml similarity index 100% rename from spring-security-angular/server/src/main/resources/logback.xml rename to spring-security-modules/spring-security-cache-control/src/main/resources/logback.xml diff --git a/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java b/spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java similarity index 100% rename from spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java rename to spring-security-modules/spring-security-cache-control/src/test/java/com/baeldung/cachecontrol/ResourceEndpointIntegrationTest.java diff --git a/spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-cache-control/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-modules/spring-security-core/.gitignore b/spring-security-modules/spring-security-core/.gitignore new file mode 100644 index 0000000000..9f970225ad --- /dev/null +++ b/spring-security-modules/spring-security-core/.gitignore @@ -0,0 +1 @@ +target/ \ No newline at end of file diff --git a/spring-security-core/README.md b/spring-security-modules/spring-security-core/README.md similarity index 89% rename from spring-security-core/README.md rename to spring-security-modules/spring-security-core/README.md index 3579e5e759..6b1f236b7c 100644 --- a/spring-security-core/README.md +++ b/spring-security-modules/spring-security-core/README.md @@ -8,8 +8,6 @@ This module contains articles about core Spring Security - [Introduction to Spring Method Security](https://www.baeldung.com/spring-security-method-security) - [Overview and Need for DelegatingFilterProxy in Spring](https://www.baeldung.com/spring-delegating-filter-proxy) -### @PreFilter and @PostFilter annotations - -#### Build the Project +### Build the Project `mvn clean install` diff --git a/spring-security-core/pom.xml b/spring-security-modules/spring-security-core/pom.xml similarity index 97% rename from spring-security-core/pom.xml rename to spring-security-modules/spring-security-core/pom.xml index 00d12ed7d2..9f1e7cda29 100644 --- a/spring-security-core/pom.xml +++ b/spring-security-modules/spring-security-core/pom.xml @@ -1,17 +1,17 @@ + 4.0.0 - com.baeldung spring-security-core 0.1-SNAPSHOT spring-security-core war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 @@ -50,7 +50,6 @@ - spring-security-core diff --git a/spring-security-core/src/main/java/com/baeldung/app/App.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/App.java similarity index 85% rename from spring-security-core/src/main/java/com/baeldung/app/App.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/App.java index d23df9adef..6e41a53967 100644 --- a/spring-security-core/src/main/java/com/baeldung/app/App.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/App.java @@ -12,9 +12,6 @@ import org.springframework.web.filter.DelegatingFilterProxy; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; @SpringBootApplication -@EnableJpaRepositories("com.baeldung.repository") -@ComponentScan("com.baeldung") -@EntityScan("com.baeldung.entity") public class App extends SpringBootServletInitializer { public static void main(String[] args) { SpringApplication.run(App.class, args); @@ -31,19 +28,16 @@ public class App extends SpringBootServletInitializer { @Override protected Class[] getRootConfigClasses() { - // TODO Auto-generated method stub return null; } @Override protected Class[] getServletConfigClasses() { - // TODO Auto-generated method stub return null; } @Override protected String[] getServletMappings() { - // TODO Auto-generated method stub return null; } } diff --git a/spring-security-core/src/main/java/com/baeldung/auditing/ExposeAttemptedPathAuthorizationAuditListener.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/auditing/ExposeAttemptedPathAuthorizationAuditListener.java similarity index 97% rename from spring-security-core/src/main/java/com/baeldung/auditing/ExposeAttemptedPathAuthorizationAuditListener.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/auditing/ExposeAttemptedPathAuthorizationAuditListener.java index 615d14584f..d238c157df 100644 --- a/spring-security-core/src/main/java/com/baeldung/auditing/ExposeAttemptedPathAuthorizationAuditListener.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/auditing/ExposeAttemptedPathAuthorizationAuditListener.java @@ -1,4 +1,4 @@ -package com.baeldung.auditing; +package com.baeldung.app.auditing; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.boot.actuate.security.AbstractAuthorizationAuditListener; diff --git a/spring-security-core/src/main/java/com/baeldung/auditing/LoginAttemptsLogger.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/auditing/LoginAttemptsLogger.java similarity index 96% rename from spring-security-core/src/main/java/com/baeldung/auditing/LoginAttemptsLogger.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/auditing/LoginAttemptsLogger.java index d06c3e24e1..e775006953 100644 --- a/spring-security-core/src/main/java/com/baeldung/auditing/LoginAttemptsLogger.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/auditing/LoginAttemptsLogger.java @@ -1,4 +1,4 @@ -package com.baeldung.auditing; +package com.baeldung.app.auditing; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/spring-security-core/src/main/java/com/baeldung/config/DatabaseLoader.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/config/DatabaseLoader.java similarity index 85% rename from spring-security-core/src/main/java/com/baeldung/config/DatabaseLoader.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/config/DatabaseLoader.java index 7f22c3ec99..9d06d5f7ac 100644 --- a/spring-security-core/src/main/java/com/baeldung/config/DatabaseLoader.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/config/DatabaseLoader.java @@ -1,11 +1,11 @@ -package com.baeldung.config; +package com.baeldung.app.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.stereotype.Component; -import com.baeldung.entity.Task; -import com.baeldung.repository.TaskRepository; +import com.baeldung.app.entity.Task; +import com.baeldung.app.repository.TaskRepository; @Component public class DatabaseLoader implements CommandLineRunner { diff --git a/spring-security-core/src/main/java/com/baeldung/config/WebSecurityConfig.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/config/WebSecurityConfig.java similarity index 98% rename from spring-security-core/src/main/java/com/baeldung/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/config/WebSecurityConfig.java index be11a0fde5..15af160135 100644 --- a/spring-security-core/src/main/java/com/baeldung/config/WebSecurityConfig.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/config/WebSecurityConfig.java @@ -1,4 +1,4 @@ -package com.baeldung.config; +package com.baeldung.app.config; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; diff --git a/spring-security-core/src/main/java/com/baeldung/controller/TaskController.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/controller/TaskController.java similarity index 89% rename from spring-security-core/src/main/java/com/baeldung/controller/TaskController.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/controller/TaskController.java index 91156354b1..a084f14eca 100644 --- a/spring-security-core/src/main/java/com/baeldung/controller/TaskController.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/controller/TaskController.java @@ -1,4 +1,4 @@ -package com.baeldung.controller; +package com.baeldung.app.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; @@ -7,8 +7,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; -import com.baeldung.entity.Task; -import com.baeldung.service.TaskService; +import com.baeldung.app.entity.Task; +import com.baeldung.app.service.TaskService; @Controller @RequestMapping("api/tasks") diff --git a/spring-security-core/src/main/java/com/baeldung/entity/Task.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/entity/Task.java similarity index 96% rename from spring-security-core/src/main/java/com/baeldung/entity/Task.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/entity/Task.java index 9103c342cc..d2a8a1383d 100644 --- a/spring-security-core/src/main/java/com/baeldung/entity/Task.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/entity/Task.java @@ -1,4 +1,4 @@ -package com.baeldung.entity; +package com.baeldung.app.entity; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/spring-security-core/src/main/java/com/baeldung/filter/CustomFilter.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/filter/CustomFilter.java similarity index 96% rename from spring-security-core/src/main/java/com/baeldung/filter/CustomFilter.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/filter/CustomFilter.java index e748b373b7..7229e4606f 100644 --- a/spring-security-core/src/main/java/com/baeldung/filter/CustomFilter.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/filter/CustomFilter.java @@ -1,4 +1,4 @@ -package com.baeldung.filter; +package com.baeldung.app.filter; import java.io.IOException; diff --git a/spring-security-core/src/main/java/com/baeldung/repository/TaskRepository.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/repository/TaskRepository.java similarity index 64% rename from spring-security-core/src/main/java/com/baeldung/repository/TaskRepository.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/repository/TaskRepository.java index afb999719c..ac0f850891 100644 --- a/spring-security-core/src/main/java/com/baeldung/repository/TaskRepository.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/repository/TaskRepository.java @@ -1,8 +1,8 @@ -package com.baeldung.repository; +package com.baeldung.app.repository; import org.springframework.data.repository.CrudRepository; -import com.baeldung.entity.Task; +import com.baeldung.app.entity.Task; public interface TaskRepository extends CrudRepository { diff --git a/spring-security-core/src/main/java/com/baeldung/service/TaskService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/service/TaskService.java similarity index 85% rename from spring-security-core/src/main/java/com/baeldung/service/TaskService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/service/TaskService.java index 1269eb4fd0..20d53ac77a 100644 --- a/spring-security-core/src/main/java/com/baeldung/service/TaskService.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/app/service/TaskService.java @@ -1,12 +1,12 @@ -package com.baeldung.service; +package com.baeldung.app.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PostFilter; import org.springframework.security.access.prepost.PreFilter; import org.springframework.stereotype.Service; -import com.baeldung.entity.Task; -import com.baeldung.repository.TaskRepository; +import com.baeldung.app.entity.Task; +import com.baeldung.app.repository.TaskRepository; @Service public class TaskService { diff --git a/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/CustomPermissionAllowedMethodSecurityMetadataSource.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/CustomPermissionAllowedMethodSecurityMetadataSource.java new file mode 100644 index 0000000000..4bde3f5aa3 --- /dev/null +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/CustomPermissionAllowedMethodSecurityMetadataSource.java @@ -0,0 +1,49 @@ +package com.baeldung.denyonmissing; + +import static org.springframework.security.access.annotation.Jsr250SecurityConfig.DENY_ALL_ATTRIBUTE; + +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.security.access.ConfigAttribute; +import org.springframework.security.access.method.AbstractFallbackMethodSecurityMetadataSource; +import org.springframework.security.access.prepost.PostAuthorize; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Controller; + +public class CustomPermissionAllowedMethodSecurityMetadataSource extends AbstractFallbackMethodSecurityMetadataSource { + @Override + protected Collection findAttributes(Class clazz) { + return null; + } + + @Override + protected Collection findAttributes(Method method, Class targetClass) { + Annotation[] annotations = AnnotationUtils.getAnnotations(method); + List attributes = new ArrayList<>(); + + // if the class is annotated as @Controller we should by default deny access to every method + if (AnnotationUtils.findAnnotation(targetClass, Controller.class) != null) { + attributes.add(DENY_ALL_ATTRIBUTE); + } + + if (annotations != null) { + for (Annotation a : annotations) { + // but not if the method has at least a PreAuthorize or PostAuthorize annotation + if (a instanceof PreAuthorize || a instanceof PostAuthorize) { + return null; + } + } + } + return attributes; + } + + @Override + public Collection getAllConfigAttributes() { + return null; + } +} \ No newline at end of file diff --git a/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyApplication.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyApplication.java new file mode 100644 index 0000000000..d5d28ae210 --- /dev/null +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyApplication.java @@ -0,0 +1,11 @@ +package com.baeldung.denyonmissing; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DenyApplication { + public static void main(String[] args) { + SpringApplication.run(DenyApplication.class, args); + } +} diff --git a/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyMethodSecurityConfig.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyMethodSecurityConfig.java new file mode 100644 index 0000000000..695f81eb54 --- /dev/null +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyMethodSecurityConfig.java @@ -0,0 +1,29 @@ +package com.baeldung.denyonmissing; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.access.method.MethodSecurityMetadataSource; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.provisioning.InMemoryUserDetailsManager; + +@Configuration +@EnableWebSecurity +@EnableGlobalMethodSecurity(prePostEnabled = true) +public class DenyMethodSecurityConfig extends GlobalMethodSecurityConfiguration { + @Override + protected MethodSecurityMetadataSource customMethodSecurityMetadataSource() { + return new CustomPermissionAllowedMethodSecurityMetadataSource(); + } + + @Bean + public UserDetailsService userDetailsService() { + return new InMemoryUserDetailsManager( + User.withUsername("user").password("{noop}password").roles("USER").build(), + User.withUsername("guest").password("{noop}password").roles().build() + ); + } +} diff --git a/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyOnMissingController.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyOnMissingController.java new file mode 100644 index 0000000000..ef8881d3b7 --- /dev/null +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/denyonmissing/DenyOnMissingController.java @@ -0,0 +1,19 @@ +package com.baeldung.denyonmissing; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class DenyOnMissingController { + @GetMapping(path = "hello") + @PreAuthorize("hasRole('USER')") + public String hello() { + return "Hello world!"; + } + + @GetMapping(path = "bye") + public String bye() { + return "Bye bye world!"; + } +} diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java similarity index 96% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java index bde4456f8e..a7fa08ff30 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/annotation/IsViewer.java @@ -1,14 +1,14 @@ -package com.baeldung.methodsecurity.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.springframework.security.access.prepost.PreAuthorize; - -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -@PreAuthorize("hasRole('VIEWER')") -public @interface IsViewer { +package com.baeldung.methodsecurity.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.springframework.security.access.prepost.PreAuthorize; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@PreAuthorize("hasRole('VIEWER')") +public @interface IsViewer { } \ No newline at end of file diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java similarity index 100% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/config/MethodSecurityConfig.java diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java similarity index 96% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java index 7daaef5984..cce7dc5f75 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/entity/CustomUser.java @@ -1,30 +1,30 @@ -package com.baeldung.methodsecurity.entity; - -import java.util.Collection; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.userdetails.User; - -@SuppressWarnings("serial") -public class CustomUser extends User { - - private String nickName; - - public CustomUser(String username, String password, Collection authorities) { - super(username, password, authorities); - } - - public CustomUser(String username, String password, Collection authorities, String nickName) { - super(username, password, authorities); - this.nickName = nickName; - } - - public String getNickName() { - return nickName; - } - - public void setNickName(String nickName) { - this.nickName = nickName; - } - -} +package com.baeldung.methodsecurity.entity; + +import java.util.Collection; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.User; + +@SuppressWarnings("serial") +public class CustomUser extends User { + + private String nickName; + + public CustomUser(String username, String password, Collection authorities) { + super(username, password, authorities); + } + + public CustomUser(String username, String password, Collection authorities, String nickName) { + super(username, password, authorities); + this.nickName = nickName; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } + +} diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java similarity index 97% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java index eef39189a7..20a1f4e85c 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/repository/UserRoleRepository.java @@ -1,58 +1,58 @@ -package com.baeldung.methodsecurity.repository; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.authority.SimpleGrantedAuthority; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.stereotype.Service; - -import com.baeldung.methodsecurity.entity.CustomUser; - -@Service -public class UserRoleRepository { - - static Map DB_BASED_USER_MAPPING; - - static { - DB_BASED_USER_MAPPING = new LinkedHashMap<>(); - DB_BASED_USER_MAPPING.put("jane", new CustomUser("jane", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_VIEWER"), "jane")); - DB_BASED_USER_MAPPING.put("john", new CustomUser("john", "1234", getGrantedAuthorities("ROLE_EDITOR", "ROLE_ADMIN"), "jane")); - DB_BASED_USER_MAPPING.put("jack", new CustomUser("jack", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_REVIEWER"), "jane")); - } - - private static List getGrantedAuthorities(String... roles) { - ArrayList authorities = new ArrayList<>(); - for (String role : roles) { - authorities.add(new SimpleGrantedAuthority(role)); - } - return authorities; - } - - public CustomUser loadUserByUserName(String username) { - if (DB_BASED_USER_MAPPING.containsKey(username)) { - return DB_BASED_USER_MAPPING.get(username); - } - throw new UsernameNotFoundException("User " + username + " cannot be found"); - } - - public boolean isValidUsername(String username) { - return DB_BASED_USER_MAPPING.containsKey(username); - } - - public boolean isValidRole(String roleName) { - return roleName.startsWith("ROLE_"); - } - - public List getAllUsernames() { - List usernames = new ArrayList<>(); - usernames.add("jane"); - usernames.add("john"); - usernames.add("jack"); - return usernames; - } - -} +package com.baeldung.methodsecurity.repository; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +import com.baeldung.methodsecurity.entity.CustomUser; + +@Service +public class UserRoleRepository { + + static Map DB_BASED_USER_MAPPING; + + static { + DB_BASED_USER_MAPPING = new LinkedHashMap<>(); + DB_BASED_USER_MAPPING.put("jane", new CustomUser("jane", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_VIEWER"), "jane")); + DB_BASED_USER_MAPPING.put("john", new CustomUser("john", "1234", getGrantedAuthorities("ROLE_EDITOR", "ROLE_ADMIN"), "jane")); + DB_BASED_USER_MAPPING.put("jack", new CustomUser("jack", "1234", getGrantedAuthorities("ROLE_USER", "ROLE_REVIEWER"), "jane")); + } + + private static List getGrantedAuthorities(String... roles) { + ArrayList authorities = new ArrayList<>(); + for (String role : roles) { + authorities.add(new SimpleGrantedAuthority(role)); + } + return authorities; + } + + public CustomUser loadUserByUserName(String username) { + if (DB_BASED_USER_MAPPING.containsKey(username)) { + return DB_BASED_USER_MAPPING.get(username); + } + throw new UsernameNotFoundException("User " + username + " cannot be found"); + } + + public boolean isValidUsername(String username) { + return DB_BASED_USER_MAPPING.containsKey(username); + } + + public boolean isValidRole(String roleName) { + return roleName.startsWith("ROLE_"); + } + + public List getAllUsernames() { + List usernames = new ArrayList<>(); + usernames.add("jane"); + usernames.add("john"); + usernames.add("jack"); + return usernames; + } + +} diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java similarity index 97% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java index 685621b55f..e6828b32a1 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/CustomUserDetailsService.java @@ -1,20 +1,20 @@ -package com.baeldung.methodsecurity.service; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.stereotype.Service; - -import com.baeldung.methodsecurity.repository.UserRoleRepository; - -@Service("userDetailService") -public class CustomUserDetailsService implements UserDetailsService { - - @Autowired - UserRoleRepository userRoleRepo; - - @Override - public UserDetails loadUserByUsername(String username) { - return userRoleRepo.loadUserByUserName(username); - } +package com.baeldung.methodsecurity.service; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.stereotype.Service; + +import com.baeldung.methodsecurity.repository.UserRoleRepository; + +@Service("userDetailService") +public class CustomUserDetailsService implements UserDetailsService { + + @Autowired + UserRoleRepository userRoleRepo; + + @Override + public UserDetails loadUserByUsername(String username) { + return userRoleRepo.loadUserByUserName(username); + } } \ No newline at end of file diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java similarity index 95% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java index 623d51d34f..7e60f701ad 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/SystemService.java @@ -1,18 +1,18 @@ -package com.baeldung.methodsecurity.service; - -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.stereotype.Service; - -@Service -@PreAuthorize("hasRole('ROLE_ADMIN')") -public class SystemService { - - public String getSystemYear(){ - return "2017"; - } - - public String getSystemDate(){ - return "31-12-2017"; - } - -} +package com.baeldung.methodsecurity.service; + +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.stereotype.Service; + +@Service +@PreAuthorize("hasRole('ROLE_ADMIN')") +public class SystemService { + + public String getSystemYear(){ + return "2017"; + } + + public String getSystemDate(){ + return "31-12-2017"; + } + +} diff --git a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java similarity index 97% rename from spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java rename to spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java index 4d090fd90c..1579044700 100644 --- a/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java +++ b/spring-security-modules/spring-security-core/src/main/java/com/baeldung/methodsecurity/service/UserRoleService.java @@ -1,109 +1,109 @@ -package com.baeldung.methodsecurity.service; - -import java.util.List; -import java.util.stream.Collectors; - -import javax.annotation.security.RolesAllowed; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.annotation.Secured; -import org.springframework.security.access.prepost.PostAuthorize; -import org.springframework.security.access.prepost.PostFilter; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.security.access.prepost.PreFilter; -import org.springframework.security.core.context.SecurityContext; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.stereotype.Service; - -import com.baeldung.methodsecurity.annotation.IsViewer; -import com.baeldung.methodsecurity.entity.CustomUser; -import com.baeldung.methodsecurity.repository.UserRoleRepository; - -@Service -public class UserRoleService { - - @Autowired - UserRoleRepository userRoleRepository; - - @Secured("ROLE_VIEWER") - public String getUsername() { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getName(); - } - - @Secured({ "ROLE_VIEWER", "ROLE_EDITOR" }) - public boolean isValidUsername(String username) { - return userRoleRepository.isValidUsername(username); - } - - @RolesAllowed("ROLE_VIEWER") - public String getUsername2() { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getName(); - } - - @RolesAllowed({ "ROLE_VIEWER", "ROLE_EDITOR" }) - public boolean isValidUsername2(String username) { - return userRoleRepository.isValidUsername(username); - } - - @PreAuthorize("hasRole('ROLE_VIEWER')") - public String getUsernameInUpperCase() { - return getUsername().toUpperCase(); - } - - @PreAuthorize("hasAuthority('SYS_ADMIN')") - public String getUsernameLC() { - return getUsername().toLowerCase(); - } - - @PreAuthorize("hasRole('ROLE_VIEWER') or hasRole('ROLE_EDITOR')") - public boolean isValidUsername3(String username) { - return userRoleRepository.isValidUsername(username); - } - - @PreAuthorize("#username == authentication.principal.username") - public String getMyRoles(String username) { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); - } - - @PostAuthorize("#username == authentication.principal.username") - public String getMyRoles2(String username) { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); - } - - @PostAuthorize("returnObject.username == authentication.principal.nickName") - public CustomUser loadUserDetail(String username) { - return userRoleRepository.loadUserByUserName(username); - } - - @PreFilter("filterObject != authentication.principal.username") - public String joinUsernames(List usernames) { - return usernames.stream().collect(Collectors.joining(";")); - } - - @PreFilter(value = "filterObject != authentication.principal.username", filterTarget = "usernames") - public String joinUsernamesAndRoles(List usernames, List roles) { - return usernames.stream().collect(Collectors.joining(";")) + ":" + roles.stream().collect(Collectors.joining(";")); - } - - @PostFilter("filterObject != authentication.principal.username") - public List getAllUsernamesExceptCurrent() { - return userRoleRepository.getAllUsernames(); - } - - @IsViewer - public String getUsername4() { - SecurityContext securityContext = SecurityContextHolder.getContext(); - return securityContext.getAuthentication().getName(); - } - - @PreAuthorize("#username == authentication.principal.username") - @PostAuthorize("returnObject.username == authentication.principal.nickName") - public CustomUser securedLoadUserDetail(String username) { - return userRoleRepository.loadUserByUserName(username); - } - -} +package com.baeldung.methodsecurity.service; + +import java.util.List; +import java.util.stream.Collectors; + +import javax.annotation.security.RolesAllowed; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.annotation.Secured; +import org.springframework.security.access.prepost.PostAuthorize; +import org.springframework.security.access.prepost.PostFilter; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.access.prepost.PreFilter; +import org.springframework.security.core.context.SecurityContext; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.stereotype.Service; + +import com.baeldung.methodsecurity.annotation.IsViewer; +import com.baeldung.methodsecurity.entity.CustomUser; +import com.baeldung.methodsecurity.repository.UserRoleRepository; + +@Service +public class UserRoleService { + + @Autowired + UserRoleRepository userRoleRepository; + + @Secured("ROLE_VIEWER") + public String getUsername() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getName(); + } + + @Secured({ "ROLE_VIEWER", "ROLE_EDITOR" }) + public boolean isValidUsername(String username) { + return userRoleRepository.isValidUsername(username); + } + + @RolesAllowed("ROLE_VIEWER") + public String getUsername2() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getName(); + } + + @RolesAllowed({ "ROLE_VIEWER", "ROLE_EDITOR" }) + public boolean isValidUsername2(String username) { + return userRoleRepository.isValidUsername(username); + } + + @PreAuthorize("hasRole('ROLE_VIEWER')") + public String getUsernameInUpperCase() { + return getUsername().toUpperCase(); + } + + @PreAuthorize("hasAuthority('SYS_ADMIN')") + public String getUsernameLC() { + return getUsername().toLowerCase(); + } + + @PreAuthorize("hasRole('ROLE_VIEWER') or hasRole('ROLE_EDITOR')") + public boolean isValidUsername3(String username) { + return userRoleRepository.isValidUsername(username); + } + + @PreAuthorize("#username == authentication.principal.username") + public String getMyRoles(String username) { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); + } + + @PostAuthorize("#username == authentication.principal.username") + public String getMyRoles2(String username) { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getAuthorities().stream().map(auth -> auth.getAuthority()).collect(Collectors.joining(",")); + } + + @PostAuthorize("returnObject.username == authentication.principal.nickName") + public CustomUser loadUserDetail(String username) { + return userRoleRepository.loadUserByUserName(username); + } + + @PreFilter("filterObject != authentication.principal.username") + public String joinUsernames(List usernames) { + return usernames.stream().collect(Collectors.joining(";")); + } + + @PreFilter(value = "filterObject != authentication.principal.username", filterTarget = "usernames") + public String joinUsernamesAndRoles(List usernames, List roles) { + return usernames.stream().collect(Collectors.joining(";")) + ":" + roles.stream().collect(Collectors.joining(";")); + } + + @PostFilter("filterObject != authentication.principal.username") + public List getAllUsernamesExceptCurrent() { + return userRoleRepository.getAllUsernames(); + } + + @IsViewer + public String getUsername4() { + SecurityContext securityContext = SecurityContextHolder.getContext(); + return securityContext.getAuthentication().getName(); + } + + @PreAuthorize("#username == authentication.principal.username") + @PostAuthorize("returnObject.username == authentication.principal.nickName") + public CustomUser securedLoadUserDetail(String username) { + return userRoleRepository.loadUserByUserName(username); + } + +} diff --git a/spring-security-core/src/main/resources/application.properties b/spring-security-modules/spring-security-core/src/main/resources/application.properties similarity index 100% rename from spring-security-core/src/main/resources/application.properties rename to spring-security-modules/spring-security-core/src/main/resources/application.properties diff --git a/spring-security-cache-control/src/main/resources/logback.xml b/spring-security-modules/spring-security-core/src/main/resources/logback.xml similarity index 100% rename from spring-security-cache-control/src/main/resources/logback.xml rename to spring-security-modules/spring-security-core/src/main/resources/logback.xml diff --git a/spring-security-core/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-core/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-core/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-core/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-core/src/test/java/com/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/app/SpringContextTest.java similarity index 93% rename from spring-security-core/src/test/java/com/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/app/SpringContextTest.java index bca6450fb1..b3c31a936a 100644 --- a/spring-security-core/src/test/java/com/baeldung/SpringContextTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/app/SpringContextTest.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.app; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/spring-security-core/src/test/java/com/baeldung/test/LiveTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/app/test/LiveTest.java similarity index 96% rename from spring-security-core/src/test/java/com/baeldung/test/LiveTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/app/test/LiveTest.java index 6bcb2e8f0f..d099173395 100644 --- a/spring-security-core/src/test/java/com/baeldung/test/LiveTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/app/test/LiveTest.java @@ -1,4 +1,4 @@ -package com.baeldung.test; +package com.baeldung.app.test; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -22,7 +22,7 @@ import org.springframework.web.context.WebApplicationContext; import com.baeldung.app.App; @RunWith(SpringJUnit4ClassRunner.class) -@SpringBootTest(classes = App.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = App.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class LiveTest { diff --git a/spring-security-modules/spring-security-core/src/test/java/com/baeldung/denyonmissing/DenyOnMissingControllerIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/denyonmissing/DenyOnMissingControllerIntegrationTest.java new file mode 100644 index 0000000000..b4e4154982 --- /dev/null +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/denyonmissing/DenyOnMissingControllerIntegrationTest.java @@ -0,0 +1,53 @@ +package com.baeldung.denyonmissing; + +import static org.hamcrest.core.Is.isA; +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.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest(classes = DenyApplication.class) +public class DenyOnMissingControllerIntegrationTest { + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + @Autowired + private WebApplicationContext context; + private MockMvc mockMvc; + + @Before + public void setUp() { + mockMvc = MockMvcBuilders.webAppContextSetup(context) + .build(); + } + + @Test + @WithMockUser(username = "user") + public void givenANormalUser_whenCallingHello_thenAccessDenied() throws Exception { + mockMvc.perform(get("/hello")) + .andExpect(status().isOk()) + .andExpect(content().string("Hello world!")); + } + + @Test + @WithMockUser(username = "user") + public void givenANormalUser_whenCallingBye_thenAccessDenied() throws Exception { + expectedException.expectCause(isA(AccessDeniedException.class)); + + mockMvc.perform(get("/bye")); + } +} \ No newline at end of file diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java index 943bfda72c..d5ebdaa33b 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/ClassLevelSecurityIntegrationTest.java @@ -1,50 +1,50 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.service.SystemService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -public class ClassLevelSecurityIntegrationTest { - - @Autowired - SystemService systemService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } - - @Test - @WithMockUser(username="john",roles={"ADMIN"}) - public void givenRoleAdmin_whenCallGetSystemYear_return2017(){ - String systemYear = systemService.getSystemYear(); - assertEquals("2017",systemYear); - } - - @Test(expected=AccessDeniedException.class) - @WithMockUser(username="john",roles={"VIEWER"}) - public void givenRoleViewer_whenCallGetSystemYear_returnAccessDenied(){ - String systemYear = systemService.getSystemYear(); - assertEquals("2017",systemYear); - } - - @Test - @WithMockUser(username="john",roles={"ADMIN"}) - public void givenRoleAdmin_whenCallGetSystemDate_returnDate(){ - String systemYear = systemService.getSystemDate(); - assertEquals("31-12-2017",systemYear); - } -} +package com.baeldung.methodsecurity; + +import static org.junit.Assert.*; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.service.SystemService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +public class ClassLevelSecurityIntegrationTest { + + @Autowired + SystemService systemService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } + + @Test + @WithMockUser(username="john",roles={"ADMIN"}) + public void givenRoleAdmin_whenCallGetSystemYear_return2017(){ + String systemYear = systemService.getSystemYear(); + assertEquals("2017",systemYear); + } + + @Test(expected=AccessDeniedException.class) + @WithMockUser(username="john",roles={"VIEWER"}) + public void givenRoleViewer_whenCallGetSystemYear_returnAccessDenied(){ + String systemYear = systemService.getSystemYear(); + assertEquals("2017",systemYear); + } + + @Test + @WithMockUser(username="john",roles={"ADMIN"}) + public void givenRoleAdmin_whenCallGetSystemDate_returnDate(){ + String systemYear = systemService.getSystemDate(); + assertEquals("31-12-2017",systemYear); + } +} diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java index 81b150f43e..0ad01d9954 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MethodSecurityIntegrationTest.java @@ -1,177 +1,177 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; -import org.springframework.security.test.context.support.WithAnonymousUser; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.service.UserRoleService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -public class MethodSecurityIntegrationTest { - - @Autowired - UserRoleService userRoleService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } - - @Test(expected = AuthenticationCredentialsNotFoundException.class) - public void givenNoSecurity_whenCallGetUsername_thenReturnException() { - String userName = userRoleService.getUsername(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER" }) - public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { - String userName = userRoleService.getUsername(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "john", roles = { "EDITOR" }) - public void givenUsernameJohn_whenCallIsValidUsername_thenReturnTrue() { - boolean isValid = userRoleService.isValidUsername("john"); - assertEquals(true, isValid); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "ADMIN" }) - public void givenRoleAdmin_whenCallGetUsername_thenReturnAccessDenied() { - userRoleService.getUsername(); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "USER" }) - public void givenRoleUser_whenCallGetUsername2_thenReturnAccessDenied() { - userRoleService.getUsername2(); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER", "EDITOR" }) - public void givenRoleViewer_whenCallGetUsername2_thenReturnUsername() { - String userName = userRoleService.getUsername2(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER" }) - public void givenUsernameJerry_whenCallIsValidUsername2_thenReturnFalse() { - boolean isValid = userRoleService.isValidUsername2("jerry"); - assertEquals(false, isValid); - } - - @Test - @WithMockUser(username = "JOHN", authorities = { "SYS_ADMIN" }) - public void givenAuthoritySysAdmin_whenCallGetUsernameLC_thenReturnUsername() { - String username = userRoleService.getUsernameLC(); - assertEquals("john", username); - } - - @Test - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJohn_whenCallGetMyRolesWithJohn_thenReturnRoles() { - String roles = userRoleService.getMyRoles("john"); - assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJane_whenCallGetMyRolesWithJane_thenAccessDenied() { - userRoleService.getMyRoles("jane"); - } - - @Test - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJohn_whenCallGetMyRoles2WithJohn_thenReturnRoles() { - String roles = userRoleService.getMyRoles2("john"); - assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) - public void givenUserJane_whenCallGetMyRoles2WithJane_thenAccessDenied() { - userRoleService.getMyRoles2("jane"); - } - - @Test(expected = AccessDeniedException.class) - @WithAnonymousUser - public void givenAnomynousUser_whenCallGetUsername_thenAccessDenied() { - userRoleService.getUsername(); - } - - @Test - @WithMockJohnViewer - public void givenMockedJohnViewer_whenCallGetUsername_thenReturnUsername() { - String userName = userRoleService.getUsername(); - assertEquals("john", userName); - } - - @Test - @WithMockUser(username = "jane") - public void givenListContainCurrentUsername_whenJoinUsernames_thenReturnUsernames() { - List usernames = new ArrayList<>(); - usernames.add("jane"); - usernames.add("john"); - usernames.add("jack"); - String containCurrentUser = userRoleService.joinUsernames(usernames); - assertEquals("john;jack", containCurrentUser); - } - - @Test - @WithMockUser(username = "john") - public void givenListContainCurrentUsername_whenCallJoinUsernamesAndRoles_thenReturnUsernameAndRoles() { - List usernames = new ArrayList<>(); - usernames.add("jane"); - usernames.add("john"); - usernames.add("jack"); - - List roles = new ArrayList<>(); - roles.add("ROLE_ADMIN"); - roles.add("ROLE_TEST"); - - String containCurrentUser = userRoleService.joinUsernamesAndRoles(usernames, roles); - assertEquals("jane;jack:ROLE_ADMIN;ROLE_TEST", containCurrentUser); - } - - @Test - @WithMockUser(username = "john") - public void givenUserJohn_whenCallGetAllUsernamesExceptCurrent_thenReturnOtherusernames() { - List others = userRoleService.getAllUsernamesExceptCurrent(); - assertEquals(2, others.size()); - assertTrue(others.contains("jane")); - assertTrue(others.contains("jack")); - } - - @Test - @WithMockUser(username = "john", roles = { "VIEWER" }) - public void givenRoleViewer_whenCallGetUsername4_thenReturnUsername() { - String userName = userRoleService.getUsername4(); - assertEquals("john", userName); - } - - @Test(expected = AccessDeniedException.class) - @WithMockUser(username = "john") - public void givenDefaultRole_whenCallGetUsername4_thenAccessDenied() { - userRoleService.getUsername4(); - } - +package com.baeldung.methodsecurity; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; +import org.springframework.security.test.context.support.WithAnonymousUser; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.service.UserRoleService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +public class MethodSecurityIntegrationTest { + + @Autowired + UserRoleService userRoleService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } + + @Test(expected = AuthenticationCredentialsNotFoundException.class) + public void givenNoSecurity_whenCallGetUsername_thenReturnException() { + String userName = userRoleService.getUsername(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER" }) + public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { + String userName = userRoleService.getUsername(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "john", roles = { "EDITOR" }) + public void givenUsernameJohn_whenCallIsValidUsername_thenReturnTrue() { + boolean isValid = userRoleService.isValidUsername("john"); + assertEquals(true, isValid); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "ADMIN" }) + public void givenRoleAdmin_whenCallGetUsername_thenReturnAccessDenied() { + userRoleService.getUsername(); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "USER" }) + public void givenRoleUser_whenCallGetUsername2_thenReturnAccessDenied() { + userRoleService.getUsername2(); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER", "EDITOR" }) + public void givenRoleViewer_whenCallGetUsername2_thenReturnUsername() { + String userName = userRoleService.getUsername2(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER" }) + public void givenUsernameJerry_whenCallIsValidUsername2_thenReturnFalse() { + boolean isValid = userRoleService.isValidUsername2("jerry"); + assertEquals(false, isValid); + } + + @Test + @WithMockUser(username = "JOHN", authorities = { "SYS_ADMIN" }) + public void givenAuthoritySysAdmin_whenCallGetUsernameLC_thenReturnUsername() { + String username = userRoleService.getUsernameLC(); + assertEquals("john", username); + } + + @Test + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJohn_whenCallGetMyRolesWithJohn_thenReturnRoles() { + String roles = userRoleService.getMyRoles("john"); + assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJane_whenCallGetMyRolesWithJane_thenAccessDenied() { + userRoleService.getMyRoles("jane"); + } + + @Test + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJohn_whenCallGetMyRoles2WithJohn_thenReturnRoles() { + String roles = userRoleService.getMyRoles2("john"); + assertEquals("ROLE_ADMIN,ROLE_USER,ROLE_VIEWER", roles); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john", roles = { "ADMIN", "USER", "VIEWER" }) + public void givenUserJane_whenCallGetMyRoles2WithJane_thenAccessDenied() { + userRoleService.getMyRoles2("jane"); + } + + @Test(expected = AccessDeniedException.class) + @WithAnonymousUser + public void givenAnomynousUser_whenCallGetUsername_thenAccessDenied() { + userRoleService.getUsername(); + } + + @Test + @WithMockJohnViewer + public void givenMockedJohnViewer_whenCallGetUsername_thenReturnUsername() { + String userName = userRoleService.getUsername(); + assertEquals("john", userName); + } + + @Test + @WithMockUser(username = "jane") + public void givenListContainCurrentUsername_whenJoinUsernames_thenReturnUsernames() { + List usernames = new ArrayList<>(); + usernames.add("jane"); + usernames.add("john"); + usernames.add("jack"); + String containCurrentUser = userRoleService.joinUsernames(usernames); + assertEquals("john;jack", containCurrentUser); + } + + @Test + @WithMockUser(username = "john") + public void givenListContainCurrentUsername_whenCallJoinUsernamesAndRoles_thenReturnUsernameAndRoles() { + List usernames = new ArrayList<>(); + usernames.add("jane"); + usernames.add("john"); + usernames.add("jack"); + + List roles = new ArrayList<>(); + roles.add("ROLE_ADMIN"); + roles.add("ROLE_TEST"); + + String containCurrentUser = userRoleService.joinUsernamesAndRoles(usernames, roles); + assertEquals("jane;jack:ROLE_ADMIN;ROLE_TEST", containCurrentUser); + } + + @Test + @WithMockUser(username = "john") + public void givenUserJohn_whenCallGetAllUsernamesExceptCurrent_thenReturnOtherusernames() { + List others = userRoleService.getAllUsernamesExceptCurrent(); + assertEquals(2, others.size()); + assertTrue(others.contains("jane")); + assertTrue(others.contains("jack")); + } + + @Test + @WithMockUser(username = "john", roles = { "VIEWER" }) + public void givenRoleViewer_whenCallGetUsername4_thenReturnUsername() { + String userName = userRoleService.getUsername4(); + assertEquals("john", userName); + } + + @Test(expected = AccessDeniedException.class) + @WithMockUser(username = "john") + public void givenDefaultRole_whenCallGetUsername4_thenAccessDenied() { + userRoleService.getUsername4(); + } + } \ No newline at end of file diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java similarity index 96% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java index fead89f75a..e7a2a2c828 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/MockUserAtClassLevelIntegrationTest.java @@ -1,35 +1,35 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.test.context.support.WithMockUser; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.service.UserRoleService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -@WithMockUser(username = "john", roles = { "VIEWER" }) -public class MockUserAtClassLevelIntegrationTest { - - @Test - public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { - String currentUserName = userService.getUsername(); - assertEquals("john", currentUserName); - } - - @Autowired - UserRoleService userService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } -} +package com.baeldung.methodsecurity; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.test.context.support.WithMockUser; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.service.UserRoleService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +@WithMockUser(username = "john", roles = { "VIEWER" }) +public class MockUserAtClassLevelIntegrationTest { + + @Test + public void givenRoleViewer_whenCallGetUsername_thenReturnUsername() { + String currentUserName = userService.getUsername(); + assertEquals("john", currentUserName); + } + + @Autowired + UserRoleService userService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } +} diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java index d43a26a5ff..c1298b1124 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/UserDetailsIntegrationTest.java @@ -1,57 +1,57 @@ -package com.baeldung.methodsecurity; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.access.AccessDeniedException; -import org.springframework.security.test.context.support.WithUserDetails; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; - -import com.baeldung.methodsecurity.entity.CustomUser; -import com.baeldung.methodsecurity.service.UserRoleService; - -@RunWith(SpringRunner.class) -@ContextConfiguration -public class UserDetailsIntegrationTest { - - @Autowired - UserRoleService userService; - - @Configuration - @ComponentScan("com.baeldung.methodsecurity.*") - public static class SpringConfig { - - } - - @Test - @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") - public void whenJohn_callLoadUserDetail_thenOK() { - CustomUser user = userService.loadUserDetail("jane"); - assertEquals("jane", user.getNickName()); - } - - @Test - @WithUserDetails(value = "jane", userDetailsServiceBeanName = "userDetailService") - public void givenJane_callSecuredLoadUserDetailWithJane_thenOK() { - CustomUser user = userService.securedLoadUserDetail("jane"); - assertEquals("jane", user.getNickName()); - assertEquals("jane", user.getUsername()); - } - - @Test(expected = AccessDeniedException.class) - @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") - public void givenJohn_callSecuredLoadUserDetailWithJane_thenAccessDenied() { - userService.securedLoadUserDetail("jane"); - } - - @Test(expected = AccessDeniedException.class) - @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") - public void givenJohn_callSecuredLoadUserDetailWithJohn_thenAccessDenied() { - userService.securedLoadUserDetail("john"); - } -} +package com.baeldung.methodsecurity; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.security.test.context.support.WithUserDetails; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringRunner; + +import com.baeldung.methodsecurity.entity.CustomUser; +import com.baeldung.methodsecurity.service.UserRoleService; + +@RunWith(SpringRunner.class) +@ContextConfiguration +public class UserDetailsIntegrationTest { + + @Autowired + UserRoleService userService; + + @Configuration + @ComponentScan("com.baeldung.methodsecurity.*") + public static class SpringConfig { + + } + + @Test + @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") + public void whenJohn_callLoadUserDetail_thenOK() { + CustomUser user = userService.loadUserDetail("jane"); + assertEquals("jane", user.getNickName()); + } + + @Test + @WithUserDetails(value = "jane", userDetailsServiceBeanName = "userDetailService") + public void givenJane_callSecuredLoadUserDetailWithJane_thenOK() { + CustomUser user = userService.securedLoadUserDetail("jane"); + assertEquals("jane", user.getNickName()); + assertEquals("jane", user.getUsername()); + } + + @Test(expected = AccessDeniedException.class) + @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") + public void givenJohn_callSecuredLoadUserDetailWithJane_thenAccessDenied() { + userService.securedLoadUserDetail("jane"); + } + + @Test(expected = AccessDeniedException.class) + @WithUserDetails(value = "john", userDetailsServiceBeanName = "userDetailService") + public void givenJohn_callSecuredLoadUserDetailWithJohn_thenAccessDenied() { + userService.securedLoadUserDetail("john"); + } +} diff --git a/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java similarity index 97% rename from spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java rename to spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java index f05a6bc20e..51c3904331 100644 --- a/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java +++ b/spring-security-modules/spring-security-core/src/test/java/com/baeldung/methodsecurity/WithMockJohnViewer.java @@ -1,10 +1,10 @@ -package com.baeldung.methodsecurity; - -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -import org.springframework.security.test.context.support.WithMockUser; - -@Retention(RetentionPolicy.RUNTIME) -@WithMockUser(value="john",roles="VIEWER") +package com.baeldung.methodsecurity; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +import org.springframework.security.test.context.support.WithMockUser; + +@Retention(RetentionPolicy.RUNTIME) +@WithMockUser(value="john",roles="VIEWER") public @interface WithMockJohnViewer { } \ No newline at end of file diff --git a/spring-security-cors/README.md b/spring-security-modules/spring-security-cors/README.md similarity index 100% rename from spring-security-cors/README.md rename to spring-security-modules/spring-security-cors/README.md diff --git a/spring-security-cors/pom.xml b/spring-security-modules/spring-security-cors/pom.xml similarity index 98% rename from spring-security-cors/pom.xml rename to spring-security-modules/spring-security-cors/pom.xml index 0dd41e66c7..91e8f5adb6 100644 --- a/spring-security-cors/pom.xml +++ b/spring-security-modules/spring-security-cors/pom.xml @@ -2,11 +2,10 @@ 4.0.0 - com.baeldung spring-security-cors 0.0.1-SNAPSHOT - jar spring-security-cors + jar Spring Security CORS diff --git a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java similarity index 100% rename from spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java rename to spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/SpringBootSecurityApplication.java diff --git a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java similarity index 100% rename from spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/basicauth/config/WebSecurityConfig.java diff --git a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java similarity index 96% rename from spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java rename to spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java index 7292c7f4f4..5d7d9f7770 100644 --- a/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java +++ b/spring-security-modules/spring-security-cors/src/main/java/com/baeldung/springbootsecuritycors/controller/ResourceController.java @@ -1,17 +1,17 @@ -package com.baeldung.springbootsecuritycors.controller; - -import java.security.Principal; - -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RestController; - -@RestController -@CrossOrigin("http://localhost:4200") -public class ResourceController { - - @GetMapping("/user") - public String user(Principal principal) { - return principal.getName(); - } -} +package com.baeldung.springbootsecuritycors.controller; + +import java.security.Principal; + +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@CrossOrigin("http://localhost:4200") +public class ResourceController { + + @GetMapping("/user") + public String user(Principal principal) { + return principal.getName(); + } +} diff --git a/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java b/spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java similarity index 97% rename from spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java rename to spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java index b45529ca5f..a471eb922f 100644 --- a/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java +++ b/spring-security-modules/spring-security-cors/src/test/java/com/baeldung/springbootsecuritycors/ResourceControllerTest.java @@ -1,42 +1,42 @@ -package com.baeldung.springbootsecuritycors; - -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; -import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.setup.MockMvcBuilders; -import org.springframework.web.context.WebApplicationContext; - -import com.baeldung.springbootsecuritycors.basicauth.SpringBootSecurityApplication; - -@RunWith(SpringRunner.class) -@SpringBootTest(classes = { SpringBootSecurityApplication.class }) -public class ResourceControllerTest { - - private MockMvc mockMvc; - - @Autowired - private WebApplicationContext wac; - - @Before - public void setUp() { - this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) - .apply(SecurityMockMvcConfigurers.springSecurity()) - .build(); - } - - @Test - public void givenPreFlightRequest_whenPerfomed_shouldReturnOK() throws Exception { - mockMvc.perform(options("/user") - .header("Access-Control-Request-Method", "GET") - .header("Origin", "http://localhost:4200")) - .andExpect(status().isOk()); - } -} +package com.baeldung.springbootsecuritycors; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import com.baeldung.springbootsecuritycors.basicauth.SpringBootSecurityApplication; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = { SpringBootSecurityApplication.class }) +public class ResourceControllerTest { + + private MockMvc mockMvc; + + @Autowired + private WebApplicationContext wac; + + @Before + public void setUp() { + this.mockMvc = MockMvcBuilders.webAppContextSetup(wac) + .apply(SecurityMockMvcConfigurers.springSecurity()) + .build(); + } + + @Test + public void givenPreFlightRequest_whenPerfomed_shouldReturnOK() throws Exception { + mockMvc.perform(options("/user") + .header("Access-Control-Request-Method", "GET") + .header("Origin", "http://localhost:4200")) + .andExpect(status().isOk()); + } +} diff --git a/spring-security-kerberos/README.md b/spring-security-modules/spring-security-kerberos/README.md similarity index 100% rename from spring-security-kerberos/README.md rename to spring-security-modules/spring-security-kerberos/README.md diff --git a/spring-security-kerberos/pom.xml b/spring-security-modules/spring-security-kerberos/pom.xml similarity index 95% rename from spring-security-kerberos/pom.xml rename to spring-security-modules/spring-security-kerberos/pom.xml index 437e8566bb..6846bdf063 100644 --- a/spring-security-kerberos/pom.xml +++ b/spring-security-modules/spring-security-kerberos/pom.xml @@ -1,18 +1,18 @@ + 4.0.0 - com.baeldung spring-security-kerberos 0.1-SNAPSHOT spring-security-kerberos war - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 @@ -65,4 +65,5 @@ 1.0.1.RELEASE + diff --git a/spring-security-kerberos/src/main/java/org/baeldung/Application.java b/spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/Application.java similarity index 100% rename from spring-security-kerberos/src/main/java/org/baeldung/Application.java rename to spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/Application.java diff --git a/spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java b/spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java similarity index 100% rename from spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/config/WebSecurityConfig.java diff --git a/spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java b/spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java similarity index 100% rename from spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java rename to spring-security-modules/spring-security-kerberos/src/main/java/org/baeldung/security/DummyUserDetailsService.java diff --git a/spring-security-mvc-boot/README.md b/spring-security-modules/spring-security-mvc-boot/README.md similarity index 100% rename from spring-security-mvc-boot/README.md rename to spring-security-modules/spring-security-mvc-boot/README.md diff --git a/spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF b/spring-security-modules/spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF similarity index 100% rename from spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF rename to spring-security-modules/spring-security-mvc-boot/WebContent/META-INF/MANIFEST.MF diff --git a/spring-security-mvc-boot/pom.xml b/spring-security-modules/spring-security-mvc-boot/pom.xml similarity index 97% rename from spring-security-mvc-boot/pom.xml rename to spring-security-modules/spring-security-mvc-boot/pom.xml index 0063a2d82b..489ec2d427 100644 --- a/spring-security-mvc-boot/pom.xml +++ b/spring-security-modules/spring-security-mvc-boot/pom.xml @@ -1,9 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-security-mvc-boot 0.0.1-SNAPSHOT spring-security-mvc-boot @@ -11,10 +10,10 @@ Spring Security MVC Boot - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 @@ -112,7 +111,6 @@ ${ehcache-core.version} jar - @@ -228,7 +226,6 @@ - org.baeldung.custom.Application org.springframework.boot @@ -158,7 +158,7 @@ - spring-security-mvc-socket + spring-security-mvc-socket org.apache.tomcat.maven diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/Constants.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/AppConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/DataStoreConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SecurityConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketBrokerConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/SocketSecurityConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/config/WebAppInitializer.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/CsrfTokenController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/controllers/SocketController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/Role.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/domain/User.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/repositories/UserRepository.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomAccessDeniedHandler.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomDaoAuthenticationProvider.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLoginSuccessHandler.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomLogoutSuccessHandler.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/CustomUserDetailsService.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/security/SecurityWebApplicationInitializer.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/Message.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/socket/OutputMessage.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsecuredsockets/transfer/user/CustomUserDetails.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/config/WebSocketMessageBrokerConfig.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/RestAPIController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/controllers/WebSocketController.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Greeting.java diff --git a/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java b/spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java similarity index 100% rename from spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java rename to spring-security-modules/spring-security-mvc-socket/src/main/java/com/baeldung/springsockets/models/Message.java diff --git a/spring-security-mvc-socket/src/main/resources/data.sql b/spring-security-modules/spring-security-mvc-socket/src/main/resources/data.sql similarity index 100% rename from spring-security-mvc-socket/src/main/resources/data.sql rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/data.sql diff --git a/spring-security-mvc-boot/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc-socket/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-boot/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/logback.xml diff --git a/spring-security-mvc-socket/src/main/resources/schema.sql b/spring-security-modules/spring-security-mvc-socket/src/main/resources/schema.sql similarity index 100% rename from spring-security-mvc-socket/src/main/resources/schema.sql rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/schema.sql diff --git a/spring-security-mvc-socket/src/main/resources/static/rest.html b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.html similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/rest.html rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.html diff --git a/spring-security-mvc-socket/src/main/resources/static/rest.js b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.js similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/rest.js rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/rest.js diff --git a/spring-security-mvc-socket/src/main/resources/static/ws.html b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.html similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/ws.html rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.html diff --git a/spring-security-mvc-socket/src/main/resources/static/ws.js b/spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.js similarity index 100% rename from spring-security-mvc-socket/src/main/resources/static/ws.js rename to spring-security-modules/spring-security-mvc-socket/src/main/resources/static/ws.js diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/denied.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/index.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/login.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/socket.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/WEB-INF/jsp/success.jsp diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/app.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/indexController.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/socketController.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/controllers/successController.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/routes/router.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/scripts/services/SocketService.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/app.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/app.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/app.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/app.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/denied.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/index.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/index.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/index.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/index.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/login.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/login.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/login.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/login.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/socket.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/styles/success.css b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/success.css similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/styles/success.css rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/styles/success.css diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular-route.min.js.map diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/angular/angular.min.js.map diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/jquery/jquery.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/sockjs/sockjs.min.js.map diff --git a/spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js b/spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js similarity index 100% rename from spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js rename to spring-security-modules/spring-security-mvc-socket/src/main/webapp/resources/vendor/stomp/stomp.min.js diff --git a/spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc-socket/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-jsonview/.gitignore b/spring-security-modules/spring-security-mvc/.gitignore similarity index 100% rename from spring-security-mvc-jsonview/.gitignore rename to spring-security-modules/spring-security-mvc/.gitignore diff --git a/spring-security-mvc/README.md b/spring-security-modules/spring-security-mvc/README.md similarity index 100% rename from spring-security-mvc/README.md rename to spring-security-modules/spring-security-mvc/README.md diff --git a/spring-security-mvc/pom.xml b/spring-security-modules/spring-security-mvc/pom.xml similarity index 90% rename from spring-security-mvc/pom.xml rename to spring-security-modules/spring-security-mvc/pom.xml index 98ad3daa46..7da047707a 100644 --- a/spring-security-mvc/pom.xml +++ b/spring-security-modules/spring-security-mvc/pom.xml @@ -1,8 +1,8 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - com.baeldung spring-security-mvc 0.1-SNAPSHOT spring-security-mvc @@ -12,7 +12,7 @@ com.baeldung parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/monitoring/MetricRegistrySingleton.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/security/MySimpleUrlAuthenticationSuccessHandler.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/SpringSessionApplication.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Constants.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/bean/Foo.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/filter/SessionFilter.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/security/config/SecSecurityConfig.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/FooController.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/SessionRestController.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/session/web/config/MvcConfig.java diff --git a/spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java b/spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java similarity index 100% rename from spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java rename to spring-security-modules/spring-security-mvc/src/main/java/com/baeldung/web/SessionListenerWithMetrics.java diff --git a/spring-security-mvc/src/main/resources/application.properties b/spring-security-modules/spring-security-mvc/src/main/resources/application.properties similarity index 100% rename from spring-security-mvc/src/main/resources/application.properties rename to spring-security-modules/spring-security-mvc/src/main/resources/application.properties diff --git a/spring-security-mvc/src/main/resources/logback.xml b/spring-security-modules/spring-security-mvc/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc/src/main/resources/logback.xml rename to spring-security-modules/spring-security-mvc/src/main/resources/logback.xml diff --git a/spring-security-mvc/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-mvc/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-mvc/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-mvc/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/anonymous.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/console.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/invalidSession.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/login.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/view/sessionExpired.jsp diff --git a/spring-security-mvc/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-mvc/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-mvc/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/SpringContextTest.java diff --git a/spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java b/spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java similarity index 100% rename from spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java rename to spring-security-modules/spring-security-mvc/src/test/java/com/baeldung/session/SessionConfigurationLiveTest.java diff --git a/spring-security-mvc-ldap/src/test/resources/.gitignore b/spring-security-modules/spring-security-mvc/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-ldap/src/test/resources/.gitignore rename to spring-security-modules/spring-security-mvc/src/test/resources/.gitignore diff --git a/spring-security-openid/README.md b/spring-security-modules/spring-security-openid/README.md similarity index 100% rename from spring-security-openid/README.md rename to spring-security-modules/spring-security-openid/README.md diff --git a/spring-security-openid/pom.xml b/spring-security-modules/spring-security-openid/pom.xml similarity index 92% rename from spring-security-openid/pom.xml rename to spring-security-modules/spring-security-openid/pom.xml index 0b5eaf6270..970182dc3b 100644 --- a/spring-security-openid/pom.xml +++ b/spring-security-modules/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 spring-security-openid spring-security-openid @@ -8,10 +8,10 @@ Spring OpenID sample project - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/GoogleOpenIdConnectConfig.java diff --git a/spring-security-openid/src/main/java/org/baeldung/config/HomeController.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/HomeController.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/HomeController.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/HomeController.java diff --git a/spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SecurityConfig.java diff --git a/spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/config/SpringOpenidApplication.java diff --git a/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectFilter.java diff --git a/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java b/spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java similarity index 100% rename from spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java rename to spring-security-modules/spring-security-openid/src/main/java/org/baeldung/security/OpenIdConnectUserDetails.java diff --git a/spring-security-openid/src/main/resources/application.properties b/spring-security-modules/spring-security-openid/src/main/resources/application.properties similarity index 100% rename from spring-security-openid/src/main/resources/application.properties rename to spring-security-modules/spring-security-openid/src/main/resources/application.properties diff --git a/spring-security-mvc-socket/src/main/resources/logback.xml b/spring-security-modules/spring-security-openid/src/main/resources/logback.xml similarity index 100% rename from spring-security-mvc-socket/src/main/resources/logback.xml rename to spring-security-modules/spring-security-openid/src/main/resources/logback.xml diff --git a/spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-openid/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-react/.gitignore b/spring-security-modules/spring-security-react/.gitignore similarity index 100% rename from spring-security-react/.gitignore rename to spring-security-modules/spring-security-react/.gitignore diff --git a/spring-security-react/README.md b/spring-security-modules/spring-security-react/README.md similarity index 100% rename from spring-security-react/README.md rename to spring-security-modules/spring-security-react/README.md diff --git a/spring-security-react/pom.xml b/spring-security-modules/spring-security-react/pom.xml similarity index 93% rename from spring-security-react/pom.xml rename to spring-security-modules/spring-security-react/pom.xml index 40c284af7f..19240fe88c 100644 --- a/spring-security-react/pom.xml +++ b/spring-security-modules/spring-security-react/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,11 +8,11 @@ war - com.baeldung - parent-spring-4 - 0.0.1-SNAPSHOT - ../parent-spring-4 - + com.baeldung + parent-spring-4 + 0.0.1-SNAPSHOT + ../../parent-spring-4 + @@ -81,14 +82,14 @@ ${jstl.version} runtime - + - org.springframework.boot - spring-boot-starter-test - 1.5.10.RELEASE - test - + org.springframework.boot + spring-boot-starter-test + 1.5.10.RELEASE + test + diff --git a/spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java b/spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java similarity index 100% rename from spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java rename to spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/MvcConfig.java diff --git a/spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java similarity index 100% rename from spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java rename to spring-security-modules/spring-security-react/src/main/java/org/baeldung/spring/SecSecurityConfig.java diff --git a/spring-security-react/src/main/resources/logback.xml b/spring-security-modules/spring-security-react/src/main/resources/logback.xml similarity index 100% rename from spring-security-react/src/main/resources/logback.xml rename to spring-security-modules/spring-security-react/src/main/resources/logback.xml diff --git a/spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/mvc-servlet.xml diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/accessDenied.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/admin/adminpage.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/anonymous.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/homepage.jsp diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.babelrc diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintignore diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.eslintrc diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/.gitignore diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package-lock.json diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/package.json b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package.json similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/package.json rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/package.json diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/favicon.ico diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/index.html diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/public/manifest.json diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Form.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/Input.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.css diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/index.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/view/react/src/registerServiceWorker.js diff --git a/spring-security-react/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-react/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-react/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-react/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-react/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-login/.gitignore b/spring-security-modules/spring-security-rest-basic-auth/.gitignore similarity index 100% rename from spring-security-mvc-login/.gitignore rename to spring-security-modules/spring-security-rest-basic-auth/.gitignore diff --git a/spring-security-rest-basic-auth/README.md b/spring-security-modules/spring-security-rest-basic-auth/README.md similarity index 100% rename from spring-security-rest-basic-auth/README.md rename to spring-security-modules/spring-security-rest-basic-auth/README.md diff --git a/spring-security-rest-basic-auth/pom.xml b/spring-security-modules/spring-security-rest-basic-auth/pom.xml similarity index 99% rename from spring-security-rest-basic-auth/pom.xml rename to spring-security-modules/spring-security-rest-basic-auth/pom.xml index 143c61ae76..416882b3d4 100644 --- a/spring-security-rest-basic-auth/pom.xml +++ b/spring-security-modules/spring-security-rest-basic-auth/pom.xml @@ -1,8 +1,7 @@ + 4.0.0 - - com.baeldung spring-security-rest-basic-auth 0.2-SNAPSHOT spring-security-rest-basic-auth @@ -12,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/basic/MyBasicAuthenticationEntryPoint.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/HttpComponentsClientHttpRequestFactoryBasicAuth.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/RestTemplateFactory.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/client/spring/ClientConfig.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomFilter.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/filter/CustomWebSecurityConfigurerAdapter.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/SecSecurityConfig.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/spring/WebConfig.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/BarController.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/controller/FooController.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Bar.java diff --git a/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java b/spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java similarity index 100% rename from spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java rename to spring-security-modules/spring-security-rest-basic-auth/src/main/java/org/baeldung/web/dto/Foo.java diff --git a/spring-security-rest-basic-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/resources/logback.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/resources/logback.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/resources/logback.xml diff --git a/spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/api-servlet.xml diff --git a/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-rest-basic-auth/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-rest-basic-auth/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-mvc-login/src/test/resources/.gitignore b/spring-security-modules/spring-security-rest-basic-auth/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-login/src/test/resources/.gitignore rename to spring-security-modules/spring-security-rest-basic-auth/src/test/resources/.gitignore diff --git a/spring-security-rest-custom/README.md b/spring-security-modules/spring-security-rest-custom/README.md similarity index 100% rename from spring-security-rest-custom/README.md rename to spring-security-modules/spring-security-rest-custom/README.md diff --git a/spring-security-rest-custom/pom.xml b/spring-security-modules/spring-security-rest-custom/pom.xml similarity index 97% rename from spring-security-rest-custom/pom.xml rename to spring-security-modules/spring-security-rest-custom/pom.xml index 4bab9b9d95..d9072ec8a2 100644 --- a/spring-security-rest-custom/pom.xml +++ b/spring-security-modules/spring-security-rest-custom/pom.xml @@ -1,17 +1,17 @@ + + 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 0.1-SNAPSHOT spring-security-rest-custom war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/MainWebAppInitializer.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/MethodSecurityConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/child/WebConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/SecurityConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/config/parent/ServiceConfig.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/AuthenticationFacade.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/CustomAuthenticationProvider.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/IAuthenticationFacade.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/MySavedRequestAwareAuthenticationSuccessHandler.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/security/RestAuthenticationEntryPoint.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/FooService.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/IFooService.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/service/RunAsService.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/FooController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithCustomInterfaceController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/GetUserWithHTTPServletRequestController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/RunAsController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController1.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/SecurityController3.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/controller/ViewController.java diff --git a/spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java b/spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java similarity index 100% rename from spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java rename to spring-security-modules/spring-security-rest-custom/src/main/java/org/baeldung/web/dto/Foo.java diff --git a/spring-security-rest-custom/src/main/resources/foo.properties b/spring-security-modules/spring-security-rest-custom/src/main/resources/foo.properties similarity index 100% rename from spring-security-rest-custom/src/main/resources/foo.properties rename to spring-security-modules/spring-security-rest-custom/src/main/resources/foo.properties diff --git a/spring-security-rest-custom/src/main/resources/logback.xml b/spring-security-modules/spring-security-rest-custom/src/main/resources/logback.xml similarity index 100% rename from spring-security-rest-custom/src/main/resources/logback.xml rename to spring-security-modules/spring-security-rest-custom/src/main/resources/logback.xml diff --git a/spring-security-rest-custom/src/main/resources/prop.xml b/spring-security-modules/spring-security-rest-custom/src/main/resources/prop.xml similarity index 100% rename from spring-security-rest-custom/src/main/resources/prop.xml rename to spring-security-modules/spring-security-rest-custom/src/main/resources/prop.xml diff --git a/spring-security-rest-custom/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-rest-custom/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-rest-custom/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-rest-custom/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html b/spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html similarity index 100% rename from spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html rename to spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/index.html diff --git a/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html b/spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html similarity index 100% rename from spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html rename to spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/templates/runas.html diff --git a/spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml b/spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml similarity index 100% rename from spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml rename to spring-security-modules/spring-security-rest-custom/src/main/webapp/WEB-INF/web_old.xml diff --git a/spring-security-mvc-persisted-remember-me/src/test/resources/.gitignore b/spring-security-modules/spring-security-rest-custom/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc-persisted-remember-me/src/test/resources/.gitignore rename to spring-security-modules/spring-security-rest-custom/src/test/resources/.gitignore diff --git a/spring-security-mvc/.gitignore b/spring-security-modules/spring-security-rest/.gitignore similarity index 100% rename from spring-security-mvc/.gitignore rename to spring-security-modules/spring-security-rest/.gitignore diff --git a/spring-security-rest/README.md b/spring-security-modules/spring-security-rest/README.md similarity index 100% rename from spring-security-rest/README.md rename to spring-security-modules/spring-security-rest/README.md diff --git a/spring-security-rest/pom.xml b/spring-security-modules/spring-security-rest/pom.xml similarity index 97% rename from spring-security-rest/pom.xml rename to spring-security-modules/spring-security-rest/pom.xml index a66909a68e..9410f08378 100644 --- a/spring-security-rest/pom.xml +++ b/spring-security-modules/spring-security-rest/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"> 4.0.0 - spring-security-rest 0.1-SNAPSHOT spring-security-rest @@ -11,7 +11,7 @@ com.baeldung parent-spring-5 0.0.1-SNAPSHOT - ../parent-spring-5 + ../../parent-spring-5 @@ -282,4 +282,5 @@ 1.6.1 + diff --git a/spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/ApiError.java diff --git a/spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/errorhandling/CustomRestExceptionHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/persistence/model/Foo.java diff --git a/spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/SecurityJavaConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/MySavedRequestAwareAuthenticationSuccessHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/security/web/RestAuthenticationEntryPoint.java diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/ClientWebConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/SecurityXmlConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/spring/WebConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/swagger2/SwaggerConfig.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/AsyncController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/CustomController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/FooController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/controller/RootController.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/CustomAccessDeniedHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/error/RestResponseEntityExceptionHandler.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/exception/MyResourceNotFoundException.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncService.java diff --git a/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java b/spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java similarity index 100% rename from spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java rename to spring-security-modules/spring-security-rest/src/main/java/org/baeldung/web/service/AsyncServiceImpl.java diff --git a/spring-security-rest/src/main/resources/logback.xml b/spring-security-modules/spring-security-rest/src/main/resources/logback.xml similarity index 100% rename from spring-security-rest/src/main/resources/logback.xml rename to spring-security-modules/spring-security-rest/src/main/resources/logback.xml diff --git a/spring-security-rest/src/main/resources/webSecurityConfig.xml b/spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml similarity index 100% rename from spring-security-rest/src/main/resources/webSecurityConfig.xml rename to spring-security-modules/spring-security-rest/src/main/resources/webSecurityConfig.xml diff --git a/spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml b/spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml similarity index 100% rename from spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml rename to spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/api-servlet.xml diff --git a/spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp b/spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp similarity index 100% rename from spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp rename to spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/view/csrfAttacker.jsp diff --git a/spring-security-rest/src/main/webapp/WEB-INF/web.xml b/spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from spring-security-rest/src/main/webapp/WEB-INF/web.xml rename to spring-security-modules/spring-security-rest/src/main/webapp/WEB-INF/web.xml diff --git a/spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/errorhandling/FooLiveTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/AsyncControllerIntegrationTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/SwaggerLiveTest.java diff --git a/spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java b/spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java similarity index 100% rename from spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java rename to spring-security-modules/spring-security-rest/src/test/java/org/baeldung/web/TestConfig.java diff --git a/spring-security-mvc/src/test/resources/.gitignore b/spring-security-modules/spring-security-rest/src/test/resources/.gitignore similarity index 100% rename from spring-security-mvc/src/test/resources/.gitignore rename to spring-security-modules/spring-security-rest/src/test/resources/.gitignore diff --git a/spring-security-sso/README.md b/spring-security-modules/spring-security-sso/README.md similarity index 100% rename from spring-security-sso/README.md rename to spring-security-modules/spring-security-sso/README.md diff --git a/spring-security-sso/pom.xml b/spring-security-modules/spring-security-sso/pom.xml similarity index 87% rename from spring-security-sso/pom.xml rename to spring-security-modules/spring-security-sso/pom.xml index ed8ad87a62..3d9c1bf595 100644 --- a/spring-security-sso/pom.xml +++ b/spring-security-modules/spring-security-sso/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -8,10 +9,10 @@ pom - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 @@ -23,10 +24,10 @@ 3.1.0 - 2.3.3.RELEASE + 2.3.3.RELEASE 2.1.1.RELEASE 1.0.1.RELEASE 2.0.0-M2 - - + + diff --git a/spring-security-sso/spring-security-sso-auth-server/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/pom.xml similarity index 85% rename from spring-security-sso/spring-security-sso-auth-server/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/pom.xml index 3c8f04a056..933cb6a2b2 100644 --- a/spring-security-sso/spring-security-sso-auth-server/pom.xml +++ b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/pom.xml @@ -1,5 +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-sso-auth-server spring-security-sso-auth-server diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthServerConfig.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/AuthorizationServerApplication.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/SecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/java/org/baeldung/config/UserController.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/application.properties diff --git a/spring-security-openid/src/main/resources/logback.xml b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml similarity index 100% rename from spring-security-openid/src/main/resources/logback.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml diff --git a/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-auth-server/src/test/java/org/baeldung/UserInfoEndpointLiveTest.java diff --git a/spring-security-sso/spring-security-sso-kerberos/.gitignore b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/.gitignore similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/.gitignore rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/.gitignore diff --git a/spring-security-sso/spring-security-sso-kerberos/README.md b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/README.md rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/README.md diff --git a/spring-security-sso/spring-security-sso-kerberos/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml similarity index 99% rename from spring-security-sso/spring-security-sso-kerberos/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml index 5fb435a9b9..88b9354538 100644 --- a/spring-security-sso/spring-security-sso-kerberos/pom.xml +++ b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/pom.xml @@ -91,4 +91,5 @@ spring-boot-starter-thymeleaf + \ No newline at end of file diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/KerberosClientApp.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/SampleClient.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/AppConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/client/config/KerberosConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/KerberosMiniKdc.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/kdc/MiniKdcConfigBuilder.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/KerberizedServerApp.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/MvcConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/config/WebSecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/controller/SampleController.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/java/kerberos/server/service/DummyUserDetailsService.java diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/application.properties diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc-krb5.conf diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/minikdc.ldiff diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/hello.html diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/home.html diff --git a/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/main/resources/templates/login.html diff --git a/spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-kerberos/src/test/java/kerberos/client/SampleClientManualTest.java diff --git a/spring-security-sso/spring-security-sso-ui-2/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/pom.xml similarity index 90% rename from spring-security-sso/spring-security-sso-ui-2/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/pom.xml index a6cf5e5386..10592a5e92 100644 --- a/spring-security-sso/spring-security-sso-ui-2/pom.xml +++ b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/pom.xml @@ -1,5 +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-sso-ui-2 spring-security-sso-ui-2 diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiApplication.java diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiSecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/java/org/baeldung/config/UiWebConfig.java diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/application.yml diff --git a/spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml similarity index 100% rename from spring-security-sso/spring-security-sso-auth-server/src/main/resources/logback.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/index.html diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/main/resources/templates/securedPage.html diff --git a/spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui-2/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-sso/spring-security-sso-ui/pom.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui/pom.xml similarity index 90% rename from spring-security-sso/spring-security-sso-ui/pom.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/pom.xml index 7edcee82c8..2f0ac3a42e 100644 --- a/spring-security-sso/spring-security-sso-ui/pom.xml +++ b/spring-security-modules/spring-security-sso/spring-security-sso-ui/pom.xml @@ -1,5 +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-sso-ui spring-security-sso-ui @@ -22,13 +23,13 @@ org.springframework.boot spring-boot-starter-security - + org.springframework.security.oauth.boot spring-security-oauth2-autoconfigure ${oauth-auto.version} - + org.springframework.boot diff --git a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiApplication.java diff --git a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiSecurityConfig.java diff --git a/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/java/org/baeldung/config/UiWebConfig.java diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/application.yml diff --git a/spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml similarity index 100% rename from spring-security-sso/spring-security-sso-ui-2/src/main/resources/logback.xml rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/index.html diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/main/resources/templates/securedPage.html diff --git a/spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-sso/spring-security-sso-ui/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-stormpath/README.md b/spring-security-modules/spring-security-stormpath/README.md similarity index 100% rename from spring-security-stormpath/README.md rename to spring-security-modules/spring-security-stormpath/README.md diff --git a/spring-security-stormpath/pom.xml b/spring-security-modules/spring-security-stormpath/pom.xml similarity index 91% rename from spring-security-stormpath/pom.xml rename to spring-security-modules/spring-security-stormpath/pom.xml index 6db4b38d80..81a7c40aef 100644 --- a/spring-security-stormpath/pom.xml +++ b/spring-security-modules/spring-security-stormpath/pom.xml @@ -1,13 +1,13 @@ + + 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 1.0-SNAPSHOT spring-security-stormpath war http://maven.apache.org - + abhinabkanrar@gmail.com @@ -18,10 +18,10 @@ - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 @@ -60,7 +60,7 @@ - + 1.5.4 diff --git a/spring-security-stormpath/src/main/java/com/baeldung/Application.java b/spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/Application.java similarity index 100% rename from spring-security-stormpath/src/main/java/com/baeldung/Application.java rename to spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/Application.java diff --git a/spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java b/spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java similarity index 100% rename from spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java rename to spring-security-modules/spring-security-stormpath/src/main/java/com/baeldung/security/SecurityConfiguration.java diff --git a/spring-security-stormpath/src/main/resources/application.properties b/spring-security-modules/spring-security-stormpath/src/main/resources/application.properties similarity index 100% rename from spring-security-stormpath/src/main/resources/application.properties rename to spring-security-modules/spring-security-stormpath/src/main/resources/application.properties diff --git a/spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml b/spring-security-modules/spring-security-stormpath/src/main/resources/logback.xml similarity index 100% rename from spring-security-sso/spring-security-sso-ui/src/main/resources/logback.xml rename to spring-security-modules/spring-security-stormpath/src/main/resources/logback.xml diff --git a/spring-security-thymeleaf/README.MD b/spring-security-modules/spring-security-thymeleaf/README.MD similarity index 100% rename from spring-security-thymeleaf/README.MD rename to spring-security-modules/spring-security-thymeleaf/README.MD diff --git a/spring-security-thymeleaf/pom.xml b/spring-security-modules/spring-security-thymeleaf/pom.xml similarity index 90% rename from spring-security-thymeleaf/pom.xml rename to spring-security-modules/spring-security-thymeleaf/pom.xml index 732eb1dc1d..a4ecbaff21 100644 --- a/spring-security-thymeleaf/pom.xml +++ b/spring-security-modules/spring-security-thymeleaf/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-security-thymeleaf 0.0.1-SNAPSHOT spring-security-thymeleaf @@ -10,10 +9,10 @@ Spring Security with Thymeleaf tutorial - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT - ../parent-boot-2 + ../../parent-boot-2 diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java similarity index 97% rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java index 0a4344db4d..f7f8cfb708 100644 --- a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java +++ b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SecurityConfiguration.java @@ -1,50 +1,50 @@ -package com.baeldung.springsecuritythymeleaf; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; - -@Configuration -@EnableWebSecurity -public class SecurityConfiguration extends WebSecurityConfigurerAdapter { - - @Override - protected void configure(HttpSecurity http) throws Exception { - http.authorizeRequests() - .anyRequest() - .authenticated() - .and() - .formLogin() - .loginPage("/login") - .permitAll() - .successForwardUrl("/index") - .and() - .logout() - .permitAll() - .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) - .logoutSuccessUrl("/login"); - } - - @Autowired - public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { - auth.inMemoryAuthentication() - .withUser("user") - .password(passwordEncoder().encode("password")) - .roles("USER") - .and() - .withUser("admin") - .password(passwordEncoder().encode("admin")) - .roles("ADMIN"); - } - - @Bean - public BCryptPasswordEncoder passwordEncoder() { - return new BCryptPasswordEncoder(); - } -} +package com.baeldung.springsecuritythymeleaf; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +@Configuration +@EnableWebSecurity +public class SecurityConfiguration extends WebSecurityConfigurerAdapter { + + @Override + protected void configure(HttpSecurity http) throws Exception { + http.authorizeRequests() + .anyRequest() + .authenticated() + .and() + .formLogin() + .loginPage("/login") + .permitAll() + .successForwardUrl("/index") + .and() + .logout() + .permitAll() + .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) + .logoutSuccessUrl("/login"); + } + + @Autowired + public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { + auth.inMemoryAuthentication() + .withUser("user") + .password(passwordEncoder().encode("password")) + .roles("USER") + .and() + .withUser("admin") + .password(passwordEncoder().encode("admin")) + .roles("ADMIN"); + } + + @Bean + public BCryptPasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } +} diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java similarity index 100% rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplication.java diff --git a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java similarity index 95% rename from spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java rename to spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java index a2337f9db5..bb8f04d965 100644 --- a/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java +++ b/spring-security-modules/spring-security-thymeleaf/src/main/java/com/baeldung/springsecuritythymeleaf/ViewController.java @@ -1,18 +1,18 @@ -package com.baeldung.springsecuritythymeleaf; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -@Controller -public class ViewController { - - @RequestMapping("/login") - public String login() { - return "login"; - } - - @RequestMapping({ "/index", "/" }) - public String index() { - return "index"; - } -} +package com.baeldung.springsecuritythymeleaf; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +public class ViewController { + + @RequestMapping("/login") + public String login() { + return "login"; + } + + @RequestMapping({ "/index", "/" }) + public String index() { + return "index"; + } +} diff --git a/spring-security-thymeleaf/src/main/resources/application.properties b/spring-security-modules/spring-security-thymeleaf/src/main/resources/application.properties similarity index 100% rename from spring-security-thymeleaf/src/main/resources/application.properties rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/application.properties diff --git a/spring-security-stormpath/src/main/resources/logback.xml b/spring-security-modules/spring-security-thymeleaf/src/main/resources/logback.xml similarity index 100% rename from spring-security-stormpath/src/main/resources/logback.xml rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/logback.xml diff --git a/spring-security-thymeleaf/src/main/resources/templates/index.html b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html similarity index 97% rename from spring-security-thymeleaf/src/main/resources/templates/index.html rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html index 27426ec496..a419655d9e 100644 --- a/spring-security-thymeleaf/src/main/resources/templates/index.html +++ b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/index.html @@ -1,18 +1,18 @@ - - - -Welcome to Spring Security Thymeleaf tutorial - - -

Welcome

-

Spring Security Thymeleaf tutorial

-
Text visible to user.
-
Text visible to admin.
-
Text visible only to - authenticated users.
- Authenticated username: -
- Authenticated user roles: -
- + + + +Welcome to Spring Security Thymeleaf tutorial + + +

Welcome

+

Spring Security Thymeleaf tutorial

+
Text visible to user.
+
Text visible to admin.
+
Text visible only to + authenticated users.
+ Authenticated username: +
+ Authenticated user roles: +
+ \ No newline at end of file diff --git a/spring-security-thymeleaf/src/main/resources/templates/login.html b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html similarity index 97% rename from spring-security-thymeleaf/src/main/resources/templates/login.html rename to spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html index 0177f7d8e8..f4a32e0911 100644 --- a/spring-security-thymeleaf/src/main/resources/templates/login.html +++ b/spring-security-modules/spring-security-thymeleaf/src/main/resources/templates/login.html @@ -1,15 +1,15 @@ - - - -Custom Login Page - - -

Custom Login Page

-
- : : -
- + + + +Custom Login Page + + +

Custom Login Page

+
+ : : +
+ \ No newline at end of file diff --git a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java similarity index 100% rename from spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java rename to spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/SpringSecurityThymeleafApplicationIntegrationTest.java diff --git a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java similarity index 97% rename from spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java rename to spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java index d2e7354d2d..c87d1bacc3 100644 --- a/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java +++ b/spring-security-modules/spring-security-thymeleaf/src/test/java/com/baeldung/springsecuritythymeleaf/ViewControllerIntegrationTest.java @@ -1,27 +1,27 @@ -package com.baeldung.springsecuritythymeleaf; - -import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; - -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; - -@RunWith(SpringRunner.class) -@WebMvcTest -public class ViewControllerIntegrationTest { - - @Autowired - MockMvc mockMvc; - - @Test - public void givenUser_whenPerformingGet_thenReturnsIndex() throws Exception { - mockMvc.perform(get("/index").with(user("user").password("password"))).andExpect(status().isOk()).andExpect(view().name("index")); - } - -} +package com.baeldung.springsecuritythymeleaf; + +import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; + +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; + +@RunWith(SpringRunner.class) +@WebMvcTest +public class ViewControllerIntegrationTest { + + @Autowired + MockMvc mockMvc; + + @Test + public void givenUser_whenPerformingGet_thenReturnsIndex() throws Exception { + mockMvc.perform(get("/index").with(user("user").password("password"))).andExpect(status().isOk()).andExpect(view().name("index")); + } + +} diff --git a/spring-security-x509/README.md b/spring-security-modules/spring-security-x509/README.md similarity index 100% rename from spring-security-x509/README.md rename to spring-security-modules/spring-security-x509/README.md diff --git a/spring-security-x509/keystore/Makefile b/spring-security-modules/spring-security-x509/keystore/Makefile similarity index 100% rename from spring-security-x509/keystore/Makefile rename to spring-security-modules/spring-security-x509/keystore/Makefile diff --git a/spring-security-x509/keystore/keystore.jks b/spring-security-modules/spring-security-x509/keystore/keystore.jks similarity index 100% rename from spring-security-x509/keystore/keystore.jks rename to spring-security-modules/spring-security-x509/keystore/keystore.jks diff --git a/spring-security-x509/pom.xml b/spring-security-modules/spring-security-x509/pom.xml similarity index 83% rename from spring-security-x509/pom.xml rename to spring-security-modules/spring-security-x509/pom.xml index db7def0c02..a4ff908eed 100644 --- a/spring-security-x509/pom.xml +++ b/spring-security-modules/spring-security-x509/pom.xml @@ -1,18 +1,17 @@ + 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 - spring-security-x509 + spring-security-x509 pom - + - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT - ../parent-boot-1 + ../../parent-boot-1 diff --git a/spring-security-x509/spring-security-x509-basic-auth/pom.xml b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/pom.xml similarity index 92% rename from spring-security-x509/spring-security-x509-basic-auth/pom.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/pom.xml index 0bbd5d3d3d..3cff638894 100644 --- a/spring-security-x509/spring-security-x509-basic-auth/pom.xml +++ b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/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-x509-basic-auth 0.0.1-SNAPSHOT diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/application.properties diff --git a/spring-security-thymeleaf/src/main/resources/logback.xml b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml similarity index 100% rename from spring-security-thymeleaf/src/main/resources/logback.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/templates/user.html diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-basic-auth/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-x509/spring-security-x509-client-auth/pom.xml b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/pom.xml similarity index 96% rename from spring-security-x509/spring-security-x509-client-auth/pom.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/pom.xml index 3e2e18223a..3a39f6af67 100644 --- a/spring-security-x509/spring-security-x509-client-auth/pom.xml +++ b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/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-x509-client-auth 0.0.1-SNAPSHOT @@ -70,4 +70,5 @@ + diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/UserController.java diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/java/com/baeldung/spring/security/x509/X509AuthenticationServer.java diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/application.properties diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/keystore.jks diff --git a/spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml similarity index 100% rename from spring-security-x509/spring-security-x509-basic-auth/src/main/resources/logback.xml rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/main/resources/templates/user.html diff --git a/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/com/baeldung/spring/security/x509/X509AuthenticationServerIntegrationTest.java diff --git a/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java b/spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java similarity index 100% rename from spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java rename to spring-security-modules/spring-security-x509/spring-security-x509-client-auth/src/test/java/org/baeldung/SpringContextTest.java diff --git a/spring-security-rest-basic-auth/.gitignore b/spring-security-rest-basic-auth/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/spring-security-rest-basic-auth/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/spring-security-rest-basic-auth/src/test/resources/.gitignore b/spring-security-rest-basic-auth/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/spring-security-rest-basic-auth/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/spring-security-rest-custom/src/test/resources/.gitignore b/spring-security-rest-custom/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/spring-security-rest-custom/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/spring-security-rest/.gitignore b/spring-security-rest/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/spring-security-rest/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/spring-security-rest/src/test/resources/.gitignore b/spring-security-rest/src/test/resources/.gitignore deleted file mode 100644 index 83c05e60c8..0000000000 --- a/spring-security-rest/src/test/resources/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.class - -#folders# -/target -/neoDb* -/data -/src/main/webapp/WEB-INF/classes -*/META-INF/* - -# Packaged files # -*.jar -*.war -*.ear \ No newline at end of file diff --git a/spring-security-sso/spring-security-sso-auth-server/README.md b/spring-security-sso/spring-security-sso-auth-server/README.md new file mode 100644 index 0000000000..845fb50a93 --- /dev/null +++ b/spring-security-sso/spring-security-sso-auth-server/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Simple Single Sign-On with Spring Security OAuth2](https://www.baeldung.com/sso-spring-security-oauth2) diff --git a/spring-security-sso/spring-security-sso-ui-2/README.md b/spring-security-sso/spring-security-sso-ui-2/README.md new file mode 100644 index 0000000000..aed217bdf0 --- /dev/null +++ b/spring-security-sso/spring-security-sso-ui-2/README.md @@ -0,0 +1,3 @@ +### Relevant Articles: + +- [Simple Single Sign-On with Spring Security OAuth2](https://www.baeldung.com/sso-spring-security-oauth2) diff --git a/spring-security-sso/spring-security-sso-ui/README.md b/spring-security-sso/spring-security-sso-ui/README.md new file mode 100644 index 0000000000..845fb50a93 --- /dev/null +++ b/spring-security-sso/spring-security-sso-ui/README.md @@ -0,0 +1,3 @@ +### Relevant Articles + +- [Simple Single Sign-On with Spring Security OAuth2](https://www.baeldung.com/sso-spring-security-oauth2) diff --git a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml b/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml deleted file mode 100644 index 7d900d8ea8..0000000000 --- a/spring-security-x509/spring-security-x509-client-auth/src/main/resources/logback.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n - - - - - - - - \ No newline at end of file diff --git a/spring-session/pom.xml b/spring-session/pom.xml index 639686c8ee..579d2327e8 100644 --- a/spring-session/pom.xml +++ b/spring-session/pom.xml @@ -1,5 +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-session @@ -8,8 +9,8 @@ pom - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 diff --git a/spring-session/spring-session-jdbc/pom.xml b/spring-session/spring-session-jdbc/pom.xml index 432715bc0e..64cdb4dd09 100644 --- a/spring-session/spring-session-jdbc/pom.xml +++ b/spring-session/spring-session-jdbc/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 spring-session-jdbc 0.0.1-SNAPSHOT spring-session-jdbc @@ -11,8 +10,8 @@ Spring Session with JDBC tutorial - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 diff --git a/spring-session/spring-session-mongodb/pom.xml b/spring-session/spring-session-mongodb/pom.xml index b9e06615de..00ffec93c0 100644 --- a/spring-session/spring-session-mongodb/pom.xml +++ b/spring-session/spring-session-mongodb/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 spring-session-mongodb 0.0.1-SNAPSHOT spring-session-mongodb @@ -11,8 +10,8 @@ Spring Session with MongoDB tutorial - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -40,7 +39,7 @@ spring-boot-starter-test test - + de.flapdoodle.embed de.flapdoodle.embed.mongo diff --git a/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java b/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java index 9dc45c5b32..de41019e49 100644 --- a/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java +++ b/spring-session/spring-session-mongodb/src/test/java/com/baeldung/springsessionmongodb/SpringSessionMongoDBIntegrationTest.java @@ -6,6 +6,7 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.boot.web.server.LocalServerPort; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -16,9 +17,12 @@ import java.util.Base64; @RunWith(SpringRunner.class) -@SpringBootTest(classes = SpringSessionMongoDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = SpringSessionMongoDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class SpringSessionMongoDBIntegrationTest { + @LocalServerPort + private int port; + @Autowired private MongoOperationsSessionRepository repository; @@ -27,7 +31,7 @@ public class SpringSessionMongoDBIntegrationTest { @Test public void givenEndpointIsCalledTwiceAndResponseIsReturned_whenMongoDBIsQueriedForCount_thenCountMustBeSame() { HttpEntity response = restTemplate - .exchange("http://localhost:" + 8080, HttpMethod.GET, null, String.class); + .exchange("http://localhost:" + port, HttpMethod.GET, null, String.class); HttpHeaders headers = response.getHeaders(); String set_cookie = headers.getFirst(HttpHeaders.SET_COOKIE); diff --git a/spring-session/spring-session-redis/pom.xml b/spring-session/spring-session-redis/pom.xml index 96d90b2776..37402634b0 100644 --- a/spring-session/spring-session-redis/pom.xml +++ b/spring-session/spring-session-redis/pom.xml @@ -4,12 +4,12 @@ 4.0.0 spring-session-redis 1.0.0-SNAPSHOT + spring-session-redis jar - spring-session-redis - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../../parent-boot-1 @@ -37,9 +37,9 @@ ${embedded-redis.version}
- + - 0.6 + 0.6
\ No newline at end of file diff --git a/spring-session/spring-session-redis/src/test/java/com/baeldung/spring/session/SessionControllerIntegrationTest.java b/spring-session/spring-session-redis/src/test/java/com/baeldung/spring/session/SessionControllerIntegrationTest.java index f739aeb3ab..7ee0294315 100644 --- a/spring-session/spring-session-redis/src/test/java/com/baeldung/spring/session/SessionControllerIntegrationTest.java +++ b/spring-session/spring-session-redis/src/test/java/com/baeldung/spring/session/SessionControllerIntegrationTest.java @@ -1,16 +1,11 @@ package com.baeldung.spring.session; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.util.Set; - import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.springframework.boot.context.embedded.LocalServerPort; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; @@ -20,19 +15,27 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; - import redis.clients.jedis.Jedis; import redis.embedded.RedisServer; +import java.io.IOException; +import java.util.Set; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + @RunWith(SpringRunner.class) -@SpringBootTest(classes = SessionWebApplication.class, webEnvironment = WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = SessionWebApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) public class SessionControllerIntegrationTest { - private Jedis jedis; private static RedisServer redisServer; + + @LocalServerPort + private int port; + + private Jedis jedis; private TestRestTemplate testRestTemplate; private TestRestTemplate testRestTemplateWithAuth; - private String testUrl = "http://localhost:8080/"; @BeforeClass public static void startRedisServer() throws IOException { @@ -41,7 +44,7 @@ public class SessionControllerIntegrationTest { } @AfterClass - public static void stopRedisServer() throws IOException { + public static void stopRedisServer() { redisServer.stop(); } @@ -63,13 +66,13 @@ public class SessionControllerIntegrationTest { @Test public void testUnauthenticatedCantAccess() { - ResponseEntity result = testRestTemplate.getForEntity(testUrl, String.class); + ResponseEntity result = testRestTemplate.getForEntity(getTestUrl(), String.class); assertEquals(HttpStatus.UNAUTHORIZED, result.getStatusCode()); } @Test public void testRedisControlsSession() { - ResponseEntity result = testRestTemplateWithAuth.getForEntity(testUrl, String.class); + ResponseEntity result = testRestTemplateWithAuth.getForEntity(getTestUrl(), String.class); assertEquals("hello admin", result.getBody()); // login worked Set redisResult = jedis.keys("*"); @@ -80,13 +83,16 @@ public class SessionControllerIntegrationTest { headers.add("Cookie", sessionCookie); HttpEntity httpEntity = new HttpEntity<>(headers); - result = testRestTemplate.exchange(testUrl, HttpMethod.GET, httpEntity, String.class); + result = testRestTemplate.exchange(getTestUrl(), HttpMethod.GET, httpEntity, String.class); assertEquals("hello admin", result.getBody()); // access with session works worked jedis.flushAll(); // clear all keys in redis - result = testRestTemplate.exchange(testUrl, HttpMethod.GET, httpEntity, String.class); + result = testRestTemplate.exchange(getTestUrl(), HttpMethod.GET, httpEntity, String.class); assertEquals(HttpStatus.UNAUTHORIZED, result.getStatusCode());// access denied after sessions are removed in redis + } + private String getTestUrl(){ + return "http://localhost:" + port; } } \ No newline at end of file diff --git a/spring-shell/pom.xml b/spring-shell/pom.xml index 1b6fe28fdd..be1562b942 100644 --- a/spring-shell/pom.xml +++ b/spring-shell/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 @@ -7,8 +8,8 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-sleuth/pom.xml b/spring-sleuth/pom.xml index 2387915c79..c37086558d 100644 --- a/spring-sleuth/pom.xml +++ b/spring-sleuth/pom.xml @@ -1,31 +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-sleuth 1.0.0-SNAPSHOT spring-sleuth jar - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 - - - org.springframework.cloud - spring-cloud-starter-sleuth - - - org.springframework.boot - spring-boot-starter-web - - - @@ -38,6 +26,17 @@ + + + org.springframework.cloud + spring-cloud-starter-sleuth + + + org.springframework.boot + spring-boot-starter-web + + + 2.0.2.RELEASE diff --git a/spring-soap/pom.xml b/spring-soap/pom.xml index e155a0f6b2..9403b70636 100644 --- a/spring-soap/pom.xml +++ b/spring-soap/pom.xml @@ -3,12 +3,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-soap - spring-soap 1.0.0 + spring-soap - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-social-login/pom.xml b/spring-social-login/pom.xml index 655e885568..9fa839f1c2 100644 --- a/spring-social-login/pom.xml +++ b/spring-social-login/pom.xml @@ -1,13 +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 spring-social-login spring-social-login war - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 @@ -76,7 +77,6 @@ - spring-social-login diff --git a/spring-spel/pom.xml b/spring-spel/pom.xml index aa6eb45158..2109117a86 100644 --- a/spring-spel/pom.xml +++ b/spring-spel/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 spring-spel 1.0-SNAPSHOT - spring-spel + spring-spel com.baeldung diff --git a/spring-state-machine/pom.xml b/spring-state-machine/pom.xml index b911b5b5ee..acb14a7613 100644 --- a/spring-state-machine/pom.xml +++ b/spring-state-machine/pom.xml @@ -1,13 +1,13 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 spring-state-machine - spring-state-machine - + spring-state-machine + - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT diff --git a/spring-static-resources/pom.xml b/spring-static-resources/pom.xml index b8068814ba..662c757f54 100644 --- a/spring-static-resources/pom.xml +++ b/spring-static-resources/pom.xml @@ -1,8 +1,7 @@ + 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 spring-static-resources @@ -147,14 +146,14 @@ commons-io ${commons-io.version} - + org.springframework spring-test - ${spring.version} + ${spring.version} test - + diff --git a/spring-swagger-codegen/pom.xml b/spring-swagger-codegen/pom.xml index e1bb98360e..dee9415679 100644 --- a/spring-swagger-codegen/pom.xml +++ b/spring-swagger-codegen/pom.xml @@ -1,10 +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 spring-swagger-codegen 0.0.1-SNAPSHOT + spring-swagger-codegen pom - spring-swagger-codegen com.baeldung 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 cfbc90155c..b9b97139d6 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-api-client/pom.xml @@ -1,11 +1,12 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 spring-swagger-codegen-api-client spring-swagger-codegen-api-client + jar https://github.com/swagger-api/swagger-codegen Swagger Java - jar scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -37,6 +38,53 @@ ../../spring-swagger-codegen + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + 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} + + + @@ -140,53 +188,6 @@ - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - - - - - 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} - - - 1.5.15 4.3.9.RELEASE @@ -197,4 +198,5 @@ 2.10.4 1.10 + diff --git a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml index f9410b6865..cb3fe89c8f 100644 --- a/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml +++ b/spring-swagger-codegen/spring-swagger-codegen-app/pom.xml @@ -1,9 +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-swagger-codegen-app - spring-swagger-codegen-app - + spring-swagger-codegen-app + com.baeldung spring-swagger-codegen @@ -42,6 +43,7 @@ 0.0.1-SNAPSHOT - 1.5.10.RELEASE + 1.5.10.RELEASE + diff --git a/spring-thymeleaf-2/pom.xml b/spring-thymeleaf-2/pom.xml index d53bb8ab1a..24c159dab9 100644 --- a/spring-thymeleaf-2/pom.xml +++ b/spring-thymeleaf-2/pom.xml @@ -1,5 +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-thymeleaf-2 spring-thymeleaf-2 @@ -65,4 +66,5 @@ 1.8 2.2 + diff --git a/spring-thymeleaf/pom.xml b/spring-thymeleaf/pom.xml index d260a78d76..c37c66a36d 100644 --- a/spring-thymeleaf/pom.xml +++ b/spring-thymeleaf/pom.xml @@ -1,10 +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-thymeleaf 0.1-SNAPSHOT - spring-thymeleaf + spring-thymeleaf war @@ -62,7 +62,7 @@ spring-security-config ${spring-security.version} - + org.thymeleaf diff --git a/spring-vault/pom.xml b/spring-vault/pom.xml index ccad71c024..40967e2894 100644 --- a/spring-vault/pom.xml +++ b/spring-vault/pom.xml @@ -1,47 +1,45 @@ - - - 4.0.0 - com.baeldung - spring-vault - 0.0.1-SNAPSHOT - spring-vault - jar - Spring Vault sample project + + + 4.0.0 + spring-vault + 0.0.1-SNAPSHOT + spring-vault + jar + Spring Vault sample project - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + - - - org.springframework.boot - spring-boot-starter - - - org.springframework.vault - spring-vault-core - ${spring.vault.core.version} - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - + + + org.springframework.boot + spring-boot-starter + + + org.springframework.vault + spring-vault-core + ${spring.vault.core.version} + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-test + test + + - + + UTF-8 + 2.1.1.RELEASE + - - UTF-8 - 2.1.1.RELEASE - diff --git a/spring-vertx/pom.xml b/spring-vertx/pom.xml index 1a0e1c0223..ef169c9a27 100644 --- a/spring-vertx/pom.xml +++ b/spring-vertx/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 spring-vertx spring-vertx - A demo project with vertx spring integration jar + A demo project with vertx spring integration - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/spring-webflux-amqp/pom.xml b/spring-webflux-amqp/pom.xml index 88f5eff403..f9b14eea06 100755 --- a/spring-webflux-amqp/pom.xml +++ b/spring-webflux-amqp/pom.xml @@ -1,76 +1,76 @@ - 4.0.0 - org.baeldung.spring - spring-webflux-amqp - 1.0.0-SNAPSHOT - spring-webflux-amqp - jar - Spring WebFlux AMQP Sample + 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 + spring-webflux-amqp + 1.0.0-SNAPSHOT + spring-webflux-amqp + jar + Spring WebFlux AMQP Sample - - parent-boot-2 - com.baeldung - 0.0.1-SNAPSHOT - ../parent-boot-2 - + + com.baeldung + parent-boot-2 + 0.0.1-SNAPSHOT + ../parent-boot-2 + - - - - - org.springframework.boot - spring-boot-dependencies - - 2.1.3.RELEASE - pom - import - - - + + + + + org.springframework.boot + spring-boot-dependencies + + 2.1.3.RELEASE + pom + import + + + - - - org.springframework.boot - spring-boot-starter-amqp - - - org.springframework.boot - spring-boot-starter-webflux - + + + org.springframework.boot + spring-boot-starter-amqp + + + org.springframework.boot + spring-boot-starter-webflux + - - org.springframework.boot - spring-boot-configuration-processor - true - + + org.springframework.boot + spring-boot-configuration-processor + true + - - org.springframework.boot - spring-boot-starter-test - test - + + org.springframework.boot + spring-boot-starter-test + test + - - io.projectreactor - reactor-test - test - + + io.projectreactor + reactor-test + test + - - org.springframework.boot - spring-boot-starter-integration - - + + org.springframework.boot + spring-boot-starter-integration + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + diff --git a/static-analysis/pom.xml b/static-analysis/pom.xml index 94d68f895b..87e5f55977 100644 --- a/static-analysis/pom.xml +++ b/static-analysis/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 static-analysis 1.0-SNAPSHOT - static-analysis + static-analysis com.baeldung diff --git a/stripe/pom.xml b/stripe/pom.xml index 7aa458bfd5..07d2968f5f 100644 --- a/stripe/pom.xml +++ b/stripe/pom.xml @@ -1,17 +1,17 @@ + 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.stripe stripe 0.0.1-SNAPSHOT stripe - Demo project for Stripe API jar + Demo project for Stripe API - parent-boot-1 com.baeldung + parent-boot-1 0.0.1-SNAPSHOT ../parent-boot-1 @@ -38,7 +38,7 @@ ${stripe.version} - + 4.2.0 diff --git a/structurizr/pom.xml b/structurizr/pom.xml index b9f9b68717..f1b4355dcf 100644 --- a/structurizr/pom.xml +++ b/structurizr/pom.xml @@ -1,9 +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 structurizr - structurizr + structurizr com.baeldung diff --git a/struts-2/pom.xml b/struts-2/pom.xml index 1f7d6876d5..3211ad7253 100644 --- a/struts-2/pom.xml +++ b/struts-2/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"> 4.0.0 - com.baeldung struts-2 0.0.1-SNAPSHOT struts-2 @@ -65,7 +65,7 @@ - + 2.5.5 2.5.8 diff --git a/tensorflow-java/pom.xml b/tensorflow-java/pom.xml index 1c34fa465b..379a901925 100644 --- a/tensorflow-java/pom.xml +++ b/tensorflow-java/pom.xml @@ -1,51 +1,51 @@ - 4.0.0 - com.baeldung - tensorflow-java - 1.0-SNAPSHOT - jar - tensorflow-java - http://maven.apache.org + 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 + tensorflow-java + 1.0-SNAPSHOT + tensorflow-java + jar + http://maven.apache.org - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + - - - org.tensorflow - tensorflow - ${tensorflow.version} - - - org.junit.jupiter - junit-jupiter-api - ${junit-jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-engine - ${junit-jupiter.version} - test - - + + + org.tensorflow + tensorflow + ${tensorflow.version} + + + org.junit.jupiter + junit-jupiter-api + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + test + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + 1.12.0 + - - 1.12.0 - \ No newline at end of file diff --git a/testing-modules/assertion-libraries/pom.xml b/testing-modules/assertion-libraries/pom.xml index 9d60d42533..c8ab512e4b 100644 --- a/testing-modules/assertion-libraries/pom.xml +++ b/testing-modules/assertion-libraries/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung assertion-libraries 0.1-SNAPSHOT assertion-libraries diff --git a/testing-modules/easy-random/pom.xml b/testing-modules/easy-random/pom.xml index d80927c3e8..1a1f3f743d 100644 --- a/testing-modules/easy-random/pom.xml +++ b/testing-modules/easy-random/pom.xml @@ -1,14 +1,14 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 easy-random easy-random - parent-modules com.baeldung + parent-modules 1.0.0-SNAPSHOT ../../ diff --git a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Department.java b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Department.java similarity index 90% rename from testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Department.java rename to testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Department.java index ee4dc82771..87bff514a0 100644 --- a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Department.java +++ b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Department.java @@ -1,4 +1,4 @@ -package org.baeldung.easy.random.model; +package com.baeldung.easy.random.model; import java.util.StringJoiner; diff --git a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Employee.java b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Employee.java similarity index 97% rename from testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Employee.java rename to testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Employee.java index ef63642ca2..af44822215 100644 --- a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Employee.java +++ b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Employee.java @@ -1,4 +1,4 @@ -package org.baeldung.easy.random.model; +package com.baeldung.easy.random.model; import java.util.*; diff --git a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Grade.java b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Grade.java similarity index 90% rename from testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Grade.java rename to testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Grade.java index cb979be3b8..1d18a3f183 100644 --- a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Grade.java +++ b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Grade.java @@ -1,4 +1,4 @@ -package org.baeldung.easy.random.model; +package com.baeldung.easy.random.model; import java.util.StringJoiner; diff --git a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Person.java b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Person.java similarity index 93% rename from testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Person.java rename to testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Person.java index c941499993..3269af7b0f 100644 --- a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/Person.java +++ b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/Person.java @@ -1,4 +1,4 @@ -package org.baeldung.easy.random.model; +package com.baeldung.easy.random.model; import java.util.StringJoiner; diff --git a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/YearQuarter.java b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/YearQuarter.java similarity index 96% rename from testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/YearQuarter.java rename to testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/YearQuarter.java index c2868f09b8..576fe67dd0 100644 --- a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/model/YearQuarter.java +++ b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/model/YearQuarter.java @@ -1,4 +1,4 @@ -package org.baeldung.easy.random.model; +package com.baeldung.easy.random.model; import java.time.LocalDate; import java.util.Objects; diff --git a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/randomizer/YearQuarterRandomizer.java b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/randomizer/YearQuarterRandomizer.java similarity index 79% rename from testing-modules/easy-random/src/main/java/org/baeldung/easy/random/randomizer/YearQuarterRandomizer.java rename to testing-modules/easy-random/src/main/java/com/baeldung/easy/random/randomizer/YearQuarterRandomizer.java index 05232ffcbc..28db724684 100644 --- a/testing-modules/easy-random/src/main/java/org/baeldung/easy/random/randomizer/YearQuarterRandomizer.java +++ b/testing-modules/easy-random/src/main/java/com/baeldung/easy/random/randomizer/YearQuarterRandomizer.java @@ -1,6 +1,6 @@ -package org.baeldung.easy.random.randomizer; +package com.baeldung.easy.random.randomizer; -import org.baeldung.easy.random.model.YearQuarter; +import com.baeldung.easy.random.model.YearQuarter; import org.jeasy.random.api.Randomizer; import java.time.LocalDate; diff --git a/testing-modules/easy-random/src/test/java/org/baeldung/easy/random/EasyRandomUnitTest.java b/testing-modules/easy-random/src/test/java/com/baeldung/easy/random/EasyRandomUnitTest.java similarity index 89% rename from testing-modules/easy-random/src/test/java/org/baeldung/easy/random/EasyRandomUnitTest.java rename to testing-modules/easy-random/src/test/java/com/baeldung/easy/random/EasyRandomUnitTest.java index 9f7a23db66..4e0df74923 100644 --- a/testing-modules/easy-random/src/test/java/org/baeldung/easy/random/EasyRandomUnitTest.java +++ b/testing-modules/easy-random/src/test/java/com/baeldung/easy/random/EasyRandomUnitTest.java @@ -1,9 +1,9 @@ -package org.baeldung.easy.random; +package com.baeldung.easy.random; -import org.baeldung.easy.random.model.Employee; -import org.baeldung.easy.random.model.Person; -import org.baeldung.easy.random.model.YearQuarter; -import org.baeldung.easy.random.randomizer.YearQuarterRandomizer; +import com.baeldung.easy.random.model.Employee; +import com.baeldung.easy.random.model.Person; +import com.baeldung.easy.random.model.YearQuarter; +import com.baeldung.easy.random.randomizer.YearQuarterRandomizer; import org.jeasy.random.EasyRandom; import org.jeasy.random.EasyRandomParameters; import org.jeasy.random.FieldPredicates; diff --git a/testing-modules/easymock/pom.xml b/testing-modules/easymock/pom.xml index ed9a077f67..4146ae6df4 100644 --- a/testing-modules/easymock/pom.xml +++ b/testing-modules/easymock/pom.xml @@ -1,8 +1,7 @@ - - + + 4.0.0 easymock easymock @@ -27,4 +26,5 @@ UTF-8 4.0.2 + diff --git a/testing-modules/gatling/pom.xml b/testing-modules/gatling/pom.xml index d105cc8b3e..99eaaac044 100644 --- a/testing-modules/gatling/pom.xml +++ b/testing-modules/gatling/pom.xml @@ -15,7 +15,6 @@ ../../ - @@ -106,7 +105,6 @@ - 1.8 1.8 diff --git a/testing-modules/groovy-spock/pom.xml b/testing-modules/groovy-spock/pom.xml index 35d8f5034f..fa2c98a884 100644 --- a/testing-modules/groovy-spock/pom.xml +++ b/testing-modules/groovy-spock/pom.xml @@ -1,11 +1,11 @@ + 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 1.0-SNAPSHOT - groovy-spock + groovy-spock jar diff --git a/testing-modules/hamcrest/pom.xml b/testing-modules/hamcrest/pom.xml index 2136702b3a..cfd5bf5fac 100644 --- a/testing-modules/hamcrest/pom.xml +++ b/testing-modules/hamcrest/pom.xml @@ -1,7 +1,7 @@ + 4.0.0 - com.baeldung hamcrest 0.0.1-SNAPSHOT hamcrest @@ -26,4 +26,5 @@ 2.0.0.0 + diff --git a/testing-modules/junit-4/README.md b/testing-modules/junit-4/README.md index 6cc3981ed4..d19a0a1e47 100644 --- a/testing-modules/junit-4/README.md +++ b/testing-modules/junit-4/README.md @@ -4,4 +4,3 @@ - [Custom JUnit 4 Test Runners](http://www.baeldung.com/junit-4-custom-runners) - [Introduction to JUnitParams](http://www.baeldung.com/junit-params) - [Running JUnit Tests Programmatically, from a Java Application](https://www.baeldung.com/junit-tests-run-programmatically-from-java) -- [Introduction to Lambda Behave](https://www.baeldung.com/lambda-behave) diff --git a/testing-modules/junit-5-advanced/pom.xml b/testing-modules/junit-5-advanced/pom.xml index bc879ebfc3..4756223c3d 100644 --- a/testing-modules/junit-5-advanced/pom.xml +++ b/testing-modules/junit-5-advanced/pom.xml @@ -1,52 +1,53 @@ - 4.0.0 - junit-5-advanced - 1.0-SNAPSHOT - junit-5-advanced - Advanced JUnit 5 Topics + 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 + junit-5-advanced + 1.0-SNAPSHOT + junit-5-advanced + Advanced JUnit 5 Topics - - com.baeldung - parent-modules - 1.0.0-SNAPSHOT - ../../ - + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + ../../ + - - - org.junit.jupiter - junit-jupiter - ${junit-jupiter.version} - test - - - org.junit.jupiter - junit-jupiter-engine - ${junit-jupiter.version} - - - org.junit.vintage - junit-vintage-engine - ${junit.vintage.version} - test - - + + + org.junit.jupiter + junit-jupiter + ${junit-jupiter.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit-jupiter.version} + + + org.junit.vintage + junit-vintage-engine + ${junit.vintage.version} + test + + - - - - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - - - 5.4.2 - 2.21.0 - 5.4.2 - + + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + + + + 5.4.2 + 2.21.0 + 5.4.2 + diff --git a/testing-modules/junit-5-basics/pom.xml b/testing-modules/junit-5-basics/pom.xml index 68a0ceeee7..b9c9635dc4 100644 --- a/testing-modules/junit-5-basics/pom.xml +++ b/testing-modules/junit-5-basics/pom.xml @@ -85,7 +85,6 @@ src/main/resources true - @@ -100,7 +99,7 @@ maven-surefire-plugin ${maven-surefire-plugin.version} - + **/*IntegrationTest.java @@ -146,9 +145,8 @@ - - + 5.4.2 1.2.0 diff --git a/testing-modules/junit-5-basics/src/test/java/com/baeldung/assertexception/ExceptionAssertionUnitTest.java b/testing-modules/junit-5-basics/src/test/java/com/baeldung/assertexception/ExceptionAssertionUnitTest.java index 1b1c70d824..ee2f696408 100644 --- a/testing-modules/junit-5-basics/src/test/java/com/baeldung/assertexception/ExceptionAssertionUnitTest.java +++ b/testing-modules/junit-5-basics/src/test/java/com/baeldung/assertexception/ExceptionAssertionUnitTest.java @@ -1,23 +1,32 @@ package com.baeldung.assertexception; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; public class ExceptionAssertionUnitTest { @Test public void whenExceptionThrown_thenAssertionSucceeds() { - String test = null; - assertThrows(NullPointerException.class, () -> { - test.length(); + Exception exception = assertThrows(NumberFormatException.class, () -> { + Integer.parseInt("1a"); }); + + String expectedMessage = "For input string"; + String actualMessage = exception.getMessage(); + + assertTrue(actualMessage.contains(expectedMessage)); } @Test public void whenDerivedExceptionThrown_thenAssertionSucceds() { - String test = null; - assertThrows(RuntimeException.class, () -> { - test.length(); + Exception exception = assertThrows(RuntimeException.class, () -> { + Integer.parseInt("1a"); }); + + String expectedMessage = "For input string"; + String actualMessage = exception.getMessage(); + + assertTrue(actualMessage.contains(expectedMessage)); } } \ No newline at end of file diff --git a/testing-modules/junit-5/pom.xml b/testing-modules/junit-5/pom.xml index a27e4da61b..33fd0bbce8 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 junit-5 @@ -30,20 +30,20 @@ org.junit.jupiter junit-jupiter-api ${junit.jupiter.version} - + org.junit.platform junit-platform-runner ${junit.platform.version} test - + org.junit.vintage junit-vintage-engine ${junit.vintage.version} test - + org.junit.jupiter junit-jupiter-migrationsupport ${junit.vintage.version} @@ -131,6 +131,7 @@ + 5.4.2 2.23.0 diff --git a/testing-modules/junit5-annotations/pom.xml b/testing-modules/junit5-annotations/pom.xml index c8abfe909d..080844c30b 100644 --- a/testing-modules/junit5-annotations/pom.xml +++ b/testing-modules/junit5-annotations/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 junit5-annotations 1.0-SNAPSHOT diff --git a/testing-modules/junit5-migration/pom.xml b/testing-modules/junit5-migration/pom.xml index 536953afc8..3b2663d81d 100644 --- a/testing-modules/junit5-migration/pom.xml +++ b/testing-modules/junit5-migration/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 junit5-migration 1.0-SNAPSHOT diff --git a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java index 8f2eb2b5c5..7378eafaa7 100644 --- a/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java +++ b/testing-modules/junit5-migration/src/test/java/com/baeldung/junit5vstestng/SelectPackagesSuiteUnitTest.java @@ -5,7 +5,7 @@ import org.junit.platform.suite.api.SelectPackages; import org.junit.runner.RunWith; @RunWith(JUnitPlatform.class) -@SelectPackages({ "org.baeldung.java.suite.childpackage1", "org.baeldung.java.suite.childpackage2" }) +@SelectPackages({ "com.baeldung.java.suite.childpackage1", "com.baeldung.java.suite.childpackage2" }) public class SelectPackagesSuiteUnitTest { } diff --git a/testing-modules/load-testing-comparison/pom.xml b/testing-modules/load-testing-comparison/pom.xml index 8441eb3db7..1143ecb9ac 100644 --- a/testing-modules/load-testing-comparison/pom.xml +++ b/testing-modules/load-testing-comparison/pom.xml @@ -4,11 +4,11 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 load-testing-comparison - load-testing-comparison - + load-testing-comparison + - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../../parent-boot-2 @@ -65,13 +65,13 @@ - - - - - - - + + + + + + + @@ -80,40 +80,40 @@ 2.0.5.RELEASE - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + @@ -128,5 +128,5 @@ 2.2.1 5.0 - + diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index e319dd9edd..76608a3039 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/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"> 4.0.0 - com.baeldung mockito-2 0.0.1-SNAPSHOT mockito-2 @@ -17,4 +17,5 @@ 2.21.0 + diff --git a/testing-modules/mockito/pom.xml b/testing-modules/mockito/pom.xml index e0f32d88bf..0fb11d23ab 100644 --- a/testing-modules/mockito/pom.xml +++ b/testing-modules/mockito/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"> 4.0.0 - com.baeldung mockito 0.1-SNAPSHOT mockito @@ -14,7 +14,6 @@ - org.springframework spring-core @@ -83,9 +82,9 @@ - 2.0.4.RELEASE - 5.0.8.RELEASE - 2.0.9.RELEASE + 2.0.4.RELEASE + 5.0.8.RELEASE + 2.0.9.RELEASE 19.0 diff --git a/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoInitWithMockitoJUnitRuleUnitTest.java b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoInitWithMockitoJUnitRuleUnitTest.java new file mode 100644 index 0000000000..1bbe13ec84 --- /dev/null +++ b/testing-modules/mockito/src/test/java/com/baeldung/mockito/MockitoInitWithMockitoJUnitRuleUnitTest.java @@ -0,0 +1,28 @@ +package com.baeldung.mockito; + +import org.junit.Rule; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.when; + +public class MockitoInitWithMockitoJUnitRuleUnitTest { + + @Rule + public MockitoRule initRule = MockitoJUnit.rule(); + + @Mock + private List mockedList; + + @Test + public void whenUsingMockitoJUnitRule_thenMocksInitialized() { + when(mockedList.size()).thenReturn(41); + + assertThat(mockedList.size()).isEqualTo(41); + } +} diff --git a/testing-modules/mocks/pom.xml b/testing-modules/mocks/pom.xml index cbda386af8..abaf313dc5 100644 --- a/testing-modules/mocks/pom.xml +++ b/testing-modules/mocks/pom.xml @@ -1,3 +1,4 @@ + 4.0.0 diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/AdvancedCollaborator.java b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/AdvancedCollaborator.java similarity index 93% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/AdvancedCollaborator.java rename to testing-modules/mocks/src/main/java/com/baeldung/jmockit/AdvancedCollaborator.java index 4d25f466a6..ef7484cfdd 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/AdvancedCollaborator.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/AdvancedCollaborator.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; public class AdvancedCollaborator { int i; diff --git a/testing-modules/mocks/src/main/java/com/baeldung/mocks/jmockit/AppManager.java b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/AppManager.java similarity index 94% rename from testing-modules/mocks/src/main/java/com/baeldung/mocks/jmockit/AppManager.java rename to testing-modules/mocks/src/main/java/com/baeldung/jmockit/AppManager.java index 615650ea6d..6306a94d29 100644 --- a/testing-modules/mocks/src/main/java/com/baeldung/mocks/jmockit/AppManager.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/AppManager.java @@ -1,4 +1,4 @@ -package com.baeldung.mocks.jmockit; +package com.baeldung.jmockit; import java.util.Random; diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Collaborator.java b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/Collaborator.java similarity index 80% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Collaborator.java rename to testing-modules/mocks/src/main/java/com/baeldung/jmockit/Collaborator.java index 60da12fa7c..8c4f6b15b6 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Collaborator.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/Collaborator.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; public class Collaborator { diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/ExpectationsCollaborator.java b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/ExpectationsCollaborator.java similarity index 94% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/ExpectationsCollaborator.java rename to testing-modules/mocks/src/main/java/com/baeldung/jmockit/ExpectationsCollaborator.java index 8209464936..799e7721e0 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/ExpectationsCollaborator.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/ExpectationsCollaborator.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; import java.util.List; diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Model.java b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/Model.java similarity index 69% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Model.java rename to testing-modules/mocks/src/main/java/com/baeldung/jmockit/Model.java index 79ae24c2f5..ac81e5059a 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Model.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/Model.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; public class Model { public String getInfo() { diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Performer.java b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/Performer.java similarity index 84% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Performer.java rename to testing-modules/mocks/src/main/java/com/baeldung/jmockit/Performer.java index 4f8e8adb24..82fd03fef1 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/jmockit/Performer.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/jmockit/Performer.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; public class Performer { private Collaborator collaborator; diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginController.java b/testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginController.java similarity index 94% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginController.java rename to testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginController.java index 914b0034d2..e7e972a3ce 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginController.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginController.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.testCase; +package com.baeldung.testCase; public class LoginController { diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginDao.java b/testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginDao.java similarity index 79% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginDao.java rename to testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginDao.java index 2cbff6c9d4..f2efe38019 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginDao.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginDao.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.testCase; +package com.baeldung.testCase; public class LoginDao { diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginService.java b/testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginService.java similarity index 94% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginService.java rename to testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginService.java index d6a31a8047..3e34024971 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/LoginService.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/testCase/LoginService.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.testCase; +package com.baeldung.testCase; public class LoginService { diff --git a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/UserForm.java b/testing-modules/mocks/src/main/java/com/baeldung/testCase/UserForm.java similarity index 84% rename from testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/UserForm.java rename to testing-modules/mocks/src/main/java/com/baeldung/testCase/UserForm.java index 14136d0f31..bfb1411ce5 100644 --- a/testing-modules/mocks/src/main/java/org/baeldung/mocks/testCase/UserForm.java +++ b/testing-modules/mocks/src/main/java/com/baeldung/testCase/UserForm.java @@ -1,4 +1,4 @@ -package org.baeldung.mocks.testCase; +package com.baeldung.testCase; public class UserForm { diff --git a/testing-modules/mocks/src/test/java/org/baeldung/mocks/easymock/LoginControllerIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/easymock/LoginControllerIntegrationTest.java similarity index 94% rename from testing-modules/mocks/src/test/java/org/baeldung/mocks/easymock/LoginControllerIntegrationTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/easymock/LoginControllerIntegrationTest.java index 4cf2a23ee8..5636382efd 100644 --- a/testing-modules/mocks/src/test/java/org/baeldung/mocks/easymock/LoginControllerIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/easymock/LoginControllerIntegrationTest.java @@ -1,9 +1,9 @@ -package org.baeldung.mocks.easymock; +package com.baeldung.easymock; -import org.baeldung.mocks.testCase.LoginController; -import org.baeldung.mocks.testCase.LoginDao; -import org.baeldung.mocks.testCase.LoginService; -import org.baeldung.mocks.testCase.UserForm; +import com.baeldung.testCase.LoginController; +import com.baeldung.testCase.LoginDao; +import com.baeldung.testCase.LoginService; +import com.baeldung.testCase.UserForm; import org.easymock.*; import org.junit.Assert; import org.junit.Test; diff --git a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/AdvancedCollaboratorIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/AdvancedCollaboratorIntegrationTest.java similarity index 96% rename from testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/AdvancedCollaboratorIntegrationTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/jmockit/AdvancedCollaboratorIntegrationTest.java index 3a30342eb9..e55a69895f 100644 --- a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/AdvancedCollaboratorIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/AdvancedCollaboratorIntegrationTest.java @@ -1,10 +1,11 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; +import com.baeldung.jmockit.AdvancedCollaborator; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/testing-modules/mocks/src/test/java/com/baeldung/mocks/jmockit/AppManagerUnitTest.java b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/AppManagerUnitTest.java similarity index 91% rename from testing-modules/mocks/src/test/java/com/baeldung/mocks/jmockit/AppManagerUnitTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/jmockit/AppManagerUnitTest.java index ecdc6e441e..bc88f62024 100644 --- a/testing-modules/mocks/src/test/java/com/baeldung/mocks/jmockit/AppManagerUnitTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/AppManagerUnitTest.java @@ -1,10 +1,9 @@ -package com.baeldung.mocks.jmockit; +package com.baeldung.jmockit; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import mockit.Deencapsulation; import mockit.Mock; import mockit.MockUp; diff --git a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/ExpectationsIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/ExpectationsIntegrationTest.java similarity index 97% rename from testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/ExpectationsIntegrationTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/jmockit/ExpectationsIntegrationTest.java index 8b85af6243..8b0c3ab4ec 100644 --- a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/ExpectationsIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/ExpectationsIntegrationTest.java @@ -1,5 +1,7 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; +import com.baeldung.jmockit.ExpectationsCollaborator; +import com.baeldung.jmockit.Model; import mockit.Delegate; import mockit.Expectations; import mockit.Mocked; diff --git a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/LoginControllerIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/LoginControllerIntegrationTest.java similarity index 95% rename from testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/LoginControllerIntegrationTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/jmockit/LoginControllerIntegrationTest.java index ecad7df5b5..4dbe94991f 100644 --- a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/LoginControllerIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/LoginControllerIntegrationTest.java @@ -1,11 +1,11 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; import mockit.*; import mockit.integration.junit4.JMockit; -import org.baeldung.mocks.testCase.LoginController; -import org.baeldung.mocks.testCase.LoginDao; -import org.baeldung.mocks.testCase.LoginService; -import org.baeldung.mocks.testCase.UserForm; +import com.baeldung.testCase.LoginController; +import com.baeldung.testCase.LoginDao; +import com.baeldung.testCase.LoginService; +import com.baeldung.testCase.UserForm; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; import org.junit.Assert; diff --git a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/PerformerIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/PerformerIntegrationTest.java similarity index 80% rename from testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/PerformerIntegrationTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/jmockit/PerformerIntegrationTest.java index 7c79a5979e..fb94ae908b 100644 --- a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/PerformerIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/PerformerIntegrationTest.java @@ -1,5 +1,8 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; +import com.baeldung.jmockit.Collaborator; +import com.baeldung.jmockit.Model; +import com.baeldung.jmockit.Performer; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/ReusingIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/ReusingIntegrationTest.java similarity index 89% rename from testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/ReusingIntegrationTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/jmockit/ReusingIntegrationTest.java index 73bc712143..30b17ee2e4 100644 --- a/testing-modules/mocks/src/test/java/org/baeldung/mocks/jmockit/ReusingIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/jmockit/ReusingIntegrationTest.java @@ -1,5 +1,8 @@ -package org.baeldung.mocks.jmockit; +package com.baeldung.jmockit; +import com.baeldung.jmockit.Collaborator; +import com.baeldung.jmockit.Model; +import com.baeldung.jmockit.Performer; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/testing-modules/mocks/src/test/java/org/baeldung/mocks/mockito/LoginControllerIntegrationTest.java b/testing-modules/mocks/src/test/java/com/baeldung/mockito/LoginControllerIntegrationTest.java similarity index 94% rename from testing-modules/mocks/src/test/java/org/baeldung/mocks/mockito/LoginControllerIntegrationTest.java rename to testing-modules/mocks/src/test/java/com/baeldung/mockito/LoginControllerIntegrationTest.java index 9d47b2f5d4..98df2cf850 100644 --- a/testing-modules/mocks/src/test/java/org/baeldung/mocks/mockito/LoginControllerIntegrationTest.java +++ b/testing-modules/mocks/src/test/java/com/baeldung/mockito/LoginControllerIntegrationTest.java @@ -1,9 +1,9 @@ -package org.baeldung.mocks.mockito; +package com.baeldung.mockito; -import org.baeldung.mocks.testCase.LoginController; -import org.baeldung.mocks.testCase.LoginDao; -import org.baeldung.mocks.testCase.LoginService; -import org.baeldung.mocks.testCase.UserForm; +import com.baeldung.testCase.LoginController; +import com.baeldung.testCase.LoginDao; +import com.baeldung.testCase.LoginService; +import com.baeldung.testCase.UserForm; import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/testing-modules/mockserver/pom.xml b/testing-modules/mockserver/pom.xml index 1db409bd7c..6d553f4b90 100644 --- a/testing-modules/mockserver/pom.xml +++ b/testing-modules/mockserver/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 mockserver 1.0.0-SNAPSHOT - mockserver - + mockserver + com.baeldung parent-modules diff --git a/testing-modules/parallel-tests-junit/math-test-functions/pom.xml b/testing-modules/parallel-tests-junit/math-test-functions/pom.xml index cc9f27de05..ba645d00ff 100644 --- a/testing-modules/parallel-tests-junit/math-test-functions/pom.xml +++ b/testing-modules/parallel-tests-junit/math-test-functions/pom.xml @@ -1,52 +1,52 @@ - - - 4.0.0 - math-test-functions - math-test-functions - http://maven.apache.org + + + 4.0.0 + math-test-functions + math-test-functions + http://maven.apache.org - - com.baeldung - parallel-tests-junit - 0.0.1-SNAPSHOT - + + com.baeldung + parallel-tests-junit + 0.0.1-SNAPSHOT + - - - junit - junit - ${junit.version} - test - - + + + junit + junit + ${junit.version} + test + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - all - 10 - 2 - 2 - 6 - 3.5 - 5 - true - - FunctionTestSuite.class - - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.0 + + all + 10 + 2 + 2 + 6 + 3.5 + 5 + true + + FunctionTestSuite.class + + + + + + + + UTF-8 + - - UTF-8 - diff --git a/testing-modules/parallel-tests-junit/pom.xml b/testing-modules/parallel-tests-junit/pom.xml index 993974046c..f9c47c827c 100644 --- a/testing-modules/parallel-tests-junit/pom.xml +++ b/testing-modules/parallel-tests-junit/pom.xml @@ -1,7 +1,7 @@ - + 4.0.0 - com.baeldung parallel-tests-junit 0.0.1-SNAPSHOT parallel-tests-junit @@ -13,7 +13,7 @@ 0.0.1-SNAPSHOT ../../parent-java - + math-test-functions string-test-functions diff --git a/testing-modules/parallel-tests-junit/string-test-functions/pom.xml b/testing-modules/parallel-tests-junit/string-test-functions/pom.xml index b0c0ed29fc..984dd64ce4 100644 --- a/testing-modules/parallel-tests-junit/string-test-functions/pom.xml +++ b/testing-modules/parallel-tests-junit/string-test-functions/pom.xml @@ -1,44 +1,44 @@ - - - 4.0.0 - string-test-functions - string-test-functions - http://maven.apache.org + + + 4.0.0 + string-test-functions + string-test-functions + http://maven.apache.org - - com.baeldung - parallel-tests-junit - 0.0.1-SNAPSHOT - + + com.baeldung + parallel-tests-junit + 0.0.1-SNAPSHOT + - - - junit - junit - ${junit.version} - test - - + + + junit + junit + ${junit.version} + test + + - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - all - true - 2 - - - - + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.0 + + all + true + 2 + + + + + + + UTF-8 + - - UTF-8 - diff --git a/testing-modules/pom.xml b/testing-modules/pom.xml index aad709cfe9..f4a8368581 100644 --- a/testing-modules/pom.xml +++ b/testing-modules/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 testing-modules testing-modules @@ -41,4 +41,5 @@ junit-4 testing-libraries + diff --git a/testing-modules/rest-assured/pom.xml b/testing-modules/rest-assured/pom.xml index 75f33c26f1..74935bcf6f 100644 --- a/testing-modules/rest-assured/pom.xml +++ b/testing-modules/rest-assured/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 - com.baeldung rest-assured 1.0 rest-assured @@ -213,7 +213,7 @@ 3.0.1 3.0.1 - + 2.5.3 diff --git a/testing-modules/rest-testing/pom.xml b/testing-modules/rest-testing/pom.xml index a1995ce9ff..1e8a27afa5 100644 --- a/testing-modules/rest-testing/pom.xml +++ b/testing-modules/rest-testing/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"> 4.0.0 - com.baeldung rest-testing 0.1-SNAPSHOT rest-testing @@ -105,9 +105,9 @@ true - + - + maven-failsafe-plugin ${maven-failsafe-plugin.version} @@ -122,27 +122,27 @@ - + - com.github.temyers - cucumber-jvm-parallel-plugin - 5.0.0 - - - generateRunners - generate-test-sources - - generateRunners - - - - com.baeldung.rest.cucumber - - src/test/resources/Feature/ - SCENARIO - - - + com.github.temyers + cucumber-jvm-parallel-plugin + 5.0.0 + + + generateRunners + generate-test-sources + + generateRunners + + + + com.baeldung.rest.cucumber + + src/test/resources/Feature/ + SCENARIO + + + diff --git a/testing-modules/rest-testing/src/test/java/org/baeldung/rest/GitHubUser.java b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/GitHubUser.java similarity index 88% rename from testing-modules/rest-testing/src/test/java/org/baeldung/rest/GitHubUser.java rename to testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/GitHubUser.java index 73c9677377..6992789f0e 100644 --- a/testing-modules/rest-testing/src/test/java/org/baeldung/rest/GitHubUser.java +++ b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/GitHubUser.java @@ -1,4 +1,4 @@ -package org.baeldung.rest; +package com.baeldung.rest.jbehave; public class GitHubUser { diff --git a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/GithubUserResponsePayloadSteps.java b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/GithubUserResponsePayloadSteps.java index d9401a5d00..51beb609c2 100644 --- a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/GithubUserResponsePayloadSteps.java +++ b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/GithubUserResponsePayloadSteps.java @@ -1,11 +1,6 @@ package com.baeldung.rest.jbehave; import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpUriRequest; -import org.apache.http.impl.client.HttpClientBuilder; -import org.baeldung.rest.GitHubUser; -import org.baeldung.rest.RetrieveUtil; import org.hamcrest.Matchers; import org.jbehave.core.annotations.Given; import org.jbehave.core.annotations.Then; diff --git a/testing-modules/rest-testing/src/test/java/org/baeldung/rest/RetrieveUtil.java b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/RetrieveUtil.java similarity index 95% rename from testing-modules/rest-testing/src/test/java/org/baeldung/rest/RetrieveUtil.java rename to testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/RetrieveUtil.java index 75ec3c842c..03f96bed73 100644 --- a/testing-modules/rest-testing/src/test/java/org/baeldung/rest/RetrieveUtil.java +++ b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/jbehave/RetrieveUtil.java @@ -1,4 +1,4 @@ -package org.baeldung.rest; +package com.baeldung.rest.jbehave; import java.io.IOException; diff --git a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/karate/KarateIntegrationTest.java b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/karate/KarateIntegrationTest.java index 5654a0ee0c..5da2784179 100644 --- a/testing-modules/rest-testing/src/test/java/com/baeldung/rest/karate/KarateIntegrationTest.java +++ b/testing-modules/rest-testing/src/test/java/com/baeldung/rest/karate/KarateIntegrationTest.java @@ -15,7 +15,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; @CucumberOptions(features = "classpath:karate") public class KarateIntegrationTest { - public static final int PORT_NUMBER = 8097; + private static final int PORT_NUMBER = 8097; private static final WireMockServer wireMockServer = new WireMockServer(WireMockConfiguration.options().port(PORT_NUMBER)); diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index ae15fc97c0..0616cdaa29 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/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 selenium-junit-testng 0.0.1-SNAPSHOT - selenium-junit-testng - + selenium-junit-testng + com.baeldung parent-modules @@ -45,7 +45,7 @@ src - + live @@ -70,4 +70,5 @@ 6.10 3.4.0 + \ No newline at end of file diff --git a/testing-modules/spring-testing/pom.xml b/testing-modules/spring-testing/pom.xml index 15431cfb77..38e7a0dd46 100644 --- a/testing-modules/spring-testing/pom.xml +++ b/testing-modules/spring-testing/pom.xml @@ -1,8 +1,9 @@ + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.baeldung + com.baeldung spring-testing 0.1-SNAPSHOT spring-testing @@ -15,7 +16,6 @@ - org.hamcrest java-hamcrest @@ -110,7 +110,6 @@ true - diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/User.java b/testing-modules/spring-testing/src/main/java/com/baeldung/mockito/repository/User.java similarity index 95% rename from testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/User.java rename to testing-modules/spring-testing/src/main/java/com/baeldung/mockito/repository/User.java index 28cd4f9fb0..1854a085ac 100644 --- a/testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/User.java +++ b/testing-modules/spring-testing/src/main/java/com/baeldung/mockito/repository/User.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.repository; +package com.baeldung.mockito.repository; import javax.persistence.Entity; import javax.persistence.GeneratedValue; diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/UserRepository.java b/testing-modules/spring-testing/src/main/java/com/baeldung/mockito/repository/UserRepository.java similarity index 84% rename from testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/UserRepository.java rename to testing-modules/spring-testing/src/main/java/com/baeldung/mockito/repository/UserRepository.java index 3f1952a5e7..fd5bd55c84 100644 --- a/testing-modules/spring-testing/src/main/java/org/baeldung/mockito/repository/UserRepository.java +++ b/testing-modules/spring-testing/src/main/java/com/baeldung/mockito/repository/UserRepository.java @@ -1,4 +1,4 @@ -package org.baeldung.mockito.repository; +package com.baeldung.mockito.repository; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/Employee.java b/testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/Employee.java similarity index 87% rename from testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/Employee.java rename to testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/Employee.java index 8d4eeb57c4..d542f9c234 100644 --- a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/Employee.java +++ b/testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/Employee.java @@ -1,4 +1,4 @@ -package org.baeldung.reflectiontestutils.repository; +package com.baeldung.reflectiontestutils.repository; public class Employee { private Integer id; diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/EmployeeService.java b/testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/EmployeeService.java similarity index 87% rename from testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/EmployeeService.java rename to testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/EmployeeService.java index d28745e2ab..9feae7ae30 100644 --- a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/EmployeeService.java +++ b/testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/EmployeeService.java @@ -1,4 +1,4 @@ -package org.baeldung.reflectiontestutils.repository; +package com.baeldung.reflectiontestutils.repository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/HRService.java b/testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/HRService.java similarity index 77% rename from testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/HRService.java rename to testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/HRService.java index 13a5973ee8..bb2c34d82f 100644 --- a/testing-modules/spring-testing/src/main/java/org/baeldung/reflectiontestutils/repository/HRService.java +++ b/testing-modules/spring-testing/src/main/java/com/baeldung/reflectiontestutils/repository/HRService.java @@ -1,4 +1,4 @@ -package org.baeldung.reflectiontestutils.repository; +package com.baeldung.reflectiontestutils.repository; import org.springframework.stereotype.Component; diff --git a/testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java b/testing-modules/spring-testing/src/test/java/com/baeldung/mockito/MockAnnotationUnitTest.java similarity index 92% rename from testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java rename to testing-modules/spring-testing/src/test/java/com/baeldung/mockito/MockAnnotationUnitTest.java index 1fa7f241e7..424a622b65 100644 --- a/testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockAnnotationUnitTest.java +++ b/testing-modules/spring-testing/src/test/java/com/baeldung/mockito/MockAnnotationUnitTest.java @@ -1,6 +1,6 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; -import org.baeldung.mockito.repository.UserRepository; +import com.baeldung.mockito.repository.UserRepository; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java b/testing-modules/spring-testing/src/test/java/com/baeldung/mockito/MockBeanAnnotationIntegrationTest.java similarity index 91% rename from testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java rename to testing-modules/spring-testing/src/test/java/com/baeldung/mockito/MockBeanAnnotationIntegrationTest.java index 3a7e58fb48..b7617ef652 100644 --- a/testing-modules/spring-testing/src/test/java/org/baeldung/mockito/MockBeanAnnotationIntegrationTest.java +++ b/testing-modules/spring-testing/src/test/java/com/baeldung/mockito/MockBeanAnnotationIntegrationTest.java @@ -1,6 +1,6 @@ -package org.baeldung.mockito; +package com.baeldung.mockito; -import org.baeldung.mockito.repository.UserRepository; +import com.baeldung.mockito.repository.UserRepository; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/testing-modules/spring-testing/src/test/java/org/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java b/testing-modules/spring-testing/src/test/java/com/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java similarity index 87% rename from testing-modules/spring-testing/src/test/java/org/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java rename to testing-modules/spring-testing/src/test/java/com/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java index 36e5428b58..33d4db22f3 100644 --- a/testing-modules/spring-testing/src/test/java/org/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java +++ b/testing-modules/spring-testing/src/test/java/com/baeldung/reflectiontestutils/ReflectionTestUtilsUnitTest.java @@ -1,11 +1,11 @@ -package org.baeldung.reflectiontestutils; +package com.baeldung.reflectiontestutils; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; -import org.baeldung.reflectiontestutils.repository.Employee; -import org.baeldung.reflectiontestutils.repository.EmployeeService; -import org.baeldung.reflectiontestutils.repository.HRService; +import com.baeldung.reflectiontestutils.repository.EmployeeService; +import com.baeldung.reflectiontestutils.repository.HRService; +import com.baeldung.reflectiontestutils.repository.Employee; import org.junit.Test; import org.springframework.test.util.ReflectionTestUtils; diff --git a/testing-modules/test-containers/pom.xml b/testing-modules/test-containers/pom.xml index bd87cb5b22..e83d3aff32 100644 --- a/testing-modules/test-containers/pom.xml +++ b/testing-modules/test-containers/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 @@ -28,7 +28,7 @@ junit-platform-commons ${junit.platform.version} test - + org.junit.vintage junit-vintage-engine @@ -47,12 +47,12 @@ org.testcontainers - postgresql + postgresql ${testcontainers.version} org.testcontainers - selenium + selenium ${testcontainers.version} @@ -69,7 +69,7 @@ org.seleniumhq.selenium selenium-chrome-driver ${selenium-remote-driver.version} - + diff --git a/testing-modules/testing-libraries/pom.xml b/testing-modules/testing-libraries/pom.xml index 844fcb3e53..53b58cee17 100644 --- a/testing-modules/testing-libraries/pom.xml +++ b/testing-modules/testing-libraries/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 testing-libraries testing-libraries @@ -29,7 +29,7 @@ ${cucumber.version} test - + io.cucumber cucumber-java8 @@ -92,5 +92,4 @@ 3.0.0 - diff --git a/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumber/books/BookStore.java b/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumber/books/BookStore.java index e5a3ceab3e..da9b711a16 100644 --- a/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumber/books/BookStore.java +++ b/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumber/books/BookStore.java @@ -1,13 +1,9 @@ package com.baeldung.cucumber.books; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; public class BookStore { - private List books = new ArrayList<>(); public void addBook(Book book) { @@ -20,7 +16,7 @@ public class BookStore { public List booksByAuthor(String author) { return books.stream() - .filter(book -> Objects.equals(author, book.getAuthor())) - .collect(Collectors.toList()); + .filter(book -> Objects.equals(author, book.getAuthor())) + .collect(Collectors.toList()); } } diff --git a/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumberbackground/books/Book.java b/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumberbackground/books/Book.java new file mode 100644 index 0000000000..5fd1e680a0 --- /dev/null +++ b/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumberbackground/books/Book.java @@ -0,0 +1,35 @@ +package com.baeldung.cucumberbackground.books; + +public class Book { + + private String title; + private String author; + + public Book(String title, String author) { + this.title = title; + this.author = author; + } + + public Book() {} + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + @Override + public String toString() { + return "Book [title=" + title + ", author=" + author + "]"; + } +} diff --git a/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumberbackground/books/BookStore.java b/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumberbackground/books/BookStore.java new file mode 100644 index 0000000000..f22eecb5f3 --- /dev/null +++ b/testing-modules/testing-libraries/src/main/java/com/baeldung/cucumberbackground/books/BookStore.java @@ -0,0 +1,28 @@ +package com.baeldung.cucumberbackground.books; + +import java.util.*; +import java.util.stream.Collectors; + +public class BookStore { + private List books = new ArrayList<>(); + + public void addBook(Book book) { + books.add(book); + } + + public void addAllBooks(Collection books) { + this.books.addAll(books); + } + + public List booksByAuthor(String author) { + return books.stream() + .filter(book -> Objects.equals(author, book.getAuthor())) + .collect(Collectors.toList()); + } + + public Optional bookByTitle(String title) { + return books.stream() + .filter(book -> book.getTitle().equals(title)) + .findFirst(); + } +} diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumber/books/BookStoreRunSteps.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumber/books/BookStoreRunSteps.java index e0944d3dd4..a0c759ab26 100644 --- a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumber/books/BookStoreRunSteps.java +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumber/books/BookStoreRunSteps.java @@ -1,7 +1,5 @@ package com.baeldung.cucumber.books; -import static org.junit.Assert.assertEquals; - import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -12,10 +10,12 @@ import io.cucumber.java.en.Then; import io.cucumber.java.en.When; import io.cucumber.datatable.DataTable; -public class BookStoreRunSteps { +import static org.junit.Assert.*; +public class BookStoreRunSteps { private BookStore store; private List foundBooks; + private Book foundBook; @Before public void setUp() { @@ -23,19 +23,22 @@ public class BookStoreRunSteps { foundBooks = new ArrayList<>(); } + @Given("^I have the following books in the store$") + public void haveBooksInTheStore(DataTable table) { + haveBooksInTheStoreByList(table); + } + @Given("^I have the following books in the store by list$") public void haveBooksInTheStoreByList(DataTable table) { - List> rows = table.asLists(String.class); - + for (List columns: rows) { store.addBook(new Book(columns.get(0), columns.get(1))); } } - + @Given("^I have the following books in the store by map$") public void haveBooksInTheStoreByMap(DataTable table) { - List> rows = table.asMaps(String.class, String.class); for (Map columns: rows) { @@ -52,9 +55,19 @@ public class BookStoreRunSteps { public void searchForBooksByAuthor(String author) { foundBooks = store.booksByAuthor(author); } - + @Then("^I find (\\d+) books$") public void findBooks(int count) { assertEquals(count, foundBooks.size()); } + + @Then("^I find a book$") + public void findABook() { + assertNotNull(foundBook); + } + + @Then("^I find no book$") + public void findNoBook() { + assertNull(foundBook); + } } diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreRunSteps.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreRunSteps.java new file mode 100644 index 0000000000..981fe41f11 --- /dev/null +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreRunSteps.java @@ -0,0 +1,58 @@ +package com.baeldung.cucumberbackground.books; + +import io.cucumber.datatable.DataTable; +import io.cucumber.java.Before; +import io.cucumber.java.en.Given; +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.*; + +public class BookStoreRunSteps { + private BookStore store; + private List foundBooks; + private Book foundBook; + + @Before + public void setUp() { + store = new BookStore(); + foundBooks = new ArrayList<>(); + } + + @Given("^I have the following books in the store$") + public void haveBooksInTheStore(DataTable table) { + List> rows = table.asLists(String.class); + + for (List columns: rows) { + store.addBook(new Book(columns.get(0), columns.get(1))); + } + } + + @When("^I search for books by author (.+)$") + public void searchForBooksByAuthor(String author) { + foundBooks = store.booksByAuthor(author); + } + + @When("^I search for a book titled (.+)$") + public void searchForBookByTitle(String title) { + foundBook = store.bookByTitle(title).orElse(null); + } + + @Then("^I find (\\d+) books$") + public void findBooks(int count) { + assertEquals(count, foundBooks.size()); + } + + @Then("^I find a book$") + public void findABook() { + assertNotNull(foundBook); + } + + @Then("^I find no book$") + public void findNoBook() { + assertNull(foundBook); + } +} diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreWithBackgroundIntegrationTest.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreWithBackgroundIntegrationTest.java new file mode 100644 index 0000000000..528ccbc882 --- /dev/null +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreWithBackgroundIntegrationTest.java @@ -0,0 +1,12 @@ +package com.baeldung.cucumberbackground.books; + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.junit.runner.RunWith; + +@RunWith(Cucumber.class) +@CucumberOptions(features = "classpath:features/book-store-with-background.feature") +public class BookStoreWithBackgroundIntegrationTest { + +} + diff --git a/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreWithoutBackgroundIntegrationTest.java b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreWithoutBackgroundIntegrationTest.java new file mode 100644 index 0000000000..6343a52cdc --- /dev/null +++ b/testing-modules/testing-libraries/src/test/java/com/baeldung/cucumberbackground/books/BookStoreWithoutBackgroundIntegrationTest.java @@ -0,0 +1,12 @@ +package com.baeldung.cucumberbackground.books; + +import io.cucumber.junit.Cucumber; +import io.cucumber.junit.CucumberOptions; +import org.junit.runner.RunWith; + +@RunWith(Cucumber.class) +@CucumberOptions(features = "classpath:features/book-store-without-background.feature") +public class BookStoreWithoutBackgroundIntegrationTest { + +} + diff --git a/testing-modules/testing-libraries/src/test/resources/features/book-store-with-background.feature b/testing-modules/testing-libraries/src/test/resources/features/book-store-with-background.feature new file mode 100644 index 0000000000..61bcdc5c50 --- /dev/null +++ b/testing-modules/testing-libraries/src/test/resources/features/book-store-with-background.feature @@ -0,0 +1,22 @@ +Feature: Book Store With Background + Background: The Book Store + Given I have the following books in the store + | The Devil in the White City | Erik Larson | + | The Lion, the Witch and the Wardrobe | C.S. Lewis | + | In the Garden of Beasts | Erik Larson | + + Scenario: Find books by author + When I search for books by author Erik Larson + Then I find 2 books + + Scenario: Find books by author, but isn't there + When I search for books by author Marcel Proust + Then I find 0 books + + Scenario: Find book by title + When I search for a book titled The Lion, the Witch and the Wardrobe + Then I find a book + + Scenario: Find book by title, but isn't there + When I search for a book titled Swann's Way + Then I find no book \ No newline at end of file diff --git a/testing-modules/testing-libraries/src/test/resources/features/book-store-without-background.feature b/testing-modules/testing-libraries/src/test/resources/features/book-store-without-background.feature new file mode 100644 index 0000000000..771c585127 --- /dev/null +++ b/testing-modules/testing-libraries/src/test/resources/features/book-store-without-background.feature @@ -0,0 +1,32 @@ +Feature: Book Store Without Background + Scenario: Find books by author + Given I have the following books in the store + | The Devil in the White City | Erik Larson | + | The Lion, the Witch and the Wardrobe | C.S. Lewis | + | In the Garden of Beasts | Erik Larson | + When I search for books by author Erik Larson + Then I find 2 books + + Scenario: Find books by author, but isn't there + Given I have the following books in the store + | The Devil in the White City | Erik Larson | + | The Lion, the Witch and the Wardrobe | C.S. Lewis | + | In the Garden of Beasts | Erik Larson | + When I search for books by author Marcel Proust + Then I find 0 books + + Scenario: Find book by title + Given I have the following books in the store + | The Devil in the White City | Erik Larson | + | The Lion, the Witch and the Wardrobe | C.S. Lewis | + | In the Garden of Beasts | Erik Larson | + When I search for a book titled The Lion, the Witch and the Wardrobe + Then I find a book + + Scenario: Find book by title, but isn't there + Given I have the following books in the store + | The Devil in the White City | Erik Larson | + | The Lion, the Witch and the Wardrobe | C.S. Lewis | + | In the Garden of Beasts | Erik Larson | + When I search for a book titled Swann's Way + Then I find no book \ No newline at end of file diff --git a/testing-modules/testng/pom.xml b/testing-modules/testng/pom.xml index 5d0c9f126b..601b152144 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/testing-modules/xmlunit-2/pom.xml b/testing-modules/xmlunit-2/pom.xml index aa516bfcc5..5689e680e6 100644 --- a/testing-modules/xmlunit-2/pom.xml +++ b/testing-modules/xmlunit-2/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 xmlunit-2 - xmlunit-2 + xmlunit-2 com.baeldung diff --git a/twilio/pom.xml b/twilio/pom.xml index 266ac45c92..76ad5faafb 100644 --- a/twilio/pom.xml +++ b/twilio/pom.xml @@ -1,16 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 twilio 1.0-SNAPSHOT - twilio - - - parent-modules - com.baeldung - 1.0.0-SNAPSHOT - + twilio + + + com.baeldung + parent-modules + 1.0.0-SNAPSHOT + diff --git a/twitter4j/pom.xml b/twitter4j/pom.xml index b82b9f6778..6d98e2fe58 100644 --- a/twitter4j/pom.xml +++ b/twitter4j/pom.xml @@ -1,5 +1,6 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 Twitter4J Twitter4J diff --git a/undertow/pom.xml b/undertow/pom.xml index 1c2cc3aa36..bed9c905c2 100644 --- a/undertow/pom.xml +++ b/undertow/pom.xml @@ -1,5 +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.undertow undertow diff --git a/vaadin/pom.xml b/vaadin/pom.xml index 0cc6cd5757..9de1bec6e2 100644 --- a/vaadin/pom.xml +++ b/vaadin/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.test vaadin @@ -9,12 +9,12 @@ war - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 - + @@ -26,7 +26,7 @@ - + javax.servlet diff --git a/vavr/pom.xml b/vavr/pom.xml index a2c6e29cde..16097af848 100644 --- a/vavr/pom.xml +++ b/vavr/pom.xml @@ -1,14 +1,14 @@ + + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - com.baeldung vavr 1.0 vavr - parent-boot-2 com.baeldung + parent-boot-2 0.0.1-SNAPSHOT ../parent-boot-2 diff --git a/vertx-and-rxjava/pom.xml b/vertx-and-rxjava/pom.xml index 389eaf687b..20b022a773 100644 --- a/vertx-and-rxjava/pom.xml +++ b/vertx-and-rxjava/pom.xml @@ -1,10 +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 vertx-and-rxjava - vertx-and-rxjava - + vertx-and-rxjava + com.baeldung parent-modules diff --git a/vertx/pom.xml b/vertx/pom.xml index c566681073..81ede1ba0b 100644 --- a/vertx/pom.xml +++ b/vertx/pom.xml @@ -1,8 +1,7 @@ - + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 - com.baeldung vertx 1.0-SNAPSHOT vertx @@ -54,7 +53,7 @@ - + ${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 200ca7577f..f396baf80b 100644 --- a/video-tutorials/jackson-annotations/pom.xml +++ b/video-tutorials/jackson-annotations/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"> 4.0.0 - com.baeldung jackson-annotations 1.0.0-SNAPSHOT jackson-annotations @@ -147,7 +147,6 @@ 3.6.1 2.2.6 3.0.1 - \ No newline at end of file diff --git a/video-tutorials/pom.xml b/video-tutorials/pom.xml index a798f77863..53ff0c6d89 100644 --- a/video-tutorials/pom.xml +++ b/video-tutorials/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"> 4.0.0 - com.baeldung video-tutorials 1.0.0-SNAPSHOT video-tutorials diff --git a/vraptor/pom.xml b/vraptor/pom.xml index 3904eb8c63..9956305e98 100644 --- a/vraptor/pom.xml +++ b/vraptor/pom.xml @@ -1,10 +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 vraptor 1.0.0 - vraptor + vraptor war A demo project to start using VRaptor 4 diff --git a/webrtc/pom.xml b/webrtc/pom.xml new file mode 100644 index 0000000000..2a3b48b2ed --- /dev/null +++ b/webrtc/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + webrtc + 0.0.1 + + + parent-boot-2 + com.baeldung + 0.0.1-SNAPSHOT + ../parent-boot-2 + + + + + org.springframework.boot + spring-boot-starter-websocket + + + + + 1.8 + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/webrtc/src/main/java/com/baeldung/webrtc/SocketHandler.java b/webrtc/src/main/java/com/baeldung/webrtc/SocketHandler.java new file mode 100644 index 0000000000..bffd57f6cf --- /dev/null +++ b/webrtc/src/main/java/com/baeldung/webrtc/SocketHandler.java @@ -0,0 +1,31 @@ +package com.baeldung.webrtc; + +import org.springframework.stereotype.Component; +import org.springframework.web.socket.TextMessage; +import org.springframework.web.socket.WebSocketSession; +import org.springframework.web.socket.handler.TextWebSocketHandler; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +@Component +public class SocketHandler extends TextWebSocketHandler { + + List sessions = new CopyOnWriteArrayList<>(); + + @Override + public void handleTextMessage(WebSocketSession session, TextMessage message) throws InterruptedException, IOException { + + for (WebSocketSession webSocketSession : sessions) { + if (webSocketSession.isOpen() && !session.getId().equals(webSocketSession.getId())) { + webSocketSession.sendMessage(message); + } + } + } + + @Override + public void afterConnectionEstablished(WebSocketSession session) throws Exception { + sessions.add(session); + } +} \ No newline at end of file diff --git a/webrtc/src/main/java/com/baeldung/webrtc/WebRTCDemoApplication.java b/webrtc/src/main/java/com/baeldung/webrtc/WebRTCDemoApplication.java new file mode 100644 index 0000000000..f54946547d --- /dev/null +++ b/webrtc/src/main/java/com/baeldung/webrtc/WebRTCDemoApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.webrtc; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class WebRTCDemoApplication { + + public static void main(String[] args) { + SpringApplication.run(WebRTCDemoApplication.class, args); + } +} diff --git a/webrtc/src/main/java/com/baeldung/webrtc/WebSocketConfiguration.java b/webrtc/src/main/java/com/baeldung/webrtc/WebSocketConfiguration.java new file mode 100644 index 0000000000..9deb395dad --- /dev/null +++ b/webrtc/src/main/java/com/baeldung/webrtc/WebSocketConfiguration.java @@ -0,0 +1,17 @@ +package com.baeldung.webrtc; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.config.annotation.EnableWebSocket; +import org.springframework.web.socket.config.annotation.WebSocketConfigurer; +import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry; + +@Configuration +@EnableWebSocket +public class WebSocketConfiguration implements WebSocketConfigurer { + + @Override + public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { + registry.addHandler(new SocketHandler(), "/socket") + .setAllowedOrigins("*"); + } +} diff --git a/webrtc/src/main/resources/application.properties b/webrtc/src/main/resources/application.properties new file mode 100644 index 0000000000..e69de29bb2 diff --git a/webrtc/src/main/resources/static/client.js b/webrtc/src/main/resources/static/client.js new file mode 100644 index 0000000000..059dc84bcb --- /dev/null +++ b/webrtc/src/main/resources/static/client.js @@ -0,0 +1,116 @@ +//connecting to our signaling server +var conn = new WebSocket('ws://localhost:8080/socket'); + +conn.onopen = function() { + console.log("Connected to the signaling server"); + initialize(); +}; + +conn.onmessage = function(msg) { + console.log("Got message", msg.data); + var content = JSON.parse(msg.data); + var data = content.data; + switch (content.event) { + // when somebody wants to call us + case "offer": + handleOffer(data); + break; + case "answer": + handleAnswer(data); + break; + // when a remote peer sends an ice candidate to us + case "candidate": + handleCandidate(data); + break; + default: + break; + } +}; + +function send(message) { + conn.send(JSON.stringify(message)); +} + +var peerConnection; +var dataChannel; +var input = document.getElementById("messageInput"); + +function initialize() { + var configuration = null; + + peerConnection = new RTCPeerConnection(configuration, { + optional : [ { + RtpDataChannels : true + } ] + }); + + // Setup ice handling + peerConnection.onicecandidate = function(event) { + if (event.candidate) { + send({ + event : "candidate", + data : event.candidate + }); + } + }; + + // creating data channel + dataChannel = peerConnection.createDataChannel("dataChannel", { + reliable : true + }); + + dataChannel.onerror = function(error) { + console.log("Error occured on datachannel:", error); + }; + + // when we receive a message from the other peer, printing it on the console + dataChannel.onmessage = function(event) { + console.log("message:", event.data); + }; + + dataChannel.onclose = function() { + console.log("data channel is closed"); + }; +} + +function createOffer() { + peerConnection.createOffer(function(offer) { + send({ + event : "offer", + data : offer + }); + peerConnection.setLocalDescription(offer); + }, function(error) { + alert("Error creating an offer"); + }); +} + +function handleOffer(offer) { + peerConnection.setRemoteDescription(new RTCSessionDescription(offer)); + + // create and send an answer to an offer + peerConnection.createAnswer(function(answer) { + peerConnection.setLocalDescription(answer); + send({ + event : "answer", + data : answer + }); + }, function(error) { + alert("Error creating an answer"); + }); + +}; + +function handleCandidate(candidate) { + peerConnection.addIceCandidate(new RTCIceCandidate(candidate)); +}; + +function handleAnswer(answer) { + peerConnection.setRemoteDescription(new RTCSessionDescription(answer)); + console.log("connection established successfully!!"); +}; + +function sendMessage() { + dataChannel.send(input.value); + input.value = ""; +} diff --git a/webrtc/src/main/resources/static/index.html b/webrtc/src/main/resources/static/index.html new file mode 100644 index 0000000000..39a86ec61e --- /dev/null +++ b/webrtc/src/main/resources/static/index.html @@ -0,0 +1,67 @@ + + + +WebRTC demo + + + + + + + + + + +
+

A Demo for messaging in WebRTC

+ +

+ Run two instances of this webpage along with the server to test this + application.
Create an offer, and then send the message.
Check + the browser console to see the output. +

+ + + + + + + + +
+ + + + + diff --git a/wicket/pom.xml b/wicket/pom.xml index c7e6bc20de..5175eca59c 100644 --- a/wicket/pom.xml +++ b/wicket/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.wicket.examples wicket @@ -30,7 +30,7 @@ test
- + diff --git a/wildfly/pom.xml b/wildfly/pom.xml index d7dd1e835b..e81b609206 100644 --- a/wildfly/pom.xml +++ b/wildfly/pom.xml @@ -1,13 +1,11 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.springframework wildfly 0.1.0 wildfly - war @@ -47,10 +45,6 @@
- - 1.8 - - @@ -78,4 +72,9 @@ + + + 1.8 + +
diff --git a/xml/pom.xml b/xml/pom.xml index bbd607f9b5..eb2d567957 100644 --- a/xml/pom.xml +++ b/xml/pom.xml @@ -1,3 +1,4 @@ + @@ -137,68 +138,68 @@ - - xml - - - src/main/resources - true - - - - - - org.jibx - maven-jibx-plugin - - - - - - org.jibx - maven-jibx-plugin - ${maven-jibx-plugin.version} - - src/main/resources - - *-binding.xml - - - template-binding.xml - - src/main/resources - - *-binding.xml - - true - - - - process-classes - process-classes - - bind - - - - process-test-classes - process-test-classes - - test-bind - - - - - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - - maven-surefire-plugin - ${maven-surefire-plugin.version} - - - + + xml + + + src/main/resources + true + + + + + + org.jibx + maven-jibx-plugin + + + + + + org.jibx + maven-jibx-plugin + ${maven-jibx-plugin.version} + + src/main/resources + + *-binding.xml + + + template-binding.xml + + src/main/resources + + *-binding.xml + + true + + + + process-classes + process-classes + + bind + + + + process-test-classes + process-test-classes + + test-bind + + + + + + maven-compiler-plugin + ${maven-compiler-plugin.version} + + + maven-surefire-plugin + ${maven-surefire-plugin.version} + + + diff --git a/xstream/pom.xml b/xstream/pom.xml index b98e258599..a703aa3774 100644 --- a/xstream/pom.xml +++ b/xstream/pom.xml @@ -1,5 +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 xstream @@ -25,7 +26,6 @@ jettison ${jettison.version} -