Making duplicate classpath scanning test result more understandable and a few reorganizations for MariaDB and PostgreSQL deps

This commit is contained in:
Arnold Galovics
2022-11-28 16:56:05 +01:00
committed by Arnold Gálovics
parent 6e7e4221ba
commit 418675b800
4 changed files with 29 additions and 13 deletions
@@ -221,5 +221,12 @@ dependencyManagement {
dependency "org.apache.avro:avro:1.11.1"
dependency "io.github.resilience4j:resilience4j-spring-boot2:1.7.1"
dependency ('org.mariadb.jdbc:mariadb-java-client:3.1.0') {
exclude 'org.slf4j:jcl-over-slf4j'
exclude 'org.slf4j:slf4j-api'
}
dependency 'org.postgresql:postgresql:42.5.1'
}
}
+2 -2
View File
@@ -84,9 +84,9 @@ jib {
}
}
// NOTE: other custom dependencies
implementation 'org.mariadb.jdbc:mariadb-java-client:3.1.0'
implementation 'org.mariadb.jdbc:mariadb-java-client'
implementation 'mysql:mysql-connector-java:8.0.31'
implementation 'org.postgresql:postgresql:42.5.1'
implementation 'org.postgresql:postgresql'
annotationProcessor('org.springframework.boot:spring-boot-autoconfigure-processor')
annotationProcessor('org.springframework.boot:spring-boot-configuration-processor')
}
+6 -6
View File
@@ -150,8 +150,8 @@ configurations {
driver
}
dependencies {
driver 'org.mariadb.jdbc:mariadb-java-client:3.1.0'
driver 'org.postgresql:postgresql:42.5.1'
driver 'org.mariadb.jdbc:mariadb-java-client'
driver 'org.postgresql:postgresql'
driver 'mysql:mysql-connector-java:8.0.31'
}
@@ -222,8 +222,8 @@ bootRun {
]
dependencies {
implementation 'org.mariadb.jdbc:mariadb-java-client:3.1.0'
implementation 'org.postgresql:postgresql:42.5.1'
implementation 'org.mariadb.jdbc:mariadb-java-client'
implementation 'org.postgresql:postgresql'
}
}
@@ -286,8 +286,8 @@ jib {
allowInsecureRegistries = true
dependencies {
implementation 'org.mariadb.jdbc:mariadb-java-client:3.1.0'
implementation 'org.postgresql:postgresql:42.5.1'
implementation 'org.mariadb.jdbc:mariadb-java-client'
implementation 'org.postgresql:postgresql'
}
pluginExtensions {
@@ -22,10 +22,14 @@ import io.cucumber.java8.En;
import io.github.classgraph.ClassGraph;
import io.github.classgraph.ResourceList;
import io.github.classgraph.ScanResult;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.commons.collections4.MapUtils;
import org.opentest4j.AssertionFailedError;
public class ClasspathDuplicatesStepDefinitions implements En {
@@ -69,7 +73,11 @@ public class ClasspathDuplicatesStepDefinitions implements En {
// tag::then[]
Then("There should be no duplicates", () -> {
if (!duplicates.isEmpty()) {
throw new AssertionFailedError(duplicates.size() + " Classpath duplicates detected:\n" + duplicates);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos, false, StandardCharsets.UTF_8);
MapUtils.debugPrint(ps, "duplicates", duplicates);
String prettyPrintedMap = baos.toString(StandardCharsets.UTF_8);
throw new AssertionFailedError(duplicates.size() + " Classpath duplicates detected:\n" + prettyPrintedMap);
}
});
// end::then[]
@@ -89,10 +97,11 @@ public class ClasspathDuplicatesStepDefinitions implements En {
// list formerly in ClasspathHellDuplicatesCheckRule (moved here
// in INFRAUTILS-52)
|| resourcePath.endsWith(".txt") || resourcePath.endsWith("LICENSE") || resourcePath.endsWith("license.html")
|| resourcePath.endsWith("about.html") || resourcePath.endsWith("readme.html")
|| resourcePath.startsWith("META-INF/services") || resourcePath.equals("META-INF/DEPENDENCIES")
|| resourcePath.equals("META-INF/git.properties") || resourcePath.equals("META-INF/io.netty.versions.properties")
|| resourcePath.equals("META-INF/jersey-module-version") || resourcePath.startsWith("OSGI-INF/blueprint/")
|| resourcePath.endsWith("AL2.0") || resourcePath.endsWith("LGPL2.1") || resourcePath.endsWith("about.html")
|| resourcePath.endsWith("readme.html") || resourcePath.startsWith("META-INF/services")
|| resourcePath.equals("META-INF/DEPENDENCIES") || resourcePath.equals("META-INF/git.properties")
|| resourcePath.equals("META-INF/io.netty.versions.properties") || resourcePath.equals("META-INF/jersey-module-version")
|| resourcePath.startsWith("OSGI-INF/blueprint/")
// in Akka's JARs
|| resourcePath.startsWith("org/opendaylight/blueprint/") || resourcePath.endsWith("reference.conf")
// json-schema-core and json-schema-validator depend on each