This is an automated email from the ASF dual-hosted git repository.
chenhang pushed a commit to branch branch-4.14
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/branch-4.14 by this push:
new a256a59652 [branch-4.14] sync pr#3317 Fix maven javadoc generate
(#3615)
a256a59652 is described below
commit a256a5965223e9096c9c0eefe108cda9ec284481
Author: xiang092689 <[email protected]>
AuthorDate: Mon Nov 14 09:25:49 2022 +0800
[branch-4.14] sync pr#3317 Fix maven javadoc generate (#3615)
### Motivation
Currently, the maven javadoc generate is broken both on master and
branch-4.14
sync pr#3317 Fix maven javadoc generate
### Changes
fix the javadoc generate, the gradle script has already use delombok
delete unneeded package-info file
---
.github/workflows/pr-validation.yml | 2 +
bookkeeper-common/pom.xml | 25 +++++++++++++
bookkeeper-server/pom.xml | 1 +
.../org/apache/bookkeeper/stats/package-info.java | 23 ------------
.../org/apache/bookkeeper/stats/package-info.java | 20 ----------
bookkeeper-stats/pom.xml | 1 +
.../apache/bookkeeper/stats/AlertStatsLogger.java | 0
pom.xml | 43 +++++++++++++++++++++-
site/scripts/javadoc-gen.sh | 6 ++-
stream/distributedlog/pom.xml | 3 +-
10 files changed, 78 insertions(+), 46 deletions(-)
diff --git a/.github/workflows/pr-validation.yml
b/.github/workflows/pr-validation.yml
index edcebaa484..6366fab0ca 100644
--- a/.github/workflows/pr-validation.yml
+++ b/.github/workflows/pr-validation.yml
@@ -52,3 +52,5 @@ jobs:
run: mvn clean -B -nsu apache-rat:check checkstyle:check package
-Ddistributedlog -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
- name: Check license files
run: dev/check-all-licenses
+ - name: Generate Javadoc
+ run: mvn clean -B -nsu -am -pl
bookkeeper-common,bookkeeper-server,:bookkeeper-stats-api,:bookkeeper-stats-providers,:codahale-metrics-provider,:prometheus-metrics-provider
install javadoc:aggregate -DskipTests -Pdelombok
diff --git a/bookkeeper-common/pom.xml b/bookkeeper-common/pom.xml
index dd4824148c..43103d2811 100644
--- a/bookkeeper-common/pom.xml
+++ b/bookkeeper-common/pom.xml
@@ -101,6 +101,31 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${maven-javadoc-plugin.version}</version>
+ <configuration>
+ <sourcepath>${src.dir}</sourcepath>
+ <!-- Avoid for missing javadoc comments to be marked as errors -->
+ <doclint>none</doclint>
+ <subpackages>org.apache.bookkeeper.common.annotation</subpackages>
+ <groups>
+ <group>
+ <title>Bookkeeper Client</title>
+ <packages>org.apache.bookkeeper.common.annotation*</packages>
+ </group>
+ </groups>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/bookkeeper-server/pom.xml b/bookkeeper-server/pom.xml
index ea4bd42eea..50199a755a 100644
--- a/bookkeeper-server/pom.xml
+++ b/bookkeeper-server/pom.xml
@@ -247,6 +247,7 @@
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<!-- Avoid for missing javadoc comments to be marked as errors -->
+ <sourcepath>${src.dir}</sourcepath>
<doclint>none</doclint>
<subpackages>org.apache.bookkeeper.client:org.apache.bookkeeper.conf:org.apache.bookkeeper.feature</subpackages>
<groups>
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/stats/package-info.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/stats/package-info.java
deleted file mode 100644
index df77c581c3..0000000000
---
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/stats/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * The bookkeeper stats related classes.
- */
-package org.apache.bookkeeper.stats;
\ No newline at end of file
diff --git
a/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/package-info.java
b/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/package-info.java
deleted file mode 100644
index 7276104dca..0000000000
---
a/bookkeeper-stats-providers/codahale-metrics-provider/src/main/java/org/apache/bookkeeper/stats/package-info.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
under
- * the License.
- */
-/**
- * A lightweight stats library implemention based on <i>Codahale</i> metrics
library.
- */
-package org.apache.bookkeeper.stats;
diff --git a/bookkeeper-stats/pom.xml b/bookkeeper-stats/pom.xml
index c6860300eb..fefb9bf273 100644
--- a/bookkeeper-stats/pom.xml
+++ b/bookkeeper-stats/pom.xml
@@ -33,6 +33,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
+ <sourcepath>${src.dir}</sourcepath>
<!-- Avoid for missing javadoc comments to be marked as errors -->
<doclint>none</doclint>
<subpackages>org.apache.bookkeeper.stats</subpackages>
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/stats/AlertStatsLogger.java
b/bookkeeper-stats/src/main/java/org/apache/bookkeeper/stats/AlertStatsLogger.java
similarity index 100%
rename from
bookkeeper-server/src/main/java/org/apache/bookkeeper/stats/AlertStatsLogger.java
rename to
bookkeeper-stats/src/main/java/org/apache/bookkeeper/stats/AlertStatsLogger.java
diff --git a/pom.xml b/pom.xml
index 3d295c0fcb..62c057db60 100644
--- a/pom.xml
+++ b/pom.xml
@@ -110,6 +110,7 @@
<javac.target>1.8</javac.target>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<testRetryCount>2</testRetryCount>
+ <src.dir>src/main/java</src.dir>
<!-- dependencies -->
<arquillian-cube.version>1.18.2</arquillian-cube.version>
@@ -176,6 +177,7 @@
<dockerfile-maven-plugin.version>1.4.13</dockerfile-maven-plugin.version>
<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
<license-maven-plugin.version>1.6</license-maven-plugin.version>
+ <lombok-maven-plugin.version>1.18.20.0</lombok-maven-plugin.version>
<jacoco-maven-plugin.version>0.8.0</jacoco-maven-plugin.version>
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
<maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
@@ -824,6 +826,7 @@
</dependencies>
<build>
+ <sourceDirectory>${src.dir}</sourceDirectory>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
@@ -908,7 +911,7 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
- <additionalparam>-notimestamp</additionalparam>
+ <notimestamp>true</notimestamp>
<!-- Prevent missing javadoc comments from being marked as errors -->
<doclint>none</doclint>
<subpackages>org.apache.bookkeeper.client:org.apache.bookkeeper.client.api:org.apache.bookkeeper.common.annotation:org.apache.bookkeeper.conf:org.apache.bookkeeper.feature:org.apache.bookkeeper.stats</subpackages>
@@ -1080,6 +1083,44 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>delombok</id>
+ <properties>
+
<src.dir>${project.build.directory}/generated-sources/delombok</src.dir>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok-maven-plugin</artifactId>
+ <version>${lombok-maven-plugin.version}</version>
+ <inherited>true</inherited>
+ <dependencies>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>${lombok.version}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>delombok</goal>
+ </goals>
+ <configuration>
+
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
+
<outputDirectory>${project.build.directory}/generated-sources/delombok</outputDirectory>
+ <formatPreferences>
+ <pretty/>
+ </formatPreferences>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
<!-- the profiles below are only for development purpose -->
<profile>
diff --git a/site/scripts/javadoc-gen.sh b/site/scripts/javadoc-gen.sh
index 0998213294..de0c84c8b3 100755
--- a/site/scripts/javadoc-gen.sh
+++ b/site/scripts/javadoc-gen.sh
@@ -18,7 +18,11 @@ function build_javadoc() {
fi
javadoc_dest_dir="${ROOT_DIR}/site/docs/${version}/api/javadoc"
rm -rf $javadoc_dest_dir
- mvn clean install javadoc:aggregate -DskipTests
+ if [[ "$use_gradle" == "true" ]]; then
+ ./gradlew generateApiJavadoc
+ else
+ mvn clean -B -nsu -am -pl
bookkeeper-common,bookkeeper-server,:bookkeeper-stats-api,:bookkeeper-stats-providers,:codahale-metrics-provider,:prometheus-metrics-provider
install javadoc:aggregate -DskipTests -Pdelombok
+ fi
mv $javadoc_gen_dir $javadoc_dest_dir
echo "Built the javadoc for version ${version}."
diff --git a/stream/distributedlog/pom.xml b/stream/distributedlog/pom.xml
index 19bc24bcac..366d33aae4 100644
--- a/stream/distributedlog/pom.xml
+++ b/stream/distributedlog/pom.xml
@@ -45,7 +45,8 @@
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<!-- Avoid for missing javadoc comments to be marked as errors -->
- <additionalparam>-notimestamp</additionalparam>
+ <sourcepath>${src.dir}</sourcepath>
+ <notimestamp>true</notimestamp>
<doclint>none</doclint>
<groups>
<group>