-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathAbstractJavadocMojo.java
6092 lines (5352 loc) · 250 KB
/
AbstractJavadocMojo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* 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.
*/
package org.apache.maven.plugins.javadoc;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.time.LocalDate;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.RepositoryUtils;
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.apache.maven.doxia.tools.SiteTool;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.javadoc.options.BootclasspathArtifact;
import org.apache.maven.plugins.javadoc.options.DocletArtifact;
import org.apache.maven.plugins.javadoc.options.Group;
import org.apache.maven.plugins.javadoc.options.JavadocOptions;
import org.apache.maven.plugins.javadoc.options.JavadocPathArtifact;
import org.apache.maven.plugins.javadoc.options.OfflineLink;
import org.apache.maven.plugins.javadoc.options.ResourcesArtifact;
import org.apache.maven.plugins.javadoc.options.Tag;
import org.apache.maven.plugins.javadoc.options.Taglet;
import org.apache.maven.plugins.javadoc.options.TagletArtifact;
import org.apache.maven.plugins.javadoc.options.io.xpp3.JavadocOptionsXpp3Writer;
import org.apache.maven.plugins.javadoc.resolver.JavadocBundle;
import org.apache.maven.plugins.javadoc.resolver.ResourceResolver;
import org.apache.maven.plugins.javadoc.resolver.SourceResolverConfig;
import org.apache.maven.project.DefaultProjectBuildingRequest;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.reporting.MavenReportException;
import org.apache.maven.settings.Proxy;
import org.apache.maven.settings.Settings;
import org.apache.maven.shared.artifact.filter.resolve.AndFilter;
import org.apache.maven.shared.artifact.filter.resolve.PatternExclusionsFilter;
import org.apache.maven.shared.artifact.filter.resolve.PatternInclusionsFilter;
import org.apache.maven.shared.artifact.filter.resolve.TransformableFilter;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.apache.maven.toolchain.Toolchain;
import org.apache.maven.toolchain.ToolchainManager;
import org.apache.maven.wagon.PathUtils;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.manager.ArchiverManager;
import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
import org.codehaus.plexus.components.io.fileselectors.IncludeExcludeFileSelector;
import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;
import org.codehaus.plexus.languages.java.jpms.LocationManager;
import org.codehaus.plexus.languages.java.jpms.ModuleNameSource;
import org.codehaus.plexus.languages.java.jpms.ResolvePathRequest;
import org.codehaus.plexus.languages.java.jpms.ResolvePathResult;
import org.codehaus.plexus.languages.java.jpms.ResolvePathsRequest;
import org.codehaus.plexus.languages.java.jpms.ResolvePathsResult;
import org.codehaus.plexus.languages.java.version.JavaVersion;
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.WriterFactory;
import org.codehaus.plexus.util.cli.CommandLineException;
import org.codehaus.plexus.util.cli.CommandLineUtils;
import org.codehaus.plexus.util.cli.Commandline;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.ArtifactTypeRegistry;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.collection.CollectRequest;
import org.eclipse.aether.graph.DependencyFilter;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;
import org.eclipse.aether.resolution.DependencyRequest;
import org.eclipse.aether.resolution.DependencyResolutionException;
import org.eclipse.aether.util.filter.AndDependencyFilter;
import org.eclipse.aether.util.filter.PatternExclusionsDependencyFilter;
import org.eclipse.aether.util.filter.ScopeDependencyFilter;
import static org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast;
import static org.apache.maven.plugins.javadoc.JavadocUtil.isEmpty;
import static org.apache.maven.plugins.javadoc.JavadocUtil.isNotEmpty;
import static org.apache.maven.plugins.javadoc.JavadocUtil.toList;
import static org.apache.maven.plugins.javadoc.JavadocUtil.toRelative;
/**
* Base class with majority of Javadoc functionalities.
*
* @author <a href="mailto:[email protected]">Brett Porter</a>
* @author <a href="mailto:[email protected]">Vincent Siveton</a>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html">The javadoc Command</a>
* @since 2.0
*/
public abstract class AbstractJavadocMojo extends AbstractMojo {
/**
* Classifier used in the name of the javadoc-options XML file, and in the resources bundle
* artifact that gets attached to the project. This one is used for non-test javadocs.
*
* @see #TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
* @since 2.7
*/
public static final String JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER = "javadoc-resources";
/**
* Classifier used in the name of the javadoc-options XML file, and in the resources bundle
* artifact that gets attached to the project. This one is used for test-javadocs.
*
* @see #JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
* @since 2.7
*/
public static final String TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER = "test-javadoc-resources";
/**
* The Javadoc script file name when <code>debug</code> parameter is on, i.e. javadoc.bat or javadoc.sh
*/
protected static final String DEBUG_JAVADOC_SCRIPT_NAME = "javadoc." + (SystemUtils.IS_OS_WINDOWS ? "bat" : "sh");
/**
* The <code>options</code> file name in the output directory when calling:
* <code>javadoc.exe(or .sh) @options @packages | @argfile | @files</code>
*/
protected static final String OPTIONS_FILE_NAME = "options";
/**
* The <code>packages</code> file name in the output directory when calling:
* <code>javadoc.exe(or .sh) @options @packages | @argfile | @files</code>
*/
protected static final String PACKAGES_FILE_NAME = "packages";
/**
* The <code>argfile</code> file name in the output directory when calling:
* <code>javadoc.exe(or .sh) @options @packages | @argfile | @files</code>
*/
protected static final String ARGFILE_FILE_NAME = "argfile";
/**
* The <code>files</code> file name in the output directory when calling:
* <code>javadoc.exe(or .sh) @options @packages | @argfile | @files</code>
*/
protected static final String FILES_FILE_NAME = "files";
/**
* Default css file name, used as file name in the output directory for the temporary custom stylesheet file
* loaded from classloader resources.
*/
private static final String DEFAULT_CSS_NAME = "stylesheet.css";
private static final String PACKAGE_LIST = "package-list";
private static final String ELEMENT_LIST = "element-list";
/**
* For Javadoc options appears since Java 1.4.
* See <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.4.1.html#summary">
* What's New in Javadoc 1.4</a>
*
* @since 2.1
*/
private static final JavaVersion SINCE_JAVADOC_1_4 = JavaVersion.parse("1.4");
/**
* For Javadoc options appears since Java 1.4.2.
* See <a
* href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.4.2.html#commandlineoptions">
* What's New in Javadoc 1.4.2</a>
*
* @since 2.1
*/
private static final JavaVersion SINCE_JAVADOC_1_4_2 = JavaVersion.parse("1.4.2");
/**
* For Javadoc options appears since Java 5.0.
* See <a
* href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.5.0.html#commandlineoptions">
* What's New in Javadoc 5.0</a>
*
* @since 2.1
*/
private static final JavaVersion SINCE_JAVADOC_1_5 = JavaVersion.parse("1.5");
/**
* For Javadoc options appears since Java 6.0.
* See <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/index.html">
* Javadoc Technology</a>
*
* @since 2.4
*/
private static final JavaVersion SINCE_JAVADOC_1_6 = JavaVersion.parse("1.6");
/**
* For Javadoc options appears since Java 8.0.
* See <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/index.html">
* Javadoc Technology</a>
*
* @since 3.0.0
*/
private static final JavaVersion SINCE_JAVADOC_1_8 = JavaVersion.parse("1.8");
/**
*
*/
private static final JavaVersion JAVA_VERSION = JavaVersion.JAVA_SPECIFICATION_VERSION;
// ----------------------------------------------------------------------
// Mojo components
// ----------------------------------------------------------------------
/**
* SiteTool.
*/
@Component
protected SiteTool siteTool;
/**
* Archiver manager
*
* @since 2.5
*/
@Component
private ArchiverManager archiverManager;
@Component
private ResourceResolver resourceResolver;
@Component
private RepositorySystem repoSystem;
@Parameter(defaultValue = "${repositorySystemSession}", readonly = true, required = true)
private RepositorySystemSession repoSession;
@Component
private ArtifactHandlerManager artifactHandlerManager;
/**
* Project builder
*
* @since 3.0
*/
@Component
private ProjectBuilder mavenProjectBuilder;
/** */
@Component
private ToolchainManager toolchainManager;
final LocationManager locationManager = new LocationManager();
// ----------------------------------------------------------------------
// Mojo parameters
// ----------------------------------------------------------------------
/**
* The current build session instance. This is used for
* toolchain manager API calls.
*/
@Parameter(defaultValue = "${session}", readonly = true, required = true)
protected MavenSession session;
/**
* The Maven Settings.
*
* @since 2.3
*/
@Parameter(defaultValue = "${settings}", readonly = true, required = true)
private Settings settings;
/**
* The Maven Project Object
*/
@Parameter(defaultValue = "${project}", readonly = true, required = true)
protected MavenProject project;
@Parameter(defaultValue = "${mojoExecution}", readonly = true, required = true)
protected MojoExecution mojoExecution;
/**
* Specify if the Javadoc plugin should operate in offline mode. If maven is run in offline
* mode (using {@code -o} or {@code --offline} on the command line), this option has no effect
* and the plugin is always in offline mode.
*
* @since 3.6.0
*/
@Parameter(property = "maven.javadoc.offline", defaultValue = "false")
private boolean offline;
/**
* Specifies the Javadoc resources directory to be included in the Javadoc (i.e. package.html, images...).
* <br/>
* Could be used in addition of <code>docfilessubdirs</code> parameter.
* <br/>
* See <a href="#docfilessubdirs">docfilessubdirs</a>.
*
* @see #docfilessubdirs
* @since 2.1
*/
@Parameter(defaultValue = "${basedir}/src/main/javadoc")
private File javadocDirectory;
/**
* Set an additional option(s) on the command line. All input will be passed as-is to the
* {@code @options} file. You must take care of quoting and escaping. Useful for a custom doclet.
*
* @since 3.0.0
*/
@Parameter
private String[] additionalOptions;
/**
* Sets additional Javadoc options (e.g. JVM options) on the command line.
* Example:
* <pre>
* <additionalJOption>-J-Xss128m</additionalJOption>
* </pre>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">
* Javadoc Options</a>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html#overview-of-java-options">
* VM Options</a>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/doc-files/net-properties.html">
* Networking Properties</a>
*
* @since 2.3
*/
@Parameter(property = "additionalJOption")
private String additionalJOption;
/**
* Sets additional Javadoc options for the execution of the javadoc command via the '-J' option to javadoc.
* Example:
* <pre>
* <additionalJOptions>
* <additionalJOption>-J-Xmx1g </additionalJOption>
* </additionalJOptions>
* </pre>
* @since 2.9
* @see #additionalJOption
*/
@Parameter
private String[] additionalJOptions;
/**
* A list of artifacts containing resources which should be copied into the
* Javadoc output directory (like stylesheets, icons, etc.).
* <br/>
* Example:
* <pre>
* <resourcesArtifacts>
* <resourcesArtifact>
* <groupId>external.group.id</groupId>
* <artifactId>external-resources</artifactId>
* <version>1.0</version>
* </resourcesArtifact>
* </resourcesArtifacts>
* </pre>
* <br/>
* See <a href="./apidocs/org/apache/maven/plugins/javadoc/options/ResourcesArtifact.html">Javadoc</a>.
* <br/>
*
* @since 2.5
*/
@Parameter(property = "resourcesArtifacts")
private ResourcesArtifact[] resourcesArtifacts;
/**
* The projects in the reactor for aggregation report.
*/
@Parameter(defaultValue = "${reactorProjects}", required = true, readonly = true)
protected List<MavenProject> reactorProjects;
/**
* Set this to <code>true</code> to debug the Javadoc plugin. With this, <code>javadoc.bat(or.sh)</code>,
* <code>options</code>, <code>@packages</code> or <code>argfile</code> files are provided in the output directory.
* <br/>
*
* @since 2.1
*/
@Parameter(property = "debug", defaultValue = "false")
private boolean debug;
/**
* Sets the absolute path of the Javadoc Tool executable to use. Since version 2.5, a mere directory specification
* is sufficient to have the plugin use "javadoc" or "javadoc.exe" respectively from this directory.
*
* @since 2.3
*/
@Parameter(property = "javadocExecutable")
private String javadocExecutable;
/**
* Version of the Javadoc Tool executable to use, ex. "1.3", "1.5".
*
* @since 2.3
*/
@Parameter(property = "javadocVersion")
private String javadocVersion;
/**
* Version of the Javadoc Tool executable to use.
*/
private JavaVersion javadocRuntimeVersion;
/**
* Specifies whether the Javadoc generation should be skipped.
*
* @since 2.5
*/
@Parameter(property = "maven.javadoc.skip", defaultValue = "false")
protected boolean skip;
/**
* Specifies if the build will fail if there are errors during javadoc execution or not.
*
* @since 2.5
*/
@Parameter(property = "maven.javadoc.failOnError", defaultValue = "true")
protected boolean failOnError;
/**
* Specifies if the build will fail if there are warning during javadoc execution or not.
*
* @since 3.0.1
*/
@Parameter(property = "maven.javadoc.failOnWarnings", defaultValue = "false")
protected boolean failOnWarnings;
/**
* Specifies to use the
* <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">
* options provided by the Standard Doclet</a> for a custom doclet.
* <br>
* Example:
* <pre>
* <docletArtifacts>
* <docletArtifact>
* <groupId>com.sun.tools.doclets</groupId>
* <artifactId>doccheck</artifactId>
* <version>1.2b2</version>
* </docletArtifact>
* </docletArtifacts>
* <useStandardDocletOptions>true</useStandardDocletOptions>
* </pre>
*
* @since 2.5
*/
@Parameter(property = "useStandardDocletOptions", defaultValue = "true")
protected boolean useStandardDocletOptions;
/**
* Detect the Javadoc links for all dependencies defined in the project. The detection is based on the default
* Maven conventions, i.e.: <code>${project.url}/apidocs</code>.
* <br/>
* For instance, if the project has a dependency to
* <a href="http://commons.apache.org/lang/">Apache Commons Lang</a> i.e.:
* <pre>
* <dependency>
* <groupId>commons-lang</groupId>
* <artifactId>commons-lang</artifactId>
* </dependency>
* </pre>
* The added Javadoc <code>-link</code> parameter will be <code>http://commons.apache.org/lang/apidocs</code>.
*
* @see #links
* @see #dependencyLinks
* @since 2.6
*/
@Parameter(property = "detectLinks", defaultValue = "false")
private boolean detectLinks;
/**
* Detect the links for all modules defined in the project.
* <br/>
* If {@code reactorProjects} is defined in a non-aggregator way, it generates default offline links
* between modules based on the defined project's urls. For instance, if a parent project has two projects
* <code>module1</code> and <code>module2</code>, the <code>-linkoffline</code> will be:
* <br/>
* The added Javadoc <code>-linkoffline</code> parameter for <b>module1</b> will be
* <code>/absolute/path/to/</code><b>module2</b><code>/target/site/apidocs</code>
* <br/>
* The added Javadoc <code>-linkoffline</code> parameter for <b>module2</b> will be
* <code>/absolute/path/to/</code><b>module1</b><code>/target/site/apidocs</code>
*
* @see #offlineLinks
* @since 2.6
*/
@Parameter(property = "detectOfflineLinks", defaultValue = "true")
private boolean detectOfflineLinks;
/**
* Detect the Java API link for the current build, e.g. <code>https://docs.oracle.com/javase/1.4.2/docs/api/</code>
* for Java source 1.4.
* <br/>
* By default, the goal detects the Javadoc API link depending the value of the <code>source</code>
* parameter in the <code>org.apache.maven.plugins:maven-compiler-plugin</code>
* (defined in <code>${project.build.plugins}</code> or in <code>${project.build.pluginManagement}</code>),
* or try to compute it from the {@code javadocExecutable} version.
*
* @see #links
* @see #javaApiLinks
* @since 2.6
*/
@Parameter(property = "detectJavaApiLink", defaultValue = "true")
private boolean detectJavaApiLink;
/**
* Use this parameter <b>only</b> if if you want to override the default URLs.
*
* The key should match {@code api_x}, where {@code x} matches the Java version.
*
* For example:
* <dl>
* <dt>api_1.5</dt>
* <dd>https://docs.oracle.com/javase/1.5.0/docs/api/</dd>
* <dt>api_1.8<dt>
* <dd>https://docs.oracle.com/javase/8/docs/api/</dd>
* <dt>api_9</dd>
* <dd>https://docs.oracle.com/javase/9/docs/api/</dd>
* </dl>
* @since 2.6
*/
@Parameter(property = "javaApiLinks")
private Properties javaApiLinks;
/**
* Flag controlling content validation of <code>package-list</code>/<code>element-list</code> resources.
* If set, the content of <code>package-list</code>/<code>element-list</code> resources will be validated.
*
* @since 2.8
*/
@Parameter(property = "validateLinks", defaultValue = "false")
private boolean validateLinks;
// ----------------------------------------------------------------------
// Javadoc Options - all alphabetical
// ----------------------------------------------------------------------
/**
* Specifies the paths where the boot classes reside. The <code>bootclasspath</code> can contain multiple paths
* by separating them with a colon (<code>:</code>) or a semicolon (<code>;</code>).
* @see <a href=
* "https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-boot-class-path">
* Javadoc option bootclasspath</a>.
* @since 2.5
*/
@Parameter(property = "bootclasspath")
private String bootclasspath;
/**
* Specifies the artifacts where the boot classes reside.
* <br/>
* Example:
* <pre>
* <bootclasspathArtifacts>
* <bootclasspathArtifact>
* <groupId>my-groupId</groupId>
* <artifactId>my-artifactId</artifactId>
* <version>my-version</version>
* </bootclasspathArtifact>
* </bootclasspathArtifacts>
* </pre>
* <br/>
* See <a href="./apidocs/org/apache/maven/plugins/javadoc/options/BootclasspathArtifact.html">Javadoc</a>.
*
* @see <a href=
* "https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-boot-class-path">
* Javadoc option bootclasspath</a>
* @since 2.5
*/
@Parameter(property = "bootclasspathArtifacts")
private BootclasspathArtifact[] bootclasspathArtifacts;
/**
* Uses the sentence break iterator to determine the end of the first sentence.
* @see <a href=
* "https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">
* Javadoc option breakiterator</a>.
*/
@Parameter(property = "breakiterator", defaultValue = "false")
private boolean breakiterator;
/**
* Specifies the class file that starts the doclet used in generating the documentation.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option doclet</a>.
*/
@Parameter(property = "doclet")
private String doclet;
/**
* Specifies the artifact containing the doclet starting class file (specified with the {@link #doclet}
* option).
* <br/>
* Example:
* <pre>
* <docletArtifact>
* <groupId>com.sun.tools.doclets</groupId>
* <artifactId>doccheck</artifactId>
* <version>1.2b2</version>
* </docletArtifact>
* </pre>
* <br/>
* See <a href="./apidocs/org/apache/maven/plugins/javadoc/options/DocletArtifact.html">Javadoc</a>.
* <br/>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option docletpath</a>.
*/
@Parameter(property = "docletArtifact")
private DocletArtifact docletArtifact;
/**
* Specifies multiple artifacts containing the path for the doclet starting class file (specified with the
* {@link #doclet} option).
* <br/>
* Example:
* <pre>
* <docletArtifacts>
* <docletArtifact>
* <groupId>com.sun.tools.doclets</groupId>
* <artifactId>doccheck</artifactId>
* <version>1.2b2</version>
* </docletArtifact>
* </docletArtifacts>
* </pre>
* <br/>
* See <a href="./apidocs/org/apache/maven/plugins/javadoc/options/DocletArtifact.html">Javadoc</a>.
* <br/>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option docletpath</a>.
* @since 2.1
*/
@Parameter(property = "docletArtifacts")
private DocletArtifact[] docletArtifacts;
/**
* Specifies the path to the doclet starting class file (specified with the {@link #doclet} option) and
* any jar files it depends on. The <code>docletPath</code> can contain multiple paths by separating them with
* a colon (<code>:</code>) or a semicolon (<code>;</code>).
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option docletpath</a>.
*/
@Parameter(property = "docletPath")
private String docletPath;
/**
* Specifies the encoding name of the source files. If not specified, the encoding value will be the value of the
* <code>file.encoding</code> system property.
* <br/>
* <b>Note</b>: In 2.4, the default value was locked to <code>ISO-8859-1</code> to ensure reproducing build, but
* this was reverted in 2.5.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-encoding">Javadoc option encoding</a>.
*/
@Parameter(property = "encoding", defaultValue = "${project.build.sourceEncoding}")
private String encoding;
/**
* Unconditionally excludes the specified packages and their subpackages from the list formed by
* <code>-subpackages</code>. Multiple packages can be separated by commas (<code>,</code>), colons (<code>:</code>)
* or semicolons (<code>;</code>).
* <p>
* Wildcards work as followed:
* <ul>
* <li>a wildcard at the beginning should match one or more directories</li>
* <li>any other wildcard must match exactly one directory</li>
* </ul>
* </p>
* Example:
* <pre>
* <excludePackageNames>*.internal:org.acme.exclude1.*:org.acme.exclude2</excludePackageNames>
* </pre>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option exclude</a>.
*/
@Parameter(property = "excludePackageNames")
private String excludePackageNames;
/**
* Specifies the directories where extension classes reside. Separate directories in <code>extdirs</code> with a
* colon (<code>:</code>) or a semicolon (<code>;</code>).
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-extdirs">Javadoc option extdirs</a>.
*/
@Parameter(property = "extdirs")
private String extdirs;
/**
* Specifies the locale that javadoc uses when generating documentation.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option locale</a>.
*/
@Parameter(property = "locale")
private String locale;
/**
* Specifies the maximum Java heap size to be used when launching the Javadoc tool.
* JVMs refer to this property as the <code>-Xmx</code> parameter. Example: '512' or '512m'.
* The memory unit depends on the JVM used. The units supported could be: <code>k</code>, <code>kb</code>,
* <code>m</code>, <code>mb</code>, <code>g</code>, <code>gb</code>, <code>t</code>, <code>tb</code>.
* If no unit specified, the default unit is <code>m</code>.
*/
@Parameter(property = "maxmemory")
private String maxmemory;
/**
* Specifies the minimum Java heap size to be used when launching the Javadoc tool.
* JVMs refer to this property as the <code>-Xms</code> parameter. Example: '512' or '512m'.
* The memory unit depends on the JVM used. The units supported could be: <code>k</code>, <code>kb</code>,
* <code>m</code>, <code>mb</code>, <code>g</code>, <code>gb</code>, <code>t</code>, <code>tb</code>.
* If no unit specified, the default unit is <code>m</code>.
*/
@Parameter(property = "minmemory")
private String minmemory;
/**
* This option creates documentation with the appearance and functionality of documentation generated by
* Javadoc 1.1. This is no longer supported since Javadoc 1.4 (shipped with JDK 1.4)
* @see <a href="https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#a1.1">Javadoc option 1.1</a>.
*/
@Parameter(property = "old", defaultValue = "false")
@Deprecated
private boolean old;
/**
* Specifies that javadoc should retrieve the text for the overview documentation from the "source" file
* specified by path/filename and place it on the Overview page (overview-summary.html).
* <br/>
* <b>Note</b>: could be in conflict with {@link #nooverview}.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Javadoc option overview</a>.
* <br/>
*/
@Parameter(property = "overview", defaultValue = "${basedir}/src/main/javadoc/overview.html")
private File overview;
/**
* Shuts off non-error and non-warning messages, leaving only the warnings and errors appear, making them
* easier to view.
* <br/>
* Note: was a standard doclet in Java 1.4.2 (refer to bug ID
* <a href="https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4714350">4714350</a>).
* <br/>
* Since Java 5.0.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option quiet</a>.
*/
@Parameter(property = "quiet", defaultValue = "false")
private boolean quiet;
/**
* Specifies the access level for classes and members to show in the Javadocs.
* Possible values are:
* <ul>
* <li>public (shows only public classes and members)</li>
* <li>protected (shows only public and protected classes and members)</li>
* <li>package (shows all classes and members not marked private)</li>
* <li>private (shows all classes and members)</li>
* </ul>
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc options private, protected, public and package</a>
*/
@Parameter(property = "show", defaultValue = "protected")
private String show;
/**
* Provide source compatibility with specified release. Since JDK 9 rather use {@link #release}.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-source">Javadoc option source</a>.
*/
@Parameter(property = "source", defaultValue = "${maven.compiler.source}")
private String source;
/**
* Provide source compatibility with specified release
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-release">Javadoc option release</a>.
* @since JDK 9
* @since 3.1.0
*/
@Parameter(defaultValue = "${maven.compiler.release}")
private String release;
/**
* Specifies the source paths where the subpackages are located. The <code>sourcepath</code> can contain
* multiple paths by separating them with a colon (<code>:</code>) or a semicolon (<code>;</code>).
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#option-source-path">Javadoc option sourcepath</a>.
*/
@Parameter(property = "sourcepath")
private String sourcepath;
/**
* Specifies the package directory where javadoc will be executed. Multiple packages can be separated by
* colons (<code>:</code>).
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option subpackages</a>.
*/
@Parameter(property = "subpackages")
private String subpackages;
/**
* Provides more detailed messages while javadoc is running.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc">Javadoc option verbose</a>.
*/
@Parameter(property = "verbose", defaultValue = "false")
private boolean verbose;
/**
* Run the javadoc tool in pre-Java 9 (non-modular) style even if the java version is
* post java 9. This allows non-JPMS projects that have moved to newer Java
* versions to create javadocs without having to use JPMS modules.
*
* @since 3.6.0
*/
@Parameter(property = "legacyMode", defaultValue = "false")
private boolean legacyMode;
// ----------------------------------------------------------------------
// Standard Doclet Options - all alphabetical
// ----------------------------------------------------------------------
/**
* Specifies whether or not the author text is included in the generated Javadocs.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option author</a>.
*/
@Parameter(property = "author", defaultValue = "true")
private boolean author;
/**
* Specifies the text to be placed at the bottom of each output file.<br/>
* If you want to use html, you have to put it in a CDATA section, <br/>
* e.g. <code><![CDATA[Copyright 2005, <a href="http://www.mycompany.com">MyCompany, Inc.<a>]]></code>
* <br>
* <strong>Note:<strong>If the project has the property <code>project.build.outputTimestamp</code>, its year will
* be used as {currentYear}. This way it is possible to generate reproducible javadoc jars.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option bottom</a>.
*/
@Parameter(
property = "bottom",
defaultValue = "Copyright © {inceptionYear}–{currentYear} {organizationName}. "
+ "All rights reserved.")
private String bottom;
/**
* Specifies the HTML character set for this document. If not specified, the charset value will be the value of
* the {@link #docencoding} parameter.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option charset</a>.
*/
@Parameter(property = "charset")
private String charset;
/**
* Specifies the encoding of the generated HTML files. If not specified, the docencoding value will be
* <code>UTF-8</code>.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option docencoding</a>.
*/
@Parameter(property = "docencoding", defaultValue = "${project.reporting.outputEncoding}")
private String docencoding;
/**
* Enables deep copying of the <code>**/doc-files</code> directories and the specifc <code>resources</code>
* directory from the <code>javadocDirectory</code> directory (for instance,
* <code>src/main/javadoc/com/mycompany/myapp/doc-files</code> and <code>src/main/javadoc/resources</code>).
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option docfilessubdirs</a>.
* @see #excludedocfilessubdir
* @see #javadocDirectory
*/
@Parameter(property = "docfilessubdirs", defaultValue = "false")
private boolean docfilessubdirs;
/**
* Specifies specific checks to be performed on Javadoc comments.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#additional-options-provided-by-the-standard-doclet">Additional Doclet option Xdoclint</a>.
*
* @since 3.0.0
*/
@Parameter(property = "doclint")
private String doclint;
/**
* Specifies the title to be placed near the top of the overview summary file.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option doctitle</a>.
*/
@Parameter(property = "doctitle", defaultValue = "${project.name} ${project.version} API")
private String doctitle;
/**
* Excludes any "doc-files" subdirectories with the given names. Multiple patterns can be excluded
* by separating them with colons (<code>:</code>).
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option excludedocfilessubdir</a>.
* @see #docfilessubdirs
*/
@Parameter(property = "excludedocfilessubdir")
private String excludedocfilessubdir;
/**
* Specifies the footer text to be placed at the bottom of each output file.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option footer</a>.
*/
@Parameter(property = "footer")
private String footer;
/**
* Separates packages on the overview page into whatever groups you specify, one group per table. The
* packages pattern can be any package name, or can be the start of any package name followed by an asterisk
* (<code>*</code>) meaning "match any characters". Multiple patterns can be included in a group
* by separating them with colons (<code>:</code>).
* <br/>
* Example:
* <pre>
* <groups>
* <group>
* <title>Core Packages</title>
* <!-- To includes java.lang, java.lang.ref,
* java.lang.reflect and only java.util
* (i.e. not java.util.jar) -->
* <packages>java.lang*:java.util</packages>
* </group>
* <group>
* <title>Extension Packages</title>
* <!-- To include javax.accessibility,
* javax.crypto, ... (among others) -->
* <packages>javax.*</packages>
* </group>
* </groups>
* </pre>
* <b>Note</b>: using <code>java.lang.*</code> for <code>packages</code> would omit the <code>java.lang</code>
* package but using <code>java.lang*</code> will include it.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option group</a>.
* @see Group
*/
@Parameter
private Group[] groups;
/**
* Specifies the header text to be placed at the top of each output file.
* @see <a href="https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#standard-doclet-options">Doclet option header</a>.
*/
@Parameter(property = "header")
private String header;
/**
* Specifies the path of an alternate help file path\filename that the HELP link in the top and bottom
* navigation bars link to.
* <br/>
* <b>Note</b>: could be in conflict with <nohelp/>.
* <br/>
* The <code>helpfile</code> could be an absolute File path.
* <br/>
* Since 2.6, it could be also be a path from a resource in the current project source directories
* (i.e. <code>src/main/java</code>, <code>src/main/resources</code> or <code>src/main/javadoc</code>)
* or from a resource in the Javadoc plugin dependencies, for instance:
* <pre>