From cba2b1e42f44991e703da856866c676c90e67efb Mon Sep 17 00:00:00 2001 From: redcatbaer Date: Mon, 9 Jun 2025 19:51:35 +0200 Subject: [PATCH 1/3] #431: Attempt to fix new Maven deployment. --- api/pom.xml | 10 +++++++++- core/pom.xml | 10 +++++++++- exporter/common/pom.xml | 8 ++++++++ exporter/specobject/pom.xml | 10 +++++++++- importer/lightweightmarkup/pom.xml | 8 ++++++++ importer/markdown/pom.xml | 8 ++++++++ importer/restructuredtext/pom.xml | 8 ++++++++ importer/specobject/pom.xml | 10 +++++++++- importer/tag/pom.xml | 10 +++++++++- importer/xmlparser/pom.xml | 8 ++++++++ importer/zip/pom.xml | 10 +++++++++- parent/pom.xml | 8 +++++++- product/pom.xml | 6 +++++- reporter/aspec/pom.xml | 10 +++++++++- reporter/html/pom.xml | 10 +++++++++- reporter/plaintext/pom.xml | 10 +++++++++- testutil/pom.xml | 7 ------- 17 files changed, 133 insertions(+), 18 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index ea13794f..8bf308a8 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -13,4 +13,12 @@ ${reproducible.build.timestamp} - \ No newline at end of file + + + + org.sonatype.central + central-publishing-maven-plugin + + + + diff --git a/core/pom.xml b/core/pom.xml index 99f051b7..50b48b83 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -24,4 +24,12 @@ test - \ No newline at end of file + + + + org.sonatype.central + central-publishing-maven-plugin + + + + diff --git a/exporter/common/pom.xml b/exporter/common/pom.xml index d6ba0c97..53a32ad6 100644 --- a/exporter/common/pom.xml +++ b/exporter/common/pom.xml @@ -24,4 +24,12 @@ test + + + + org.sonatype.central + central-publishing-maven-plugin + + + diff --git a/exporter/specobject/pom.xml b/exporter/specobject/pom.xml index e7f7ed9e..c55c0c7b 100644 --- a/exporter/specobject/pom.xml +++ b/exporter/specobject/pom.xml @@ -28,4 +28,12 @@ test - \ No newline at end of file + + + + org.sonatype.central + central-publishing-maven-plugin + + + + diff --git a/importer/lightweightmarkup/pom.xml b/importer/lightweightmarkup/pom.xml index 58872307..fc34d080 100644 --- a/importer/lightweightmarkup/pom.xml +++ b/importer/lightweightmarkup/pom.xml @@ -29,4 +29,12 @@ test + + + + org.sonatype.central + central-publishing-maven-plugin + + + diff --git a/importer/markdown/pom.xml b/importer/markdown/pom.xml index afc2f622..355886f1 100644 --- a/importer/markdown/pom.xml +++ b/importer/markdown/pom.xml @@ -28,4 +28,12 @@ test + + + + org.sonatype.central + central-publishing-maven-plugin + + + diff --git a/importer/restructuredtext/pom.xml b/importer/restructuredtext/pom.xml index f3fd4cfe..8866dba1 100644 --- a/importer/restructuredtext/pom.xml +++ b/importer/restructuredtext/pom.xml @@ -28,4 +28,12 @@ test + + + + org.sonatype.central + central-publishing-maven-plugin + + + diff --git a/importer/specobject/pom.xml b/importer/specobject/pom.xml index 1cb017c9..32469bf5 100644 --- a/importer/specobject/pom.xml +++ b/importer/specobject/pom.xml @@ -28,4 +28,12 @@ test - \ No newline at end of file + + + + org.sonatype.central + central-publishing-maven-plugin + + + + diff --git a/importer/tag/pom.xml b/importer/tag/pom.xml index 4f370246..37ce102f 100644 --- a/importer/tag/pom.xml +++ b/importer/tag/pom.xml @@ -24,4 +24,12 @@ test - \ No newline at end of file + + + + org.sonatype.central + central-publishing-maven-plugin + + + + diff --git a/importer/xmlparser/pom.xml b/importer/xmlparser/pom.xml index 78370182..e1290e6c 100644 --- a/importer/xmlparser/pom.xml +++ b/importer/xmlparser/pom.xml @@ -24,4 +24,12 @@ test + + + + org.sonatype.central + central-publishing-maven-plugin + + + diff --git a/importer/zip/pom.xml b/importer/zip/pom.xml index 6f8d3766..d5b452db 100644 --- a/importer/zip/pom.xml +++ b/importer/zip/pom.xml @@ -24,4 +24,12 @@ test - \ No newline at end of file + + + + org.sonatype.central + central-publishing-maven-plugin + + + + diff --git a/parent/pom.xml b/parent/pom.xml index 8e16325c..429399c7 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -602,9 +602,14 @@ + org.apache.maven.plugins maven-deploy-plugin 3.1.4 + + true + 1980-01-01T00:00:02Z - - 3.9.9 - parent api diff --git a/testutil/pom.xml b/testutil/pom.xml index 31fac171..8ea7417a 100644 --- a/testutil/pom.xml +++ b/testutil/pom.xml @@ -66,14 +66,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - - - true - - org.apache.maven.plugins maven-deploy-plugin diff --git a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/OsCheck.java b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/OsCheck.java index 4777b7cb..b8f41271 100644 --- a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/OsCheck.java +++ b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/OsCheck.java @@ -33,7 +33,14 @@ public OsCheck() */ public enum OSType { - WINDOWS, MACOS, LINUX, OTHER + /** Windows OS */ + WINDOWS, + /** macOS */ + MACOS, + /** Linux */ + LINUX, + /** Any other operating system */ + OTHER } /** diff --git a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImportAssertions.java b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImportAssertions.java index 5d4180c0..7eec5e4c 100644 --- a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImportAssertions.java +++ b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImportAssertions.java @@ -35,6 +35,8 @@ private ImportAssertions() * content to be imported * @param matcher * matcher that defines expectation for imported data + * @param importerFactory + * factory that generates the importer */ public static void assertImportWithFactory(final Path path, final String input, final Matcher> matcher, @@ -44,7 +46,8 @@ public static void assertImportWithFactory(final Path path, final String input, } /** - * Run an importer on the given text and return the imported specification items. + * Run an importer on the given text and return the imported specification + * items. * * @param path * path to use for the input file diff --git a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImporterFactoryTestBase.java b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImporterFactoryTestBase.java index 8653a0da..f76f9ce9 100644 --- a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImporterFactoryTestBase.java +++ b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/importer/ImporterFactoryTestBase.java @@ -42,7 +42,7 @@ protected ImporterFactoryTestBase() } @BeforeEach - public void initMocks() + void initMocks() { lenient().when(this.contextMock.getImportSettings()).thenReturn(ImportSettings.createDefault()); } diff --git a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/matcher/StringRegexpMatcher.java b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/matcher/StringRegexpMatcher.java index 17c36be7..efd25c42 100644 --- a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/matcher/StringRegexpMatcher.java +++ b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/matcher/StringRegexpMatcher.java @@ -9,11 +9,23 @@ */ public class StringRegexpMatcher extends SubstringMatcher { + /** + * Create a new instance of the {@link StringRegexpMatcher}. + * + * @param regexp regular expression to match against + */ public StringRegexpMatcher(final String regexp) { super("contains regexp", false, regexp); } + /** + * Check if the substring matches the given value with newlines removed. + * + * @param value value to match the substring against + * + * @return {@code true} if the given value matches the substring + */ protected boolean evalSubstringOf(final String value) { return Pattern.matches(this.substring, value.replace("\n", "")); diff --git a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/xml/IndentingXMLStreamWriter.java b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/xml/IndentingXMLStreamWriter.java index b37e8bba..f3594a8e 100644 --- a/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/xml/IndentingXMLStreamWriter.java +++ b/testutil/src/main/java/org/itsallcode/openfasttrace/testutil/xml/IndentingXMLStreamWriter.java @@ -3,39 +3,29 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; +/** + * A stream writer for XML that adds indentation. + */ public class IndentingXMLStreamWriter extends StreamWriterDelegate { - /** Two spaces; the default indentation. */ - public static final String DEFAULT_INDENT = " "; - - /** - * "\n"; the normalized end-of-line representation in - * XML. - */ - public static final String NORMAL_END_OF_LINE = "\n"; - private static final int WROTE_MARKUP = 1; - private static final int WROTE_DATA = 2; - private final String indent; - private final String newLine; - /** How deeply nested the current scope is. The root element is depth 1. */ private int depth = 0; // document scope - /** stack[depth] indicates what's been written into the current scope. */ private int[] stack = new int[] { 0, 0, 0, 0 }; // nothing written yet - /** Prefix that defines how deeply a line is indented. */ private char[] linePrefix = null; - public IndentingXMLStreamWriter(final XMLStreamWriter out) - { - this(out, DEFAULT_INDENT, NORMAL_END_OF_LINE); - } - + /** + * Create a new instance of the {@link IndentingXMLStreamWriter}. + * + * @param out stream writer to output to + * @param indent string used as the indentation prefix + * @param newLine newline character (for platform-specific output) + */ public IndentingXMLStreamWriter(final XMLStreamWriter out, final String indent, final String newLine) { @@ -205,7 +195,8 @@ public void writeEndDocument() throws XMLStreamException /** * Prepare to write markup by writing a new line and indentation. * - * @throws XMLStreamException here for interface compatibility only + * @throws XMLStreamException + * here for interface compatibility only */ protected void beforeMarkup() throws XMLStreamException { @@ -236,7 +227,8 @@ protected void afterData() /** * Prepare to start an element by allocating stack space. * - * @throws XMLStreamException here for interface compatibility only + * @throws XMLStreamException + * here for interface compatibility only */ protected void beforeStartElement() throws XMLStreamException { @@ -261,7 +253,8 @@ protected void afterStartElement() /** * Prepare to end an element by writing a new line and indentation. * - * @throws XMLStreamException here for interface compatibility only + * @throws XMLStreamException + * here for interface compatibility only */ protected void beforeEndElement() throws XMLStreamException { @@ -283,7 +276,8 @@ protected void afterEndElement() /** * Note that a document was ended. * - * @throws XMLStreamException here for interface compatibility only + * @throws XMLStreamException + * here for interface compatibility only */ protected void afterEndDocument() throws XMLStreamException { @@ -295,7 +289,14 @@ protected void afterEndDocument() throws XMLStreamException this.stack[this.depth] = 0; // start fresh } - /** Write a line separator followed by indentation. */ + /** + * Write an indented line. + * + * @param indentation + * indentation depth + * @throws XMLStreamException + * if the underlying {@link XMLStreamWriter} has a problem + */ protected void writeNewLine(final int indentation) throws XMLStreamException { final int newLineLength = this.newLine.length();