Skip to content

Commit 3b8de11

Browse files
committed
Add GitHub Actions job for JavaDoc verification
1 parent b8475f4 commit 3b8de11

File tree

4 files changed

+83
-38
lines changed

4 files changed

+83
-38
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,19 @@ jobs:
3131
- name: Build with Maven
3232
run: mvn package
3333

34+
verify-javadoc:
35+
runs-on: ubuntu-latest
36+
name: Validate JavaDocs
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Setup JDK
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: 'temurin'
43+
java-version: '23'
44+
architecture: 'x64'
45+
cache: 'maven'
46+
47+
- name: Validate JavaDocs
48+
run: mvn -Pdoclint package -DskipTests=true
49+

pom.xml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34

45
<licenses>
56
<license>
@@ -25,11 +26,12 @@
2526
<url>https://github.com/pivovarit/parallel-collectors</url>
2627
<connection>scm:git:[email protected]:pivovarit/parallel-collectors.git</connection>
2728
<developerConnection>scm:git:[email protected]:pivovarit/parallel-collectors.git</developerConnection>
28-
<tag>HEAD</tag>
29-
</scm>
29+
<tag>HEAD</tag>
30+
</scm>
3031

3132
<properties>
3233
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34+
<maven.javadoc.plugin.version>3.10.1</maven.javadoc.plugin.version>
3335
<junit.version>5.11.2</junit.version>
3436
<assertj.version>3.26.3</assertj.version>
3537
<awaitility.version>4.2.2</awaitility.version>
@@ -47,8 +49,7 @@
4749
<artifactId>maven-compiler-plugin</artifactId>
4850
<version>3.13.0</version>
4951
<configuration>
50-
<source>21</source>
51-
<target>21</target>
52+
<release>21</release>
5253
</configuration>
5354
</plugin>
5455

@@ -126,7 +127,7 @@
126127
<plugin>
127128
<groupId>org.apache.maven.plugins</groupId>
128129
<artifactId>maven-javadoc-plugin</artifactId>
129-
<version>3.10.1</version>
130+
<version>${maven.javadoc.plugin.version}</version>
130131
<executions>
131132
<execution>
132133
<id>attach-javadocs</id>
@@ -247,6 +248,30 @@
247248
</plugins>
248249
</build>
249250
</profile>
251+
<profile>
252+
<id>doclint</id>
253+
<build>
254+
<plugins>
255+
<plugin>
256+
<groupId>org.apache.maven.plugins</groupId>
257+
<artifactId>maven-javadoc-plugin</artifactId>
258+
<version>${maven.javadoc.plugin.version}</version>
259+
<executions>
260+
<execution>
261+
<id>attach-javadocs</id>
262+
<goals>
263+
<goal>jar</goal>
264+
</goals>
265+
</execution>
266+
</executions>
267+
<configuration>
268+
<failOnWarnings>true</failOnWarnings>
269+
<failOnError>true</failOnError>
270+
</configuration>
271+
</plugin>
272+
</plugins>
273+
</build>
274+
</profile>
250275
</profiles>
251276

252277
<dependencies>

