Skip to content

Commit 84a63af

Browse files
programmatixdnault
authored andcommitted
SCBC-493: Fix issues with Scala 3 scaladoc generation
The Scala 3 build cannot currently be uploaded to Maven Central due to as the javadocs jar is not available. Producing this jar turns out to be very challenging, as the scala-maven-plugin does not support it in Scala 3: davidB/scala-maven-plugin#862 For now, we will produce an empty javadocs jar for this build. Change-Id: I5b9986c32cd4cd166d601326478fc4509f5347f6 Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/232259 Tested-by: Build Bot <[email protected]> Reviewed-by: David Nault <[email protected]>
1 parent f524e32 commit 84a63af

File tree

4 files changed

+80
-1
lines changed

4 files changed

+80
-1
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
5959
<build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
6060
<flatten-maven-plugin.version>1.7.0</flatten-maven-plugin.version>
61-
<scala-maven-plugin.version>4.8.1</scala-maven-plugin.version>
61+
<scala-maven-plugin.version>4.9.5</scala-maven-plugin.version>
6262
<mvn-scalafmt.version>1.1.1713302731.c3d0074</mvn-scalafmt.version>
6363

6464
<!-- When changing this, make sure to update these versions:

scala-client/pom.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,35 @@
532532
</execution>
533533
</executions>
534534
</plugin>
535+
536+
<!-- scala-maven-plugin does not support scaladocs together with Scala 3:
537+
https://github.com/davidB/scala-maven-plugin/issues/862
538+
so we attach an empty javadocs to satisfy Maven Central.
539+
540+
The Scala 2 builds continue to provide scaladocs as usual.
541+
-->
542+
<plugin>
543+
<groupId>org.apache.maven.plugins</groupId>
544+
<artifactId>maven-javadoc-plugin</artifactId>
545+
<version>${maven-javadoc-plugin.version}</version>
546+
<executions>
547+
<execution>
548+
<id>attach-javadocs</id>
549+
<goals>
550+
<goal>jar</goal>
551+
</goals>
552+
<configuration>
553+
<sourcepath>${project.basedir}/src/main/java</sourcepath>
554+
<sourceFileIncludes>com/couchbase/client/scala/internal/**/*.java</sourceFileIncludes>
555+
<show>private</show>
556+
<source>8</source>
557+
<doclint>none</doclint>
558+
<quiet>true</quiet>
559+
<stylesheetfile>${project.basedir}/../config/javadoc/style.css</stylesheetfile>
560+
</configuration>
561+
</execution>
562+
</executions>
563+
</plugin>
535564
</plugins>
536565
</build>
537566
</profile>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2025 Couchbase, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.couchbase.client.scala.internal;
18+
19+
/**
20+
* Empty API docs are generated for the Scala 3 build at this time, due to known incompatibilies between Maven and Scala 3:
21+
* https://github.com/davidB/scala-maven-plugin/issues/862
22+
*/
23+
@Deprecated
24+
class JavadocPlaceholder {
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2025 Couchbase, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.couchbase.client.scala.internal;
18+
19+
/**
20+
* Empty API docs are generated for the Scala 3 build at this time, due to known incompatibilies between Maven and Scala 3:
21+
* https://github.com/davidB/scala-maven-plugin/issues/862
22+
*/
23+
@Deprecated
24+
class JavadocPlaceholder {
25+
}

0 commit comments

Comments
 (0)