Jamison929611 commented on code in PR #2060:
URL: https://github.com/apache/maven-resolver/pull/2060#discussion_r3804845564


##########
maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java:
##########
@@ -757,11 +772,39 @@ private String getConfigurationType(DocTreePath path, 
Map<String, UnknownBlockTa
                         configurationTypePath, "No valid {@link ...} reference 
found in @" + typeTag.getTagName()));
 
         String type = getType(configurationTypePath, linkTree);
+        String javadocUrl = resolveReferencedType(configurationTypePath, 
linkTree.getReference())
+                .filter(typeElement ->
+                        
!typeElement.getQualifiedName().toString().startsWith("java."))
+                .map(ConfigurationCollectorDoclet::getJavadocUrl)
+                .orElse("");
         String javaLangPackage = "java.lang.";
         if (type.startsWith(javaLangPackage)) {
             type = type.substring(javaLangPackage.length());
         }
-        return type;
+        return new ConfigurationType(type, javadocUrl);
+    }
+
+    private String getConfigurationKey(VariableElement field) {
+        if (field == null || !(field.getConstantValue() instanceof String 
key)) {
+            return null;
+        }
+        if (mode == Mode.MAVEN) {
+            return getAnnotation(field, MAVEN_CONFIG_ANNOTATION) != null ? key 
: null;
+        }
+        DocCommentTree docComment = docTrees.getDocCommentTree(field);
+        return docComment != null && 
collectBlockTags(docComment).containsKey("configurationSource") ? key : null;
+    }
+
+    private static String getJavadocUrl(TypeElement type) {

Review Comment:
   Implemented in 0d7e9e95. Link construction now uses JavadocLinkGenerator for 
type, member, package, and module references. The tests cover both Javadoc 8 
and Javadoc 10+ method/constructor fragment formats.



##########
maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java:
##########
@@ -757,11 +772,39 @@ private String getConfigurationType(DocTreePath path, 
Map<String, UnknownBlockTa
                         configurationTypePath, "No valid {@link ...} reference 
found in @" + typeTag.getTagName()));
 
         String type = getType(configurationTypePath, linkTree);
+        String javadocUrl = resolveReferencedType(configurationTypePath, 
linkTree.getReference())
+                .filter(typeElement ->
+                        
!typeElement.getQualifiedName().toString().startsWith("java."))
+                .map(ConfigurationCollectorDoclet::getJavadocUrl)
+                .orElse("");
         String javaLangPackage = "java.lang.";
         if (type.startsWith(javaLangPackage)) {
             type = type.substring(javaLangPackage.length());
         }
-        return type;
+        return new ConfigurationType(type, javadocUrl);
+    }
+
+    private String getConfigurationKey(VariableElement field) {
+        if (field == null || !(field.getConstantValue() instanceof String 
key)) {
+            return null;
+        }
+        if (mode == Mode.MAVEN) {
+            return getAnnotation(field, MAVEN_CONFIG_ANNOTATION) != null ? key 
: null;
+        }
+        DocCommentTree docComment = docTrees.getDocCommentTree(field);
+        return docComment != null && 
collectBlockTags(docComment).containsKey("configurationSource") ? key : null;
+    }
+
+    private static String getJavadocUrl(TypeElement type) {
+        Element enclosing = type;
+        while (!(enclosing instanceof PackageElement)) {
+            enclosing = enclosing.getEnclosingElement();
+        }
+        String packageName = ((PackageElement) 
enclosing).getQualifiedName().toString();
+        String qualifiedName = type.getQualifiedName().toString();
+        String className = packageName.isEmpty() ? qualifiedName : 
qualifiedName.substring(packageName.length() + 1);
+        String packagePath = packageName.replace('.', '/');
+        return "apidocs/" + (packagePath.isEmpty() ? "" : packagePath + "/") + 
className + ".html";

Review Comment:
   Implemented in 0d7e9e95. The internal base URL is configurable with 
--internal-javadoc-url, the internal Javadoc version with 
--internal-javadoc-version, and external bases with repeatable 
--external-javadoc-url. The defaults preserve apidocs/ with Javadoc 21.



##########
maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java:
##########
@@ -757,11 +772,39 @@ private String getConfigurationType(DocTreePath path, 
Map<String, UnknownBlockTa
                         configurationTypePath, "No valid {@link ...} reference 
found in @" + typeTag.getTagName()));
 
         String type = getType(configurationTypePath, linkTree);
+        String javadocUrl = resolveReferencedType(configurationTypePath, 
linkTree.getReference())
+                .filter(typeElement ->
+                        
!typeElement.getQualifiedName().toString().startsWith("java."))
+                .map(ConfigurationCollectorDoclet::getJavadocUrl)
+                .orElse("");
         String javaLangPackage = "java.lang.";
         if (type.startsWith(javaLangPackage)) {
             type = type.substring(javaLangPackage.length());
         }
-        return type;
+        return new ConfigurationType(type, javadocUrl);
+    }
+
+    private String getConfigurationKey(VariableElement field) {
+        if (field == null || !(field.getConstantValue() instanceof String 
key)) {
+            return null;
+        }
+        if (mode == Mode.MAVEN) {
+            return getAnnotation(field, MAVEN_CONFIG_ANNOTATION) != null ? key 
: null;
+        }
+        DocCommentTree docComment = docTrees.getDocCommentTree(field);
+        return docComment != null && 
collectBlockTags(docComment).containsKey("configurationSource") ? key : null;
+    }
+
+    private static String getJavadocUrl(TypeElement type) {

Review Comment:
   Implemented in 0d7e9e95. References now support types, fields, methods, 
constructors, packages, and modules. Internal links require visible 
declarations backed by the project source tree; external sites are validated 
through element-list/package-list, including module-aware layouts, and 
unavailable sites or packages fall back to plain text. Configuration-key 
anchors still take priority. Tests cover internal and external modules, 
external member fragments, unavailable packages, and non-public members.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to