Skip to content

Commit 5a6d4b8

Browse files
committed
HV-2022 Update Javadoc generation
(cherry picked from commit 115c279) Signed-off-by: marko-bekhta <marko.prykladna@gmail.com>
1 parent cb47f9d commit 5a6d4b8

File tree

19 files changed

+640
-41
lines changed

19 files changed

+640
-41
lines changed

annotation-processor/pom.xml

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<properties>
2424
<hibernate-validator-parent.path>..</hibernate-validator-parent.path>
2525
<automatic.module.name>org.hibernate.validator.annotationprocessor</automatic.module.name>
26+
<maven.javadoc.skip>false</maven.javadoc.skip>
27+
<deploy.skip>false</deploy.skip>
2628
</properties>
2729

2830
<dependencies>
@@ -89,19 +91,6 @@
8991
<groupId>de.thetaphi</groupId>
9092
<artifactId>forbiddenapis</artifactId>
9193
</plugin>
92-
<plugin>
93-
<groupId>org.apache.maven.plugins</groupId>
94-
<artifactId>maven-javadoc-plugin</artifactId>
95-
<configuration>
96-
<links>
97-
<link>${java.api-docs.base-url}</link>
98-
<link>${bv.api-docs.base-url}</link>
99-
</links>
100-
<packagesheader>Hibernate Validator Annotation Processor Packages</packagesheader>
101-
<doctitle>Hibernate Validator Annotation Processor ${project.version}</doctitle>
102-
<windowtitle>Hibernate Validator Annotation Processor ${project.version}</windowtitle>
103-
</configuration>
104-
</plugin>
10594
<plugin>
10695
<artifactId>maven-jar-plugin</artifactId>
10796
<executions>
@@ -193,5 +182,80 @@
193182
</plugins>
194183
</build>
195184
</profile>
185+
<profile>
186+
<id>dist</id>
187+
<activation>
188+
<property>
189+
<name>disableDistributionBuild</name>
190+
<value>!true</value>
191+
</property>
192+
</activation>
193+
<build>
194+
<plugins>
195+
<plugin>
196+
<groupId>org.apache.maven.plugins</groupId>
197+
<artifactId>maven-dependency-plugin</artifactId>
198+
<executions>
199+
<execution>
200+
<id>unpack-dependencies-javadoc-packagelists</id>
201+
<phase>${javadoc.download.phase}</phase>
202+
<goals>
203+
<goal>unpack</goal>
204+
</goals>
205+
<configuration>
206+
<artifactItems>
207+
<artifactItem>
208+
<groupId>${project.groupId}</groupId>
209+
<artifactId>hibernate-validator-build-config</artifactId>
210+
<classifier>dependencies-javadoc-packagelists</classifier>
211+
<type>zip</type>
212+
<version>${project.version}</version>
213+
</artifactItem>
214+
</artifactItems>
215+
<outputDirectory>${javadoc.packagelists.directory}</outputDirectory>
216+
<overWriteSnapshots>true</overWriteSnapshots>
217+
</configuration>
218+
</execution>
219+
</executions>
220+
<dependencies>
221+
<!--
222+
This ensures that using mvn install -pl <some project> -am
223+
will correctly force the build of the build-config module.
224+
-->
225+
<dependency>
226+
<groupId>${project.groupId}</groupId>
227+
<artifactId>hibernate-validator-build-config</artifactId>
228+
<classifier>dependencies-javadoc-packagelists</classifier>
229+
<type>zip</type>
230+
<version>${project.version}</version>
231+
</dependency>
232+
</dependencies>
233+
</plugin>
234+
<plugin>
235+
<artifactId>maven-javadoc-plugin</artifactId>
236+
<executions>
237+
<execution>
238+
<id>generate-javadoc</id>
239+
<goals>
240+
<goal>javadoc-no-fork</goal>
241+
</goals>
242+
<phase>process-resources</phase>
243+
</execution>
244+
<execution>
245+
<!--
246+
This is the default name of an execution that is added automatically if release profile is enabled.
247+
We want to "override" it so that we can control when it is actually executed.
248+
-->
249+
<id>attach-javadocs</id>
250+
<goals>
251+
<goal>jar</goal>
252+
</goals>
253+
<phase>${javadoc.generate.jar.phase}</phase>
254+
</execution>
255+
</executions>
256+
</plugin>
257+
</plugins>
258+
</build>
259+
</profile>
196260
</profiles>
197261
</project>

build-config/pom.xml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,76 @@
2222

2323
<properties>
2424
<hibernate-validator-parent.path>..</hibernate-validator-parent.path>
25+
26+
<tmpdir.dependencies-javadoc-packagelists>${project.build.directory}/dependencies-javadoc-packagelists</tmpdir.dependencies-javadoc-packagelists>
2527
</properties>
2628

