You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2026/08/30 18:51:08 UTC
(maven-resolver) branch fix/pr-2060-review-fixes created (now 493d70f1d)
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a change to branch fix/pr-2060-review-fixes
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
at 493d70f1d Fix link label rendering and deprecated text markup in configuration page
This branch includes the following new commits:
new 493d70f1d Fix link label rendering and deprecated text markup in configuration page
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(maven-resolver) 01/01: Fix link label rendering and deprecated text markup in configuration page
Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
gnodet pushed a commit to branch fix/pr-2060-review-fixes
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
commit 493d70f1d6814818e74398de541ff3a1480f957a
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Sun Aug 30 20:50:56 2026 +0200
Fix link label rendering and deprecated text markup in configuration page
- Fix visitLink to render node.getLabel() instead of node.getReference()
for the display text; previously, explicit link labels like
{@link Type custom label} would show "Type" instead of "custom label"
- Replace Markdown emphasis (*...*) with HTML <em> for deprecated content
in configuration.md.vm to avoid mixing Markdown and HTML markup
- Add test case for explicit link labels
- Add missing trailing newline to package-info.java test fixture
Co-Authored-By: Claude Opus 4.6 <no...@anthropic.com>
---
.../org/eclipse/aether/tools/ConfigurationCollectorDoclet.java | 7 +++++--
maven-resolver-tools/src/main/resources/configuration.md.vm | 2 +-
.../org/eclipse/aether/tools/ConfigurationCollectorDocletTest.java | 7 ++++++-
.../org/eclipse/aether/sample/SampleConfigurationKeys.java | 3 ++-
.../src/test/resources/org/eclipse/aether/sample/package-info.java | 2 +-
5 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java b/maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java
index 6fdb95a7c..ed64517c1 100644
--- a/maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java
+++ b/maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java
@@ -724,8 +724,11 @@ public class ConfigurationCollectorDoclet implements Doclet {
@Override
public String visitLink(LinkTree node, Void p) {
String ref = node.getReference() != null ? node.getReference().getSignature() : "";
- String label = renderContent(DocTreePath.getPath(docTreePath, node.getReference()), mode, false);
- String text = label == null || label.isEmpty() ? ref : label;
+ List<? extends DocTree> labelTrees = node.getLabel();
+ String label = (labelTrees != null && !labelTrees.isEmpty())
+ ? renderContent(docTreePath, mode, false, labelTrees)
+ : "";
+ String text = label.isEmpty() ? ref : label;
String rendered = node.getKind() == DocTree.Kind.LINK_PLAIN ? escape(mode, text) : renderAsCode(text);
if (mode == RenderMode.HTML) {
VariableElement referenced = resolveReferencedField(docTreePath, node);
diff --git a/maven-resolver-tools/src/main/resources/configuration.md.vm b/maven-resolver-tools/src/main/resources/configuration.md.vm
index 1c61af102..9109438d3 100644
--- a/maven-resolver-tools/src/main/resources/configuration.md.vm
+++ b/maven-resolver-tools/src/main/resources/configuration.md.vm
@@ -52,7 +52,7 @@ To modify this file, edit the template and regenerate.
| Key | Type | Description | Default Value | Since | Supports Repo ID suffix | Source |
| --- | --- | --- | --- | --- | --- | --- |
#foreach($key in $keys)
-| <a id="$key.key"></a>`$key.key` | #if ($key.configurationTypeJavadocUrl) [`$key.configurationType`]($key.configurationTypeJavadocUrl) #else `$key.configurationType` #end | #if($key.deprecated) **Deprecated**. *$key.deprecated*<br/>#end$key.description | #value( $key.defaultValue ) | $key.since | $key.supportRepoIdSuffix | $key.configurationSource |
+| <a id="$key.key"></a>`$key.key` | #if ($key.configurationTypeJavadocUrl) [`$key.configurationType`]($key.configurationTypeJavadocUrl) #else `$key.configurationType` #end | #if($key.deprecated) **Deprecated**. <em>$key.deprecated</em><br/>#end$key.description | #value( $key.defaultValue ) | $key.since | $key.supportRepoIdSuffix | $key.configurationSource |
#end
#[[
diff --git a/maven-resolver-tools/src/test/java/org/eclipse/aether/tools/ConfigurationCollectorDocletTest.java b/maven-resolver-tools/src/test/java/org/eclipse/aether/tools/ConfigurationCollectorDocletTest.java
index 4c6253008..0fff2cad2 100644
--- a/maven-resolver-tools/src/test/java/org/eclipse/aether/tools/ConfigurationCollectorDocletTest.java
+++ b/maven-resolver-tools/src/test/java/org/eclipse/aether/tools/ConfigurationCollectorDocletTest.java
@@ -149,6 +149,11 @@ class ConfigurationCollectorDocletTest {
assertTrue(enumDescription.contains("<code>SampleType#hidden()</code>"));
assertFalse(enumDescription.contains(
"href=\"apidocs/" + "org/eclipse/aether/sample/SampleConfigurationKeys.SampleType.html#hidden()\""));
+ // {@link SampleType custom label text} should render the explicit label, not the reference signature
+ assertTrue(
+ enumDescription.contains(
+ "<a href=\"apidocs/org/eclipse/aether/sample/SampleConfigurationKeys.SampleType.html\"><code>custom label text</code></a>"),
+ "expected explicit link label to be rendered, but got: " + enumDescription);
// no @configurationRepoIdSuffix -> defaults to "No"
assertEquals("No", enumKey.get("supportRepoIdSuffix"));
assertEquals("Use <a href=\"#sample.enum2\"><code>#ENUM2_KEY</code></a> instead", enumKey.get("deprecated"));
@@ -182,7 +187,7 @@ class ConfigurationCollectorDocletTest {
markdown.contains(
"[`org.eclipse.aether.sample.SampleConfigurationKeys.SampleEnum`](apidocs/org/eclipse/aether/sample/SampleConfigurationKeys.SampleEnum.html)"));
assertTrue(markdown.contains("<a href=\"#sample.string\"><code>#STRING_KEY</code></a>"));
- assertTrue(markdown.contains("**Deprecated**. *Use <a href=\"#sample.enum2\">"));
+ assertTrue(markdown.contains("**Deprecated**. <em>Use <a href=\"#sample.enum2\">"));
}
@Test
diff --git a/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/SampleConfigurationKeys.java b/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/SampleConfigurationKeys.java
index c1a5a5991..c970fe61c 100644
--- a/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/SampleConfigurationKeys.java
+++ b/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/SampleConfigurationKeys.java
@@ -62,7 +62,8 @@ public final class SampleConfigurationKeys {
/**
* An enum value. See {@link #STRING_KEY}. Also see field {@link SampleType#VALUE}, method
* {@link SampleType#convert(String)}, constructor {@link SampleType#SampleType(String)}, type {@link SampleType},
- * package {@link org.eclipse.aether.sample}, and unavailable member {@link SampleType#hidden()}.
+ * package {@link org.eclipse.aether.sample}, unavailable member {@link SampleType#hidden()},
+ * and a link with explicit label {@link SampleType custom label text}.
* The type is a custom enum with a default value declared as a variable referencing an enum value.
*
* @configurationSource {@link System#getProperty(String,String)}
diff --git a/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/package-info.java b/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/package-info.java
index 42ee58fed..58bc8bf35 100644
--- a/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/package-info.java
+++ b/maven-resolver-tools/src/test/resources/org/eclipse/aether/sample/package-info.java
@@ -21,4 +21,4 @@
*
* @since 2.0
*/
-package org.eclipse.aether.sample;
\ No newline at end of file
+package org.eclipse.aether.sample;