diff --git a/build-tools/build-infra/build.gradle b/build-tools/build-infra/build.gradle index 3159ed0d162..85bf1a1c51e 100644 --- a/build-tools/build-infra/build.gradle +++ b/build-tools/build-infra/build.gradle @@ -17,6 +17,7 @@ plugins { id "java-gradle-plugin" + alias(libs.plugins.diffplug.spotless) apply false } repositories { @@ -25,6 +26,19 @@ repositories { group = "org.apache" +// Make sure the build environment is consistent. +apply from: file('../../gradle/conventions.gradle') +apply from: file('../../gradle/validation/check-environment.gradle') + +// Add spotless/ tidy. +tasks.register("checkJdkInternalsExportedToGradle") {} +apply from: file('../../gradle/validation/spotless.gradle') + +java { + sourceCompatibility = JavaVersion.toVersion(libs.versions.minJava.get()) + targetCompatibility = JavaVersion.toVersion(libs.versions.minJava.get()) +} + gradlePlugin { automatedPublishing = false @@ -36,14 +50,6 @@ gradlePlugin { } } -// Make sure the build environment is consistent. -apply from: file('../../gradle/validation/check-environment.gradle') - -java { - sourceCompatibility = JavaVersion.toVersion(libs.versions.minJava.get()) - targetCompatibility = JavaVersion.toVersion(libs.versions.minJava.get()) -} - dependencies { implementation gradleApi() implementation localGroovy() diff --git a/build-tools/build-infra/settings.gradle b/build-tools/build-infra/settings.gradle index 4e5a6a9a5de..7a55021b366 100644 --- a/build-tools/build-infra/settings.gradle +++ b/build-tools/build-infra/settings.gradle @@ -20,7 +20,7 @@ rootProject.name = 'build-infra' // Use project's version catalog for centralized dependency management dependencyResolutionManagement { versionCatalogs { - create("libs") { + libs { from(files("../../gradle/libs.versions.toml")) } } diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/Checksum.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/Checksum.java index bdc82f1fa0a..a1d5c09586f 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/Checksum.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/Checksum.java @@ -27,6 +27,11 @@ package org.apache.lucene.gradle; +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.Locale; import org.apache.commons.codec.digest.DigestUtils; import org.gradle.api.DefaultTask; import org.gradle.api.GradleException; @@ -39,12 +44,6 @@ import org.gradle.work.Incremental; import org.gradle.work.InputChanges; -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.Locale; - public class Checksum extends DefaultTask { private FileCollection files; private File outputDir; diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ErrorReportingTestListener.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ErrorReportingTestListener.java index 44cd09b33f4..c1fb7b83983 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ErrorReportingTestListener.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ErrorReportingTestListener.java @@ -16,7 +16,11 @@ */ package org.apache.lucene.gradle; -import java.io.*; +import java.io.BufferedReader; +import java.io.Closeable; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.io.Writer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -25,7 +29,6 @@ import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; - import org.gradle.api.internal.tasks.testing.logging.FullExceptionFormatter; import org.gradle.api.internal.tasks.testing.logging.TestExceptionFormatter; import org.gradle.api.logging.Logger; @@ -38,238 +41,248 @@ import org.gradle.api.tasks.testing.logging.TestLogging; /** - * An error reporting listener that queues test output streams and displays them - * on failure. - *

- * Heavily inspired by Elasticsearch's ErrorReportingTestListener (ASL 2.0 licensed). + * An error reporting listener that queues test output streams and displays them on failure. + * + *

Heavily inspired by Elasticsearch's ErrorReportingTestListener (ASL 2.0 licensed). */ public class ErrorReportingTestListener implements TestOutputListener, TestListener { - private static final Logger LOGGER = Logging.getLogger(ErrorReportingTestListener.class); - - private final TestExceptionFormatter formatter; - private final Map outputHandlers = new ConcurrentHashMap<>(); - private final Path spillDir; - private final Path outputsDir; - private final boolean verboseMode; - - public ErrorReportingTestListener(TestLogging testLogging, Path spillDir, Path outputsDir, boolean verboseMode) { - this.formatter = new FullExceptionFormatter(testLogging); - this.spillDir = spillDir; - this.outputsDir = outputsDir; - this.verboseMode = verboseMode; - } - - @Override - public void onOutput(TestDescriptor testDescriptor, TestOutputEvent outputEvent) { - handlerFor(testDescriptor).write(outputEvent); - } - - @Override - public void beforeSuite(TestDescriptor suite) { - // noop. - } - - @Override - public void beforeTest(TestDescriptor testDescriptor) { - // Noop. - } - - @Override - public void afterSuite(final TestDescriptor suite, TestResult result) { - if (suite.getParent() == null || suite.getName().startsWith("Gradle")) { - return; + private static final Logger LOGGER = Logging.getLogger(ErrorReportingTestListener.class); + + private final TestExceptionFormatter formatter; + private final Map outputHandlers = new ConcurrentHashMap<>(); + private final Path spillDir; + private final Path outputsDir; + private final boolean verboseMode; + + public ErrorReportingTestListener( + TestLogging testLogging, Path spillDir, Path outputsDir, boolean verboseMode) { + this.formatter = new FullExceptionFormatter(testLogging); + this.spillDir = spillDir; + this.outputsDir = outputsDir; + this.verboseMode = verboseMode; + } + + @Override + public void onOutput(TestDescriptor testDescriptor, TestOutputEvent outputEvent) { + handlerFor(testDescriptor).write(outputEvent); + } + + @Override + public void beforeSuite(TestDescriptor suite) { + // noop. + } + + @Override + public void beforeTest(TestDescriptor testDescriptor) { + // Noop. + } + + @Override + public void afterSuite(final TestDescriptor suite, TestResult result) { + if (suite.getParent() == null || suite.getName().startsWith("Gradle")) { + return; + } + + TestKey key = TestKey.of(suite); + try { + OutputHandler outputHandler = outputHandlers.get(key); + if (outputHandler != null) { + long length = outputHandler.length(); + if (length > 1024 * 1024 * 10) { + LOGGER.warn( + String.format( + Locale.ROOT, + "WARNING: Test %s wrote %,d bytes of output.", + suite.getName(), + length)); + } } - TestKey key = TestKey.of(suite); - try { - OutputHandler outputHandler = outputHandlers.get(key); - if (outputHandler != null) { - long length = outputHandler.length(); - if (length > 1024 * 1024 * 10) { - LOGGER.warn(String.format(Locale.ROOT, "WARNING: Test %s wrote %,d bytes of output.", - suite.getName(), - length)); - } - } - - boolean echoOutput = Objects.equals(result.getResultType(), TestResult.ResultType.FAILURE); - boolean dumpOutput = echoOutput; - - // If the test suite failed, report output. - if (dumpOutput || echoOutput) { - Files.createDirectories(outputsDir); - Path outputLog = outputsDir.resolve(getOutputLogName(suite)); - - // Save the output of a failing test to disk. - try (Writer w = Files.newBufferedWriter(outputLog, StandardCharsets.UTF_8)) { - if (outputHandler != null) { - outputHandler.copyTo(w); - } - } - - if (echoOutput && !verboseMode) { - synchronized (this) { - System.out.println(""); - System.out.println(suite.getClassName() + " > test suite's output saved to " + outputLog + ", copied below:"); - try (BufferedReader reader = Files.newBufferedReader(outputLog, StandardCharsets.UTF_8)) { - char[] buf = new char[1024]; - int len; - while ((len = reader.read(buf)) >= 0) { - System.out.print(new String(buf, 0, len)); - } - System.out.println(); - } - } + boolean echoOutput = Objects.equals(result.getResultType(), TestResult.ResultType.FAILURE); + boolean dumpOutput = echoOutput; + + // If the test suite failed, report output. + if (dumpOutput || echoOutput) { + Files.createDirectories(outputsDir); + Path outputLog = outputsDir.resolve(getOutputLogName(suite)); + + // Save the output of a failing test to disk. + try (Writer w = Files.newBufferedWriter(outputLog, StandardCharsets.UTF_8)) { + if (outputHandler != null) { + outputHandler.copyTo(w); + } + } + + if (echoOutput && !verboseMode) { + synchronized (this) { + System.out.println(""); + System.out.println( + suite.getClassName() + + " > test suite's output saved to " + + outputLog + + ", copied below:"); + try (BufferedReader reader = + Files.newBufferedReader(outputLog, StandardCharsets.UTF_8)) { + char[] buf = new char[1024]; + int len; + while ((len = reader.read(buf)) >= 0) { + System.out.print(new String(buf, 0, len)); + } + System.out.println(); } - } - } catch (IOException e) { - throw new UncheckedIOException(e); - } finally { - OutputHandler handler = outputHandlers.remove(key); - if (handler != null) { - try { - handler.close(); - } catch (IOException e) { - LOGGER.error("Failed to close output handler for: " + key, e); - } - } - } - } - - private static Pattern SANITIZE = Pattern.compile("[^a-zA-Z .\\-_0-9]+"); - - public static String getOutputLogName(TestDescriptor suite) { - return SANITIZE.matcher("OUTPUT-" + suite.getName() + ".txt").replaceAll("_"); - } - - @Override - public void afterTest(TestDescriptor testDescriptor, TestResult result) { - // Include test failure exception stacktrace(s) in test output log. - if (result.getResultType() == TestResult.ResultType.FAILURE) { - if (result.getExceptions().size() > 0) { - String message = formatter.format(testDescriptor, result.getExceptions()); - handlerFor(testDescriptor).write(message); - } - } - } - - private OutputHandler handlerFor(TestDescriptor descriptor) { - // Attach output of leaves (individual tests) to their parent. - if (!descriptor.isComposite()) { - descriptor = descriptor.getParent(); - } - return outputHandlers.computeIfAbsent(TestKey.of(descriptor), (key) -> new OutputHandler()); - } - - public static class TestKey { - private final String key; - - private TestKey(String key) { - this.key = key; - } - - public static TestKey of(TestDescriptor d) { - StringBuilder key = new StringBuilder(); - key.append(d.getClassName()); - key.append("::"); - key.append(d.getName()); - key.append("::"); - key.append(d.getParent() == null ? "-" : d.getParent().toString()); - return new TestKey(key.toString()); - } - - @Override - public boolean equals(Object o) { - return o != null && - o.getClass() == this.getClass() && - Objects.equals(((TestKey) o).key, key); - } - - @Override - public int hashCode() { - return key.hashCode(); + } + } } - - @Override - public String toString() { - return key; - } - } - - private class OutputHandler implements Closeable { - // Max single-line buffer before automatic wrap occurs. - private static final int MAX_LINE_WIDTH = 1024 * 4; - - private final SpillWriter buffer; - - // internal stream. - private final PrefixedWriter sint; - // stdout - private final PrefixedWriter sout; - // stderr - private final PrefixedWriter serr; - - // last used stream (so that we can flush it properly and prefixes are not screwed up). - private PrefixedWriter last; - - public OutputHandler() { - buffer = new SpillWriter(() -> { - try { - return Files.createTempFile(spillDir, "spill-", ".tmp"); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }); - - Writer sink = buffer; - if (verboseMode) { - sink = new StdOutTeeWriter(buffer); - } - - sint = new PrefixedWriter(" > ", sink, MAX_LINE_WIDTH); - sout = new PrefixedWriter(" 1> ", sink, MAX_LINE_WIDTH); - serr = new PrefixedWriter(" 2> ", sink, MAX_LINE_WIDTH); - last = sint; + } catch (IOException e) { + throw new UncheckedIOException(e); + } finally { + OutputHandler handler = outputHandlers.remove(key); + if (handler != null) { + try { + handler.close(); + } catch (IOException e) { + LOGGER.error("Failed to close output handler for: " + key, e); + } } - - public void write(TestOutputEvent event) { - write((event.getDestination() == TestOutputEvent.Destination.StdOut ? sout : serr), event.getMessage()); + } + } + + private static Pattern SANITIZE = Pattern.compile("[^a-zA-Z .\\-_0-9]+"); + + public static String getOutputLogName(TestDescriptor suite) { + return SANITIZE.matcher("OUTPUT-" + suite.getName() + ".txt").replaceAll("_"); + } + + @Override + public void afterTest(TestDescriptor testDescriptor, TestResult result) { + // Include test failure exception stacktrace(s) in test output log. + if (result.getResultType() == TestResult.ResultType.FAILURE) { + if (result.getExceptions().size() > 0) { + String message = formatter.format(testDescriptor, result.getExceptions()); + handlerFor(testDescriptor).write(message); } - - public void write(String message) { - write(sint, message); + } + } + + private OutputHandler handlerFor(TestDescriptor descriptor) { + // Attach output of leaves (individual tests) to their parent. + if (!descriptor.isComposite()) { + descriptor = descriptor.getParent(); + } + return outputHandlers.computeIfAbsent(TestKey.of(descriptor), (key) -> new OutputHandler()); + } + + public static class TestKey { + private final String key; + + private TestKey(String key) { + this.key = key; + } + + public static TestKey of(TestDescriptor d) { + StringBuilder key = new StringBuilder(); + key.append(d.getClassName()); + key.append("::"); + key.append(d.getName()); + key.append("::"); + key.append(d.getParent() == null ? "-" : d.getParent().toString()); + return new TestKey(key.toString()); + } + + @Override + public boolean equals(Object o) { + return o != null && o.getClass() == this.getClass() && Objects.equals(((TestKey) o).key, key); + } + + @Override + public int hashCode() { + return key.hashCode(); + } + + @Override + public String toString() { + return key; + } + } + + private class OutputHandler implements Closeable { + // Max single-line buffer before automatic wrap occurs. + private static final int MAX_LINE_WIDTH = 1024 * 4; + + private final SpillWriter buffer; + + // internal stream. + private final PrefixedWriter sint; + // stdout + private final PrefixedWriter sout; + // stderr + private final PrefixedWriter serr; + + // last used stream (so that we can flush it properly and prefixes are not screwed up). + private PrefixedWriter last; + + public OutputHandler() { + buffer = + new SpillWriter( + () -> { + try { + return Files.createTempFile(spillDir, "spill-", ".tmp"); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + + Writer sink = buffer; + if (verboseMode) { + sink = new StdOutTeeWriter(buffer); } - public long length() throws IOException { - return buffer.length(); - } + sint = new PrefixedWriter(" > ", sink, MAX_LINE_WIDTH); + sout = new PrefixedWriter(" 1> ", sink, MAX_LINE_WIDTH); + serr = new PrefixedWriter(" 2> ", sink, MAX_LINE_WIDTH); + last = sint; + } - private void write(PrefixedWriter out, String message) { - try { - if (out != last) { - last.completeLine(); - last = out; - } - out.write(message); - } catch (IOException e) { - throw new UncheckedIOException("Unable to write to test output.", e); - } - } + public void write(TestOutputEvent event) { + write( + (event.getDestination() == TestOutputEvent.Destination.StdOut ? sout : serr), + event.getMessage()); + } - public void copyTo(Writer out) throws IOException { - flush(); - buffer.copyTo(out); - } + public void write(String message) { + write(sint, message); + } - public void flush() throws IOException { - sout.completeLine(); - serr.completeLine(); - buffer.flush(); - } + public long length() throws IOException { + return buffer.length(); + } - @Override - public void close() throws IOException { - buffer.close(); + private void write(PrefixedWriter out, String message) { + try { + if (out != last) { + last.completeLine(); + last = out; + } + out.write(message); + } catch (IOException e) { + throw new UncheckedIOException("Unable to write to test output.", e); } - } + } + + public void copyTo(Writer out) throws IOException { + flush(); + buffer.copyTo(out); + } + + public void flush() throws IOException { + sout.completeLine(); + serr.completeLine(); + buffer.flush(); + } + + @Override + public void close() throws IOException { + buffer.close(); + } + } } diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/GradlePropertiesGenerator.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/GradlePropertiesGenerator.java index db4f804f12e..5436afe70f8 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/GradlePropertiesGenerator.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/GradlePropertiesGenerator.java @@ -67,6 +67,6 @@ public void run(Path source, Path destination) throws IOException { fileContent = fileContent.replace(entry.getKey(), String.valueOf(entry.getValue())); } Files.writeString( - destination, fileContent, StandardCharsets.UTF_8, StandardOpenOption.CREATE_NEW); + destination, fileContent, StandardCharsets.UTF_8, StandardOpenOption.CREATE_NEW); } } diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/PrefixedWriter.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/PrefixedWriter.java index 7281d496001..3dc663e8332 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/PrefixedWriter.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/PrefixedWriter.java @@ -20,12 +20,13 @@ import java.io.Writer; /** - * Prefixes every new line with a given string, synchronizing multiple streams to emit consistent lines. + * Prefixes every new line with a given string, synchronizing multiple streams to emit consistent + * lines. */ public class PrefixedWriter extends Writer { Writer sink; - private final static char LF = '\n'; + private static final char LF = '\n'; private final String prefix; private final StringBuilder lineBuffer = new StringBuilder(); private final int maxLineLength; @@ -45,7 +46,7 @@ public void write(int c) throws IOException { sink.write(LF); lineBuffer.setLength(0); - if (c != LF) { + if (c != LF) { lineBuffer.append((char) c); } } else { @@ -70,9 +71,7 @@ public void close() throws IOException { throw new UnsupportedOperationException(); } - /** - * Complete the current line (emit LF if not at the start of the line already). - */ + /** Complete the current line (emit LF if not at the start of the line already). */ public void completeLine() throws IOException { if (lineBuffer.length() > 0) { write(LF); diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ProfileResults.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ProfileResults.java index 60def1a89d1..15e0f11c56e 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ProfileResults.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/ProfileResults.java @@ -20,13 +20,12 @@ import java.io.IOException; import java.nio.file.Paths; import java.util.AbstractMap.SimpleEntry; -import java.util.Arrays; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; - import jdk.jfr.consumer.RecordedClass; import jdk.jfr.consumer.RecordedEvent; import jdk.jfr.consumer.RecordedFrame; @@ -36,15 +35,12 @@ import jdk.jfr.consumer.RecordingFile; /** - * Processes an array of recording files (from tests), and prints a simple histogram. - * Inspired by the JFR example code. - * Whole stacks are deduplicated (with the default stacksize being 1): you can drill deeper - * by adjusting the parameters. + * Processes an array of recording files (from tests), and prints a simple histogram. Inspired by + * the JFR example code. Whole stacks are deduplicated (with the default stacksize being 1): you can + * drill deeper by adjusting the parameters. */ public class ProfileResults { - /** - * Formats a frame to a formatted line. This is deduplicated on! - */ + /** Formats a frame to a formatted line. This is deduplicated on! */ static String frameToString(RecordedFrame frame, boolean lineNumbers) { StringBuilder builder = new StringBuilder(); RecordedMethod method = frame.getMethod(); @@ -84,29 +80,32 @@ static String frameToString(RecordedFrame frame, boolean lineNumbers) { /** * Driver method, for testing standalone. + * *

    * java -Dtests.profile.count=5 buildSrc/src/main/java/org/apache/lucene/gradle/ProfileResults.java \
    *   ./lucene/core/build/tmp/tests-cwd/somefile.jfr ...
    * 
*/ public static void main(String[] args) throws IOException { - printReport(Arrays.asList(args), - System.getProperty(MODE_KEY, MODE_DEFAULT), - Integer.parseInt(System.getProperty(STACKSIZE_KEY, STACKSIZE_DEFAULT)), - Integer.parseInt(System.getProperty(COUNT_KEY, COUNT_DEFAULT)), - Boolean.parseBoolean(System.getProperty(LINENUMBERS_KEY, LINENUMBERS_DEFAULT))); + printReport( + Arrays.asList(args), + System.getProperty(MODE_KEY, MODE_DEFAULT), + Integer.parseInt(System.getProperty(STACKSIZE_KEY, STACKSIZE_DEFAULT)), + Integer.parseInt(System.getProperty(COUNT_KEY, COUNT_DEFAULT)), + Boolean.parseBoolean(System.getProperty(LINENUMBERS_KEY, LINENUMBERS_DEFAULT))); } /** true if we care about this event */ static boolean isInteresting(String mode, RecordedEvent event) { String name = event.getEventType().getName(); - switch(mode) { + switch (mode) { case "cpu": - return (name.equals("jdk.ExecutionSample") || name.equals("jdk.NativeMethodSample")) && - !isGradlePollThread(event.getThread("sampledThread")); + return (name.equals("jdk.ExecutionSample") || name.equals("jdk.NativeMethodSample")) + && !isGradlePollThread(event.getThread("sampledThread")); case "heap": - return (name.equals("jdk.ObjectAllocationInNewTLAB") || name.equals("jdk.ObjectAllocationOutsideTLAB")) && - !isGradlePollThread(event.getThread("eventThread")); + return (name.equals("jdk.ObjectAllocationInNewTLAB") + || name.equals("jdk.ObjectAllocationOutsideTLAB")) + && !isGradlePollThread(event.getThread("eventThread")); default: throw new UnsupportedOperationException(event.toString()); } @@ -119,7 +118,7 @@ static boolean isGradlePollThread(RecordedThread thread) { /** value we accumulate for this event */ static long getValue(RecordedEvent event) { - switch(event.getEventType().getName()) { + switch (event.getEventType().getName()) { case "jdk.ObjectAllocationInNewTLAB": return event.getLong("tlabSize"); case "jdk.ObjectAllocationOutsideTLAB": @@ -144,15 +143,17 @@ static String formatValue(long value) { /** fixed width used for printing the different columns */ private static final int COLUMN_SIZE = 14; + private static final String COLUMN_PAD = "%-" + COLUMN_SIZE + "s"; + private static String pad(String input) { return String.format(Locale.ROOT, COLUMN_PAD, input); } - /** - * Process all the JFR files passed in args and print a merged summary. - */ - public static void printReport(List files, String mode, int stacksize, int count, boolean lineNumbers) throws IOException { + /** Process all the JFR files passed in args and print a merged summary. */ + public static void printReport( + List files, String mode, int stacksize, int count, boolean lineNumbers) + throws IOException { if (!"cpu".equals(mode) && !"heap".equals(mode)) { throw new IllegalArgumentException("tests.profile.mode must be one of (cpu,heap)"); } @@ -178,14 +179,13 @@ public static void printReport(List files, String mode, int stacksize, i StringBuilder stack = new StringBuilder(); for (int i = 0; i < Math.min(stacksize, trace.getFrames().size()); i++) { if (stack.length() > 0) { - stack.append("\n") - .append(framePadding) - .append(" at "); + stack.append("\n").append(framePadding).append(" at "); } stack.append(frameToString(trace.getFrames().get(i), lineNumbers)); } String line = stack.toString(); - SimpleEntry entry = histogram.computeIfAbsent(line, u -> new SimpleEntry<>(line, 0L)); + SimpleEntry entry = + histogram.computeIfAbsent(line, u -> new SimpleEntry<>(line, 0L)); long value = getValue(event); entry.setValue(entry.getValue() + value); totalEvents++; @@ -195,12 +195,20 @@ public static void printReport(List files, String mode, int stacksize, i } } // print summary from histogram - System.out.printf(Locale.ROOT, "PROFILE SUMMARY from %d events (total: %s)\n", totalEvents, formatValue(sumValues)); + System.out.printf( + Locale.ROOT, + "PROFILE SUMMARY from %d events (total: %s)\n", + totalEvents, + formatValue(sumValues)); System.out.printf(Locale.ROOT, " tests.profile.mode=%s\n", mode); System.out.printf(Locale.ROOT, " tests.profile.count=%d\n", count); System.out.printf(Locale.ROOT, " tests.profile.stacksize=%d\n", stacksize); System.out.printf(Locale.ROOT, " tests.profile.linenumbers=%b\n", lineNumbers); - System.out.printf(Locale.ROOT, "%s%sSTACK\n", pad("PERCENT"), pad(mode.toUpperCase(Locale.ROOT) + " SAMPLES")); + System.out.printf( + Locale.ROOT, + "%s%sSTACK\n", + pad("PERCENT"), + pad(mode.toUpperCase(Locale.ROOT) + " SAMPLES")); List> entries = new ArrayList<>(histogram.values()); entries.sort((u, v) -> v.getValue().compareTo(u.getValue())); int seen = 0; @@ -209,7 +217,8 @@ public static void printReport(List files, String mode, int stacksize, i break; } String percent = String.format("%2.2f%%", 100 * (c.getValue() / (float) sumValues)); - System.out.printf(Locale.ROOT, "%s%s%s\n", pad(percent), pad(formatValue(c.getValue())), c.getKey()); + System.out.printf( + Locale.ROOT, "%s%s%s\n", pad(percent), pad(formatValue(c.getValue())), c.getKey()); } } } diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/SpillWriter.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/SpillWriter.java index f89977c2503..9539bddbbfe 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/SpillWriter.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/SpillWriter.java @@ -26,7 +26,7 @@ import java.util.function.Supplier; public class SpillWriter extends Writer { - private final static int MAX_BUFFERED = 2 * 1024; + private static final int MAX_BUFFERED = 2 * 1024; private final StringWriter buffer = new StringWriter(MAX_BUFFERED); private final Supplier spillPathSupplier; diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/StdOutTeeWriter.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/StdOutTeeWriter.java index 20a4c8524f6..8bd2256e091 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/StdOutTeeWriter.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/StdOutTeeWriter.java @@ -21,73 +21,73 @@ import java.io.Writer; class StdOutTeeWriter extends Writer { - private final Writer delegate; - private final PrintStream out = System.out; + private final Writer delegate; + private final PrintStream out = System.out; - public StdOutTeeWriter(Writer delegate) { - this.delegate = delegate; - } + public StdOutTeeWriter(Writer delegate) { + this.delegate = delegate; + } - @Override - public void write(int c) throws IOException { - delegate.write(c); - out.write(c); - } + @Override + public void write(int c) throws IOException { + delegate.write(c); + out.write(c); + } - @Override - public void write(char[] cbuf) throws IOException { - delegate.write(cbuf); - out.print(cbuf); - } + @Override + public void write(char[] cbuf) throws IOException { + delegate.write(cbuf); + out.print(cbuf); + } - @Override - public void write(String str) throws IOException { - delegate.write(str); - out.print(str); - } + @Override + public void write(String str) throws IOException { + delegate.write(str); + out.print(str); + } - @Override - public void write(String str, int off, int len) throws IOException { - delegate.write(str, off, len); - out.append(str, off, len); - } + @Override + public void write(String str, int off, int len) throws IOException { + delegate.write(str, off, len); + out.append(str, off, len); + } - @Override - public Writer append(CharSequence csq) throws IOException { - delegate.append(csq); - out.append(csq); - return this; - } + @Override + public Writer append(CharSequence csq) throws IOException { + delegate.append(csq); + out.append(csq); + return this; + } - @Override - public Writer append(CharSequence csq, int start, int end) throws IOException { - delegate.append(csq, start, end); - out.append(csq, start, end); - return this; - } + @Override + public Writer append(CharSequence csq, int start, int end) throws IOException { + delegate.append(csq, start, end); + out.append(csq, start, end); + return this; + } - @Override - public Writer append(char c) throws IOException { - delegate.append(c); - out.append(c); - return this; - } + @Override + public Writer append(char c) throws IOException { + delegate.append(c); + out.append(c); + return this; + } - @Override - public void write(char[] cbuf, int off, int len) throws IOException { - delegate.write(cbuf, off, len); - out.print(new String(cbuf, off, len)); - } + @Override + public void write(char[] cbuf, int off, int len) throws IOException { + delegate.write(cbuf, off, len); + out.print(new String(cbuf, off, len)); + } - @Override - public void flush() throws IOException { - delegate.flush(); - out.flush(); - } + @Override + public void flush() throws IOException { + delegate.flush(); + out.flush(); + } - @Override - public void close() throws IOException { - delegate.close(); - // Don't close the actual output. - } + @Override + public void close() throws IOException { + delegate.close(); + // Don't close the actual output. + } } diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java index e6930af7c74..f7e07eb164a 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java @@ -16,32 +16,26 @@ */ package org.apache.lucene.gradle; +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; -import java.net.URLConnection; -import java.nio.channels.Channels; -import java.nio.channels.FileChannel; -import java.nio.channels.ReadableByteChannel; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.EnumSet; import java.util.Locale; import java.util.concurrent.TimeUnit; -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; -import static java.nio.file.StandardOpenOption.APPEND; - /** * Standalone class that can be used to download a gradle-wrapper.jar - *

- * Has no dependencies outside of standard java libraries + * + *

Has no dependencies outside of standard java libraries */ public class WrapperDownloader { public static void main(String[] args) { @@ -62,18 +56,21 @@ public static void main(String[] args) { public static void checkVersion() { int major = Runtime.getRuntime().version().feature(); if (major < 11 || major > 21) { - throw new IllegalStateException("java version must be between 11 and 21, your version: " + major); + throw new IllegalStateException( + "java version must be between 11 and 21, your version: " + major); } } public void run(Path destination) throws IOException, NoSuchAlgorithmException { - Path checksumPath = destination.resolveSibling(destination.getFileName().toString() + ".sha256"); + Path checksumPath = + destination.resolveSibling(destination.getFileName().toString() + ".sha256"); if (!Files.exists(checksumPath)) { throw new IOException("Checksum file not found: " + checksumPath); } String expectedChecksum = Files.readString(checksumPath, StandardCharsets.UTF_8).trim(); - Path versionPath = destination.resolveSibling(destination.getFileName().toString() + ".version"); + Path versionPath = + destination.resolveSibling(destination.getFileName().toString() + ".version"); if (!Files.exists(versionPath)) { throw new IOException("Wrapper version file not found: " + versionPath); } @@ -92,7 +89,11 @@ public void run(Path destination) throws IOException, NoSuchAlgorithmException { } } - URL url = new URL("https://raw.githubusercontent.com/gradle/gradle/v" + wrapperVersion + "/gradle/wrapper/gradle-wrapper.jar"); + URL url = + new URL( + "https://raw.githubusercontent.com/gradle/gradle/v" + + wrapperVersion + + "/gradle/wrapper/gradle-wrapper.jar"); System.err.println("Downloading gradle-wrapper.jar from " + url); // Zero-copy save the jar to a temp file @@ -108,7 +109,8 @@ public void run(Path destination) throws IOException, NoSuchAlgorithmException { } catch (IOException e) { if (retries-- > 0) { // Retry after a short delay - System.err.println("Error connecting to server: " + e + ", will retry in " + retryDelay + " seconds."); + System.err.println( + "Error connecting to server: " + e + ", will retry in " + retryDelay + " seconds."); Thread.sleep(TimeUnit.SECONDS.toMillis(retryDelay)); continue; } @@ -120,7 +122,12 @@ public void run(Path destination) throws IOException, NoSuchAlgorithmException { case HttpURLConnection.HTTP_BAD_GATEWAY: if (retries-- > 0) { // Retry after a short delay. - System.err.println("Server returned HTTP " + connection.getResponseCode() + ", will retry in " + retryDelay + " seconds."); + System.err.println( + "Server returned HTTP " + + connection.getResponseCode() + + ", will retry in " + + retryDelay + + " seconds."); Thread.sleep(TimeUnit.SECONDS.toMillis(retryDelay)); continue; } @@ -131,13 +138,15 @@ public void run(Path destination) throws IOException, NoSuchAlgorithmException { } try (InputStream is = connection.getInputStream(); - OutputStream out = Files.newOutputStream(temp)){ + OutputStream out = Files.newOutputStream(temp)) { is.transferTo(out); } String checksum = checksum(digest, temp); if (!checksum.equalsIgnoreCase(expectedChecksum)) { - throw new IOException(String.format(Locale.ROOT, + throw new IOException( + String.format( + Locale.ROOT, "Checksum mismatch on downloaded gradle-wrapper.jar (was: %s, expected: %s).", checksum, expectedChecksum)); @@ -146,8 +155,12 @@ public void run(Path destination) throws IOException, NoSuchAlgorithmException { Files.move(temp, destination, REPLACE_EXISTING); temp = null; } catch (IOException | InterruptedException e) { - throw new IOException("Could not download gradle-wrapper.jar (" + - e.getClass().getSimpleName() + ": " + e.getMessage() + ")."); + throw new IOException( + "Could not download gradle-wrapper.jar (" + + e.getClass().getSimpleName() + + ": " + + e.getMessage() + + ")."); } finally { if (temp != null) { Files.deleteIfExists(temp); @@ -165,7 +178,8 @@ private String checksum(MessageDigest messageDigest, Path path) throws IOExcepti } return sb.toString(); } catch (IOException e) { - throw new IOException("Could not compute digest of file: " + path + " (" + e.getMessage() + ")"); + throw new IOException( + "Could not compute digest of file: " + path + " (" + e.getMessage() + ")"); } } } diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/buildinfra/BuildInfraPlugin.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/buildinfra/BuildInfraPlugin.java index 4d7873c83d3..027e393dd3e 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/buildinfra/BuildInfraPlugin.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/buildinfra/BuildInfraPlugin.java @@ -16,47 +16,44 @@ */ package org.apache.lucene.gradle.buildinfra; +import java.nio.file.Path; +import org.apache.commons.codec.digest.DigestUtils; import org.apache.lucene.gradle.Checksum; -import org.apache.lucene.gradle.ProfileResults; import org.apache.lucene.gradle.ErrorReportingTestListener; -import org.gradle.api.tasks.testing.TestDescriptor; +import org.apache.lucene.gradle.ProfileResults; import org.gradle.api.Plugin; import org.gradle.api.Project; +import org.gradle.api.tasks.testing.TestDescriptor; import org.gradle.api.tasks.testing.logging.TestLogging; -import java.nio.file.Path; -import org.apache.commons.codec.digest.DigestUtils; public class BuildInfraPlugin implements Plugin { - @Override - public void apply(Project project) { - project - .getExtensions() - .create( - BuildInfraExtension.NAME, - BuildInfraExtension.class); - } + @Override + public void apply(Project project) { + project.getExtensions().create(BuildInfraExtension.NAME, BuildInfraExtension.class); + } - public static class BuildInfraExtension { - public static final String NAME = "buildinfra"; + public static class BuildInfraExtension { + public static final String NAME = "buildinfra"; - public ErrorReportingTestListener newErrorReportingTestListener(TestLogging testLogging, Path spillDir, Path outputsDir, boolean verboseMode) { - return new ErrorReportingTestListener(testLogging, spillDir, outputsDir, verboseMode); - } + public ErrorReportingTestListener newErrorReportingTestListener( + TestLogging testLogging, Path spillDir, Path outputsDir, boolean verboseMode) { + return new ErrorReportingTestListener(testLogging, spillDir, outputsDir, verboseMode); + } - public DigestUtils sha1Digest() { - return new DigestUtils(DigestUtils.getSha1Digest()); - } + public DigestUtils sha1Digest() { + return new DigestUtils(DigestUtils.getSha1Digest()); + } - public String getOutputLogName(TestDescriptor suite) { - return ErrorReportingTestListener.getOutputLogName(suite); - } + public String getOutputLogName(TestDescriptor suite) { + return ErrorReportingTestListener.getOutputLogName(suite); + } - public Class checksumClass() { - return Checksum.class; - } + public Class checksumClass() { + return Checksum.class; + } - public Class profileResultsClass() { - return ProfileResults.class; - } + public Class profileResultsClass() { + return ProfileResults.class; } + } } diff --git a/build-tools/missing-doclet/build.gradle b/build-tools/missing-doclet/build.gradle index aeaaf3f7af4..d0c463c5908 100644 --- a/build-tools/missing-doclet/build.gradle +++ b/build-tools/missing-doclet/build.gradle @@ -17,12 +17,25 @@ plugins { id 'java-library' + alias(libs.plugins.diffplug.spotless) apply false +} + +repositories { + mavenCentral() } version = "1.0.0-SNAPSHOT" group = "org.apache.solr.tools" description = 'Doclet-based javadoc validation' +// Make sure the build environment is consistent. +apply from: file('../../gradle/conventions.gradle') +apply from: file('../../gradle/validation/check-environment.gradle') + +// Add spotless/ tidy. +tasks.register("checkJdkInternalsExportedToGradle") {} +apply from: file('../../gradle/validation/spotless.gradle') + java { sourceCompatibility = JavaVersion.toVersion(libs.versions.minJava.get()) targetCompatibility = JavaVersion.toVersion(libs.versions.minJava.get()) diff --git a/build-tools/missing-doclet/settings.gradle b/build-tools/missing-doclet/settings.gradle index cf21576fb8c..96d1cc0bf04 100644 --- a/build-tools/missing-doclet/settings.gradle +++ b/build-tools/missing-doclet/settings.gradle @@ -20,7 +20,7 @@ rootProject.name = "missing-doclet" // Use project's version catalog for centralized dependency management dependencyResolutionManagement { versionCatalogs { - create("libs") { + libs { from(files("../../gradle/libs.versions.toml")) } } diff --git a/build-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java b/build-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java index 36c0e4fe4c8..44c9c411a9e 100644 --- a/build-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java +++ b/build-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java @@ -16,6 +16,9 @@ */ package org.apache.lucene.missingdoclet; +import com.sun.source.doctree.DocCommentTree; +import com.sun.source.doctree.ParamTree; +import com.sun.source.util.DocTrees; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; @@ -24,7 +27,6 @@ import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; - import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; @@ -35,24 +37,19 @@ import javax.lang.model.util.ElementFilter; import javax.lang.model.util.Elements; import javax.tools.Diagnostic; - -import com.sun.source.doctree.DocCommentTree; -import com.sun.source.doctree.ParamTree; -import com.sun.source.util.DocTrees; - import jdk.javadoc.doclet.Doclet; import jdk.javadoc.doclet.DocletEnvironment; import jdk.javadoc.doclet.Reporter; import jdk.javadoc.doclet.StandardDoclet; /** - * Checks for missing javadocs, where missing also means "only whitespace" or "license header". - * Has option --missing-level (package, class, method, parameter) so that we can improve over time. - * Has option --missing-ignore to ignore individual elements (such as split packages). - * It isn't recursive, just ignores exactly the elements you tell it. - * This should be removed when packaging is fixed to no longer be split across JARs. - * Has option --missing-method to apply "method" level to selected packages (fix one at a time). - * Matches package names exactly: so you'll need to list subpackages separately. + * Checks for missing javadocs, where missing also means "only whitespace" or "license header". Has + * option --missing-level (package, class, method, parameter) so that we can improve over time. Has + * option --missing-ignore to ignore individual elements (such as split packages). It isn't + * recursive, just ignores exactly the elements you tell it. This should be removed when packaging + * is fixed to no longer be split across JARs. Has option --missing-method to apply "method" level + * to selected packages (fix one at a time). Matches package names exactly: so you'll need to list + * subpackages separately. */ public class MissingDoclet extends StandardDoclet { // checks that modules and packages have documentation @@ -70,121 +67,124 @@ public class MissingDoclet extends StandardDoclet { Elements elementUtils; Set ignored = Collections.emptySet(); Set methodPackages = Collections.emptySet(); - + @Override public Set getSupportedOptions() { Set options = new HashSet<>(); options.addAll(super.getSupportedOptions()); - options.add(new Doclet.Option() { - @Override - public int getArgumentCount() { - return 1; - } + options.add( + new Doclet.Option() { + @Override + public int getArgumentCount() { + return 1; + } - @Override - public String getDescription() { - return "level to enforce for missing javadocs: [package, class, method, parameter]"; - } + @Override + public String getDescription() { + return "level to enforce for missing javadocs: [package, class, method, parameter]"; + } - @Override - public Kind getKind() { - return Option.Kind.STANDARD; - } + @Override + public Kind getKind() { + return Option.Kind.STANDARD; + } - @Override - public List getNames() { - return Collections.singletonList("--missing-level"); - } + @Override + public List getNames() { + return Collections.singletonList("--missing-level"); + } - @Override - public String getParameters() { - return "level"; - } + @Override + public String getParameters() { + return "level"; + } - @Override - public boolean process(String option, List arguments) { - switch (arguments.get(0)) { - case "package": - level = PACKAGE; - return true; - case "class": - level = CLASS; - return true; - case "method": - level = METHOD; - return true; - case "parameter": - level = PARAMETER; - return true; - default: - return false; - } - } - }); - options.add(new Doclet.Option() { - @Override - public int getArgumentCount() { - return 1; - } + @Override + public boolean process(String option, List arguments) { + switch (arguments.get(0)) { + case "package": + level = PACKAGE; + return true; + case "class": + level = CLASS; + return true; + case "method": + level = METHOD; + return true; + case "parameter": + level = PARAMETER; + return true; + default: + return false; + } + } + }); + options.add( + new Doclet.Option() { + @Override + public int getArgumentCount() { + return 1; + } - @Override - public String getDescription() { - return "comma separated list of element names to ignore (e.g. as a workaround for split packages)"; - } + @Override + public String getDescription() { + return "comma separated list of element names to ignore (e.g. as a workaround for split packages)"; + } - @Override - public Kind getKind() { - return Option.Kind.STANDARD; - } + @Override + public Kind getKind() { + return Option.Kind.STANDARD; + } - @Override - public List getNames() { - return Collections.singletonList("--missing-ignore"); - } + @Override + public List getNames() { + return Collections.singletonList("--missing-ignore"); + } - @Override - public String getParameters() { - return "ignoredNames"; - } + @Override + public String getParameters() { + return "ignoredNames"; + } - @Override - public boolean process(String option, List arguments) { - ignored = new HashSet<>(Arrays.asList(arguments.get(0).split(","))); - return true; - } - }); - options.add(new Doclet.Option() { - @Override - public int getArgumentCount() { - return 1; - } + @Override + public boolean process(String option, List arguments) { + ignored = new HashSet<>(Arrays.asList(arguments.get(0).split(","))); + return true; + } + }); + options.add( + new Doclet.Option() { + @Override + public int getArgumentCount() { + return 1; + } - @Override - public String getDescription() { - return "comma separated list of packages to check at 'method' level"; - } + @Override + public String getDescription() { + return "comma separated list of packages to check at 'method' level"; + } - @Override - public Kind getKind() { - return Option.Kind.STANDARD; - } + @Override + public Kind getKind() { + return Option.Kind.STANDARD; + } - @Override - public List getNames() { - return Collections.singletonList("--missing-method"); - } + @Override + public List getNames() { + return Collections.singletonList("--missing-method"); + } - @Override - public String getParameters() { - return "packages"; - } + @Override + public String getParameters() { + return "packages"; + } - @Override - public boolean process(String option, List arguments) { - methodPackages = new HashSet<>(Arrays.asList(arguments.get(0).split(","))); - return true; - } - }); + @Override + public boolean process(String option, List arguments) { + methodPackages = new HashSet<>(Arrays.asList(arguments.get(0).split(","))); + return true; + } + }); return options; } @@ -205,10 +205,8 @@ public boolean run(DocletEnvironment docEnv) { return super.run(docEnv); } - - /** - * Returns effective check level for this element - */ + + /** Returns effective check level for this element */ private int level(Element element) { String pkg = elementUtils.getPackageOf(element).getQualifiedName().toString(); if (methodPackages.contains(pkg)) { @@ -217,24 +215,24 @@ private int level(Element element) { return level; } } - - /** - * Check an individual element. - * This checks packages and types from the doctrees. - * It will recursively check methods/fields from encountered types when the level is "method" + + /** + * Check an individual element. This checks packages and types from the doctrees. It will + * recursively check methods/fields from encountered types when the level is "method" */ private void check(Element element) { - switch(element.getKind()) { + switch (element.getKind()) { case MODULE: // don't check the unnamed module, it won't have javadocs - if (!((ModuleElement)element).isUnnamed()) { + if (!((ModuleElement) element).isUnnamed()) { checkComment(element); } break; case PACKAGE: checkComment(element); break; - // class-like elements, check them, then recursively check their children (fields and methods) + // class-like elements, check them, then recursively check their children (fields and + // methods) case CLASS: case INTERFACE: case ENUM: @@ -242,17 +240,18 @@ private void check(Element element) { if (level(element) >= CLASS) { checkComment(element); for (var subElement : element.getEnclosedElements()) { - // don't recurse into enclosed types, otherwise we'll double-check since they are already in the included docTree - if (subElement.getKind() == ElementKind.METHOD || - subElement.getKind() == ElementKind.CONSTRUCTOR || - subElement.getKind() == ElementKind.FIELD || - subElement.getKind() == ElementKind.ENUM_CONSTANT) { + // don't recurse into enclosed types, otherwise we'll double-check since they are + // already in the included docTree + if (subElement.getKind() == ElementKind.METHOD + || subElement.getKind() == ElementKind.CONSTRUCTOR + || subElement.getKind() == ElementKind.FIELD + || subElement.getKind() == ElementKind.ENUM_CONSTANT) { check(subElement); } } } break; - // method-like elements, check them if we are configured to do so + // method-like elements, check them if we are configured to do so case METHOD: case CONSTRUCTOR: case FIELD: @@ -267,9 +266,9 @@ private void check(Element element) { } /** - * Return true if the method is synthetic enum method (values/valueOf). - * According to the doctree documentation, the "included" set never includes synthetic elements. - * UweSays: It should not happen but it happens! + * Return true if the method is synthetic enum method (values/valueOf). According to the doctree + * documentation, the "included" set never includes synthetic elements. UweSays: It should not + * happen but it happens! */ private boolean isSyntheticEnumMethod(Element element) { String simpleName = element.getSimpleName().toString(); @@ -280,20 +279,23 @@ private boolean isSyntheticEnumMethod(Element element) { } return false; } - + /** - * Checks that an element doesn't have missing javadocs. - * In addition to truly "missing", check that comments aren't solely whitespace (generated by some IDEs), - * that they aren't a license header masquerading as a javadoc comment. + * Checks that an element doesn't have missing javadocs. In addition to truly "missing", check + * that comments aren't solely whitespace (generated by some IDEs), that they aren't a license + * header masquerading as a javadoc comment. */ private void checkComment(Element element) { // sanity check that the element is really "included", because we do some recursion into types if (!docEnv.isIncluded(element)) { return; } - // check that this element isn't on our ignore list. This is only used as a workaround for "split packages". - // ignoring a package isn't recursive (on purpose), we still check all the classes, etc. inside it. - // we just need to cope with the fact package-info.java isn't there because it is split across multiple jars. + // check that this element isn't on our ignore list. This is only used as a workaround for + // "split packages". + // ignoring a package isn't recursive (on purpose), we still check all the classes, etc. inside + // it. + // we just need to cope with the fact package-info.java isn't there because it is split across + // multiple jars. if (ignored.contains(element.toString())) { return; } @@ -306,14 +308,17 @@ private void checkComment(Element element) { error(element, "javadocs are missing"); } } else { - var normalized = tree.getFirstSentence().get(0).toString() - .replace('\u00A0', ' ') - .trim() - .toLowerCase(Locale.ROOT); + var normalized = + tree.getFirstSentence() + .get(0) + .toString() + .replace('\u00A0', ' ') + .trim() + .toLowerCase(Locale.ROOT); if (normalized.isEmpty()) { error(element, "blank javadoc comment"); - } else if (normalized.startsWith("licensed to the apache software foundation") || - normalized.startsWith("copyright 2004 the apache software foundation")) { + } else if (normalized.startsWith("licensed to the apache software foundation") + || normalized.startsWith("copyright 2004 the apache software foundation")) { error(element, "comment is really a license"); } } @@ -323,13 +328,15 @@ private void checkComment(Element element) { } private boolean hasInheritedJavadocs(Element element) { - boolean hasOverrides = element.getAnnotationMirrors().stream() - .anyMatch(ann -> ann.getAnnotationType().toString().equals(Override.class.getName())); + boolean hasOverrides = + element.getAnnotationMirrors().stream() + .anyMatch(ann -> ann.getAnnotationType().toString().equals(Override.class.getName())); if (hasOverrides) { // If an element has explicit @Overrides annotation, assume it does // have inherited javadocs somewhere. - reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping."); + reporter.print( + Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping."); return true; } @@ -346,7 +353,10 @@ private boolean hasInheritedJavadocs(Element element) { // We could check supMethod for non-empty javadoc here. Don't know if this makes // sense though as all methods will be verified in the end so it'd fail on the // top of the hierarchy (if empty) anyway. - reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but method overrides another, skipping."); + reporter.print( + Diagnostic.Kind.NOTE, + element, + "javadoc empty but method overrides another, skipping."); return true; } } @@ -356,15 +366,14 @@ private boolean hasInheritedJavadocs(Element element) { return false; } - /* Find types from which methods in type may inherit javadoc, in the proper order.*/ private Stream superTypeForInheritDoc(Element type) { TypeElement clazz = (TypeElement) type; - List interfaces = clazz.getInterfaces() - .stream() - .filter(tm -> tm.getKind() == TypeKind.DECLARED) - .map(tm -> ((DeclaredType) tm).asElement()) - .collect(Collectors.toList()); + List interfaces = + clazz.getInterfaces().stream() + .filter(tm -> tm.getKind() == TypeKind.DECLARED) + .map(tm -> ((DeclaredType) tm).asElement()) + .collect(Collectors.toList()); Stream result = interfaces.stream(); result = Stream.concat(result, interfaces.stream().flatMap(this::superTypeForInheritDoc)); @@ -386,13 +395,13 @@ private void checkParameters(Element element, DocCommentTree tree) { if (tree != null) { for (var tag : tree.getBlockTags()) { if (tag instanceof ParamTree) { - var name = ((ParamTree)tag).getName().getName().toString(); + var name = ((ParamTree) tag).getName().getName().toString(); seenParameters.add(name); } } } // now compare the method's formal parameter list against it - for (var param : ((ExecutableElement)element).getParameters()) { + for (var param : ((ExecutableElement) element).getParameters()) { var name = param.getSimpleName().toString(); if (!seenParameters.contains(name)) { error(element, "missing javadoc @param for parameter '" + name + "'"); @@ -400,7 +409,7 @@ private void checkParameters(Element element, DocCommentTree tree) { } } } - + /** logs a new error for the particular element */ private void error(Element element, String message) { var fullMessage = new StringBuilder(); diff --git a/build.gradle b/build.gradle index 89b1a81200e..a4c7350d13d 100644 --- a/build.gradle +++ b/build.gradle @@ -25,6 +25,8 @@ plugins { alias(libs.plugins.carrotsearch.dependencychecks) alias(libs.plugins.owasp.dependencycheck) alias(libs.plugins.cutterslade.analyze) + alias(libs.plugins.benmanes.versions) + alias(libs.plugins.littlerobots.versioncatalogupdate) apply false alias(libs.plugins.thetaphi.forbiddenapis) apply false alias(libs.plugins.udnercouch.download) apply false alias(libs.plugins.ltgt.errorprone) apply false @@ -117,6 +119,7 @@ ext { // if the build file is incorrectly written and evaluates something // eagerly). +apply from: file('gradle/conventions.gradle') apply from: file('gradle/generation/local-settings.gradle') // Ant-compatibility layer: apply folder layout early so that @@ -158,9 +161,17 @@ apply from: file('gradle/validation/validate-log-calls.gradle') apply from: file('gradle/validation/check-broken-links.gradle') apply from: file('gradle/validation/solr.config-file-sanity.gradle') - +apply from: file('gradle/validation/dependencies.gradle') apply from: file('gradle/validation/spotless.gradle') +// Wire up included builds to some validation tasks. +rootProject.tasks.named("tidy").configure { + dependsOn gradle.includedBuilds*.task(":tidy") +} +rootProject.tasks.named("clean").configure { + dependsOn gradle.includedBuilds*.task(":clean") +} + // Source or data regeneration tasks apply from: file('gradle/generation/regenerate.gradle') apply from: file('gradle/generation/javacc.gradle') diff --git a/gradle/conventions.gradle b/gradle/conventions.gradle new file mode 100644 index 00000000000..fabc9b4cc58 --- /dev/null +++ b/gradle/conventions.gradle @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * http://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. + */ + +configure(allprojects) { + tasks.register("tidy").configure { + description "Applies formatters and cleanups to sources." + group "verification" + } +} + +// Locate script-relative resource folder. This is context-sensitive so pass +// the right buildscript (top-level). +configure(rootProject) { + ext { + scriptResources = { buildscript -> + return file(buildscript.sourceFile.absolutePath.replaceAll('.gradle$', "")) + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1a1e4f54ac9..620a57f5a76 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,22 +12,14 @@ # 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. - -# Note: To avoid duplicate entries with slightly different names, keep the lists -# sorted alphabetically. - [versions] - -# @keep This is the minimum required Java version. -minJava = "11" -# @keep Gradle version to run the build -gradle = "8.4" - adobe-testing-s3mock = "2.17.0" amazon-awssdk = "2.26.19" +# @keep Antora version used in ref-guide antora = "3.1.4" -# Most recent commit as of 2022-06-24, this repo does not have tags +# @keep Most recent commit as of 2022-06-24, this repo does not have tags antora-default-ui = "51ad811622394027afb4e182c2fdabc235ae04dd" +# @keep Antora Lunr extensions version used in ref-guide antora-lunr-extension = "1.0.0-alpha.8" apache-calcite = "1.37.0" apache-calcite-avatica = "1.25.0" @@ -38,11 +30,11 @@ apache-commons-exec = "1.4.0" apache-commons-lang3 = "3.15.0" apache-commons-math3 = "3.6.1" apache-curator = "5.7.0" -apache-httpcomponents-httpmime = "4.5.14" -apache-httpcomponents-httpclient = "4.5.14" -apache-httpcomponents-httpcore = "4.4.16" apache-hadoop = "3.3.6" apache-hadoop-thirdparty = "1.2.0" +apache-httpcomponents-httpclient = "4.5.14" +apache-httpcomponents-httpcore = "4.4.16" +apache-httpcomponents-httpmime = "4.5.14" apache-kerby = "1.0.1" apache-log4j = "2.21.0" apache-lucene = "9.11.1" @@ -54,11 +46,15 @@ apache-tomcat = "6.0.53" apache-zookeeper = "3.9.2" aqute-bnd = "6.4.1" argparse4j = "0.9.0" +# @keep Asciidoctor mathjax version used in ref-guide asciidoctor-mathjax = "0.0.9" +# @keep Asciidoctor tabs version used in ref-guide asciidoctor-tabs = "1.0.0-beta.6" bc-jose4j = "0.9.6" benmanes-caffeine = "3.1.8" +benmanes-versions = "0.51.0" bouncycastle = "1.78.1" +# @keep Browserify version used in ref-guide browserify = "17.0.0" carrot2-core = "4.5.1" carrotsearch-dependencychecks = "0.0.9" @@ -69,16 +65,18 @@ commons-cli = "1.8.0" commons-codec = "1.17.1" commons-collections = "3.2.2" commons-io = "2.15.1" -cybozulabs-langdetect = "1.1-20120112" cutterslade-analyze = "1.9.1" +cybozulabs-langdetect = "1.1-20120112" diffplug-spotless = "6.5.2" dropwizard-metrics = "4.2.26" eclipse-ecj = "3.33.0" eclipse-jetty = "10.0.22" -eclipse-jgit = "6.7.0.202309050840-r" eclipse-jettytoolchain = "4.0.6" +# @keep jgit version used by git-statuts.gradle +eclipse-jgit = "6.7.0.202309050840-r" fasterxml = "2.17.2" fasterxml-woodstox = "6.6.2" +# @keep Flexmark used in classpath flexmark = "0.64.8" google-api-gax = "2.33.0" google-auth = "1.19.0" @@ -91,13 +89,16 @@ google-guava = "32.1.3-jre" # @keep This is GJF version for spotless/ tidy. google-javaformat = "1.18.1" google-re2j = "1.7" +# @keep Gradle version to run the build +gradle = "8.4" grpc = "1.65.1" +# @keep Gulp version used in ref-guide gulp-cli = "2.3.0" hamcrest = "2.2" hk2 = "3.0.5" hsqldb = "2.7.2" ibm-icu = "74.2" -immutables-valueannotations= "2.10.1" +immutables-valueannotations = "2.10.1" j256-simplemagic = "1.17" jakarta-annotation = "2.1.1" jakarta-inject = "2.0.1" @@ -109,9 +110,13 @@ jersey = "3.1.5" jersey-containers = "2.39.1" johnrengelman-shadow = "6.1.0" junit = "4.13.2" +# @keep Link checker version used in ref-guide link-checker = "1.4.2" +littlerobots-versioncatalogupdate = "0.8.4" lmax-disruptor = "3.4.4" ltgt-errorprone = "3.1.0" +# @keep This is the minimum required Java version. +minJava = "11" mockito = "5.12.0" morethan-jmhreport = "0.9.0" navsecurity = "0.5.10" @@ -119,14 +124,13 @@ netty = "4.1.111.Final" nimbusds-josejwt = "9.30.2" nodegradle-node = "7.0.1" openapi = "7.6.0" +openjdk-jmh = "1.37" opentelemetry = "1.40.0" osgi-annotation = "8.1.0" owasp-dependencycheck = "9.0.8" -palantir-consistentversions = "2.16.0" prometheus-metrics = "1.1.0" prometheus-simpleclient = "0.16.0" quicktheories = "0.26" -openjdk-jmh = "1.37" semver4j = "5.3.0" slf4j = "2.0.13" spatial4j = "0.8" @@ -136,235 +140,233 @@ squareup-okhttp3-okhttp = "4.12.0" stephenc-jcip = "1.0-1" swagger3 = "2.2.22" tdunning-tdigest = "3.3" +thetaphi-forbiddenapis = "3.7" thisptr-jacksonjq = "0.0.13" threeten-bp = "1.6.8" -thetaphi-forbiddenapis = "3.7" undercouch-download = "5.5.0" -xerces = "2.12.2" +xerces = "2.12.2" xerial-snappy = "1.1.10.5" [plugins] - +benmanes-versions = { id = "com.github.ben-manes.versions", version.ref = "benmanes-versions" } carrotsearch-dependencychecks = { id = "com.carrotsearch.gradle.dependencychecks", version.ref = "carrotsearch-dependencychecks" } cutterslade-analyze = { id = "ca.cutterslade.analyze", version.ref = "cutterslade-analyze" } -diffplug-spotless = { id = "com.diffplug.spotless", version.ref = "diffplug-spotless" } +diffplug-spotless = { id = "com.diffplug.spotless", version.ref = "diffplug-spotless" } johnrengelman-shadow = { id = "com.github.johnrengelman.shadow", version.ref = "johnrengelman-shadow" } +littlerobots-versioncatalogupdate = { id = "nl.littlerobots.version-catalog-update", version.ref = "littlerobots-versioncatalogupdate" } ltgt-errorprone = { id = "net.ltgt.errorprone", version.ref = "ltgt-errorprone" } morethan-jmhreport = { id = "io.morethan.jmhreport", version.ref = "morethan-jmhreport" } nodegradle-node = { id = "com.github.node-gradle.node", version.ref = "nodegradle-node" } openapi-generator = { id = "org.openapi.generator", version.ref = "openapi" } owasp-dependencycheck = { id = "org.owasp.dependencycheck", version.ref = "owasp-dependencycheck" } -palantir-consistentversions = { id = "com.palantir.consistent-versions", version.ref = "palantir-consistentversions" } swagger3-core = { id = "io.swagger.core.v3.swagger-gradle-plugin", version.ref = "swagger3" } thetaphi-forbiddenapis = { id = "de.thetaphi.forbiddenapis", version.ref = "thetaphi-forbiddenapis" } udnercouch-download = { id = "de.undercouch.download", version.ref = "undercouch-download" } [libraries] - # Libraries of which the version is provided via a Maven BOM should use { module = "..." } # without a version. # All other libraries should use { group = "...", name = "..." version.ref = "..." } # and provide the version in [versions]. - -adobe-testing-s3mock-junit4 = { group = "com.adobe.testing", name = "s3mock-junit4", version.ref = "adobe-testing-s3mock" } -adobe-testing-s3mock-testsupportcommon = { group = "com.adobe.testing", name = "s3mock-testsupport-common", version.ref = "adobe-testing-s3mock" } -amazon-awssdk-apacheclient = { group = "software.amazon.awssdk", name = "apache-client", version.ref = "amazon-awssdk" } -amazon-awssdk-auth = { group = "software.amazon.awssdk", name = "auth", version.ref = "amazon-awssdk" } -amazon-awssdk-awscore = { group = "software.amazon.awssdk", name = "aws-core", version.ref = "amazon-awssdk" } -amazon-awssdk-bom = { group = "software.amazon.awssdk", name = "bom", version.ref = "amazon-awssdk" } -amazon-awssdk-profiles = { group = "software.amazon.awssdk", name = "profiles", version.ref = "amazon-awssdk" } -amazon-awssdk-regions = { group = "software.amazon.awssdk", name = "regions", version.ref = "amazon-awssdk" } -amazon-awssdk-s3 = { group = "software.amazon.awssdk", name = "s3", version.ref = "amazon-awssdk" } -amazon-awssdk-sdkcore = { group = "software.amazon.awssdk", name = "sdk-core", version.ref = "amazon-awssdk" } -amazon-awssdk-sts = { group = "software.amazon.awssdk", name = "sts", version.ref = "amazon-awssdk" } -apache-calcite-avatica-core = { group = "org.apache.calcite.avatica", name = "avatica-core", version.ref = "apache-calcite-avatica" } -apache-calcite-core = { group = "org.apache.calcite", name = "calcite-core", version.ref = "apache-calcite" } -apache-calcite-linq4j = { group = "org.apache.calcite", name = "calcite-linq4j", version.ref = "apache-calcite" } -apache-commons-collections4 = { group = "org.apache.commons", name = "commons-collections4", version.ref = "apache-commons-collections4" } -apache-commons-compress = { group = "org.apache.commons", name = "commons-compress", version.ref = "apache-commons-compress" } -apache-commons-configuration2 = { group = "org.apache.commons", name = "commons-configuration2", version.ref = "apache-commons-configuration2" } -apache-commons-exec = { group = "org.apache.commons", name = "commons-exec", version.ref = "apache-commons-exec" } -apache-commons-lang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "apache-commons-lang3" } -apache-commons-math3 = { group = "org.apache.commons", name = "commons-math3", version.ref = "apache-commons-math3" } -apache-curator-client = { group = "org.apache.curator", name = "curator-client", version.ref = "apache-curator" } -apache-curator-framework = { group = "org.apache.curator", name = "curator-framework", version.ref = "apache-curator" } -apache-curator-recipes = { group = "org.apache.curator", name = "curator-recipes", version.ref = "apache-curator" } -apache-kerby-core = { group = "org.apache.kerby", name = "kerb-core", version.ref = "apache-kerby" } -apache-kerby-util = { group = "org.apache.kerby", name = "kerb-util", version.ref = "apache-kerby" } -apache-log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "apache-log4j" } -apache-log4j1-api = { group = "org.apache.logging.log4j", name = "log4j-1.2-api", version.ref = "apache-log4j" } -apache-log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "apache-log4j" } -apache-log4j-jul = { group = "org.apache.logging.log4j", name = "log4j-jul", version.ref = "apache-log4j" } -apache-log4j-layout-templatejson = { group = "org.apache.logging.log4j", name = "log4j-layout-template-json", version.ref = "apache-log4j" } -apache-log4j-slf4j2impl = { group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version.ref = "apache-log4j" } -apache-log4j-web = { group = "org.apache.logging.log4j", name = "log4j-web", version.ref = "apache-log4j" } -apache-hadoop-annotations = { group = "org.apache.hadoop", name = "hadoop-annotations", version.ref = "apache-hadoop" } -apache-hadoop-auth = { group = "org.apache.hadoop", name = "hadoop-auth", version.ref = "apache-hadoop" } -apache-hadoop-client-api = { group = "org.apache.hadoop", name = "hadoop-client-api", version.ref = "apache-hadoop" } -apache-hadoop-client-minicluster = { group = "org.apache.hadoop", name = "hadoop-client-minicluster", version.ref = "apache-hadoop" } -apache-hadoop-client-runtime = { group = "org.apache.hadoop", name = "hadoop-client-runtime", version.ref = "apache-hadoop" } -apache-hadoop-common = { group = "org.apache.hadoop", name = "hadoop-common", version.ref = "apache-hadoop" } -apache-hadoop-hdfs = { group = "org.apache.hadoop", name = "hadoop-hdfs", version.ref = "apache-hadoop" } -apache-hadoop-minikdc = { group = "org.apache.hadoop", name = "hadoop-minikdc", version.ref = "apache-hadoop" } -apache-hadoop-thirdparty-shadedguava = { group = "org.apache.hadoop.thirdparty", name = "hadoop-shaded-guava", version.ref = "apache-hadoop-thirdparty" } -apache-httpcomponents-httpmime = { group = "org.apache.httpcomponents", name = "httpmime", version.ref = "apache-httpcomponents-httpmime" } -apache-httpcomponents-httpclient = { group = "org.apache.httpcomponents", name = "httpclient", version.ref = "apache-httpcomponents-httpclient" } -apache-httpcomponents-httpcore = { group = "org.apache.httpcomponents", name = "httpcore", version.ref = "apache-httpcomponents-httpcore" } -apache-lucene-analysis-common = { group = "org.apache.lucene", name = "lucene-analysis-common", version.ref = "apache-lucene" } -apache-lucene-analysis-icu = { group = "org.apache.lucene", name = "lucene-analysis-icu", version.ref = "apache-lucene" } -apache-lucene-analysis-kuromoji = { group = "org.apache.lucene", name = "lucene-analysis-kuromoji", version.ref = "apache-lucene" } -apache-lucene-analysis-morfologik = { group = "org.apache.lucene", name = "lucene-analysis-morfologik", version.ref = "apache-lucene" } -apache-lucene-analysis-nori = { group = "org.apache.lucene", name = "lucene-analysis-nori", version.ref = "apache-lucene" } -apache-lucene-analysis-opennlp = { group = "org.apache.lucene", name = "lucene-analysis-opennlp", version.ref = "apache-lucene" } -apache-lucene-analysis-phonetic = { group = "org.apache.lucene", name = "lucene-analysis-phonetic", version.ref = "apache-lucene" } -apache-lucene-analysis-smartcn = { group = "org.apache.lucene", name = "lucene-analysis-smartcn", version.ref = "apache-lucene" } -apache-lucene-analysis-stempel = { group = "org.apache.lucene", name = "lucene-analysis-stempel", version.ref = "apache-lucene" } -apache-lucene-backward-codecs = { group = "org.apache.lucene", name = "lucene-backward-codecs", version.ref = "apache-lucene" } -apache-lucene-classification = { group = "org.apache.lucene", name = "lucene-classification", version.ref = "apache-lucene" } -apache-lucene-codecs = { group = "org.apache.lucene", name = "lucene-codecs", version.ref = "apache-lucene" } -apache-lucene-core = { group = "org.apache.lucene", name = "lucene-core", version.ref = "apache-lucene" } -apache-lucene-expressions = { group = "org.apache.lucene", name = "lucene-expressions", version.ref = "apache-lucene" } -apache-lucene-grouping = { group = "org.apache.lucene", name = "lucene-grouping", version.ref = "apache-lucene" } -apache-lucene-highlighter = { group = "org.apache.lucene", name = "lucene-highlighter", version.ref = "apache-lucene" } -apache-lucene-join = { group = "org.apache.lucene", name = "lucene-join", version.ref = "apache-lucene" } -apache-lucene-misc = { group = "org.apache.lucene", name = "lucene-misc", version.ref = "apache-lucene" } -apache-lucene-queries = { group = "org.apache.lucene", name = "lucene-queries", version.ref = "apache-lucene" } -apache-lucene-queryparser = { group = "org.apache.lucene", name = "lucene-queryparser", version.ref = "apache-lucene" } -apache-lucene-spatialextras = { group = "org.apache.lucene", name = "lucene-spatial-extras", version.ref = "apache-lucene" } -apache-lucene-suggest = { group = "org.apache.lucene", name = "lucene-suggest", version.ref = "apache-lucene" } -apache-lucene-testframework = { group = "org.apache.lucene", name = "lucene-test-framework", version.ref = "apache-lucene" } -apache-opennlp-tools = { group = "org.apache.opennlp", name = "opennlp-tools", version.ref = "apache-opennlp" } -apache-poi-ooxml = { group = "org.apache.poi", name = "poi-ooxml", version.ref = "apache-poi" } -apache-poi-poi = { group = "org.apache.poi", name = "poi", version.ref = "apache-poi" } -apache-rat-rat = { group = "org.apache.rat", name = "apache-rat", version.ref = "apache-rat" } -apache-tika-core = { group = "org.apache.tika", name = "tika-core", version.ref = "apache-tika" } -apache-tika-parsers = { group = "org.apache.tika", name = "tika-parsers", version.ref = "apache-tika" } -apache-tomcat-annotationsapi = { group = "org.apache.tomcat", name = "annotations-api", version.ref = "apache-tomcat" } -apache-zookeeper-jute = { group = "org.apache.zookeeper", name = "zookeeper-jute", version.ref = "apache-zookeeper" } -apache-zookeeper-zookeeper = { group = "org.apache.zookeeper", name = "zookeeper", version.ref = "apache-zookeeper" } -aqute-bnd-annotation = { group = "biz.aQute.bnd", name = "biz.aQute.bnd.annotation", version.ref = "aqute-bnd" } -argparse4j-argparse4j = { group = "net.sourceforge.argparse4j", name = "argparse4j", version.ref = "argparse4j" } -bc-jose4j = { group = "org.bitbucket.b_c", name = "jose4j", version.ref = "bc-jose4j"} -benmanes-caffeine = { group = "com.github.ben-manes.caffeine", name = "caffeine", version.ref = "benmanes-caffeine" } -bouncycastle-bcpkix = { group = "org.bouncycastle", name = "bcpkix-jdk18on", version.ref = "bouncycastle" } -bouncycastle-bcprov = { group = "org.bouncycastle", name = "bcprov-jdk18on", version.ref = "bouncycastle" } -carrot2-core = { group = "org.carrot2", name = "carrot2-core", version.ref = "carrot2-core" } -carrotsearch-hppc = { group = "com.carrotsearch", name = "hppc", version.ref = "carrotsearch-hppc" } -carrotsearch-randomizedtesting-runner = { group = "com.carrotsearch.randomizedtesting", name = "randomizedtesting-runner", version.ref = "carrotsearch-randomizedtesting" } -codehaus-woodstox-stax2api = { group = "org.codehaus.woodstox", name = "stax2-api", version.ref = "codehaus-woodstox" } -commonscli-commonscli = { group = "commons-cli", name = "commons-cli", version.ref = "commons-cli" } -commonscodec-commonscodec = { group = "commons-codec", name = "commons-codec", version.ref = "commons-codec" } -commonscollections-commonscollections = { group = "commons-collections", name = "commons-collections", version.ref = "commons-collections" } -commonsio-commonsio = { group = "commons-io", name = "commons-io", version.ref = "commons-io" } -cybozulabs-langdetect = { group = "com.cybozu.labs", name = "langdetect", version.ref = "cybozulabs-langdetect" } -dropwizard-metrics-core = { group = "io.dropwizard.metrics", name = "metrics-core", version.ref = "dropwizard-metrics" } -dropwizard-metrics-graphite = { group = "io.dropwizard.metrics", name = "metrics-graphite", version.ref = "dropwizard-metrics" } -dropwizard-metrics-jetty10 = { group = "io.dropwizard.metrics", name = "metrics-jetty10", version.ref = "dropwizard-metrics" } -dropwizard-metrics-jmx = { group = "io.dropwizard.metrics", name = "metrics-jmx", version.ref = "dropwizard-metrics" } -dropwizard-metrics-jvm = { group = "io.dropwizard.metrics", name = "metrics-jvm", version.ref = "dropwizard-metrics" } -eclipse-jdt-ecj = { group = "org.eclipse.jdt", name = "ecj", version.ref = "eclipse-ecj" } -eclipse-jetty-alpnjavaclient = { group = "org.eclipse.jetty", name = "jetty-alpn-java-client", version.ref = "eclipse-jetty" } -eclipse-jetty-alpnjavaserver = { group = "org.eclipse.jetty", name = "jetty-alpn-java-server", version.ref = "eclipse-jetty" } -eclipse-jetty-alpnserver = { group = "org.eclipse.jetty", name = "jetty-alpn-server", version.ref = "eclipse-jetty" } -eclipse-jetty-client = { group = "org.eclipse.jetty", name = "jetty-client", version.ref = "eclipse-jetty" } -eclipse-jetty-deploy = { group = "org.eclipse.jetty", name = "jetty-deploy", version.ref = "eclipse-jetty" } -eclipse-jetty-http = { group = "org.eclipse.jetty", name = "jetty-http", version.ref = "eclipse-jetty" } -eclipse-jetty-http2-common = { group = "org.eclipse.jetty.http2", name = "http2-common", version.ref = "eclipse-jetty" } -eclipse-jetty-http2-client = { group = "org.eclipse.jetty.http2", name = "http2-client", version.ref = "eclipse-jetty" } -eclipse-jetty-http2-httpclienttransport = { group = "org.eclipse.jetty.http2", name = "http2-http-client-transport", version.ref = "eclipse-jetty" } -eclipse-jetty-http2-hpack = { group = "org.eclipse.jetty.http2", name = "http2-hpack", version.ref = "eclipse-jetty" } -eclipse-jetty-http2-server = { group = "org.eclipse.jetty.http2", name = "http2-server", version.ref = "eclipse-jetty" } -eclipse-jetty-io = { group = "org.eclipse.jetty", name = "jetty-io", version.ref = "eclipse-jetty" } -eclipse-jetty-jmx = { group = "org.eclipse.jetty", name = "jetty-jmx", version.ref = "eclipse-jetty" } -eclipse-jetty-rewrite = { group = "org.eclipse.jetty", name = "jetty-rewrite", version.ref = "eclipse-jetty" } -eclipse-jetty-security = { group = "org.eclipse.jetty", name = "jetty-security", version.ref = "eclipse-jetty" } -eclipse-jetty-server = { group = "org.eclipse.jetty", name = "jetty-server", version.ref = "eclipse-jetty" } -eclipse-jetty-servlet = { group = "org.eclipse.jetty", name = "jetty-servlet", version.ref = "eclipse-jetty" } -eclipse-jetty-servlets = { group = "org.eclipse.jetty", name = "jetty-servlets", version.ref = "eclipse-jetty" } -eclipse-jetty-start = { group = "org.eclipse.jetty", name = "jetty-start", version.ref = "eclipse-jetty" } -eclipse-jetty-toolchain-servletapi = { group = "org.eclipse.jetty.toolchain", name = "jetty-servlet-api", version.ref = "eclipse-jettytoolchain" } -eclipse-jetty-util = { group = "org.eclipse.jetty", name = "jetty-util", version.ref = "eclipse-jetty" } -eclipse-jetty-webapp = { group = "org.eclipse.jetty", name = "jetty-webapp", version.ref = "eclipse-jetty" } -eclipse-jetty-xml = { group = "org.eclipse.jetty", name = "jetty-xml", version.ref = "eclipse-jetty" } -eclipse-jgit-jgit = { group = "org.eclipse.jgit", name = "org.eclipse.jgit", version.ref = "eclipse-jgit" } -fasterxml-jackson-bom = { group = "com.fasterxml.jackson", name = "jackson-bom", version.ref = "fasterxml" } -fasterxml-jackson-core-annotations = { group = "com.fasterxml.jackson.core", name = "jackson-annotations", version.ref = "fasterxml" } -fasterxml-jackson-core-core = { group = "com.fasterxml.jackson.core", name = "jackson-core", version.ref = "fasterxml" } -fasterxml-jackson-core-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "fasterxml" } -fasterxml-jackson-dataformat-cbor = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-cbor", version.ref = "fasterxml" } -fasterxml-jackson-dataformat-smile = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-smile", version.ref = "fasterxml" } -fasterxml-woodstox-core = { group = "com.fasterxml.woodstox", name = "woodstox-core", version.ref = "fasterxml-woodstox" } -flexmark-flexmark = { group = "com.vladsch.flexmark", name = "flexmark", version.ref = "flexmark" } -flexmark-extensions-abbreviation = { group = "com.vladsch.flexmark", name = "flexmark-ext-abbreviation", version.ref = "flexmark" } -flexmark-extensions-attributes = { group = "com.vladsch.flexmark", name = "flexmark-ext-attributes", version.ref = "flexmark" } -flexmark-extensions-autolink = { group = "com.vladsch.flexmark", name = "flexmark-ext-autolink", version.ref = "flexmark" } -google-api-gax = { group = "com.google.api", name = "gax", version.ref = "google-api-gax" } -google-auth-oauth2http = { group = "com.google.auth", name = "google-auth-library-oauth2-http", version.ref = "google-auth" } -google-cloud-bom = { group = "com.google.cloud", name = "google-cloud-bom", version.ref = "google-cloud-bom" } -google-cloud-core = { group = "com.google.cloud", name = "google-cloud-core", version.ref = "google-cloud-core" } -google-cloud-corehttp = { group = "com.google.cloud", name = "google-cloud-core-http", version.ref = "google-cloud-core" } -google-cloud-nio = { group = "com.google.cloud", name = "google-cloud-nio", version.ref = "google-cloud-nio" } -google-cloud-storage = { group = "com.google.cloud", name = "google-cloud-storage", version.ref = "google-cloud-storage" } -google-errorprone-core = { group = "com.google.errorprone", name = "error_prone_core", version.ref = "google-errorprone" } -google-guava = { group = "com.google.guava", name = "guava", version.ref = "google-guava" } -google-re2j = { group = "com.google.re2j", name = "re2j", version.ref = "google-re2j" } -grpc-netty = { group = "io.grpc", name = "grpc-netty", version.ref = "grpc" } -grpc-protobuf = { group = "io.grpc", name = "grpc-protobuf", version.ref = "grpc" } -grpc-stub = { group = "io.grpc", name = "grpc-stub", version.ref = "grpc" } -grpc-context = { group = "io.grpc", name = "grpc-context", version.ref = "grpc" } -hamcrest-hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" } -hk2-api = { group = "org.glassfish.hk2", name = "hk2-api", version.ref = "hk2" } -hsqldb-hsqldb = { group = "org.hsqldb", name = "hsqldb", version.ref = "hsqldb" } -ibm-icu-icu4j = { group = "com.ibm.icu", name = "icu4j", version.ref = "ibm-icu" } -immutables-valueannotations = { group = "org.immutables", name = "value-annotations", version.ref = "immutables-valueannotations" } -j256-simplemagic = { group = "com.j256.simplemagic", name = "simplemagic", version.ref = "j256-simplemagic" } -jakarta-annotation-api = { group = "jakarta.annotation", name = "jakarta.annotation-api", version.ref = "jakarta-annotation" } -jakarta-inject-api = { group = "jakarta.inject", name = "jakarta.inject-api", version.ref = "jakarta-inject" } -jakarta-ws-rsapi = { group = "jakarta.ws.rs", name = "jakarta.ws.rs-api", version.ref = "jakarta-ws" } -javacc-javacc = { group = "net.java.dev.javacc", name = "javacc", version.ref ="javacc" } -jayway-jsonpath = { group = "com.jayway.jsonpath", name = "json-path", version.ref = "jayway-jsonpath" } -jctools-core = { group = "org.jctools", name = "jctools-core", version.ref = "jctools" } -jersey-containers-jettyhttp = { group = "org.glassfish.jersey.containers", name = "jersey-container-jetty-http", version.ref = "jersey-containers" } -jersey-core-common = { group = "org.glassfish.jersey.core", name = "jersey-common", version.ref = "jersey" } -jersey-core-server = { group = "org.glassfish.jersey.core", name = "jersey-server", version.ref = "jersey" } -jersey-inject-hk2 = { group = "org.glassfish.jersey.inject", name = "jersey-hk2", version.ref = "jersey" } -jersey-media-jsonjackson = { group = "org.glassfish.jersey.media", name = "jersey-media-json-jackson", version.ref = "jersey" } -junit-junit = { group = "junit", name = "junit", version.ref = "junit" } -lmax-disruptor = { group = "com.lmax", name = "disruptor", version.ref = "lmax-disruptor" } -locationtech-spatial4j = { group = "org.locationtech.spatial4j", name = "spatial4j", version.ref = "spatial4j" } -mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" } -mockito-subclass = { group = "org.mockito", name = "mockito-subclass", version.ref = "mockito" } -navsecurity-mockoauth2server = { group = "no.nav.security", name = "mock-oauth2-server", version.ref = "navsecurity"} -netty-codechttp = { group = "io.netty", name = "netty-codec-http", version.ref = "netty" } -nimbusds-josejwt = { group = "com.nimbusds", name = "nimbus-jose-jwt", version.ref = "nimbusds-josejwt" } -openjdk-jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "openjdk-jmh" } -openjdk-jmh-generatorannprocess = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "openjdk-jmh" } -opentelemetry-api = { group = "io.opentelemetry", name = "opentelemetry-api", version.ref = "opentelemetry" } -opentelemetry-bom = { group = "io.opentelemetry", name = "opentelemetry-bom", version.ref = "opentelemetry" } -opentelemetry-context = { group = "io.opentelemetry", name = "opentelemetry-context", version.ref = "opentelemetry" } -opentelemetry-exporter-otlp = { group = "io.opentelemetry", name = "opentelemetry-exporter-otlp", version.ref = "opentelemetry" } -opentelemetry-sdk = { group = "io.opentelemetry", name = "opentelemetry-sdk", version.ref = "opentelemetry" } -opentelemetry-sdktrace = { group = "io.opentelemetry", name = "opentelemetry-sdk-trace", version.ref = "opentelemetry" } -opentelemetry-sdktesting = { group = "io.opentelemetry", name = "opentelemetry-sdk-testing", version.ref = "opentelemetry" } -opentelemetry-sdkextension-autoconfigure = { group = "io.opentelemetry", name = "opentelemetry-sdk-extension-autoconfigure", version.ref = "opentelemetry" } -osgi-annotation = { group = "org.osgi", name = "osgi.annotation", version.ref = "osgi-annotation" } -prometheus-metrics-expositionformats = { group = "io.prometheus", name = "prometheus-metrics-exposition-formats", version.ref = "prometheus-metrics" } -prometheus-metrics-model = { group = "io.prometheus", name = "prometheus-metrics-model", version.ref = "prometheus-metrics" } -prometheus-simpleclient = { group = "io.prometheus", name = "simpleclient", version.ref = "prometheus-simpleclient" } -prometheus-simpleclient-httpserver = { group = "io.prometheus", name = "simpleclient_httpserver", version.ref = "prometheus-simpleclient" } -quicktheories-quicktheories = { group = "org.quicktheories", name = "quicktheories", version.ref = "quicktheories" } -semver4j-semver4j = { group = "org.semver4j", name = "semver4j", version.ref = "semver4j" } -slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" } -slf4j-jcloverslf4j = { group = "org.slf4j", name = "jcl-over-slf4j", version.ref = "slf4j" } -slf4j-jultoslf4j = { group = "org.slf4j", name = "jul-to-slf4j", version.ref = "slf4j" } -spotbugs-annotations = { group = "com.github.spotbugs", name = "spotbugs-annotations", version.ref = "spotbugs" } -squareup-okhttp3-mockwebserver = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "squareup-okhttp3-mockwebserver" } -squareup-okhttp3-okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "squareup-okhttp3-okhttp" } -stephenc-jcip-annotations = { group = "com.github.stephenc.jcip", name = "jcip-annotations", version.ref = "stephenc-jcip" } -swagger3-annotations-jakarta = { group = "io.swagger.core.v3", name = "swagger-annotations-jakarta", version.ref = "swagger3" } -swagger3-jaxrs2-jakarta = { group = "io.swagger.core.v3", name = "swagger-jaxrs2-jakarta", version.ref = "swagger3" } -tdunning-tdigest = { group = "com.tdunning", name = "t-digest", version.ref = "tdunning-tdigest" } -thisptr-jacksonjq = { group = "net.thisptr", name = "jackson-jq", version.ref = "thisptr-jacksonjq" } -threeten-bp = { group = "org.threeten", name = "threetenbp", version.ref = "threeten-bp" } -xerces-impl = { group = "xerces", name = "xercesImpl", version.ref = "xerces" } -xerial-snappy-java = { group = "org.xerial.snappy", name = "snappy-java", version.ref = "xerial-snappy" } +adobe-testing-s3mock-junit4 = { module = "com.adobe.testing:s3mock-junit4", version.ref = "adobe-testing-s3mock" } +adobe-testing-s3mock-testsupportcommon = { module = "com.adobe.testing:s3mock-testsupport-common", version.ref = "adobe-testing-s3mock" } +amazon-awssdk-apacheclient = { module = "software.amazon.awssdk:apache-client", version.ref = "amazon-awssdk" } +amazon-awssdk-auth = { module = "software.amazon.awssdk:auth", version.ref = "amazon-awssdk" } +amazon-awssdk-awscore = { module = "software.amazon.awssdk:aws-core", version.ref = "amazon-awssdk" } +amazon-awssdk-bom = { module = "software.amazon.awssdk:bom", version.ref = "amazon-awssdk" } +amazon-awssdk-profiles = { module = "software.amazon.awssdk:profiles", version.ref = "amazon-awssdk" } +amazon-awssdk-regions = { module = "software.amazon.awssdk:regions", version.ref = "amazon-awssdk" } +amazon-awssdk-s3 = { module = "software.amazon.awssdk:s3", version.ref = "amazon-awssdk" } +amazon-awssdk-sdkcore = { module = "software.amazon.awssdk:sdk-core", version.ref = "amazon-awssdk" } +amazon-awssdk-sts = { module = "software.amazon.awssdk:sts", version.ref = "amazon-awssdk" } +apache-calcite-avatica-core = { module = "org.apache.calcite.avatica:avatica-core", version.ref = "apache-calcite-avatica" } +apache-calcite-core = { module = "org.apache.calcite:calcite-core", version.ref = "apache-calcite" } +apache-calcite-linq4j = { module = "org.apache.calcite:calcite-linq4j", version.ref = "apache-calcite" } +apache-commons-collections4 = { module = "org.apache.commons:commons-collections4", version.ref = "apache-commons-collections4" } +apache-commons-compress = { module = "org.apache.commons:commons-compress", version.ref = "apache-commons-compress" } +apache-commons-configuration2 = { module = "org.apache.commons:commons-configuration2", version.ref = "apache-commons-configuration2" } +apache-commons-exec = { module = "org.apache.commons:commons-exec", version.ref = "apache-commons-exec" } +apache-commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "apache-commons-lang3" } +apache-commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "apache-commons-math3" } +apache-curator-client = { module = "org.apache.curator:curator-client", version.ref = "apache-curator" } +apache-curator-framework = { module = "org.apache.curator:curator-framework", version.ref = "apache-curator" } +apache-curator-recipes = { module = "org.apache.curator:curator-recipes", version.ref = "apache-curator" } +apache-hadoop-annotations = { module = "org.apache.hadoop:hadoop-annotations", version.ref = "apache-hadoop" } +apache-hadoop-auth = { module = "org.apache.hadoop:hadoop-auth", version.ref = "apache-hadoop" } +apache-hadoop-client-api = { module = "org.apache.hadoop:hadoop-client-api", version.ref = "apache-hadoop" } +apache-hadoop-client-minicluster = { module = "org.apache.hadoop:hadoop-client-minicluster", version.ref = "apache-hadoop" } +apache-hadoop-client-runtime = { module = "org.apache.hadoop:hadoop-client-runtime", version.ref = "apache-hadoop" } +apache-hadoop-common = { module = "org.apache.hadoop:hadoop-common", version.ref = "apache-hadoop" } +apache-hadoop-hdfs = { module = "org.apache.hadoop:hadoop-hdfs", version.ref = "apache-hadoop" } +apache-hadoop-minikdc = { module = "org.apache.hadoop:hadoop-minikdc", version.ref = "apache-hadoop" } +apache-hadoop-thirdparty-shadedguava = { module = "org.apache.hadoop.thirdparty:hadoop-shaded-guava", version.ref = "apache-hadoop-thirdparty" } +apache-httpcomponents-httpclient = { module = "org.apache.httpcomponents:httpclient", version.ref = "apache-httpcomponents-httpclient" } +apache-httpcomponents-httpcore = { module = "org.apache.httpcomponents:httpcore", version.ref = "apache-httpcomponents-httpcore" } +apache-httpcomponents-httpmime = { module = "org.apache.httpcomponents:httpmime", version.ref = "apache-httpcomponents-httpmime" } +apache-kerby-core = { module = "org.apache.kerby:kerb-core", version.ref = "apache-kerby" } +apache-kerby-util = { module = "org.apache.kerby:kerb-util", version.ref = "apache-kerby" } +apache-log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "apache-log4j" } +apache-log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "apache-log4j" } +apache-log4j-jul = { module = "org.apache.logging.log4j:log4j-jul", version.ref = "apache-log4j" } +apache-log4j-layout-templatejson = { module = "org.apache.logging.log4j:log4j-layout-template-json", version.ref = "apache-log4j" } +apache-log4j-slf4j2impl = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "apache-log4j" } +apache-log4j-web = { module = "org.apache.logging.log4j:log4j-web", version.ref = "apache-log4j" } +apache-log4j1-api = { module = "org.apache.logging.log4j:log4j-1.2-api", version.ref = "apache-log4j" } +apache-lucene-analysis-common = { module = "org.apache.lucene:lucene-analysis-common", version.ref = "apache-lucene" } +apache-lucene-analysis-icu = { module = "org.apache.lucene:lucene-analysis-icu", version.ref = "apache-lucene" } +apache-lucene-analysis-kuromoji = { module = "org.apache.lucene:lucene-analysis-kuromoji", version.ref = "apache-lucene" } +apache-lucene-analysis-morfologik = { module = "org.apache.lucene:lucene-analysis-morfologik", version.ref = "apache-lucene" } +apache-lucene-analysis-nori = { module = "org.apache.lucene:lucene-analysis-nori", version.ref = "apache-lucene" } +apache-lucene-analysis-opennlp = { module = "org.apache.lucene:lucene-analysis-opennlp", version.ref = "apache-lucene" } +apache-lucene-analysis-phonetic = { module = "org.apache.lucene:lucene-analysis-phonetic", version.ref = "apache-lucene" } +apache-lucene-analysis-smartcn = { module = "org.apache.lucene:lucene-analysis-smartcn", version.ref = "apache-lucene" } +apache-lucene-analysis-stempel = { module = "org.apache.lucene:lucene-analysis-stempel", version.ref = "apache-lucene" } +apache-lucene-backward-codecs = { module = "org.apache.lucene:lucene-backward-codecs", version.ref = "apache-lucene" } +apache-lucene-classification = { module = "org.apache.lucene:lucene-classification", version.ref = "apache-lucene" } +apache-lucene-codecs = { module = "org.apache.lucene:lucene-codecs", version.ref = "apache-lucene" } +apache-lucene-core = { module = "org.apache.lucene:lucene-core", version.ref = "apache-lucene" } +apache-lucene-expressions = { module = "org.apache.lucene:lucene-expressions", version.ref = "apache-lucene" } +apache-lucene-grouping = { module = "org.apache.lucene:lucene-grouping", version.ref = "apache-lucene" } +apache-lucene-highlighter = { module = "org.apache.lucene:lucene-highlighter", version.ref = "apache-lucene" } +apache-lucene-join = { module = "org.apache.lucene:lucene-join", version.ref = "apache-lucene" } +apache-lucene-misc = { module = "org.apache.lucene:lucene-misc", version.ref = "apache-lucene" } +apache-lucene-queries = { module = "org.apache.lucene:lucene-queries", version.ref = "apache-lucene" } +apache-lucene-queryparser = { module = "org.apache.lucene:lucene-queryparser", version.ref = "apache-lucene" } +apache-lucene-spatialextras = { module = "org.apache.lucene:lucene-spatial-extras", version.ref = "apache-lucene" } +apache-lucene-suggest = { module = "org.apache.lucene:lucene-suggest", version.ref = "apache-lucene" } +apache-lucene-testframework = { module = "org.apache.lucene:lucene-test-framework", version.ref = "apache-lucene" } +apache-opennlp-tools = { module = "org.apache.opennlp:opennlp-tools", version.ref = "apache-opennlp" } +apache-poi-ooxml = { module = "org.apache.poi:poi-ooxml", version.ref = "apache-poi" } +apache-poi-poi = { module = "org.apache.poi:poi", version.ref = "apache-poi" } +apache-rat-rat = { module = "org.apache.rat:apache-rat", version.ref = "apache-rat" } +apache-tika-core = { module = "org.apache.tika:tika-core", version.ref = "apache-tika" } +apache-tika-parsers = { module = "org.apache.tika:tika-parsers", version.ref = "apache-tika" } +apache-tomcat-annotationsapi = { module = "org.apache.tomcat:annotations-api", version.ref = "apache-tomcat" } +apache-zookeeper-jute = { module = "org.apache.zookeeper:zookeeper-jute", version.ref = "apache-zookeeper" } +apache-zookeeper-zookeeper = { module = "org.apache.zookeeper:zookeeper", version.ref = "apache-zookeeper" } +aqute-bnd-annotation = { module = "biz.aQute.bnd:biz.aQute.bnd.annotation", version.ref = "aqute-bnd" } +argparse4j-argparse4j = { module = "net.sourceforge.argparse4j:argparse4j", version.ref = "argparse4j" } +bc-jose4j = { module = "org.bitbucket.b_c:jose4j", version.ref = "bc-jose4j" } +benmanes-caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "benmanes-caffeine" } +bouncycastle-bcpkix = { module = "org.bouncycastle:bcpkix-jdk18on", version.ref = "bouncycastle" } +bouncycastle-bcprov = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bouncycastle" } +carrot2-core = { module = "org.carrot2:carrot2-core", version.ref = "carrot2-core" } +carrotsearch-hppc = { module = "com.carrotsearch:hppc", version.ref = "carrotsearch-hppc" } +carrotsearch-randomizedtesting-runner = { module = "com.carrotsearch.randomizedtesting:randomizedtesting-runner", version.ref = "carrotsearch-randomizedtesting" } +codehaus-woodstox-stax2api = { module = "org.codehaus.woodstox:stax2-api", version.ref = "codehaus-woodstox" } +commonscli-commonscli = { module = "commons-cli:commons-cli", version.ref = "commons-cli" } +commonscodec-commonscodec = { module = "commons-codec:commons-codec", version.ref = "commons-codec" } +commonscollections-commonscollections = { module = "commons-collections:commons-collections", version.ref = "commons-collections" } +commonsio-commonsio = { module = "commons-io:commons-io", version.ref = "commons-io" } +cybozulabs-langdetect = { module = "com.cybozu.labs:langdetect", version.ref = "cybozulabs-langdetect" } +dropwizard-metrics-core = { module = "io.dropwizard.metrics:metrics-core", version.ref = "dropwizard-metrics" } +dropwizard-metrics-graphite = { module = "io.dropwizard.metrics:metrics-graphite", version.ref = "dropwizard-metrics" } +dropwizard-metrics-jetty10 = { module = "io.dropwizard.metrics:metrics-jetty10", version.ref = "dropwizard-metrics" } +dropwizard-metrics-jmx = { module = "io.dropwizard.metrics:metrics-jmx", version.ref = "dropwizard-metrics" } +dropwizard-metrics-jvm = { module = "io.dropwizard.metrics:metrics-jvm", version.ref = "dropwizard-metrics" } +eclipse-jdt-ecj = { module = "org.eclipse.jdt:ecj", version.ref = "eclipse-ecj" } +eclipse-jetty-alpnjavaclient = { module = "org.eclipse.jetty:jetty-alpn-java-client", version.ref = "eclipse-jetty" } +eclipse-jetty-alpnjavaserver = { module = "org.eclipse.jetty:jetty-alpn-java-server", version.ref = "eclipse-jetty" } +eclipse-jetty-alpnserver = { module = "org.eclipse.jetty:jetty-alpn-server", version.ref = "eclipse-jetty" } +eclipse-jetty-client = { module = "org.eclipse.jetty:jetty-client", version.ref = "eclipse-jetty" } +eclipse-jetty-deploy = { module = "org.eclipse.jetty:jetty-deploy", version.ref = "eclipse-jetty" } +eclipse-jetty-http = { module = "org.eclipse.jetty:jetty-http", version.ref = "eclipse-jetty" } +eclipse-jetty-http2-client = { module = "org.eclipse.jetty.http2:http2-client", version.ref = "eclipse-jetty" } +eclipse-jetty-http2-common = { module = "org.eclipse.jetty.http2:http2-common", version.ref = "eclipse-jetty" } +eclipse-jetty-http2-hpack = { module = "org.eclipse.jetty.http2:http2-hpack", version.ref = "eclipse-jetty" } +eclipse-jetty-http2-httpclienttransport = { module = "org.eclipse.jetty.http2:http2-http-client-transport", version.ref = "eclipse-jetty" } +eclipse-jetty-http2-server = { module = "org.eclipse.jetty.http2:http2-server", version.ref = "eclipse-jetty" } +eclipse-jetty-io = { module = "org.eclipse.jetty:jetty-io", version.ref = "eclipse-jetty" } +eclipse-jetty-jmx = { module = "org.eclipse.jetty:jetty-jmx", version.ref = "eclipse-jetty" } +eclipse-jetty-rewrite = { module = "org.eclipse.jetty:jetty-rewrite", version.ref = "eclipse-jetty" } +eclipse-jetty-security = { module = "org.eclipse.jetty:jetty-security", version.ref = "eclipse-jetty" } +eclipse-jetty-server = { module = "org.eclipse.jetty:jetty-server", version.ref = "eclipse-jetty" } +eclipse-jetty-servlet = { module = "org.eclipse.jetty:jetty-servlet", version.ref = "eclipse-jetty" } +eclipse-jetty-servlets = { module = "org.eclipse.jetty:jetty-servlets", version.ref = "eclipse-jetty" } +eclipse-jetty-start = { module = "org.eclipse.jetty:jetty-start", version.ref = "eclipse-jetty" } +eclipse-jetty-toolchain-servletapi = { module = "org.eclipse.jetty.toolchain:jetty-servlet-api", version.ref = "eclipse-jettytoolchain" } +eclipse-jetty-util = { module = "org.eclipse.jetty:jetty-util", version.ref = "eclipse-jetty" } +eclipse-jetty-webapp = { module = "org.eclipse.jetty:jetty-webapp", version.ref = "eclipse-jetty" } +eclipse-jetty-xml = { module = "org.eclipse.jetty:jetty-xml", version.ref = "eclipse-jetty" } +eclipse-jgit-jgit = { module = "org.eclipse.jgit:org.eclipse.jgit", version.ref = "eclipse-jgit" } +fasterxml-jackson-bom = { module = "com.fasterxml.jackson:jackson-bom", version.ref = "fasterxml" } +fasterxml-jackson-core-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "fasterxml" } +fasterxml-jackson-core-core = { module = "com.fasterxml.jackson.core:jackson-core", version.ref = "fasterxml" } +fasterxml-jackson-core-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "fasterxml" } +fasterxml-jackson-dataformat-cbor = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor", version.ref = "fasterxml" } +fasterxml-jackson-dataformat-smile = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-smile", version.ref = "fasterxml" } +fasterxml-woodstox-core = { module = "com.fasterxml.woodstox:woodstox-core", version.ref = "fasterxml-woodstox" } +flexmark-extensions-abbreviation = { module = "com.vladsch.flexmark:flexmark-ext-abbreviation", version.ref = "flexmark" } +flexmark-extensions-attributes = { module = "com.vladsch.flexmark:flexmark-ext-attributes", version.ref = "flexmark" } +flexmark-extensions-autolink = { module = "com.vladsch.flexmark:flexmark-ext-autolink", version.ref = "flexmark" } +flexmark-flexmark = { module = "com.vladsch.flexmark:flexmark", version.ref = "flexmark" } +google-api-gax = { module = "com.google.api:gax", version.ref = "google-api-gax" } +google-auth-oauth2http = { module = "com.google.auth:google-auth-library-oauth2-http", version.ref = "google-auth" } +google-cloud-bom = { module = "com.google.cloud:google-cloud-bom", version.ref = "google-cloud-bom" } +google-cloud-core = { module = "com.google.cloud:google-cloud-core", version.ref = "google-cloud-core" } +google-cloud-corehttp = { module = "com.google.cloud:google-cloud-core-http", version.ref = "google-cloud-core" } +google-cloud-nio = { module = "com.google.cloud:google-cloud-nio", version.ref = "google-cloud-nio" } +google-cloud-storage = { module = "com.google.cloud:google-cloud-storage", version.ref = "google-cloud-storage" } +google-errorprone-core = { module = "com.google.errorprone:error_prone_core", version.ref = "google-errorprone" } +google-guava = { module = "com.google.guava:guava", version.ref = "google-guava" } +google-re2j = { module = "com.google.re2j:re2j", version.ref = "google-re2j" } +grpc-context = { module = "io.grpc:grpc-context", version.ref = "grpc" } +grpc-netty = { module = "io.grpc:grpc-netty", version.ref = "grpc" } +grpc-protobuf = { module = "io.grpc:grpc-protobuf", version.ref = "grpc" } +grpc-stub = { module = "io.grpc:grpc-stub", version.ref = "grpc" } +hamcrest-hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" } +hk2-api = { module = "org.glassfish.hk2:hk2-api", version.ref = "hk2" } +hsqldb-hsqldb = { module = "org.hsqldb:hsqldb", version.ref = "hsqldb" } +ibm-icu-icu4j = { module = "com.ibm.icu:icu4j", version.ref = "ibm-icu" } +immutables-valueannotations = { module = "org.immutables:value-annotations", version.ref = "immutables-valueannotations" } +j256-simplemagic = { module = "com.j256.simplemagic:simplemagic", version.ref = "j256-simplemagic" } +jakarta-annotation-api = { module = "jakarta.annotation:jakarta.annotation-api", version.ref = "jakarta-annotation" } +jakarta-inject-api = { module = "jakarta.inject:jakarta.inject-api", version.ref = "jakarta-inject" } +jakarta-ws-rsapi = { module = "jakarta.ws.rs:jakarta.ws.rs-api", version.ref = "jakarta-ws" } +javacc-javacc = { module = "net.java.dev.javacc:javacc", version.ref = "javacc" } +jayway-jsonpath = { module = "com.jayway.jsonpath:json-path", version.ref = "jayway-jsonpath" } +jctools-core = { module = "org.jctools:jctools-core", version.ref = "jctools" } +jersey-containers-jettyhttp = { module = "org.glassfish.jersey.containers:jersey-container-jetty-http", version.ref = "jersey-containers" } +jersey-core-common = { module = "org.glassfish.jersey.core:jersey-common", version.ref = "jersey" } +jersey-core-server = { module = "org.glassfish.jersey.core:jersey-server", version.ref = "jersey" } +jersey-inject-hk2 = { module = "org.glassfish.jersey.inject:jersey-hk2", version.ref = "jersey" } +jersey-media-jsonjackson = { module = "org.glassfish.jersey.media:jersey-media-json-jackson", version.ref = "jersey" } +junit-junit = { module = "junit:junit", version.ref = "junit" } +lmax-disruptor = { module = "com.lmax:disruptor", version.ref = "lmax-disruptor" } +locationtech-spatial4j = { module = "org.locationtech.spatial4j:spatial4j", version.ref = "spatial4j" } +mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } +mockito-subclass = { module = "org.mockito:mockito-subclass", version.ref = "mockito" } +navsecurity-mockoauth2server = { module = "no.nav.security:mock-oauth2-server", version.ref = "navsecurity" } +netty-codechttp = { module = "io.netty:netty-codec-http", version.ref = "netty" } +nimbusds-josejwt = { module = "com.nimbusds:nimbus-jose-jwt", version.ref = "nimbusds-josejwt" } +openjdk-jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "openjdk-jmh" } +openjdk-jmh-generatorannprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "openjdk-jmh" } +opentelemetry-api = { module = "io.opentelemetry:opentelemetry-api", version.ref = "opentelemetry" } +opentelemetry-bom = { module = "io.opentelemetry:opentelemetry-bom", version.ref = "opentelemetry" } +opentelemetry-context = { module = "io.opentelemetry:opentelemetry-context", version.ref = "opentelemetry" } +opentelemetry-exporter-otlp = { module = "io.opentelemetry:opentelemetry-exporter-otlp", version.ref = "opentelemetry" } +opentelemetry-sdk = { module = "io.opentelemetry:opentelemetry-sdk", version.ref = "opentelemetry" } +opentelemetry-sdkextension-autoconfigure = { module = "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure", version.ref = "opentelemetry" } +opentelemetry-sdktesting = { module = "io.opentelemetry:opentelemetry-sdk-testing", version.ref = "opentelemetry" } +opentelemetry-sdktrace = { module = "io.opentelemetry:opentelemetry-sdk-trace", version.ref = "opentelemetry" } +osgi-annotation = { module = "org.osgi:osgi.annotation", version.ref = "osgi-annotation" } +prometheus-metrics-expositionformats = { module = "io.prometheus:prometheus-metrics-exposition-formats", version.ref = "prometheus-metrics" } +prometheus-metrics-model = { module = "io.prometheus:prometheus-metrics-model", version.ref = "prometheus-metrics" } +prometheus-simpleclient = { module = "io.prometheus:simpleclient", version.ref = "prometheus-simpleclient" } +prometheus-simpleclient-httpserver = { module = "io.prometheus:simpleclient_httpserver", version.ref = "prometheus-simpleclient" } +quicktheories-quicktheories = { module = "org.quicktheories:quicktheories", version.ref = "quicktheories" } +semver4j-semver4j = { module = "org.semver4j:semver4j", version.ref = "semver4j" } +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +slf4j-jcloverslf4j = { module = "org.slf4j:jcl-over-slf4j", version.ref = "slf4j" } +slf4j-jultoslf4j = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" } +spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version.ref = "spotbugs" } +squareup-okhttp3-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "squareup-okhttp3-mockwebserver" } +squareup-okhttp3-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "squareup-okhttp3-okhttp" } +stephenc-jcip-annotations = { module = "com.github.stephenc.jcip:jcip-annotations", version.ref = "stephenc-jcip" } +swagger3-annotations-jakarta = { module = "io.swagger.core.v3:swagger-annotations-jakarta", version.ref = "swagger3" } +swagger3-jaxrs2-jakarta = { module = "io.swagger.core.v3:swagger-jaxrs2-jakarta", version.ref = "swagger3" } +tdunning-tdigest = { module = "com.tdunning:t-digest", version.ref = "tdunning-tdigest" } +thisptr-jacksonjq = { module = "net.thisptr:jackson-jq", version.ref = "thisptr-jacksonjq" } +threeten-bp = { module = "org.threeten:threetenbp", version.ref = "threeten-bp" } +xerces-impl = { module = "xerces:xercesImpl", version.ref = "xerces" } +xerial-snappy-java = { module = "org.xerial.snappy:snappy-java", version.ref = "xerial-snappy" } diff --git a/gradle/validation/dependencies.gradle b/gradle/validation/dependencies.gradle new file mode 100644 index 00000000000..c79ad8d8342 --- /dev/null +++ b/gradle/validation/dependencies.gradle @@ -0,0 +1,99 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 + * + * http://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. + */ + +// Helper function for specifying stable versions for dependency updates +// https://github.com/ben-manes/gradle-versions-plugin +def isNonStable = { String version -> + def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) } + def regex = /^[0-9,.v-]+(-r)?$/ + return !stableKeyword && !(version ==~ regex) +} + +// Configure sanity check for conflicting dependencies across certain configurations +allprojects { + apply plugin: libs.plugins.carrotsearch.dependencychecks.get().pluginId + + def mainConfigurations = project.configurations.matching { + it.name in [ + "compileClasspath", + "runtimeClasspath", + ] + } + + def testConfigurations = project.configurations.matching { + it.name in [ + "annotationProcessor", + "testCompileClasspath", + "testRuntimeClasspath" + ] + } + + dependencyVersionChecks { + lockFileComment = "An inventory of resolved dependency versions. Do not edit this file directly." + + configurationGroups { + main_dependencies { + include mainConfigurations + } + + test_dependencies { + include testConfigurations + } + } + } + + dependencies { + constraints { + mainConfigurations.configureEach { Configuration conf -> + // no resolutions for conflicting dependencies at the moment. + } + } + } +} + +// Configure version catalog cleanups plugin. +configure(rootProject) { + apply plugin: libs.plugins.littlerobots.versioncatalogupdate.get().pluginId + + versionCatalogUpdate { + sortByKey = true + } + + tasks.matching { it.name == "tidy" }.configureEach { + it.dependsOn(":versionCatalogFormat") + } + + tasks.matching { + it.path in [ ":versionCatalogUpdate" ] + }.configureEach { + it.interactive = true + } + + tasks.register("updateLibs", { + dependsOn ":versionCatalogUpdate" + }) + + // on dependencyUpdates get only stable versions recommended if current version is stable + // https://github.com/ben-manes/gradle-versions-plugin + tasks.named("dependencyUpdates").configure { + checkConstraints = true + checkBuildEnvironmentConstraints = true + rejectVersionIf { + isNonStable(it.candidate.version) && !isNonStable(it.currentVersion) + } + } +} \ No newline at end of file diff --git a/gradle/validation/spotless.gradle b/gradle/validation/spotless.gradle index 7400bd1ecfd..f53bf5c22a6 100644 --- a/gradle/validation/spotless.gradle +++ b/gradle/validation/spotless.gradle @@ -20,9 +20,9 @@ * spotless and Google Java Format. */ -def resources = scriptResources(buildscript) +// def resources = scriptResources(buildscript) -configure(project(":solr").subprojects) { prj -> +configure(allprojects) { prj -> plugins.withType(JavaPlugin) { prj.apply plugin: libs.plugins.diffplug.spotless.get().pluginId @@ -95,23 +95,20 @@ configure(project(":solr").subprojects) { prj -> // Emit a custom message about how to fix formatting errors. tasks.matching { task -> task.name == "spotlessJavaCheck" }.configureEach { - runToFixMessage.set("\nIMPORTANT: run the top-level './gradlew tidy' to format code automatically (see help/formatting.txt for more info).") + it.runToFixMessage.set("\nIMPORTANT: run the top-level './gradlew tidy' to format code automatically (see help/formatting.txt for more info).") } - // Add an alias to 'spotlessApply' simply called 'tidy' and wire up - // spotlessCheck to convention's check. - task tidy() { - description "Applies formatters and cleanups to sources." - group "verification" + // Hook up spotless to tidy and check tasks. + + tasks.matching { it.name == "tidy" }.configureEach { v -> + v.dependsOn tasks.matching { it.name == "spotlessApply" } } - tasks.matching { task -> task.name == "spotlessApply" }.configureEach { v -> - tidy.dependsOn v - v.dependsOn ":checkJdkInternalsExportedToGradle" + tasks.matching { it.name == "check" }.configureEach { v -> + v.dependsOn tasks.matching { it.name == "spotlessCheck" } } - tasks.matching { task -> task.name == "spotlessCheck" }.configureEach { v -> - check.dependsOn v + tasks.matching { task -> task.name in ["spotlessApply", "spotlessCheck"] }.configureEach { v -> v.dependsOn ":checkJdkInternalsExportedToGradle" } }