Merge branch 'master' of https://github.com/eugenp/tutorials into BAEL-4883

This commit is contained in:
Nguyen Nam Thai 2021-08-07 01:30:19 +07:00
commit fa7fa84eba
197 changed files with 2173 additions and 535 deletions

View File

@ -20,19 +20,16 @@
<version>${org.assertj.core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>${commons-collections4.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
@ -43,13 +40,11 @@
<artifactId>converter-jackson</artifactId>
<version>${retrofit.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>pl.pragmatists</groupId>
<artifactId>JUnitParams</artifactId>

View File

@ -39,7 +39,6 @@
<artifactId>junit-platform-commons</artifactId>
<version>${junit.platform.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>

View File

@ -20,4 +20,4 @@
</dependency>
</dependencies>
</project>
</project>

View File

@ -37,4 +37,4 @@
</plugins>
</build>
</project>
</project>

View File

@ -52,4 +52,4 @@
<httpclient.version>4.5.2</httpclient.version>
</properties>
</project>
</project>

View File

@ -107,4 +107,4 @@
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
</properties>
</project>
</project>

View File

@ -38,4 +38,4 @@
<cxf.version>3.1.8</cxf.version>
</properties>
</project>
</project>

View File

@ -18,4 +18,4 @@
<module>sse-jaxrs-client</module>
</modules>
</project>
</project>

View File

@ -14,7 +14,6 @@
</parent>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
@ -33,7 +32,6 @@
<version>${bind-api.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
@ -85,4 +83,4 @@
<bind-api.version>1.0</bind-api.version>
</properties>
</project>
</project>

View File

@ -183,7 +183,6 @@
</execution>
</executions>
</plugin>
<!-- meecrowave -->
<plugin>
<groupId>org.apache.meecrowave</groupId>
@ -216,4 +215,4 @@
<solr.solr-solrj.version>6.4.0</solr.solr-solrj.version>
</properties>
</project>
</project>

View File

@ -25,4 +25,5 @@
<geode.core>1.6.0</geode.core>
<rocketmq.version>2.0.4</rocketmq.version>
</properties>
</project>

View File

@ -91,7 +91,7 @@
</plugins>
</build>
<repositories>
<repositories>
<repository>
<id>SparkPackagesRepo</id>
<url>https://repos.spark-packages.org</url>

View File

@ -77,7 +77,6 @@
<optimize>true</optimize>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
@ -88,7 +87,6 @@
</systemPropertyVariables>
</configuration>
</plugin>
<!-- Run the application using "mvn jetty:run" -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
@ -119,7 +117,6 @@
<id>jboss</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<!-- This repository is only needed when the Tapestry version is a preview release, rather than
a final release. -->
<repository>

View File

@ -68,4 +68,4 @@
<asciidoctorj-pdf.plugin.version>1.5.0-alpha.15</asciidoctorj-pdf.plugin.version>
</properties>
</project>
</project>

View File

@ -31,4 +31,4 @@
<atomix-all.version>1.0.0-rc9</atomix-all.version>
</properties>
</project>
</project>

View File

@ -20,4 +20,4 @@
<module>todo-reminder/ToDoFunction</module>
</modules>
</project>
</project>

View File

@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>helloworld</groupId>
@ -6,10 +7,6 @@
<version>1.0</version>
<packaging>jar</packaging>
<name>ToDoFunction</name>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
@ -18,9 +15,9 @@
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.6.0</version>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>3.6.0</version>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
@ -58,10 +55,10 @@
<version>5.0.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
@ -84,22 +81,28 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<configuration>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
</project>

View File

@ -93,4 +93,5 @@
<spring.version>2.2.1.RELEASE</spring.version>
<awssdk.version>2.10.27</awssdk.version>
</properties>
</project>

View File

@ -83,7 +83,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${assembly.plugin.version}</version>

View File

@ -48,13 +48,11 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
</plugin>
</plugins>
</build>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@ -20,4 +19,4 @@
<module>cf-uaa-oauth2-resource-server</module>
</modules>
</project>
</project>

View File

@ -173,4 +173,4 @@
<groovy.compiler.version>3.3.0-01</groovy.compiler.version>
</properties>
</project>
</project>

View File

@ -1,49 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-12</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>core-java-12</name>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-12</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>core-java-12</name>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-modules</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../../</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${maven.compiler.source.version}</source>
<target>${maven.compiler.target.version}</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${maven.compiler.source.version}</source>
<target>${maven.compiler.target.version}</target>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>--enable-preview</argLine>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source.version>12</maven.compiler.source.version>
<maven.compiler.target.version>12</maven.compiler.target.version>
<assertj.version>3.6.1</assertj.version>
</properties>
<properties>
<maven.compiler.source.version>12</maven.compiler.source.version>
<maven.compiler.target.version>12</maven.compiler.target.version>
<assertj.version>3.6.1</assertj.version>
</properties>
</project>

View File

@ -0,0 +1,88 @@
package com.baeldung.file.content.comparison;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Path;
public class CompareFileContents {
public static long filesCompareByByte(Path path1, Path path2) throws IOException {
if (path1.getFileSystem()
.provider()
.isSameFile(path1, path2)) {
return -1;
}
try (BufferedInputStream fis1 = new BufferedInputStream(new FileInputStream(path1.toFile()));
BufferedInputStream fis2 = new BufferedInputStream(new FileInputStream(path2.toFile()))) {
int ch = 0;
long pos = 1;
while ((ch = fis1.read()) != -1) {
if (ch != fis2.read()) {
return pos;
}
pos++;
}
if (fis2.read() == -1) {
return -1;
} else {
return pos;
}
}
}
public static long filesCompareByLine(Path path1, Path path2) throws IOException {
if (path1.getFileSystem()
.provider()
.isSameFile(path1, path2)) {
return -1;
}
try (BufferedReader bf1 = Files.newBufferedReader(path1);
BufferedReader bf2 = Files.newBufferedReader(path2)) {
long lineNumber = 1;
String line1 = "", line2 = "";
while ((line1 = bf1.readLine()) != null) {
line2 = bf2.readLine();
if (line2 == null || !line1.equals(line2)) {
return lineNumber;
}
lineNumber++;
}
if (bf2.readLine() == null) {
return -1;
} else {
return lineNumber;
}
}
}
public static boolean compareByMemoryMappedFiles(Path path1, Path path2) throws IOException {
try (RandomAccessFile randomAccessFile1 = new RandomAccessFile(path1.toFile(), "r");
RandomAccessFile randomAccessFile2 = new RandomAccessFile(path2.toFile(), "r")) {
FileChannel ch1 = randomAccessFile1.getChannel();
FileChannel ch2 = randomAccessFile2.getChannel();
if (ch1.size() != ch2.size()) {
return false;
}
long size = ch1.size();
MappedByteBuffer m1 = ch1.map(FileChannel.MapMode.READ_ONLY, 0L, size);
MappedByteBuffer m2 = ch2.map(FileChannel.MapMode.READ_ONLY, 0L, size);
return m1.equals(m2);
}
}
}

View File

@ -0,0 +1,88 @@
package com.baeldung.file.content.comparison;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.nio.file.Files;
import java.nio.file.Path;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class CampareFileContentsApacheIOUnitTest {
public static Path path1 = null;
public static Path path2 = null;
@BeforeAll
public static void setup() throws IOException {
path1 = Files.createTempFile("file1Test", ".txt");
path2 = Files.createTempFile("file2Test", ".txt");
}
@Test
public void whenFilesIdentical_thenReturnTrue() throws IOException {
InputStream inputStream1 = new FileInputStream(path1.toFile());
InputStream inputStream2 = new FileInputStream(path2.toFile());
Files.writeString(path1, "testing line 1" + System.lineSeparator() + "line 2");
Files.writeString(path2, "testing line 1" + System.lineSeparator() + "line 2");
assertTrue(IOUtils.contentEquals(inputStream1, inputStream2));
}
@Test
public void whenFilesDifferent_thenReturnFalse() throws IOException {
InputStream inputStream1 = new FileInputStream(path1.toFile());
InputStream inputStream2 = new FileInputStream(path2.toFile());
Files.writeString(path1, "testing line " + System.lineSeparator() + "line 2");
Files.writeString(path2, "testing line 1" + System.lineSeparator() + "line 2");
assertFalse(IOUtils.contentEquals(inputStream1, inputStream2));
}
@Test
public void whenFilesIdenticalIgnoreEOF_thenReturnTrue() throws IOException {
Files.writeString(path1, "testing line 1 \n line 2");
Files.writeString(path2, "testing line 1 \r\n line 2");
Reader reader1 = new BufferedReader(new FileReader(path1.toFile()));
Reader reader2 = new BufferedReader(new FileReader(path2.toFile()));
assertTrue(IOUtils.contentEqualsIgnoreEOL(reader1, reader2));
}
@Test
public void whenFilesNotIdenticalIgnoreEOF_thenReturnFalse() throws IOException {
Files.writeString(path1, "testing line \n line 2");
Files.writeString(path2, "testing line 1 \r\n line 2");
Reader reader1 = new BufferedReader(new FileReader(path1.toFile()));
Reader reader2 = new BufferedReader(new FileReader(path2.toFile()));
assertFalse(IOUtils.contentEqualsIgnoreEOL(reader1, reader2));
}
@AfterAll
public static void shutDown() {
path1.toFile()
.deleteOnExit();
path2.toFile()
.deleteOnExit();
}
}

View File

@ -0,0 +1,42 @@
package com.baeldung.file.content.comparison;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class CompareByMemoryMappedFilesUnitTest {
public static Path path1 = null;
public static Path path2 = null;
@BeforeAll
public static void setup() throws IOException {
path1 = Files.createTempFile("file1Test", ".txt");
path2 = Files.createTempFile("file2Test", ".txt");
}
@Test
public void whenFilesIdentical_thenReturnTrue() throws IOException {
Files.writeString(path1, "testing line 1" + System.lineSeparator() + "line 2");
Files.writeString(path2, "testing line 1" + System.lineSeparator() + "line 2");
assertTrue(CompareFileContents.compareByMemoryMappedFiles(path1, path2));
}
@Test
public void whenFilesDifferent_thenReturnFalse() throws IOException {
Files.writeString(path1, "testing line " + System.lineSeparator() + "line 2");
Files.writeString(path2, "testing line 1" + System.lineSeparator() + "line 2");
assertFalse(CompareFileContents.compareByMemoryMappedFiles(path1, path2));
}
}

View File

@ -0,0 +1,96 @@
package com.baeldung.file.content.comparison;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class CompareFileContentsByBytesUnitTest {
public static Path path1 = null;
public static Path path2 = null;
@BeforeAll
public static void setup() throws IOException {
path1 = Files.createTempFile("file1Test", ".txt");
path2 = Files.createTempFile("file2Test", ".txt");
}
@Test
public void whenFirstFileShorter_thenPositionInSecondFile() throws IOException {
Files.writeString(path1, "testing");
Files.writeString(path2, "testing1");
assertEquals(8, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenSecondFileShorter_thenPositionInFirstFile() throws IOException {
Files.writeString(path1, "testing1");
Files.writeString(path2, "testing");
assertEquals(8, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenFilesIdentical_thenSuccess() throws IOException {
Files.writeString(path1, "testing");
Files.writeString(path2, "testing");
assertEquals(-1, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenFilesDifferent_thenPosition() throws IOException {
Files.writeString(path1, "tesXing");
Files.writeString(path2, "testing");
assertEquals(4, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenBothFilesEmpty_thenEqual() throws IOException {
Files.writeString(path1, "");
Files.writeString(path2, "");
assertEquals(-1, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenFirstEmpty_thenPositionFirst() throws IOException {
Files.writeString(path1, "");
Files.writeString(path2, "test");
assertEquals(1, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenSecondEmpty_thenPositionFirst() throws IOException {
Files.writeString(path1, "test");
Files.writeString(path2, "");
assertEquals(1, CompareFileContents.filesCompareByByte(path1, path2));
}
@AfterAll
public static void shutDown() {
path1.toFile().deleteOnExit();
path2.toFile().deleteOnExit();
}
}

View File

@ -0,0 +1,94 @@
package com.baeldung.file.content.comparison;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
public class CompareFileContentsByLinesUnitTest {
public static Path path1 = null;
public static Path path2 = null;
@BeforeAll
public static void setup() throws IOException {
path1 = Files.createTempFile("file1Test", ".txt");
path2 = Files.createTempFile("file2Test", ".txt");
}
@Test
public void whenFirstFileShorter_thenLineNumbersFirstFile() throws IOException {
Files.writeString(path1, "testing line 1");
Files.writeString(path2, "testing1 line 1" + System.lineSeparator() + "line 2");
assertEquals(1, CompareFileContents.filesCompareByLine(path1, path2));
}
@Test
public void whenSecondFileShorter_thenLineNumbersSecondFile() throws IOException {
Files.writeString(path1, "testing1 line 1" + System.lineSeparator() + "line 2");
Files.writeString(path2, "testing line 1");
assertEquals(1, CompareFileContents.filesCompareByLine(path1, path2));
}
@Test
public void whenFileIdentical_thenLineSuccess() throws IOException {
Files.writeString(path1, "testing1 line 1" + System.lineSeparator() + "line 2");
Files.writeString(path2, "testing1 line 1" + System.lineSeparator() + "line 2");
assertEquals(-1, CompareFileContents.filesCompareByLine(path1, path2));
}
@Test
public void whenFilesDifferent_thenLineNumber() throws IOException {
Files.writeString(path1, "testing1 line 1" + System.lineSeparator() + "line 2");
Files.writeString(path2, "testing1 line 1" + System.lineSeparator() + "linX 2");
assertEquals(2, CompareFileContents.filesCompareByLine(path1, path2));
}
@Test
public void whenBothFilesEmpty_thenEqual() throws IOException {
Files.writeString(path1, "");
Files.writeString(path2, "");
assertEquals(-1, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenFirstEmpty_thenPositionFirst() throws IOException {
Files.writeString(path1, "");
Files.writeString(path2, "testing1 line 1" + System.lineSeparator() + "line 2");
assertEquals(1, CompareFileContents.filesCompareByByte(path1, path2));
}
@Test
public void whenSecondEmpty_thenPositionFirst() throws IOException {
Files.writeString(path1, "testing1 line 1" + System.lineSeparator() + "line 2");
Files.writeString(path2, "");
assertEquals(1, CompareFileContents.filesCompareByByte(path1, path2));
}
@AfterAll
public static void shutDown() {
path1.toFile().deleteOnExit();
path2.toFile().deleteOnExit();
}
}

View File

@ -1,6 +1,6 @@
package java.com.baeldung.newfeatures;
package com.baeldung.newfeatures;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.text.NumberFormat;
import java.util.Locale;
@ -16,6 +16,6 @@ public class CompactNumbersUnitTest {
assertEquals("2.59K", likesShort.format(2592));
NumberFormat likesLong = NumberFormat.getCompactNumberInstance(new Locale("en", "US"), NumberFormat.Style.LONG);
likesLong.setMaximumFractionDigits(2);
assertEquals("2.59 thousand", likesShort.format(2592));
assertEquals("2.59 thousand", likesLong.format(2592));
}
}

View File

@ -1,6 +1,6 @@
package java.com.baeldung.newfeatures;
package com.baeldung.newfeatures;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.nio.file.Files;

View File

@ -1,6 +1,6 @@
package java.com.baeldung.newfeatures;
package com.baeldung.newfeatures;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.assertEquals;

View File

@ -1,6 +1,6 @@
package java.com.baeldung.newfeatures;
package com.baeldung.newfeatures;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -13,6 +13,6 @@ public class TeeingCollectorUnitTest {
public void givenSetOfNumbers_thenCalculateAverage() {
double mean = Stream.of(1, 2, 3, 4, 5)
.collect(Collectors.teeing(Collectors.summingDouble(i -> i), Collectors.counting(), (sum, count) -> sum / count));
assertEquals(3.0, mean);
assertEquals(3.0, mean, 0);
}
}

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-concurrency-2</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -31,7 +31,6 @@
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh-generator.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-concurrency-advanced</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-concurrency-basic-2</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-concurrency-basic</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -6,7 +6,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-concurrency-collections-2</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-concurrency-collections</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -49,7 +49,6 @@
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -7,7 +7,7 @@
<version>${project.parent.version}</version>
<name>core-java-date-operations-2</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -48,7 +48,6 @@
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-function</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
@ -40,4 +40,4 @@
<assertj.version>3.6.1</assertj.version>
</properties>
</project>
</project>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-functional</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-io-2</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-io-apis</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -7,6 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-io-conversions</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -7,7 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-io</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>
@ -97,6 +97,7 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>integration</id>

View File

@ -7,6 +7,7 @@
<version>0.1.0-SNAPSHOT</version>
<name>core-java-jar</name>
<packaging>jar</packaging>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -45,4 +45,4 @@
<providermodule.version>1.0</providermodule.version>
</properties>
</project>
</project>

View File

@ -48,4 +48,5 @@
</resource>
</resources>
</build>
</project>

View File

@ -6,7 +6,7 @@
<artifactId>core-java-lang-math-2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>core-java-lang-math-2</name>
<parent>
<groupId>com.baeldung.core-java-modules</groupId>
<artifactId>core-java-modules</artifactId>

View File

@ -27,4 +27,4 @@
</dependency>
</dependencies>
</project>
</project>

View File

@ -25,4 +25,4 @@
</resources>
</build>
</project>
</project>

View File

@ -25,4 +25,4 @@
</resources>
</build>
</project>
</project>

View File

@ -15,4 +15,4 @@
<relativePath>../</relativePath>
</parent>
</project>
</project>

View File

@ -62,4 +62,5 @@
<target.version>1.8</target.version>
<spring.version>5.3.4</spring.version>
</properties>
</project>

View File

@ -28,4 +28,4 @@
<assertj-core.version>3.15.0</assertj-core.version>
</properties>
</project>
</project>

View File

@ -38,7 +38,6 @@
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -91,7 +91,6 @@
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -27,7 +27,6 @@
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>

View File

@ -33,33 +33,29 @@
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>${icu.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>${commons-text.version}</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<icu.version>64.2</icu.version>
<assertj.version>3.12.2</assertj.version>

View File

@ -5,7 +5,6 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-string-operations-3</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>core-java-string-operations-3</name>
<packaging>jar</packaging>
@ -58,6 +57,13 @@
</plugins>
</build>
<repositories>
<repository>
<id>gradle-repo</id>
<url>https://repo.gradle.org/gradle/libs-releases-local/</url>
</repository>
</repositories>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
@ -68,10 +74,4 @@
<semver4j.version>3.1.0</semver4j.version>
</properties>
<repositories>
<repository>
<id>gradle-repo</id>
<url>https://repo.gradle.org/gradle/libs-releases-local/</url>
</repository>
</repositories>
</project>

View File

@ -137,4 +137,4 @@
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>
</project>

View File

@ -101,4 +101,5 @@
<properties>
<joda-money.version>1.0.1</joda-money.version>
</properties>
</project>

View File

@ -56,4 +56,5 @@
<tomcat-jdbc.version>8.5.33</tomcat-jdbc.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
</properties>
</project>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@ -48,4 +47,4 @@
<geotools-shapefile.version>15.2</geotools-shapefile.version>
</properties>
</project>
</project>

View File

@ -77,4 +77,5 @@
<os-maven-plugin.version>1.6.1</os-maven-plugin.version>
<protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
</properties>
</project>

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>guava-concurrency</artifactId>
<parent>
<artifactId>guava-modules</artifactId>
<groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>guava-concurrency</artifactId>
</project>

View File

@ -92,7 +92,6 @@
<artifactId>webcam-capture</artifactId>
<version>${webcam-capture.version}</version>
</dependency>
</dependencies>
<properties>

View File

@ -49,7 +49,6 @@
<artifactId>vavr</artifactId>
<version>0.10.3</version>
</dependency>
</dependencies>
<build>

View File

@ -41,5 +41,5 @@
<properties>
<commons-collections4.version>4.1</commons-collections4.version>
</properties>
</project>

View File

@ -40,4 +40,5 @@
<assertj.version>3.6.1</assertj.version>
<spring.version>5.2.5.RELEASE</spring.version>
</properties>
</project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>java-jdi</artifactId>
<version>0.1.0-SNAPSHOT</version>
@ -39,4 +39,4 @@
<tools.version>1.8</tools.version>
</properties>
</project>
</project>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
<artifactId>java-lite</artifactId>

View File

@ -203,7 +203,7 @@
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no
influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
@ -518,4 +518,4 @@
<jersey-container-jetty-servlet.version>2.22.1</jersey-container-jetty-servlet.version>
</properties>
</project>
</project>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>plugins</artifactId>
<version>1.0-SNAPSHOT</version>
@ -12,7 +13,7 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.33</version>
<relativePath/>
<relativePath />
</parent>
<dependencies>
@ -80,9 +81,9 @@
</pluginRepositories>
<properties>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer
to run. -->
<jenkins.version>2.7.3</jenkins.version>
<structs.version>1.7</structs.version>
<workflow-step-api.version>2.12</workflow-step-api.version>
<workflow-cps.version>2.39</workflow-cps.version>
@ -93,4 +94,4 @@
<workflow-support.version>2.14</workflow-support.version>
</properties>
</project>
</project>

View File

@ -51,7 +51,6 @@
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>

View File

@ -3,6 +3,9 @@
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">
<modelVersion>4.0.0</modelVersion>
<artifactId>k8s-admission-controller</artifactId>
<name>k8s-admission-controller</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>com.baeldung</groupId>
@ -11,16 +14,11 @@
<relativePath>./../../parent-boot-2</relativePath>
</parent>
<artifactId>k8s-admission-controller</artifactId>
<name>k8s-admission-controller</name>
<description>Demo project for Spring Boot</description>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@ -31,13 +29,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
@ -54,7 +50,6 @@
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@ -83,4 +78,4 @@
</plugins>
</build>
</project>
</project>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>kubernetes</artifactId>
<packaging>pom</packaging>
@ -12,6 +14,7 @@
<modules>
<module>k8s-intro</module>
<module>k8s-admission-controller</module>
</modules>
<module>k8s-admission-controller</module>
</modules>
</project>

View File

@ -135,4 +135,4 @@
<hsqldb.version>2.5.0</hsqldb.version>
</properties>
</project>
</project>

View File

@ -230,4 +230,5 @@
<plexus-compiler.version>2.8</plexus-compiler.version>
<errorprone.version>2.1.3</errorprone.version>
</properties>
</project>

View File

@ -126,4 +126,4 @@
<olap4j.version>1.2.0</olap4j.version>
</properties>
</project>
</project>

View File

@ -10,5 +10,6 @@ This module contains articles about HTTP libraries.
- [Adding Interceptors in OkHTTP](https://www.baeldung.com/java-okhttp-interceptors)
- [A Guide to Events in OkHTTP](https://www.baeldung.com/java-okhttp-events)
- [Download a Binary File Using OkHttp](https://www.baeldung.com/java-okhttp-download-binary-file)
- [Trusting a Self-Signed Certificate in OkHttp](https://www.baeldung.com/okhttp-self-signed-cert)
- More articles [[<-- prev]](/libraries-http)

View File

@ -2,4 +2,5 @@
### Relevant Articles:
- [Transferring a File Through SFTP in Java](https://www.baeldung.com/java-file-sftp)
- [How to Create Password-Protected Zip Files and Unzip Them in Java](https://www.baeldung.com/java-password-protected-zip-unzip)

View File

@ -29,6 +29,11 @@
<artifactId>commons-vfs2</artifactId>
<version>${vfs.version}</version>
</dependency>
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>2.9.0</version>
</dependency>
</dependencies>
<properties>

View File

@ -0,0 +1,22 @@
package com.baeldung.java.io.zip4j;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.model.enums.EncryptionMethod;
import java.io.File;
import java.util.Arrays;
public class CreateSplitZipFile {
public static void main(String[] args) throws ZipException {
ZipParameters zipParameters = new ZipParameters();
zipParameters.setEncryptFiles(true);
zipParameters.setEncryptionMethod(EncryptionMethod.AES);
ZipFile zipFile = new ZipFile("compressed.zip", "password".toCharArray());
int splitLength = 1024 * 1024 * 10; //10MB
zipFile.createSplitZipFile(Arrays.asList(new File("aFile.txt")), zipParameters, true, splitLength);
zipFile.createSplitZipFileFromFolder(new File("/users/folder_to_add"), zipParameters, true, splitLength);
}
}

View File

@ -0,0 +1,12 @@
package com.baeldung.java.io.zip4j;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;
public class ExtractAllFile {
public static void main(String[] args) throws ZipException {
ZipFile zipFile = new ZipFile("compressed.zip", "password".toCharArray());
zipFile.extractAll("/destination_directory");
}
}

View File

@ -0,0 +1,12 @@
package com.baeldung.java.io.zip4j;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;
public class ExtractSingleFile {
public static void main(String[] args) throws ZipException {
ZipFile zipFile = new ZipFile("compressed.zip", "password".toCharArray());
zipFile.extractFile("aFile.txt", "/destination_directory");
}
}

View File

@ -0,0 +1,19 @@
package com.baeldung.java.io.zip4j;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.model.enums.EncryptionMethod;
import java.io.File;
public class ZipFolder {
public static void main(String[] args) throws ZipException {
ZipParameters zipParameters = new ZipParameters();
zipParameters.setEncryptFiles(true);
zipParameters.setEncryptionMethod(EncryptionMethod.AES);
ZipFile zipFile = new ZipFile("compressed.zip", "password".toCharArray());
zipFile.addFolder(new File("/users/folder_to_add"), zipParameters);
}
}

View File

@ -0,0 +1,27 @@
package com.baeldung.java.io.zip4j;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.model.enums.EncryptionMethod;
import java.io.File;
import java.util.Arrays;
import java.util.List;
public class ZipMultiFile {
public static void main(String[] args) throws ZipException {
ZipParameters zipParameters = new ZipParameters();
zipParameters.setEncryptFiles(true);
zipParameters.setEncryptionMethod(EncryptionMethod.AES);
List<File> filesToAdd = Arrays.asList(
new File("aFile.txt"),
new File("bFile.txt")
);
ZipFile zipFile = new ZipFile("compressed.zip", "password".toCharArray());
zipFile.addFiles(filesToAdd, zipParameters);
}
}

View File

@ -0,0 +1,21 @@
package com.baeldung.java.io.zip4j;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.model.enums.CompressionLevel;
import net.lingala.zip4j.model.enums.EncryptionMethod;
import java.io.File;
public class ZipSingleFile {
public static void main(String[] args) throws ZipException {
ZipParameters zipParameters = new ZipParameters();
zipParameters.setEncryptFiles(true);
zipParameters.setCompressionLevel(CompressionLevel.HIGHER);
zipParameters.setEncryptionMethod(EncryptionMethod.AES);
ZipFile zipFile = new ZipFile("compressed.zip", "password".toCharArray());
zipFile.addFile(new File("aFile.txt"));
}
}

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>libraries-security</artifactId>
<name>libraries-security</name>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>libraries-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
@ -99,7 +100,7 @@
<version>${nanohttpd.version}</version>
</dependency>
</dependencies>
<properties>
<assertj.version>3.6.2</assertj.version>
<httpclient.version>4.5.3</httpclient.version>

View File

@ -26,4 +26,4 @@
<junit-jupiter.version>5.6.2</junit-jupiter.version>
</properties>
</project>
</project>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>lombok-custom</artifactId>
<name>lombok-custom</name>
<version>0.1-SNAPSHOT</version>
<name>lombok-custom</name>
<parent>
<groupId>com.baeldung</groupId>
@ -20,13 +20,11 @@
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
<version>${metainf-services.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>core</artifactId>
@ -62,4 +60,4 @@
<eclipse.jdt.core.version>3.3.0-v_771</eclipse.jdt.core.version>
</properties>
</project>
</project>

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>maven-builder-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
@ -14,7 +13,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
@ -38,4 +36,5 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>copy-rename-maven-plugin</name>
<parent>
<artifactId>maven-copy-files</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.baeldung</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>copy-rename-maven-plugin</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
@ -23,6 +22,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@ -89,4 +89,11 @@
</plugins>
</pluginManagement>
</build>
</project>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
</project>

View File

@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>maven-antrun-plugin</name>
<parent>
<artifactId>maven-copy-files</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.baeldung</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>maven-antrun-plugin</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
@ -23,6 +22,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@ -35,7 +35,8 @@
<target>
<mkdir dir="${basedir}/target/destination-folder" />
<copy todir="${basedir}/target/destination-folder">
<fileset dir="${basedir}/source-files" includes="foo.txt" />
<fileset dir="${basedir}/source-files"
includes="foo.txt" />
</copy>
</target>
</configuration>
@ -91,4 +92,11 @@
</plugins>
</pluginManagement>
</build>
</project>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
</project>

View File

@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>maven-resoures-plugin</name>
<parent>
<artifactId>maven-copy-files</artifactId>
<groupId>com.baeldung</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.baeldung</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>maven-resources-plugin</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
@ -23,6 +22,7 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
@ -89,4 +89,11 @@
</plugins>
</pluginManagement>
</build>
</project>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
</project>

Some files were not shown because too many files have changed in this diff Show More