diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index c60b674f..dd4b19d4 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -25,6 +25,7 @@ Improvements::
* Fix throwing an exception when registering a non Extension (#596)
* Reimplement resource copy using 'plexus.util.DirectorScanner' instead of 'maven-filtering' to reduce dependencies and build time (#597)
* Set minimal Maven version to v3.8.5 (#629)
+ * Replace deprecated 'headerFooter' by 'standalone' in configuration (#649)
Build / Infrastructure::
diff --git a/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-1/pom.xml b/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-1/pom.xml
index eff7b42a..877fac84 100644
--- a/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-1/pom.xml
+++ b/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-1/pom.xml
@@ -35,7 +35,7 @@
src/main/doc
target/docs
html
- false
+ false
@@ -43,4 +43,4 @@
-
\ No newline at end of file
+
diff --git a/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-2/pom.xml b/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-2/pom.xml
index 09e3d55a..f65bd6c3 100644
--- a/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-2/pom.xml
+++ b/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-2/pom.xml
@@ -35,7 +35,7 @@
src/main/doc
target/docs
html
- false
+ false
@@ -43,4 +43,4 @@
-
\ No newline at end of file
+
diff --git a/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-3/pom.xml b/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-3/pom.xml
index 02bc0f6a..6e34206c 100644
--- a/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-3/pom.xml
+++ b/asciidoctor-maven-plugin/src/it/thread-safe/asciidoctor-project-3/pom.xml
@@ -35,7 +35,7 @@
src/main/doc
target/docs
html
- false
+ false
@@ -43,4 +43,4 @@
-
\ No newline at end of file
+
diff --git a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/AsciidoctorMojo.java b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/AsciidoctorMojo.java
index e7742e72..006773bc 100644
--- a/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/AsciidoctorMojo.java
+++ b/asciidoctor-maven-plugin/src/main/java/org/asciidoctor/maven/AsciidoctorMojo.java
@@ -10,7 +10,6 @@
import org.asciidoctor.jruby.AsciidoctorJRuby;
import org.asciidoctor.jruby.internal.JRubyRuntimeContext;
import org.asciidoctor.maven.commons.AsciidoctorHelper;
-import org.asciidoctor.maven.commons.StringUtils;
import org.asciidoctor.maven.extensions.AsciidoctorJExtensionRegistry;
import org.asciidoctor.maven.extensions.ExtensionConfiguration;
import org.asciidoctor.maven.extensions.ExtensionRegistry;
@@ -31,7 +30,6 @@
import java.nio.file.Path;
import java.util.*;
import java.util.logging.Logger;
-import java.util.stream.Collectors;
import static org.asciidoctor.maven.commons.StringUtils.isBlank;
import static org.asciidoctor.maven.process.SourceDirectoryFinder.DEFAULT_SOURCE_DIR;
@@ -91,8 +89,8 @@ public class AsciidoctorMojo extends AbstractMojo {
@Parameter(property = AsciidoctorMaven.PREFIX + Options.ERUBY)
protected String eruby;
- @Parameter(property = AsciidoctorMaven.PREFIX + "headerFooter")
- protected boolean headerFooter = true;
+ @Parameter(property = AsciidoctorMaven.PREFIX + "standalone", defaultValue = "true")
+ protected boolean standalone = true;
@Parameter(property = AsciidoctorMaven.PREFIX + "templateDirs")
protected List templateDirs = new ArrayList<>();
@@ -389,7 +387,7 @@ protected OptionsBuilder createOptionsBuilder(AsciidoctorMojo configuration, Att
final OptionsBuilder optionsBuilder = OptionsBuilder.options()
.backend(configuration.getBackend())
.safe(SafeMode.UNSAFE)
- .headerFooter(configuration.isHeaderFooter())
+ .standalone(configuration.standalone)
.mkDirs(true);
if (!isBlank(configuration.getEruby()))
@@ -510,14 +508,6 @@ public void setAttributes(Map attributes) {
this.attributes = attributes;
}
- public boolean isHeaderFooter() {
- return headerFooter;
- }
-
- public void setHeaderFooter(boolean headerFooter) {
- this.headerFooter = headerFooter;
- }
-
public String getTemplateEngine() {
return templateEngine;
}
diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorIntegrationTest.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorIntegrationTest.java
index 8294a974..623fb445 100644
--- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorIntegrationTest.java
+++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorIntegrationTest.java
@@ -357,7 +357,7 @@ public void should_honor_doctype_set_in_document() throws MojoFailureException,
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "book.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("linkcss", "", "copycss!", "");
mojo.execute();
diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoExtensionsTest.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoExtensionsTest.java
index 9e27e807..c6216461 100644
--- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoExtensionsTest.java
+++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoExtensionsTest.java
@@ -42,7 +42,7 @@ public void should_fail_when_extension_is_not_found_in_classpath() {
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null, "linkcss!", "");
mojo.extensions = Arrays.asList(extensionConfiguration("non.existent.Processor"));
Throwable throwable = Assertions.catchThrowable(mojo::execute);
@@ -66,7 +66,7 @@ public void should_fail_when_extension_throws_an_uncaught_exception() {
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null, "linkcss!", "");
mojo.extensions = Arrays.asList(extensionConfiguration(FailingPreprocessor.class));
Throwable throwable = Assertions.catchThrowable(mojo::execute);
@@ -140,7 +140,7 @@ private void shouldRegisterAndRunExtension(String extensionClassName, String ini
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = singletonList(extensionConfiguration("org.asciidoctor.maven.test.processors." + extensionClassName));
mojo.execute();
@@ -163,7 +163,7 @@ public void should_convert_to_html_with_a_preprocessor() throws MojoFailureExcep
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = Arrays.asList(extensionConfiguration(ChangeAttributeValuePreprocessor.class));
mojo.execute();
@@ -184,7 +184,7 @@ public void should_convert_to_html_with_a_blockprocessor() throws MojoFailureExc
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = singletonList(extensionConfiguration(YellBlockProcessor.class, "yell"));
mojo.execute();
@@ -205,7 +205,7 @@ public void should_convert_to_html_and_add_meta_tag_with_a_DocinfoProcessor() th
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = singletonList(extensionConfiguration(MetaDocinfoProcessor.class, "yell"));
mojo.execute();
@@ -226,7 +226,7 @@ public void should_convert_to_html_and_modify_output_with_a_BlockMacroProcessor(
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = singletonList(extensionConfiguration(GistBlockMacroProcessor.class, "gist"));
mojo.execute();
@@ -247,7 +247,7 @@ public void should_convert_to_html_and_modify_output_with_a_InlineMacroProcessor
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = singletonList(extensionConfiguration(ManpageInlineMacroProcessor.class, "man"));
mojo.execute();
@@ -268,7 +268,7 @@ public void should_convert_to_html_and_modify_output_with_an_IncludeProcessor()
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = singletonList(extensionConfiguration(UriIncludeProcessor.class));
mojo.execute();
@@ -290,7 +290,7 @@ public void should_run_the_same_preprocessor_twice_when_registered_twice() throw
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = Arrays.asList(
extensionConfiguration(ChangeAttributeValuePreprocessor.class),
@@ -320,7 +320,7 @@ public void should_convert_to_html_with_Preprocessor_DocinfoProcessor_InlineMacr
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.extensions = Arrays.asList(
extensionConfiguration("org.asciidoctor.maven.test.processors.ChangeAttributeValuePreprocessor"),
@@ -348,7 +348,7 @@ public void should_convert_to_html_using_all_extension_types() throws MojoFailur
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", "",
"linkcss", "",
"copycss!", "");
@@ -386,7 +386,7 @@ public void property_extension() throws MojoFailureException, MojoExecutionExcep
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = "processors-sample.adoc";
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null, "linkcss!", "");
mojo.execute();
// then
diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoLogHandlerTest.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoLogHandlerTest.java
index 137462b8..4f09736d 100644
--- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoLogHandlerTest.java
+++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoLogHandlerTest.java
@@ -40,7 +40,7 @@ public void should_not_fail_when_logHandler_is_not_set() throws MojoFailureExcep
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.execute();
@@ -64,7 +64,7 @@ public void should_show_Asciidoctor_messages_as_info_by_default() throws MojoFai
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.execute();
@@ -105,7 +105,7 @@ public void should_not_fail_and_log_errors_as_INFO_when_outputToConsole_is_set()
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.execute();
@@ -148,7 +148,7 @@ public void should_not_fail_and_log_errors_as_INFO_when_outputToConsole_is_set_a
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.enableVerbose = true;
mojo.execute();
@@ -188,7 +188,7 @@ public void should_not_fail_and_log_verbose_errors_when_gempath_is_set() throws
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.enableVerbose = true;
mojo.gemPath = System.getProperty("java.io.tmpdir");
@@ -226,7 +226,7 @@ public void should_fail_when_logHandler_failIf_is_WARNING() {
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
Throwable throwable = catchThrowable(mojo::execute);
@@ -253,7 +253,7 @@ public void should_fail_when_logHandler_failIf_is_ERROR() {
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
Throwable throwable = catchThrowable(mojo::execute);
@@ -280,7 +280,7 @@ public void should_not_fail_if_containsText_does_not_match_any_message() throws
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.execute();
@@ -308,7 +308,7 @@ public void should_fail_when_containsText_matches() {
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
Throwable throwable = catchThrowable(mojo::execute);
@@ -354,7 +354,7 @@ public void should_fail_and_filter_errors_that_match_both_severity_and_text() {
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
Throwable throwable = catchThrowable(mojo::execute);
@@ -390,7 +390,7 @@ public void should_not_print_default_AsciidoctorJ_messages() throws MojoFailureE
mojo.sourceDirectory = srcDir;
mojo.sourceDocumentName = sourceDocument;
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null);
mojo.execute();
diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoTest.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoTest.java
index 74e778c9..f62fe861 100644
--- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoTest.java
+++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorMojoTest.java
@@ -159,7 +159,7 @@ public void should_convert_to_html_with_attributes() throws MojoFailureException
mojo.sourceDocumentName = "sample.asciidoc";
mojo.resources = excludeAll();
mojo.outputDirectory = outputDir;
- mojo.headerFooter = true;
+ mojo.standalone = true;
mojo.attributes = map("toc", null,
"linkcss!", "",
"source-highlighter", "coderay");
diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorRefreshMojoTest.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorRefreshMojoTest.java
index 726ad460..8f9a5191 100644
--- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorRefreshMojoTest.java
+++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/AsciidoctorRefreshMojoTest.java
@@ -351,7 +351,7 @@ public void should_convert_additional_sources_when_set_in_refreshOn() throws IOE
// when
Thread mojoThread = runMojoAsynchronously(mojo -> {
- mojo.headerFooter = false;
+ mojo.standalone = false;
mojo.backend = "html5";
mojo.sourceDirectory = srcDir;
mojo.outputDirectory = outputDir;
diff --git a/docs/modules/plugin/pages/usage.adoc b/docs/modules/plugin/pages/usage.adoc
index 0a4af627..a68e7fc7 100644
--- a/docs/modules/plugin/pages/usage.adoc
+++ b/docs/modules/plugin/pages/usage.adoc
@@ -73,7 +73,7 @@ An example of this setup is below:
src/main/asciidoc
- true
+ true
----
diff --git a/docs/modules/plugin/pages/v3-migration-guide.adoc b/docs/modules/plugin/pages/v3-migration-guide.adoc
index 0b505f52..9d508545 100644
--- a/docs/modules/plugin/pages/v3-migration-guide.adoc
+++ b/docs/modules/plugin/pages/v3-migration-guide.adoc
@@ -32,9 +32,9 @@ Note this also imposes versions on dependencies, for example:
Support for AsciidoctorJ v1.6.x (released 14th Feb, 2019) has been totally removed and will fail when configured.
This simplifies the current plugin code and allows for removal of Java reflection usage.
-*If you are setting the AsciidoctorJ dependency directly, ensure it's v2.0.0 or higher*.
+*If you are setting the AsciidoctorJ dependency directly, ensure it's v2.0.0 or higher.*
-[source,xml,subs=attributes+]
+[,xml,subs=attributes+]
.invalid configuration
----
@@ -50,3 +50,37 @@ This simplifies the current plugin code and allows for removal of Java reflectio
----
+
+=== Replace deprecated option 'headerFooter' by 'standalone'
+
+`headerFooter` option in Asciidoctor has been replaced by the easier to understand 'standalone'.
+The plugin aligns with that change replacing the option with `standalone` in the `` block.
+The new option works exactly the same with the same semantics.
+
+*If you are using `headerFooter` option, just replace it with `standalone`.*
+
+[,xml]
+.invalid configuration
+----
+
+ org.asciidoctor
+ asciidoctor-maven-plugin
+ 3.0.0
+
+ false
+
+
+----
+
+[,xml]
+.new configuration
+----
+
+ org.asciidoctor
+ asciidoctor-maven-plugin
+ 3.0.0
+
+ false
+
+
+----
diff --git a/docs/modules/plugin/partials/process-asciidoc-mojo-parameters.adoc b/docs/modules/plugin/partials/process-asciidoc-mojo-parameters.adoc
index d87e6a8d..f0e6bbce 100644
--- a/docs/modules/plugin/partials/process-asciidoc-mojo-parameters.adoc
+++ b/docs/modules/plugin/partials/process-asciidoc-mojo-parameters.adoc
@@ -96,8 +96,8 @@ doctype:: defaults to `null` (which trigger's Asciidoctor's default of `article`
[#configuration-eruby]
eruby:: defaults to erb, the version used in JRuby
-[#configuration-headerFooter]
-headerFooter:: defaults to `true`
+[#configuration-standalone]
+standalone:: add frame around that content (i.e., the header and footer in HTML), defaults to `true`
[#configuration-templateDirs]
templateDirs:: list of directories of compatible templates to be used instead of the default built-in templates, empty by default.