Merge remote-tracking branch 'origin/master'
This commit is contained in:
+11
-1
@@ -69,6 +69,7 @@ jmeter/src/main/resources/*-Basic*.csv
|
||||
jmeter/src/main/resources/*-JMeter*.csv
|
||||
jmeter/src/main/resources/*ReportsDashboard*.csv
|
||||
jmeter/src/main/resources/dashboard/*ReportsDashboard*.csv
|
||||
jmeter/src/main/resources/*FileExtractionExample.csv
|
||||
|
||||
ninja/devDb.mv.db
|
||||
|
||||
@@ -88,6 +89,7 @@ spring-soap/src/main/java/com/baeldung/springsoap/gen/
|
||||
/report-*.json
|
||||
transaction.log
|
||||
*-shell.log
|
||||
customers.xml
|
||||
|
||||
apache-cxf/cxf-aegis/baeldung.xml
|
||||
testing-modules/report-*.json
|
||||
@@ -102,6 +104,7 @@ spring-boot-modules/spring-boot-react/frontend/build
|
||||
spring-boot-modules/spring-boot-react/frontend/node
|
||||
spring-boot-modules/spring-boot-react/frontend/yarn.lock
|
||||
spring-boot-modules/spring-boot-properties-3/*.log
|
||||
spring-boot-modules/spring-boot-properties-3/*.gz
|
||||
|
||||
# SDKMan
|
||||
.sdkmanrc
|
||||
@@ -109,5 +112,12 @@ spring-boot-modules/spring-boot-properties-3/*.log
|
||||
# Localstack
|
||||
**/.localstack
|
||||
|
||||
#libraries-2
|
||||
libraries-2/employee*
|
||||
libraries-2/src/test/resources/crawler4j/**
|
||||
|
||||
#web-modules/ninja
|
||||
devDb*.db
|
||||
devDb*.db
|
||||
|
||||
#jaxb
|
||||
*.xjb
|
||||
@@ -74,6 +74,10 @@ Building a single module
|
||||
====================
|
||||
To build a specific module, run the command: `mvn clean install` in the module directory.
|
||||
|
||||
It can happen that your module is part of a parent module e.g. `parent-boot-1`,`parent-spring-5` etc, then you will need to build the parent module first so that you can build your module.
|
||||
We have created a `parents` profile that you can use to build just the parent modules, just run the profile as:
|
||||
`mvn clean install -Pparents`
|
||||
|
||||
|
||||
Building modules from the root of the repository
|
||||
====================
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<properties>
|
||||
<akka.http.version>10.0.11</akka.http.version>
|
||||
<akka.stream.version>2.5.11</akka.stream.version>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</dependencyManagement>
|
||||
|
||||
<properties>
|
||||
<spring.version>4.3.4.RELEASE</spring.version>
|
||||
<spring.version>5.3.25</spring.version>
|
||||
<akka.version>2.4.14</akka.version>
|
||||
</properties>
|
||||
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package com.baeldung.algorithms.checktargetsum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class CheckTargetSum {
|
||||
public boolean isTargetSumExistNaive(int[] nums, int target) {
|
||||
for (int i = 0; i < nums.length; i++) {
|
||||
for (int j = i + 1; j < nums.length; j++) {
|
||||
if (nums[i] + nums[j] == target) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isTargetSumExistSorted(int[] nums, int target) {
|
||||
Arrays.sort(nums);
|
||||
|
||||
int start = 0;
|
||||
int end = nums.length - 1;
|
||||
|
||||
while (start < end) {
|
||||
int sum = nums[start] + nums[end];
|
||||
|
||||
if (sum == target) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sum < target) {
|
||||
start++;
|
||||
} else {
|
||||
end--;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isTargetSumExistHashSet(int[] nums, int target) {
|
||||
Set<Integer> hashSet = new HashSet<>();
|
||||
|
||||
for (int num : nums) {
|
||||
int diff = target - num;
|
||||
|
||||
if (hashSet.contains(diff)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
hashSet.add(num);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.baeldung.algorithms.checktargetsum;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class CheckTargetSumUnitTest {
|
||||
private CheckTargetSum checkTargetSum = new CheckTargetSum();
|
||||
|
||||
private int[] nums = new int[] { 10, 5, 15, 7, 14, 1, 9 };
|
||||
|
||||
private int existingTarget = 6;
|
||||
|
||||
private int nonExistingTarget = 27;
|
||||
|
||||
@Test
|
||||
public void givenArrayOfIntegers_whenTargetSumNaive_thenPairExists() {
|
||||
assertTrue(checkTargetSum.isTargetSumExistNaive(nums, existingTarget));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenArrayOfIntegers_whenTargetSumNaive_thenPairDoesNotExists() {
|
||||
assertFalse(checkTargetSum.isTargetSumExistNaive(nums, nonExistingTarget));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenArrayOfIntegers_whenTargetSumSorted_thenPairExists() {
|
||||
assertTrue(checkTargetSum.isTargetSumExistNaive(nums, existingTarget));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenArrayOfIntegers_whenTargetSumSorted_thenPairDoesNotExists() {
|
||||
assertFalse(checkTargetSum.isTargetSumExistNaive(nums, nonExistingTarget));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenArrayOfIntegers_whenTargetSumHashSet_thenPairExists() {
|
||||
assertTrue(checkTargetSum.isTargetSumExistNaive(nums, existingTarget));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenArrayOfIntegers_whenTargetSumHashSet_thenPairDoesNotExists() {
|
||||
assertFalse(checkTargetSum.isTargetSumExistNaive(nums, nonExistingTarget));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
### Relevant Articles:
|
||||
|
||||
- [Algorithm to Identify and Validate a Credit Card Number](https://www.baeldung.com/java-validate-cc-number)
|
||||
- [Find the N Most Frequent Elements in a Java Array](https://www.baeldung.com/java-n-most-frequent-elements-array)
|
||||
- [Getting Pixel Array From Image in Java](https://www.baeldung.com/java-getting-pixel-array-from-image)
|
||||
- More articles: [[<-- prev]](/algorithms-miscellaneous-6)
|
||||
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package com.baeldung.algorithms.frequentelements;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class MostFrequentElementsFinder {
|
||||
|
||||
public static List<Integer> findByHashMapAndPriorityQueue(Integer[] array, int n) {
|
||||
Map<Integer, Integer> countMap = new HashMap<>();
|
||||
|
||||
// For each element i in the array, add it to the countMap and increment its count.
|
||||
for (Integer i : array) {
|
||||
countMap.put(i, countMap.getOrDefault(i, 0) + 1);
|
||||
}
|
||||
|
||||
// Create a max heap (priority queue) that will prioritize elements with higher counts.
|
||||
PriorityQueue<Integer> heap = new PriorityQueue<>(
|
||||
(a, b) -> countMap.get(b) - countMap.get(a));
|
||||
|
||||
// Add all the unique elements in the array to the heap.
|
||||
heap.addAll(countMap.keySet());
|
||||
|
||||
List<Integer> result = new ArrayList<>();
|
||||
for (int i = 0; i < n && !heap.isEmpty(); i++) {
|
||||
// Poll the highest-count element from the heap and add it to the result list.
|
||||
result.add(heap.poll());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<Integer> findByStream(Integer[] arr, int n) {
|
||||
return Arrays.stream(arr).collect(Collectors.groupingBy(i -> i, Collectors.counting()))
|
||||
.entrySet().stream()
|
||||
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
|
||||
.map(Map.Entry::getKey)
|
||||
.limit(n)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static List<Integer> findByTreeMap(Integer[] arr, int n) {
|
||||
// Create a TreeMap and use a reverse order comparator to sort the entries by frequency in descending order
|
||||
Map<Integer, Integer> countMap = new TreeMap<>(Collections.reverseOrder());
|
||||
|
||||
for (int i : arr) {
|
||||
countMap.put(i, countMap.getOrDefault(i, 0) + 1);
|
||||
}
|
||||
|
||||
// Create a list of the map entries and sort them by value (i.e. by frequency) in descending order
|
||||
List<Map.Entry<Integer, Integer>> sortedEntries = new ArrayList<>(countMap.entrySet());
|
||||
sortedEntries.sort((e1, e2) -> e2.getValue().compareTo(e1.getValue()));
|
||||
|
||||
// Extract the n most frequent elements from the sorted list of entries
|
||||
List<Integer> result = new ArrayList<>();
|
||||
for (int i = 0; i < n && i < sortedEntries.size(); i++) {
|
||||
result.add(sortedEntries.get(i).getKey());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<Integer> findByBucketSort(Integer[] arr, int n) {
|
||||
List<Integer> result = new ArrayList<>();
|
||||
Map<Integer, Integer> freqMap = new HashMap<>();
|
||||
List<Integer>[] bucket = new List[arr.length + 1];
|
||||
|
||||
// Loop through the input array and update the frequency count of each element in the HashMap
|
||||
for (int num : arr) {
|
||||
freqMap.put(num, freqMap.getOrDefault(num, 0) + 1);
|
||||
}
|
||||
|
||||
// Loop through the HashMap and add each element to its corresponding bucket based on its frequency count
|
||||
for (int num : freqMap.keySet()) {
|
||||
int freq = freqMap.get(num);
|
||||
if (bucket[freq] == null) {
|
||||
bucket[freq] = new ArrayList<>();
|
||||
}
|
||||
bucket[freq].add(num);
|
||||
}
|
||||
|
||||
// Loop through the bucket array in reverse order and add the elements to the result list
|
||||
// until we have found the n most frequent elements
|
||||
for (int i = bucket.length - 1; i >= 0 && result.size() < n; i--) {
|
||||
if (bucket[i] != null) {
|
||||
result.addAll(bucket[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Return a sublist of the result list containing only the first n elements
|
||||
return result.subList(0, n);
|
||||
}
|
||||
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.baeldung.algorithms.pixelarray;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBufferByte;
|
||||
public class GetPixelArray {
|
||||
|
||||
public static int[][] get2DPixelArraySlow(BufferedImage sampleImage) {
|
||||
int width = sampleImage.getWidth();
|
||||
int height = sampleImage.getHeight();
|
||||
int[][] result = new int[height][width];
|
||||
|
||||
for (int row = 0; row < height; row++) {
|
||||
for (int col = 0; col < width; col++) {
|
||||
result[row][col] = sampleImage.getRGB(col, row);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int[][] get2DPixelArrayFast(BufferedImage image) {
|
||||
final byte[] pixelData = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
|
||||
final int width = image.getWidth();
|
||||
final int height = image.getHeight();
|
||||
final boolean hasAlphaChannel = image.getAlphaRaster() != null;
|
||||
|
||||
int[][] result = new int[height][width];
|
||||
if (hasAlphaChannel) {
|
||||
final int numberOfValues = 4;
|
||||
for (int valueIndex = 0, row = 0, col = 0; valueIndex + numberOfValues - 1 < pixelData.length; valueIndex += numberOfValues) {
|
||||
// Getting the values for each pixel from the pixelData array.
|
||||
int argb = 0;
|
||||
argb += (((int) pixelData[valueIndex] & 0xff) << 24); // alpha value
|
||||
argb += ((int) pixelData[valueIndex + 1] & 0xff); // blue value
|
||||
argb += (((int) pixelData[valueIndex + 2] & 0xff) << 8); // green value
|
||||
argb += (((int) pixelData[valueIndex + 3] & 0xff) << 16); // red value
|
||||
result[row][col] = argb;
|
||||
|
||||
col++;
|
||||
if (col == width) {
|
||||
col = 0;
|
||||
row++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final int numberOfValues = 3;
|
||||
for (int valueIndex = 0, row = 0, col = 0; valueIndex + numberOfValues - 1 < pixelData.length; valueIndex += numberOfValues) {
|
||||
int argb = 0;
|
||||
argb += -16777216; // 255 alpha value (fully opaque)
|
||||
argb += ((int) pixelData[valueIndex] & 0xff); // blue value
|
||||
argb += (((int) pixelData[valueIndex + 1] & 0xff) << 8); // green value
|
||||
argb += (((int) pixelData[valueIndex + 2] & 0xff) << 16); // red value
|
||||
result[row][col] = argb;
|
||||
|
||||
col++;
|
||||
if (col == width) {
|
||||
col = 0;
|
||||
row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.baeldung.algorithms.frequentelements;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Java6Assertions.assertThat;
|
||||
|
||||
public class MostFrequentElementsUnitTest {
|
||||
|
||||
private final Integer[] inputArray = {1, 2, 3, 4, 5, 5, 5, 6, 6, 7, 7, 7, 7, 8, 9, 9, 9, 9, 9};
|
||||
private final int n = 3;
|
||||
private final Integer[] outputArray = {9, 7, 5};
|
||||
|
||||
@Test
|
||||
void givenIntegersArray_UseFindByHashMapAndPriorityQueueMethod_thenReturnMostFrequentElements() {
|
||||
assertThat(MostFrequentElementsFinder.findByHashMapAndPriorityQueue(inputArray, n)).containsExactly(outputArray);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenIntegersArray_UseFindByBucketSortMethod_thenReturnMostFrequentElements() {
|
||||
assertThat(MostFrequentElementsFinder.findByBucketSort(inputArray, n)).containsExactly(outputArray);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenIntegersArray_UseFindByStreamMethod_thenReturnMostFrequentElements() {
|
||||
assertThat(MostFrequentElementsFinder.findByStream(inputArray, n)).containsExactly(outputArray);
|
||||
}
|
||||
|
||||
@Test
|
||||
void givenIntegersArray_UseFindByTreeMapMethod_thenReturnMostFrequentElements() {
|
||||
assertThat(MostFrequentElementsFinder.findByTreeMap(inputArray, n)).containsExactly(outputArray);
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.baeldung.algorithms.pixelarray;
|
||||
|
||||
import static com.baeldung.algorithms.pixelarray.GetPixelArray.get2DPixelArrayFast;
|
||||
import static com.baeldung.algorithms.pixelarray.GetPixelArray.get2DPixelArraySlow;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class GetPixelArrayUnitTest {
|
||||
@Test
|
||||
public void givenImage_whenGetPixelArray_thenBothMethodsReturnEqualValues() {
|
||||
BufferedImage sampleImage = null;
|
||||
try {
|
||||
sampleImage = ImageIO.read(new File("src/main/resources/images/sampleImage.jpg"));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
int[][] firstResult = get2DPixelArraySlow(sampleImage);
|
||||
int[][] secondResult = get2DPixelArrayFast(sampleImage);
|
||||
|
||||
assertTrue(Arrays.deepEquals(firstResult, secondResult));
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,6 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<properties>
|
||||
<auto-service.version>1.0-rc2</auto-service.version>
|
||||
</properties>
|
||||
|
||||
@@ -20,4 +20,8 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<cxf.version>4.0.0</cxf.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -23,6 +23,16 @@
|
||||
<artifactId>cxf-rt-transports-http-jetty</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.ws</groupId>
|
||||
<artifactId>jakarta.xml.ws-api</artifactId>
|
||||
<version>${jakarta-xml.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.jws</groupId>
|
||||
<artifactId>jakarta.jws-api</artifactId>
|
||||
<version>${jakarta.jws.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -37,4 +47,10 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<cxf.version>4.0.0</cxf.version>
|
||||
<jakarta-xml.version>4.0.0</jakarta-xml.version>
|
||||
<jakarta.jws.version>3.0.0</jakarta.jws.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
+2
-2
@@ -2,8 +2,8 @@ package com.baeldung.cxf.introduction;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jws.WebService;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import jakarta.jws.WebService;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
@WebService
|
||||
public interface Baeldung {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.baeldung.cxf.introduction;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.jws.WebService;
|
||||
import jakarta.jws.WebService;
|
||||
|
||||
@WebService(endpointInterface = "com.baeldung.cxf.introduction.Baeldung")
|
||||
public class BaeldungImpl implements Baeldung {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.baeldung.cxf.introduction;
|
||||
|
||||
import javax.xml.ws.Endpoint;
|
||||
import jakarta.xml.ws.Endpoint;
|
||||
|
||||
public class Server {
|
||||
public static void main(String args[]) throws InterruptedException {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.baeldung.cxf.introduction;
|
||||
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
@XmlJavaTypeAdapter(StudentAdapter.class)
|
||||
public interface Student {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.baeldung.cxf.introduction;
|
||||
|
||||
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
|
||||
|
||||
public class StudentAdapter extends XmlAdapter<StudentImpl, Student> {
|
||||
public StudentImpl marshal(Student student) throws Exception {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.baeldung.cxf.introduction;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
@XmlType(name = "Student")
|
||||
public class StudentImpl implements Student {
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package com.baeldung.cxf.introduction;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import jakarta.xml.bind.annotation.XmlElement;
|
||||
import jakarta.xml.bind.annotation.XmlType;
|
||||
|
||||
@XmlType(name = "StudentMap")
|
||||
public class StudentMap {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package com.baeldung.cxf.introduction;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
|
||||
|
||||
public class StudentMapAdapter extends XmlAdapter<StudentMap, Map<Integer, Student>> {
|
||||
public StudentMap marshal(Map<Integer, Student> boundMap) throws Exception {
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ import static org.junit.Assert.assertEquals;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.ws.Service;
|
||||
import javax.xml.ws.soap.SOAPBinding;
|
||||
import jakarta.xml.ws.Service;
|
||||
import jakarta.xml.ws.soap.SOAPBinding;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -16,12 +16,28 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf</groupId>
|
||||
<artifactId>cxf-rt-transports-http-jetty</artifactId>
|
||||
<version>${cxf.version}</version>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.ws</groupId>
|
||||
<artifactId>jakarta.xml.ws-api</artifactId>
|
||||
<version>${jakarta-xml.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.jws</groupId>
|
||||
<artifactId>jakarta.jws-api</artifactId>
|
||||
<version>${jakarta-jws.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.platform</groupId>
|
||||
<artifactId>jakarta.jakartaee-web-api</artifactId>
|
||||
<version>${jakarta-platform.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
@@ -50,6 +66,9 @@
|
||||
|
||||
<properties>
|
||||
<httpclient.version>4.5.2</httpclient.version>
|
||||
<jakarta-xml.version>4.0.0</jakarta-xml.version>
|
||||
<jakarta-jws.version>3.0.0</jakarta-jws.version>
|
||||
<jakarta-platform.version>9.0.0</jakarta-platform.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package com.baeldung.cxf.jaxrs.implementation;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package com.baeldung.cxf.jaxrs.implementation;
|
||||
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Response;
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.baeldung.cxf.jaxrs.implementation;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@XmlRootElement(name = "Student")
|
||||
public class Student {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.xml.bind.JAXB;
|
||||
import jakarta.xml.bind.JAXB;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.HttpDelete;
|
||||
|
||||
@@ -40,10 +40,22 @@
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.ws</groupId>
|
||||
<artifactId>jaxws-ri</artifactId>
|
||||
<version>2.3.3</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>${javax.servlet-api.version}</version>
|
||||
<version>4.0.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -103,8 +115,9 @@
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
<spring.version>4.3.4.RELEASE</spring.version>
|
||||
<spring.version>5.3.25</spring.version>
|
||||
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
|
||||
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -23,6 +23,11 @@
|
||||
<artifactId>cxf-rt-rs-sse</artifactId>
|
||||
<version>${cxf-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.ws.rs</groupId>
|
||||
<artifactId>jakarta.ws.rs-api</artifactId>
|
||||
<version>${jakarta-ws.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -55,7 +60,8 @@
|
||||
</build>
|
||||
|
||||
<properties>
|
||||
<cxf-version>3.2.0</cxf-version>
|
||||
<cxf-version>4.0.0</cxf-version>
|
||||
<jakarta-ws.version>3.1.0</jakarta-ws.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user