diff --git a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java index 3f44f034..c6923de6 100644 --- a/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java +++ b/maven-plugin-tools-generators/src/main/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGenerator.java @@ -625,7 +625,7 @@ protected void writeParameterType( } } - static URI getJavadocUrlForType(JavadocLinkGenerator javadocLinkGenerator, String type) { + private static String extractBinaryNameForJavadoc(String type) { final String binaryName; int startOfParameterType = type.indexOf("<"); if (startOfParameterType != -1) { @@ -637,10 +637,10 @@ static URI getJavadocUrlForType(JavadocLinkGenerator javadocLinkGenerator, Strin .split(",\\s*"); switch (parameterTypes.length) { case 1: // if only one parameter type, assume collection, first parameter type is most interesting - binaryName = parameterTypes[0]; + binaryName = extractBinaryNameForJavadoc(parameterTypes[0]); break; case 2: // if two parameter types assume map, second parameter type is most interesting - binaryName = parameterTypes[1]; + binaryName = extractBinaryNameForJavadoc(parameterTypes[1]); break; default: // all other cases link to main type @@ -649,7 +649,11 @@ static URI getJavadocUrlForType(JavadocLinkGenerator javadocLinkGenerator, Strin } else { binaryName = type; } - return javadocLinkGenerator.createLink(binaryName); + return binaryName; + } + + static URI getJavadocUrlForType(JavadocLinkGenerator javadocLinkGenerator, String type) { + return javadocLinkGenerator.createLink(extractBinaryNameForJavadoc(type)); } /** diff --git a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGeneratorTest.java b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGeneratorTest.java index c58e9d20..eb35539e 100644 --- a/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGeneratorTest.java +++ b/maven-plugin-tools-generators/src/test/java/org/apache/maven/tools/plugin/generator/PluginDescriptorFilesGeneratorTest.java @@ -164,6 +164,10 @@ void testGetJavadocUrlForType() throws URISyntaxException { javadocBaseUri.resolve("java/lang/Integer.html"), PluginDescriptorFilesGenerator.getJavadocUrlForType( linkGenerator, "java.lang.Map")); + assertEquals( + javadocBaseUri.resolve("java/lang/Integer.html"), + PluginDescriptorFilesGenerator.getJavadocUrlForType( + linkGenerator, "java.lang.Map>")); assertEquals( javadocBaseUri.resolve("java/util/function/BiFunction.html"), PluginDescriptorFilesGenerator.getJavadocUrlForType(