@@ -333,10 +333,14 @@ public abstract class AbstractJavadocMojo extends AbstractMojo {
333333 private MojoExecution mojo ;
334334
335335 /**
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
337341 */
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 ;
340344
341345 /**
342346 * 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 {
10331037 *
10341038 * <b>Notes</b>:
10351039 * <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>
10371043 * <li>all given links should have a fetchable <code>/package-list</code> or <code>/element-list</code>
10381044 * (since Java 10). For instance:
10391045 * <pre>
@@ -3781,7 +3787,7 @@ private void addLinkArguments(List<String> arguments) throws MavenReportExceptio
37813787 continue ;
37823788 }
37833789
3784- if (isOffline && !link .startsWith ("file:" )) {
3790+ if (( settings . isOffline () || offline ) && !link .startsWith ("file:" )) {
37853791 continue ;
37863792 }
37873793
0 commit comments