-
-
Notifications
You must be signed in to change notification settings - Fork 157
Description
As far as I can tell, the scala:doc
target cannot work?
To reproduce
I created a project with mvn archetype:generate -DgroupId=com.example -DartifactId=my-scala3-project -DarchetypeGroupId=net.alchim31.maven -DarchetypeArtifactId=scala-archetype-simple -DarchetypeVersion=1.7 -DinteractiveMode=false
then tweaked it to use Scala 3 and latest version of the plugin:
git clone https://github.com/programmatix/scala-maven-plugin-issue-repo
cd scala-maven-plugin-issue-repo
mvn scala:doc -DdisplayCmd=true
Will output
...
[INFO] --- scala:4.9.5:doc (default-cli) @ my-scala3-project ---
bad option '-doc-format:html' was ignored
bad option '-doc-title' was ignored
source file not found: my-scala3-project 1.0-SNAPSHOT API
2 warnings found
1 error found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.674 s
[INFO] Finished at: 2025-08-12T16:31:08+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:4.9.5:doc (default-cli) on project my-scala3-project: wrap: org.apache.maven.reporting.MavenReportException: wrap: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
Investigation
I had a bit of a look through the code. (But I don't have too much experience either with this plugin or with Scala 3 scaladocs, so I may have made a mistake here.)
I see there is some Scala 3 support, in that we switch to using dotty.tools.dotc.Main
in Scala 3 mode (which happens here). But AFAICT, that tool can't be used directly to produce Scaladocs? And these two files don't seem to have been updated anyway to produce Scala3-compatible scaladoc CLI args:
https://github.com/davidB/scala-maven-plugin/blob/master/src/main/java/scala_maven/ScalaDocJarMojo.java
https://github.com/davidB/scala-maven-plugin/blob/master/src/main/java/scala_maven/ScalaDocMojo.java