@@ -333,10 +333,14 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
333
333
private MojoExecution mojo ;
334
334
335
335
/**
336
- * Specify if the Javadoc should operate in offline mode.
336
+ * Specify if the Javadoc plugin should operate in offline mode. If maven is run in offline
337
+ * mode (using {@code -o} or {@code --offline} on the command line), this option has no effect
338
+ * and the plugin is always in offline mode.
339
+ *
340
+ * @since 3.6.0
337
341
*/
338
- @ Parameter (defaultValue = "${settings. offline} " , required = true , readonly = true )
339
- private boolean isOffline ;
342
+ @ Parameter (property = "maven.javadoc. offline" , defaultValue = "false" )
343
+ private boolean offline ;
340
344
341
345
/**
342
346
* Specifies the Javadoc resources directory to be included in the Javadoc (i.e. package.html, images...).
@@ -1033,7 +1037,9 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
1033
1037
*
1034
1038
* <b>Notes</b>:
1035
1039
* <ol>
1036
- * <li>only used if {@code isOffline} is set to <code>false</code>.</li>
1040
+ * <li>This option is ignored if the plugin is run in offline mode (using the {@code <offline>}
1041
+ * setting or specifying {@code -o, --offline} or {@code -Dmaven.javadoc.offline=true} on the
1042
+ * command line.</li>
1037
1043
* <li>all given links should have a fetchable <code>/package-list</code> or <code>/element-list</code>
1038
1044
* (since Java 10). For instance:
1039
1045
* <pre>
@@ -3781,7 +3787,7 @@ private void addLinkArguments(List<String> arguments) throws MavenReportExceptio
3781
3787
continue ;
3782
3788
}
3783
3789
3784
- if (isOffline && !link .startsWith ("file:" )) {
3790
+ if (( settings . isOffline () || offline ) && !link .startsWith ("file:" )) {
3785
3791
continue ;
3786
3792
}
3787
3793
0 commit comments