@@ -212,44 +212,6 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
212
212
private static final String PACKAGE_LIST = "package-list" ;
213
213
private static final String ELEMENT_LIST = "element-list" ;
214
214
215
- /**
216
- * For Javadoc options appears since Java 1.4.
217
- * See <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.4.1.html#summary">
218
- * What's New in Javadoc 1.4</a>
219
- *
220
- * @since 2.1
221
- */
222
- private static final JavaVersion SINCE_JAVADOC_1_4 = JavaVersion .parse ("1.4" );
223
-
224
- /**
225
- * For Javadoc options appears since Java 1.4.2.
226
- * See <a
227
- * href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.4.2.html#commandlineoptions">
228
- * What's New in Javadoc 1.4.2</a>
229
- *
230
- * @since 2.1
231
- */
232
- private static final JavaVersion SINCE_JAVADOC_1_4_2 = JavaVersion .parse ("1.4.2" );
233
-
234
- /**
235
- * For Javadoc options appears since Java 5.0.
236
- * See <a
237
- * href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/whatsnew-1.5.0.html#commandlineoptions">
238
- * What's New in Javadoc 5.0</a>
239
- *
240
- * @since 2.1
241
- */
242
- private static final JavaVersion SINCE_JAVADOC_1_5 = JavaVersion .parse ("1.5" );
243
-
244
- /**
245
- * For Javadoc options appears since Java 6.0.
246
- * See <a href="https://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/index.html">
247
- * Javadoc Technology</a>
248
- *
249
- * @since 2.4
250
- */
251
- private static final JavaVersion SINCE_JAVADOC_1_6 = JavaVersion .parse ("1.6" );
252
-
253
215
/**
254
216
* For Javadoc options appears since Java 8.0.
255
217
* See <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/javadoc/index.html">
@@ -1802,7 +1764,7 @@ protected List<String> getProjectSourceRoots(MavenProject p) {
1802
1764
}
1803
1765
1804
1766
return p .getCompileSourceRoots () == null
1805
- ? Collections .< String > emptyList ()
1767
+ ? Collections .emptyList ()
1806
1768
: new LinkedList <>(p .getCompileSourceRoots ());
1807
1769
}
1808
1770
@@ -1816,7 +1778,7 @@ protected List<String> getExecutionProjectSourceRoots(MavenProject p) {
1816
1778
}
1817
1779
1818
1780
return p .getExecutionProject ().getCompileSourceRoots () == null
1819
- ? Collections .< String > emptyList ()
1781
+ ? Collections .emptyList ()
1820
1782
: new LinkedList <>(p .getExecutionProject ().getCompileSourceRoots ());
1821
1783
}
1822
1784
@@ -3330,7 +3292,7 @@ private List<String> getArtifactsAbsolutePath(JavadocPathArtifact javadocArtifac
3330
3292
* @param javadocArtifact the {@link JavadocPathArtifact} to resolve
3331
3293
* @return a resolved {@link Artifact}
3332
3294
* @throws org.eclipse.aether.resolution.ArtifactResolutionException
3333
- * @throws ArtifactResolverException issue while resolving artifact
3295
+ * @throws org.eclipse.aether.resolution.ArtifactResolutionException issue while resolving artifact
3334
3296
*/
3335
3297
private Artifact createAndResolveArtifact (JavadocPathArtifact javadocArtifact )
3336
3298
throws org .eclipse .aether .resolution .ArtifactResolutionException {
@@ -3861,7 +3823,6 @@ private void addLinkArguments(List<String> arguments) throws MavenReportExceptio
3861
3823
*
3862
3824
* @param javadocOutputDirectory not null
3863
3825
* @throws MavenReportException if any
3864
- * @see #copyDefaultStylesheet(File)
3865
3826
* @see #copyJavadocResources(File)
3866
3827
* @see #copyAdditionalJavadocResources(File)
3867
3828
*/
@@ -4234,13 +4195,8 @@ private void addCommandLineOptions(Commandline cmd, List<String> arguments, File
4234
4195
private void addCommandLineArgFile (Commandline cmd , File javadocOutputDirectory , List <String > files )
4235
4196
throws MavenReportException {
4236
4197
File argfileFile ;
4237
- if (JAVA_VERSION .compareTo (SINCE_JAVADOC_1_4 ) >= 0 ) {
4238
- argfileFile = new File (javadocOutputDirectory , ARGFILE_FILE_NAME );
4239
- cmd .createArg ().setValue ("@" + ARGFILE_FILE_NAME );
4240
- } else {
4241
- argfileFile = new File (javadocOutputDirectory , FILES_FILE_NAME );
4242
- cmd .createArg ().setValue ("@" + FILES_FILE_NAME );
4243
- }
4198
+ argfileFile = new File (javadocOutputDirectory , ARGFILE_FILE_NAME );
4199
+ cmd .createArg ().setValue ("@" + ARGFILE_FILE_NAME );
4244
4200
4245
4201
List <String > quotedFiles = new ArrayList <>(files .size ());
4246
4202
for (String file : files ) {
@@ -4378,20 +4334,15 @@ private void addJavadocOptions(
4378
4334
4379
4335
// all options in alphabetical order
4380
4336
4381
- if (old && isJavaDocVersionAtLeast (SINCE_JAVADOC_1_4 )) {
4382
- if (getLog ().isWarnEnabled ()) {
4383
- getLog ().warn ("Javadoc 1.4+ doesn't support the -1.1 switch anymore. Ignore this option." );
4384
- }
4385
- } else {
4386
- addArgIf (arguments , old , "-1.1" );
4337
+ if (getLog ().isWarnEnabled ()) {
4338
+ getLog ().warn ("Javadoc 1.4+ doesn't support the -1.1 switch anymore. Ignore this option." );
4387
4339
}
4388
4340
4389
4341
addArgIfNotEmpty (arguments , "-bootclasspath" , JavadocUtil .quotedPathArgument (getBootclassPath ()));
4390
4342
4391
- if (isJavaDocVersionAtLeast ( SINCE_JAVADOC_1_5 ) ) {
4392
- addArgIf (arguments , breakiterator , "-breakiterator" , SINCE_JAVADOC_1_5 );
4343
+ if (breakiterator ) {
4344
+ addArgIf (arguments , breakiterator , "-breakiterator" );
4393
4345
}
4394
-
4395
4346
List <MavenProject > aggregatedProjects = reactorProjects ; // getAggregatedProjects();
4396
4347
Map <String , MavenProject > reactorKeys = new HashMap <>(aggregatedProjects .size ());
4397
4348
for (MavenProject reactorProject : aggregatedProjects ) {
@@ -4651,15 +4602,13 @@ private void addJavadocOptions(
4651
4602
4652
4603
arguments .add (getAccessLevel ());
4653
4604
4654
- if (isJavaDocVersionAtLeast (SINCE_JAVADOC_1_5 )) {
4655
- addArgIf (arguments , quiet , "-quiet" , SINCE_JAVADOC_1_5 );
4656
- }
4605
+ addArgIf (arguments , quiet , "-quiet" );
4657
4606
4658
4607
if (javadocRuntimeVersion .isAtLeast ("9" ) && release != null ) {
4659
4608
arguments .add ("--release" );
4660
4609
arguments .add (release );
4661
4610
} else {
4662
- addArgIfNotEmpty (arguments , "-source" , JavadocUtil .quotedArgument (source ), SINCE_JAVADOC_1_4 );
4611
+ addArgIfNotEmpty (arguments , "-source" , JavadocUtil .quotedArgument (source ));
4663
4612
}
4664
4613
4665
4614
if ((sourcepath == null || sourcepath .isEmpty ()) && (subpackages != null && !subpackages .isEmpty ())) {
@@ -4682,12 +4631,10 @@ private void addJavadocOptions(
4682
4631
arguments , "--module-source-path" , JavadocUtil .quotedPathArgument (moduleSourceDir .toString ()));
4683
4632
}
4684
4633
4685
- if ((sourcepath != null && !sourcepath .isEmpty ()) && isJavaDocVersionAtLeast (SINCE_JAVADOC_1_5 )) {
4686
- addArgIfNotEmpty (arguments , "-subpackages" , subpackages , SINCE_JAVADOC_1_5 );
4687
- }
4634
+ addArgIfNotEmpty (arguments , "-subpackages" , subpackages );
4688
4635
4689
4636
// [MJAVADOC-497] must be after sourcepath is recalculated, since getExcludedPackages() depends on it
4690
- addArgIfNotEmpty (arguments , "-exclude" , getExcludedPackages (sourcePaths ), SINCE_JAVADOC_1_4 );
4637
+ addArgIfNotEmpty (arguments , "-exclude" , getExcludedPackages (sourcePaths ));
4691
4638
4692
4639
addArgIf (arguments , verbose , "-verbose" );
4693
4640
@@ -4757,28 +4704,23 @@ private void addStandardDocletOptions(
4757
4704
4758
4705
addArgIfNotEmpty (arguments , "-bottom" , JavadocUtil .quotedArgument (getBottomText ()), false , false );
4759
4706
4760
- if (!isJavaDocVersionAtLeast (SINCE_JAVADOC_1_5 )) {
4761
- addArgIf (arguments , breakiterator , "-breakiterator" , SINCE_JAVADOC_1_4 );
4762
- }
4707
+ addArgIf (arguments , breakiterator , "-breakiterator" );
4763
4708
4764
4709
addArgIfNotEmpty (arguments , "-charset" , JavadocUtil .quotedArgument (getCharset ()));
4765
4710
4766
4711
addArgIfNotEmpty (arguments , "-d" , JavadocUtil .quotedPathArgument (javadocOutputDirectory .toString ()));
4767
4712
4768
4713
addArgIfNotEmpty (arguments , "-docencoding" , JavadocUtil .quotedArgument (getDocencoding ()));
4769
4714
4770
- addArgIf (arguments , docfilessubdirs , "-docfilessubdirs" , SINCE_JAVADOC_1_4 );
4715
+ addArgIf (arguments , docfilessubdirs , "-docfilessubdirs" );
4771
4716
4772
4717
addArgIf (arguments , (doclint != null && !doclint .isEmpty ()), "-Xdoclint:" + getDoclint (), SINCE_JAVADOC_1_8 );
4773
4718
4774
4719
addArgIfNotEmpty (arguments , "-doctitle" , JavadocUtil .quotedArgument (getDoctitle ()), false , false );
4775
4720
4776
4721
if (docfilessubdirs ) {
4777
4722
addArgIfNotEmpty (
4778
- arguments ,
4779
- "-excludedocfilessubdir" ,
4780
- JavadocUtil .quotedPathArgument (excludedocfilessubdir ),
4781
- SINCE_JAVADOC_1_4 );
4723
+ arguments , "-excludedocfilessubdir" , JavadocUtil .quotedPathArgument (excludedocfilessubdir ));
4782
4724
}
4783
4725
4784
4726
addArgIfNotEmpty (arguments , "-footer" , JavadocUtil .quotedArgument (footer ), false , false );
@@ -4787,30 +4729,23 @@ private void addStandardDocletOptions(
4787
4729
4788
4730
addArgIfNotEmpty (arguments , "-header" , JavadocUtil .quotedArgument (header ), false , false );
4789
4731
4790
- Optional <File > helpFile = getHelpFile (javadocOutputDirectory );
4791
- if (helpFile .isPresent ()) {
4792
- addArgIfNotEmpty (
4793
- arguments ,
4794
- "-helpfile" ,
4795
- JavadocUtil .quotedPathArgument (helpFile .get ().getAbsolutePath ()));
4796
- }
4732
+ getHelpFile (javadocOutputDirectory )
4733
+ .ifPresent (file -> addArgIfNotEmpty (
4734
+ arguments , "-helpfile" , JavadocUtil .quotedPathArgument (file .getAbsolutePath ())));
4797
4735
4798
- addArgIf (arguments , keywords , "-keywords" , SINCE_JAVADOC_1_4_2 );
4736
+ addArgIf (arguments , keywords , "-keywords" );
4799
4737
4800
4738
addLinkArguments (arguments );
4801
4739
4802
4740
addLinkofflineArguments (arguments , offlineLinks );
4803
4741
4804
- addArgIf (arguments , linksource , "-linksource" , SINCE_JAVADOC_1_4 );
4742
+ addArgIf (arguments , linksource , "-linksource" );
4805
4743
4806
4744
if (sourcetab > 0 ) {
4807
- if (javadocRuntimeVersion == SINCE_JAVADOC_1_4_2 ) {
4808
- addArgIfNotEmpty (arguments , "-linksourcetab" , String .valueOf (sourcetab ));
4809
- }
4810
- addArgIfNotEmpty (arguments , "-sourcetab" , String .valueOf (sourcetab ), SINCE_JAVADOC_1_5 );
4745
+ addArgIfNotEmpty (arguments , "-sourcetab" , String .valueOf (sourcetab ));
4811
4746
}
4812
4747
4813
- addArgIf (arguments , nocomment , "-nocomment" , SINCE_JAVADOC_1_4 );
4748
+ addArgIf (arguments , nocomment , "-nocomment" );
4814
4749
4815
4750
addArgIf (arguments , nodeprecated , "-nodeprecated" );
4816
4751
@@ -4824,7 +4759,7 @@ private void addStandardDocletOptions(
4824
4759
4825
4760
addArgIf (arguments , nooverview , "-nooverview" );
4826
4761
4827
- addArgIfNotEmpty (arguments , "-noqualifier" , JavadocUtil .quotedArgument (noqualifier ), SINCE_JAVADOC_1_4 );
4762
+ addArgIfNotEmpty (arguments , "-noqualifier" , JavadocUtil .quotedArgument (noqualifier ));
4828
4763
4829
4764
addArgIf (arguments , nosince , "-nosince" );
4830
4765
@@ -4834,44 +4769,34 @@ private void addStandardDocletOptions(
4834
4769
notimestamp = true ;
4835
4770
}
4836
4771
4837
- addArgIf (arguments , notimestamp , "-notimestamp" , SINCE_JAVADOC_1_5 );
4772
+ addArgIf (arguments , notimestamp , "-notimestamp" );
4838
4773
4839
4774
addArgIf (arguments , notree , "-notree" );
4840
4775
4841
- addArgIfNotEmpty (arguments , "-packagesheader" , JavadocUtil .quotedArgument (packagesheader ), SINCE_JAVADOC_1_4_2 );
4776
+ addArgIfNotEmpty (arguments , "-packagesheader" , JavadocUtil .quotedArgument (packagesheader ));
4842
4777
4843
- if (!isJavaDocVersionAtLeast (SINCE_JAVADOC_1_5 )) // Sun bug: 4714350
4844
- {
4845
- addArgIf (arguments , quiet , "-quiet" , SINCE_JAVADOC_1_4 );
4846
- }
4778
+ addArgIf (arguments , quiet , "-quiet" );
4847
4779
4848
4780
addArgIf (arguments , serialwarn , "-serialwarn" );
4849
4781
4850
4782
addArgIf (arguments , splitindex , "-splitindex" );
4851
4783
4852
- Optional <File > stylesheetfile = getStylesheetFile (javadocOutputDirectory );
4853
-
4854
- if (stylesheetfile .isPresent ()) {
4855
- addArgIfNotEmpty (
4856
- arguments ,
4857
- "-stylesheetfile" ,
4858
- JavadocUtil .quotedPathArgument (stylesheetfile .get ().getAbsolutePath ()));
4859
- }
4784
+ getStylesheetFile (javadocOutputDirectory )
4785
+ .ifPresent (file -> addArgIfNotEmpty (
4786
+ arguments , "-stylesheetfile" , JavadocUtil .quotedPathArgument (file .getAbsolutePath ())));
4860
4787
4861
4788
addAddStyleSheets (arguments );
4862
4789
4863
- if ((sourcepath != null && !sourcepath .isEmpty ()) && !isJavaDocVersionAtLeast (SINCE_JAVADOC_1_5 )) {
4864
- addArgIfNotEmpty (arguments , "-subpackages" , subpackages , SINCE_JAVADOC_1_4 );
4865
- }
4790
+ addArgIfNotEmpty (arguments , "-subpackages" , subpackages );
4866
4791
4867
- addArgIfNotEmpty (arguments , "-taglet" , JavadocUtil .quotedArgument (taglet ), SINCE_JAVADOC_1_4 );
4792
+ addArgIfNotEmpty (arguments , "-taglet" , JavadocUtil .quotedArgument (taglet ));
4868
4793
addTaglets (arguments );
4869
4794
addTagletsFromTagletArtifacts (arguments );
4870
- addArgIfNotEmpty (arguments , "-tagletpath" , JavadocUtil .quotedPathArgument (getTagletPath ()), SINCE_JAVADOC_1_4 );
4795
+ addArgIfNotEmpty (arguments , "-tagletpath" , JavadocUtil .quotedPathArgument (getTagletPath ()));
4871
4796
4872
4797
addTags (arguments );
4873
4798
4874
- addArgIfNotEmpty (arguments , "-top" , JavadocUtil .quotedArgument (top ), false , false , SINCE_JAVADOC_1_6 );
4799
+ addArgIfNotEmpty (arguments , "-top" , JavadocUtil .quotedArgument (top ), false , false );
4875
4800
4876
4801
addArgIf (arguments , use , "-use" );
4877
4802
@@ -4936,7 +4861,7 @@ private void addTags(List<String> arguments) throws MavenReportException {
4936
4861
}
4937
4862
}
4938
4863
value += "\" " ;
4939
- addArgIfNotEmpty (arguments , "-tag" , value , SINCE_JAVADOC_1_4 );
4864
+ addArgIfNotEmpty (arguments , "-tag" , value );
4940
4865
}
4941
4866
}
4942
4867
}
@@ -4957,8 +4882,7 @@ private void addTaglets(List<String> arguments) {
4957
4882
getLog ().warn ("A taglet option is empty. Ignore this option." );
4958
4883
}
4959
4884
} else {
4960
- addArgIfNotEmpty (
4961
- arguments , "-taglet" , JavadocUtil .quotedArgument (taglet1 .getTagletClass ()), SINCE_JAVADOC_1_4 );
4885
+ addArgIfNotEmpty (arguments , "-taglet" , JavadocUtil .quotedArgument (taglet1 .getTagletClass ()));
4962
4886
}
4963
4887
}
4964
4888
}
@@ -5056,7 +4980,7 @@ private void addTagletsFromTagletArtifacts(List<String> arguments) throws MavenR
5056
4980
5057
4981
if (tagletClasses != null && !tagletClasses .isEmpty ()) {
5058
4982
for (String tagletClass : tagletClasses ) {
5059
- addArgIfNotEmpty (arguments , "-taglet" , JavadocUtil .quotedArgument (tagletClass ), SINCE_JAVADOC_1_4 );
4983
+ addArgIfNotEmpty (arguments , "-taglet" , JavadocUtil .quotedArgument (tagletClass ));
5060
4984
}
5061
4985
}
5062
4986
}
@@ -5603,7 +5527,7 @@ private List<String> getDependenciesLinks() {
5603
5527
url = getJavadocLink (artifactProject );
5604
5528
detected = true ;
5605
5529
} catch (ProjectBuildingException e ) {
5606
- logError ("ProjectBuildingException for " + artifact . toString () + ": " + e .getMessage (), e );
5530
+ logError ("ProjectBuildingException for " + artifact + ": " + e .getMessage (), e );
5607
5531
continue ;
5608
5532
}
5609
5533
}
0 commit comments