2729
<build>
2830
<plugins>
2931
<plugin>
3032
<artifactId>maven-checkstyle-plugin</artifactId>
3133
</plugin>
34+
<plugin>
35+
<groupId>org.apache.maven.plugins</groupId>
36+
<artifactId>maven-dependency-plugin</artifactId>
37+
<executions>
38+
<!-- See https://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html -->
39+
<execution>
40+
<id>unpack-dependencies-javadoc-packagelists</id>
41+
<phase>${javadoc.download.phase}</phase>
42+
<goals>
43+
<goal>unpack</goal>
44+
</goals>
45+
<configuration>
46+
<artifactItems>
47+
<artifactItem>
48+
<groupId>jakarta.validation</groupId>
49+
<artifactId>jakarta.validation-api</artifactId>
50+
<classifier>javadoc</classifier>
51+
<type>jar</type>
52+
<version>${version.jakarta.validation-api}</version>
53+
<outputDirectory>${tmpdir.dependencies-javadoc-packagelists}/validation-api</outputDirectory>
54+
</artifactItem>
55+
<artifactItem>
56+
<groupId>jakarta.el</groupId>
57+
<artifactId>jakarta.el-api</artifactId>
58+
<classifier>javadoc</classifier>
59+
<type>jar</type>
60+
<version>${version.jakarta.el-api}</version>
61+
<outputDirectory>${tmpdir.dependencies-javadoc-packagelists}/el-api</outputDirectory>
62+
</artifactItem>
63+
<artifactItem>
64+
<groupId>org.javamoney</groupId>
65+
<artifactId>moneta</artifactId>
66+
<classifier>javadoc</classifier>
67+
<type>jar</type>
68+
<version>${version.org.javamoney.moneta}</version>
69+
<outputDirectory>${tmpdir.dependencies-javadoc-packagelists}/javamoney-api</outputDirectory>
70+
</artifactItem>
71+
</artifactItems>
72+
<includes>package-list,element-list</includes>
73+
<overWriteSnapshots>true</overWriteSnapshots>
74+
</configuration>
75+
</execution>
76+
</executions>
77+
</plugin>
78+
<plugin>
79+
<artifactId>maven-assembly-plugin</artifactId>
80+
<executions>
81+
<execution>
82+
<id>package-dependencies-javadoc-packagelists</id>
83+
<goals>
84+
<goal>single</goal>
85+
</goals>
86+
<phase>package</phase>
87+
<configuration>
88+
<descriptors>
89+
<descriptor>src/main/assembly/dependencies-javadoc-packagelists.xml</descriptor>
90+
</descriptors>
91+
</configuration>
92+
</execution>
93+
</executions>
94+
</plugin>
3295
</plugins>
3396
</build>
3497

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Hibernate Validator, declare and validate application constraints
4+
~
5+
~ License: Apache License, Version 2.0
6+
~ See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
7+
-->
8+
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
9+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
11+
<id>dependencies-javadoc-packagelists</id>
12+
<formats>
13+
<format>zip</format>
14+
</formats>
15+
16+
<includeBaseDirectory>false</includeBaseDirectory>
17+
<baseDirectory>/</baseDirectory>
18+
19+
<fileSets>
20+
<fileSet>
21+
<directory>target/dependencies-javadoc-packagelists</directory>
22+
<outputDirectory>.</outputDirectory>
23+
</fileSet>
24+
</fileSets>
25+
</assembly>

cdi/pom.xml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
<properties>
2424
<hibernate-validator-parent.path>..</hibernate-validator-parent.path>
25+
<maven.javadoc.skip>false</maven.javadoc.skip>
26+
<deploy.skip>false</deploy.skip>
2527
</properties>
2628

2729
<dependencies>
@@ -224,4 +226,82 @@
224226
</plugin>
225227
</plugins>
226228
</build>
229+
230+
<profiles>
231+
<profile>
232+
<id>dist</id>
233+
<activation>
234+
<property>
235+
<name>disableDistributionBuild</name>
236+
<value>!true</value>
237+
</property>
238+
</activation>
239+
<build>
240+
<plugins>
241+
<plugin>
242+
<groupId>org.apache.maven.plugins</groupId>
243+
<artifactId>maven-dependency-plugin</artifactId>
244+
<executions>
245+
<execution>
246+
<id>unpack-dependencies-javadoc-packagelists</id>
247+
<phase>${javadoc.download.phase}</phase>
248+
<goals>
249+
<goal>unpack</goal>
250+
</goals>
251+
<configuration>
252+
<artifactItems>
253+
<artifactItem>
254+
<groupId>${project.groupId}</groupId>
255+
<artifactId>hibernate-validator-build-config</artifactId>
256+
<classifier>dependencies-javadoc-packagelists</classifier>
257+
<type>zip</type>
258+
<version>${project.version}</version>
259+
</artifactItem>
260+
</artifactItems>
261+
<outputDirectory>${javadoc.packagelists.directory}</outputDirectory>
262+
<overWriteSnapshots>true</overWriteSnapshots>
263+
</configuration>
264+
</execution>
265+
</executions>
266+
<dependencies>
267+
<!--
268+
This ensures that using mvn install -pl <some project> -am
269+
will correctly force the build of the build-config module.
270+
-->
271+
<dependency>
272+
<groupId>${project.groupId}</groupId>
273+
<artifactId>hibernate-validator-build-config</artifactId>
274+
<classifier>dependencies-javadoc-packagelists</classifier>
275+
<type>zip</type>
276+
<version>${project.version}</version>
277+
</dependency>
278+
</dependencies>
279+
</plugin>
280+
<plugin>
281+
<artifactId>maven-javadoc-plugin</artifactId>
282+
<executions>
283+
<execution>
284+
<id>generate-javadoc</id>
285+
<goals>
286+
<goal>javadoc-no-fork</goal>
287+
</goals>
288+
<phase>process-resources</phase>
289+
</execution>
290+
<execution>
291+
<!--
292+
This is the default name of an execution that is added automatically if release profile is enabled.
293+
We want to "override" it so that we can control when it is actually executed.
294+
-->
295+
<id>attach-javadocs</id>
296+
<goals>
297+
<goal>jar</goal>
298+
</goals>
299+
<phase>${javadoc.generate.jar.phase}</phase>
300+
</execution>
301+
</executions>
302+
</plugin>
303+
</plugins>
304+
</build>
305+
</profile>
306+
</profiles>
227307
</project>

0 commit comments

Comments
 (0)