src/main/java/com/pivovarit/collectors/ParallelCollectors.java

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ private ParallelCollectors() {
2828
* .collect(parallel(i -> foo(i), toList()));
2929
* }</pre>
3030
*
31-
* @param mapper a transformation to be performed in parallel
32-
* @param collector the {@code Collector} describing the reduction
33-
* @param <T> the type of the collected elements
34-
* @param <R> the result returned by {@code mapper}
35-
* @param <RR> the reduction result {@code collector}
31+
* @param mapper a transformation to be performed in parallel
32+
* @param collector the {@code Collector} describing the reduction
33+
* @param <T> the type of the collected elements
34+
* @param <R> the result returned by {@code mapper}
35+
* @param <RR> the reduction result {@code collector}
3636
*
3737
* @return a {@code Collector} which collects all processed elements into a user-provided mutable {@code Collection} in parallel
3838
*
@@ -106,12 +106,12 @@ private ParallelCollectors() {
106106
* .collect(parallel(i -> foo(i), toList(), executor));
107107
* }</pre>
108108
*
109-
* @param mapper a transformation to be performed in parallel
110-
* @param collector the {@code Collector} describing the reduction
111-
* @param executor the {@code Executor} to use for asynchronous execution
112-
* @param <T> the type of the collected elements
113-
* @param <R> the result returned by {@code mapper}
114-
* @param <RR> the reduction result {@code collector}
109+
* @param mapper a transformation to be performed in parallel
110+
* @param collector the {@code Collector} describing the reduction
111+
* @param executor the {@code Executor} to use for asynchronous execution
112+
* @param <T> the type of the collected elements
113+
* @param <R> the result returned by {@code mapper}
114+
* @param <RR> the reduction result {@code collector}
115115
*
116116
* @return a {@code Collector} which collects all processed elements into a user-provided mutable {@code Collection} in parallel
117117
*
@@ -135,9 +135,9 @@ private ParallelCollectors() {
135135
* .collect(parallel(i -> foo()));
136136
* }</pre>
137137
*
138-
* @param mapper a transformation to be performed in parallel
139-
* @param <T> the type of the collected elements
140-
* @param <R> the result returned by {@code mapper}
138+
* @param mapper a transformation to be performed in parallel
139+
* @param <T> the type of the collected elements
140+
* @param <R> the result returned by {@code mapper}
141141
*
142142
* @return a {@code Collector} which collects all processed elements into a {@code Stream} in parallel
143143
*
@@ -162,6 +162,7 @@ private ParallelCollectors() {
162162
* }</pre>
163163
*
164164
* @param mapper a transformation to be performed in parallel
165+
* @param parallelism the max parallelism level
165166
* @param <T> the type of the collected elements
166167
* @param <R> the result returned by {@code mapper}
167168
*
@@ -215,10 +216,10 @@ private ParallelCollectors() {
215216
* .collect(parallel(i -> foo(), executor));
216217
* }</pre>
217218
*
218-
* @param mapper a transformation to be performed in parallel
219-
* @param executor the {@code Executor} to use for asynchronous execution
220-
* @param <T> the type of the collected elements
221-
* @param <R> the result returned by {@code mapper}
219+
* @param mapper a transformation to be performed in parallel
220+
* @param executor the {@code Executor} to use for asynchronous execution
221+
* @param <T> the type of the collected elements
222+
* @param <R> the result returned by {@code mapper}
222223
*
223224
* @return a {@code Collector} which collects all processed elements into a {@code Stream} in parallel
224225
*
@@ -242,9 +243,9 @@ private ParallelCollectors() {
242243
* .forEach(System.out::println);
243244
* }</pre>
244245
*
245-
* @param mapper a transformation to be performed in parallel
246-
* @param <T> the type of the collected elements
247-
* @param <R> the result returned by {@code mapper}
246+
* @param mapper a transformation to be performed in parallel
247+
* @param <T> the type of the collected elements
248+
* @param <R> the result returned by {@code mapper}
248249
*
249250
* @return a {@code Collector} which collects all processed elements into a {@code Stream} in parallel
250251
*
@@ -295,10 +296,10 @@ private ParallelCollectors() {
295296
* .forEach(System.out::println);
296297
* }</pre>
297298
*
298-
* @param mapper a transformation to be performed in parallel
299-
* @param executor the {@code Executor} to use for asynchronous execution
300-
* @param <T> the type of the collected elements
301-
* @param <R> the result returned by {@code mapper}
299+
* @param mapper a transformation to be performed in parallel
300+
* @param executor the {@code Executor} to use for asynchronous execution
301+
* @param <T> the type of the collected elements
302+
* @param <R> the result returned by {@code mapper}
302303
*
303304
* @return a {@code Collector} which collects all processed elements into a {@code Stream} in parallel
304305
*
@@ -350,9 +351,9 @@ private ParallelCollectors() {
350351
* .forEach(System.out::println);
351352
* }</pre>
352353
*
353-
* @param mapper a transformation to be performed in parallel
354-
* @param <T> the type of the collected elements
355-
* @param <R> the result returned by {@code mapper}
354+
* @param mapper a transformation to be performed in parallel
355+
* @param <T> the type of the collected elements
356+
* @param <R> the result returned by {@code mapper}
356357
*
357358
* @return a {@code Collector} which collects all processed elements into a {@code Stream} in parallel
358359
*
@@ -403,10 +404,10 @@ private ParallelCollectors() {
403404
* .forEach(System.out::println);
404405
* }</pre>
405406
*
406-
* @param mapper a transformation to be performed in parallel
407-
* @param executor the {@code Executor} to use for asynchronous execution
408-
* @param <T> the type of the collected elements
409-
* @param <R> the result returned by {@code mapper}
407+
* @param mapper a transformation to be performed in parallel
408+
* @param executor the {@code Executor} to use for asynchronous execution
409+
* @param <T> the type of the collected elements
410+
* @param <R> the result returned by {@code mapper}
410411
*
411412
* @return a {@code Collector} which collects all processed elements into a {@code Stream} in parallel
412413
*

src/main/java/module-info.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* Parallel Collectors is a toolkit that eases parallel collection processing in Java using Stream API without the limitations imposed by standard Parallel Streams
3+
*/
14
module parallel.collectors {
25
exports com.pivovarit.collectors;
36
}

0 commit comments

Comments
 (0)