diff --git a/modello-maven-plugin/pom.xml b/modello-maven-plugin/pom.xml
index 01cc7dfe2..c60e5fcb3 100644
--- a/modello-maven-plugin/pom.xml
+++ b/modello-maven-plugin/pom.xml
@@ -210,6 +210,7 @@
${version.junit5}
${java.version}
${jdom.version}
+ ${version.maven-javadoc-plugin}
clean
diff --git a/modello-maven-plugin/src/it/javadoc/invoker.properties b/modello-maven-plugin/src/it/javadoc/invoker.properties
new file mode 100644
index 000000000..8e0e8d30f
--- /dev/null
+++ b/modello-maven-plugin/src/it/javadoc/invoker.properties
@@ -0,0 +1 @@
+invoker.goals = clean javadoc:javadoc
diff --git a/modello-maven-plugin/src/it/javadoc/pom.xml b/modello-maven-plugin/src/it/javadoc/pom.xml
index 7bb293cab..de2714a90 100644
--- a/modello-maven-plugin/src/it/javadoc/pom.xml
+++ b/modello-maven-plugin/src/it/javadoc/pom.xml
@@ -38,7 +38,7 @@
maven-javadoc-plugin
- 3.2.0
+ @javadocPluginVersion@
private
true
diff --git a/modello-maven-plugin/src/it/javadoc/verify.groovy b/modello-maven-plugin/src/it/javadoc/verify.groovy
new file mode 100644
index 000000000..3f54dc32f
--- /dev/null
+++ b/modello-maven-plugin/src/it/javadoc/verify.groovy
@@ -0,0 +1,12 @@
+// javadoc:javadoc must document the generated sources, including the private members (show = private)
+// and link to the source (linksource); the output directory depends on the Maven version
+String model = "org/plexus/modello/demo/model/Root.html"
+List pages = []
+new File(basedir, "target").eachFileRecurse { f ->
+ pages << f.path.replace(File.separator, "/")
+}
+
+List apiPages = pages.findAll { it.endsWith("/apidocs/" + model) }
+assert apiPages.size() == 1 : "Expected one javadoc page for Root, found " + apiPages
+assert new File(apiPages[0]).getText("UTF-8").contains("simpleField") : "javadoc of Root does not describe simpleField"
+assert pages.any { it.endsWith("/apidocs/src-html/" + model) } : "javadoc did not link the source of Root"