You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/10/20 13:24:04 UTC
(maven-plugin-tools) 01/01: Bump doxiaVersion from 2.1.0 to 2.2.0
This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch agent/doxia-2.2.0-3x
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
commit d883dcb9b85e033a7be9832e12da3edd55e25add
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Tue Oct 20 13:23:54 2026 +0000
Bump doxiaVersion from 2.1.0 to 2.2.0
Doxia 2.2.0 moved SinkEventAttributeSet and its Semantics constants to
doxia-sink-api. The report runs against the site plugin's Sink API, so the
old constants fail with NoClassDefFoundError under site plugin 3.20.0;
InlineSemantics builds the same attributes from the Sink API alone.
---
maven-plugin-report-plugin/pom.xml | 2 +-
.../maven/plugin/plugin/report/GoalRenderer.java | 17 +++--
.../plugin/plugin/report/InlineSemantics.java | 72 ++++++++++++++++++++++
.../plugin/report/PluginOverviewRenderer.java | 3 +-
4 files changed, 82 insertions(+), 12 deletions(-)
diff --git a/maven-plugin-report-plugin/pom.xml b/maven-plugin-report-plugin/pom.xml
index 7e80ac15..e4106da1 100644
--- a/maven-plugin-report-plugin/pom.xml
+++ b/maven-plugin-report-plugin/pom.xml
@@ -39,7 +39,7 @@
<properties>
<it.debug>true</it.debug>
- <doxiaVersion>2.1.0</doxiaVersion>
+ <doxiaVersion>2.2.0</doxiaVersion>
</properties>
<dependencies>
diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java
index b105f143..daceb5be 100644
--- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java
+++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/GoalRenderer.java
@@ -36,7 +36,6 @@ import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet.Semantics;
import org.apache.maven.doxia.util.DoxiaUtils;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.Parameter;
@@ -153,7 +152,7 @@ public class GoalRenderer extends AbstractPluginReportRenderer {
private void renderDescriptionPrefix(String prefixKey) {
sink.paragraph();
- sink.inline(Semantics.STRONG);
+ sink.inline(InlineSemantics.strong());
sink.text(getI18nString(prefixKey));
sink.inline_();
sink.text(":");
@@ -206,7 +205,7 @@ public class GoalRenderer extends AbstractPluginReportRenderer {
linkPatternedText(getI18nString(attributeKey));
if (codeArgument.isPresent()) {
text(": ");
- sink.inline(Semantics.CODE);
+ sink.inline(InlineSemantics.code());
sink.text(codeArgument.get());
sink.inline_();
}
@@ -244,7 +243,7 @@ public class GoalRenderer extends AbstractPluginReportRenderer {
if (link.isPresent()) {
sink.link(link.get(), null);
}
- sink.inline(Semantics.CODE);
+ sink.inline(InlineSemantics.code());
sink.text(text);
sink.inline_();
if (link.isPresent()) {
@@ -351,7 +350,7 @@ public class GoalRenderer extends AbstractPluginReportRenderer {
if (StringUtils.isNotEmpty(deprecated)) {
String deprecatedXhtml = getXhtmlWithValidatedLinks(deprecated, context);
sink.division();
- sink.inline(Semantics.STRONG);
+ sink.inline(InlineSemantics.strong());
sink.text(getI18nString("parameter.deprecated"));
sink.inline_();
sink.lineBreak();
@@ -364,11 +363,11 @@ public class GoalRenderer extends AbstractPluginReportRenderer {
private void renderTableCellDetail(String nameKey, String value) {
if (StringUtils.isNotEmpty(value)) {
sink.lineBreak();
- sink.inline(Semantics.STRONG);
+ sink.inline(InlineSemantics.strong());
sink.text(getI18nString(nameKey));
sink.inline_();
sink.text(": ");
- sink.inline(Semantics.CODE);
+ sink.inline(InlineSemantics.code());
sink.text(value);
sink.inline_();
}
@@ -381,14 +380,14 @@ public class GoalRenderer extends AbstractPluginReportRenderer {
private void renderDetail(String param, String value, Optional<String> valueLink) {
if (value != null && !value.isEmpty()) {
sink.listItem();
- sink.inline(Semantics.STRONG);
+ sink.inline(InlineSemantics.strong());
sink.text(param);
sink.inline_();
sink.text(": ");
if (valueLink.isPresent()) {
sink.link(valueLink.get());
}
- sink.inline(Semantics.CODE);
+ sink.inline(InlineSemantics.code());
sink.text(value);
sink.inline_();
if (valueLink.isPresent()) {
diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/InlineSemantics.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/InlineSemantics.java
new file mode 100644
index 00000000..f1a363bf
--- /dev/null
+++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/InlineSemantics.java
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+package org.apache.maven.plugin.plugin.report;
+
+import javax.swing.text.SimpleAttributeSet;
+
+import java.util.AbstractMap;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.maven.doxia.sink.SinkEventAttributes;
+
+/**
+ * Inline semantics attributes that only depend on the Sink API.
+ * <p>
+ * Doxia 2.2.0 moved {@code SinkEventAttributeSet} and its {@code Semantics} constants to doxia-sink-api. The report
+ * runs against the Sink API of the site plugin, so referencing those constants fails with
+ * {@code NoClassDefFoundError} under a site plugin that provides an older Sink API. Each call returns a new set,
+ * as sinks may copy and change it.
+ */
+final class InlineSemantics extends SimpleAttributeSet implements SinkEventAttributes {
+
+ private static final long serialVersionUID = 1L;
+
+ private InlineSemantics(String semantics) {
+ addAttribute(SEMANTICS, semantics);
+ }
+
+ /**
+ * @return a new attribute set for {@code strong} semantics
+ */
+ static SinkEventAttributes strong() {
+ return new InlineSemantics("strong");
+ }
+
+ /**
+ * @return a new attribute set for {@code code} semantics
+ */
+ static SinkEventAttributes code() {
+ return new InlineSemantics("code");
+ }
+
+ @Override
+ public Set<Map.Entry<String, Object>> entrySet() {
+ Set<Map.Entry<String, Object>> entries = new LinkedHashSet<>();
+ Enumeration<?> names = getAttributeNames();
+ while (names.hasMoreElements()) {
+ Object name = names.nextElement();
+ entries.add(new AbstractMap.SimpleImmutableEntry<>(name.toString(), getAttribute(name)));
+ }
+ return Collections.unmodifiableSet(entries);
+ }
+}
diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
index 9b810ca1..9d8d6f48 100644
--- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
+++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
@@ -25,7 +25,6 @@ import java.util.Locale;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.doxia.markup.Markup;
import org.apache.maven.doxia.sink.Sink;
-import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.project.MavenProject;
@@ -146,7 +145,7 @@ class PluginOverviewRenderer extends AbstractPluginReportRenderer {
sink.tableCell();
if (StringUtils.isNotEmpty(mojo.getDeprecated())) {
sink.division();
- sink.inline(SinkEventAttributeSet.Semantics.STRONG);
+ sink.inline(InlineSemantics.strong());
sink.text(getI18nString("goal.deprecated"));
sink.text(".");
sink.inline_();