From 50b434d7366fd7ca393c411c4133daec7b7fbddd Mon Sep 17 00:00:00 2001 From: Abel Salgado Romero Date: Wed, 14 Jun 2023 22:45:32 +0200 Subject: [PATCH] WIP --- .../site/AsciidoctorConverterDoxiaParser.java | 4 +- .../maven/commons/AsciidoctorHelper.java | 1 - .../SiteConversionConfigurationParser.java | 20 +++--- ...SiteConversionConfigurationParserTest.java | 66 ++++++++++--------- .../asciidoctor/maven/AsciidoctorMojo.java | 11 ++-- .../ChangeAttributeValuePreprocessor.java | 15 +++-- .../test/processors/FailingPreprocessor.java | 6 +- .../ManpageInlineMacroProcessor.java | 10 +-- .../test/processors/UriIncludeProcessor.java | 11 ++-- .../site/ast/AsciidoctorAstDoxiaParser.java | 9 +-- pom.xml | 2 +- 11 files changed, 78 insertions(+), 77 deletions(-) diff --git a/asciidoctor-converter-doxia-module/src/main/java/org/asciidoctor/maven/site/AsciidoctorConverterDoxiaParser.java b/asciidoctor-converter-doxia-module/src/main/java/org/asciidoctor/maven/site/AsciidoctorConverterDoxiaParser.java index aacf0df7..3c34fe75 100644 --- a/asciidoctor-converter-doxia-module/src/main/java/org/asciidoctor/maven/site/AsciidoctorConverterDoxiaParser.java +++ b/asciidoctor-converter-doxia-module/src/main/java/org/asciidoctor/maven/site/AsciidoctorConverterDoxiaParser.java @@ -119,14 +119,14 @@ protected File resolveSiteDirectory(MavenProject project, Xpp3Dom siteConfig) { } protected OptionsBuilder defaultOptions(File siteDirectory) { - return OptionsBuilder.options() + return Options.builder() .backend("xhtml") .safe(SafeMode.UNSAFE) .baseDir(new File(siteDirectory, ROLE_HINT)); } protected AttributesBuilder defaultAttributes() { - return AttributesBuilder.attributes() + return Attributes.builder() .attribute("idprefix", "@") .attribute("showtitle", "@"); } diff --git a/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/AsciidoctorHelper.java b/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/AsciidoctorHelper.java index 8f6588c8..8ae820e9 100644 --- a/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/AsciidoctorHelper.java +++ b/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/commons/AsciidoctorHelper.java @@ -66,5 +66,4 @@ else if (value instanceof Boolean) { attributesBuilder.attribute(attribute, value); } } - } diff --git a/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/site/SiteConversionConfigurationParser.java b/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/site/SiteConversionConfigurationParser.java index 44e31c53..7c90e4f4 100644 --- a/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/site/SiteConversionConfigurationParser.java +++ b/asciidoctor-maven-commons/src/main/java/org/asciidoctor/maven/site/SiteConversionConfigurationParser.java @@ -1,7 +1,9 @@ package org.asciidoctor.maven.site; import org.apache.maven.project.MavenProject; +import org.asciidoctor.Attributes; import org.asciidoctor.AttributesBuilder; +import org.asciidoctor.Options; import org.asciidoctor.OptionsBuilder; import org.asciidoctor.maven.commons.AsciidoctorHelper; import org.asciidoctor.maven.commons.StringUtils; @@ -29,19 +31,21 @@ public SiteConversionConfiguration processAsciiDocConfig(Xpp3Dom siteConfig, OptionsBuilder presetOptions, AttributesBuilder presetAttributes) { + AsciidoctorHelper.addProperties(project.getProperties(), presetAttributes); + + final Attributes attributes = presetAttributes.build(); + if (siteConfig == null) { - OptionsBuilder options = presetOptions.attributes(presetAttributes); - return new SiteConversionConfiguration(options.get(), Collections.emptyList()); + final Options options = presetOptions.attributes(attributes).build(); + return new SiteConversionConfiguration(options, Collections.emptyList()); } final Xpp3Dom asciidocConfig = siteConfig.getChild("asciidoc"); if (asciidocConfig == null) { - OptionsBuilder options = presetOptions.attributes(presetAttributes); - return new SiteConversionConfiguration(options.get(), Collections.emptyList()); + final Options options = presetOptions.attributes(attributes).build(); + return new SiteConversionConfiguration(options, Collections.emptyList()); } - AsciidoctorHelper.addProperties(project.getProperties(), presetAttributes); - final List gemsToRequire = new ArrayList<>(); for (Xpp3Dom asciidocOpt : asciidocConfig.getChildren()) { String optName = asciidocOpt.getName(); @@ -83,7 +87,8 @@ public SiteConversionConfiguration processAsciiDocConfig(Xpp3Dom siteConfig, } } - return new SiteConversionConfiguration(presetOptions.attributes(presetAttributes).get(), gemsToRequire); + final Options options = presetOptions.attributes(attributes).build(); + return new SiteConversionConfiguration(options, gemsToRequire); } private File resolveProjectDir(MavenProject project, String path) { @@ -93,5 +98,4 @@ private File resolveProjectDir(MavenProject project, String path) { } return filePath; } - } diff --git a/asciidoctor-maven-commons/src/test/java/org/asciidoctor/maven/site/SiteConversionConfigurationParserTest.java b/asciidoctor-maven-commons/src/test/java/org/asciidoctor/maven/site/SiteConversionConfigurationParserTest.java index 3b72e652..74edab78 100644 --- a/asciidoctor-maven-commons/src/test/java/org/asciidoctor/maven/site/SiteConversionConfigurationParserTest.java +++ b/asciidoctor-maven-commons/src/test/java/org/asciidoctor/maven/site/SiteConversionConfigurationParserTest.java @@ -2,7 +2,9 @@ import org.apache.maven.model.Model; import org.apache.maven.project.MavenProject; +import org.asciidoctor.Attributes; import org.asciidoctor.AttributesBuilder; +import org.asciidoctor.Options; import org.asciidoctor.OptionsBuilder; import org.codehaus.plexus.util.xml.Xpp3Dom; import org.junit.jupiter.api.Test; @@ -22,8 +24,8 @@ public class SiteConversionConfigurationParserTest { public void should_return_default_configuration_when_site_xml_is_null() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); // when SiteConversionConfiguration configuration = new SiteConversionConfigurationParser(project) @@ -40,8 +42,8 @@ public void should_return_default_configuration_when_site_xml_is_null() { public void should_return_default_configuration_when_asciidoc_xml_is_null() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.siteNode() .build(); // when @@ -59,8 +61,8 @@ public void should_return_default_configuration_when_asciidoc_xml_is_null() { public void should_return_simple_single_requires() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("requires") .addChild("require", "gem") @@ -82,8 +84,8 @@ public void should_return_simple_single_requires() { public void should_return_multiple_requires() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("requires") .addChild("require", "gem_1", "gem_2", "gem_3") @@ -105,8 +107,8 @@ public void should_return_multiple_requires() { public void should_return_multiple_requires_when_defined_in_single_element() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("requires") .addChild("require", "gem_1,gem_2, gem_3") @@ -128,8 +130,8 @@ public void should_return_multiple_requires_when_defined_in_single_element() { public void should_remove_empty_and_blank_requires() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("requires") .addChild("require", "gem_1,,gem_2", "", ",,", "gem_3") @@ -151,8 +153,8 @@ public void should_remove_empty_and_blank_requires() { public void should_return_attributes() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("attributes") .addChild("imagesdir", "./images") @@ -182,8 +184,8 @@ public void should_return_attributes() { public void should_map_null_attributes_as_empty_string() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("attributes") .addChild("toc", null) @@ -208,8 +210,8 @@ public void should_map_null_attributes_as_empty_string() { public void should_map_true_boolean_attribute_as_empty_string_value() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("attributes") .addChild("toc", "true") @@ -234,8 +236,8 @@ public void should_map_true_boolean_attribute_as_empty_string_value() { public void should_map_false_boolean_attribute_as_null_value() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("attributes") .addChild("toc", "false") @@ -260,8 +262,8 @@ public void should_map_false_boolean_attribute_as_null_value() { public void should_return_template_dirs_when_defined_as_templateDirs_dir() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("templateDirs") .addChild("dir", "path") @@ -288,8 +290,8 @@ public void should_return_template_dirs_when_defined_as_templateDirs_dir() { public void should_return_template_dirs_when_defined_as_template_dirs_dir() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("template_dirs") .addChild("dir", "path") @@ -316,8 +318,8 @@ public void should_return_template_dirs_when_defined_as_template_dirs_dir() { public void should_not_return_empty_template_dirs() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("template_dirs") .addChild("dir", "") @@ -339,8 +341,8 @@ public void should_not_return_empty_template_dirs() { public void should_return_baseDir_dirs_when_defined_as_template_dirs_dir() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("baseDir", "path") .build(); @@ -362,8 +364,8 @@ public void should_return_baseDir_dirs_when_defined_as_template_dirs_dir() { public void should_return_any_configuration_inside_asciidoc_node_as_option() { // given final MavenProject project = fakeProject(); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode() .addChild("option-1", "value-1") .parent().addChild("option_2", "value-2") @@ -395,8 +397,8 @@ public void should_return_and_format_any_maven_project_property_as_attribute() { projectProperties.put("mvn.property-test1", "value-1"); projectProperties.put("mvn-property.test2", "value_2"); final MavenProject project = fakeProject(projectProperties); - OptionsBuilder emptyOptions = OptionsBuilder.options(); - AttributesBuilder emptyAttributes = AttributesBuilder.attributes(); + OptionsBuilder emptyOptions = Options.builder(); + AttributesBuilder emptyAttributes = Attributes.builder(); Xpp3Dom siteConfig = Xpp3DoomBuilder.asciidocNode().build(); // when 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 03c579d2..3b958dbd 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 @@ -231,7 +231,7 @@ public void processSources(List sourceFiles, ResourcesProcessor resourcesP if (!uniquePaths.add(destinationPath)) getLog().warn("Duplicated destination found: overwriting file: " + destinationPath.getAbsolutePath()); - convertFile(asciidoctor, optionsBuilder.asMap(), source); + convertFile(asciidoctor, optionsBuilder.build(), source); try { // process log messages according to mojo configuration @@ -359,7 +359,7 @@ protected List findSourceFiles(File sourceDirectory) { finder.find(sourceDirectoryPath, sourceDocumentExtensions); } - protected void convertFile(Asciidoctor asciidoctor, Map options, File f) { + protected void convertFile(Asciidoctor asciidoctor, Options options, File f) { asciidoctor.convertFile(f, options); logConvertedFile(f); } @@ -384,7 +384,7 @@ protected boolean ensureOutputExists() { */ protected OptionsBuilder createOptionsBuilder(AsciidoctorMojo configuration, AttributesBuilder attributesBuilder) { - final OptionsBuilder optionsBuilder = OptionsBuilder.options() + final OptionsBuilder optionsBuilder = Options.builder() .backend(configuration.getBackend()) .safe(SafeMode.UNSAFE) .standalone(configuration.standalone) @@ -411,8 +411,7 @@ protected OptionsBuilder createOptionsBuilder(AsciidoctorMojo configuration, Att if (!configuration.getTemplateDirs().isEmpty()) optionsBuilder.templateDirs(templateDirs.toArray(new File[]{})); - if (!attributesBuilder.asMap().isEmpty()) - optionsBuilder.attributes(attributesBuilder); + optionsBuilder.attributes(attributesBuilder.build()); return optionsBuilder; } @@ -427,7 +426,7 @@ protected OptionsBuilder createOptionsBuilder(AsciidoctorMojo configuration, Att */ protected AttributesBuilder createAttributesBuilder(AsciidoctorMojo configuration, MavenProject mavenProject) { - final AttributesBuilder attributesBuilder = AttributesBuilder.attributes(); + final AttributesBuilder attributesBuilder = Attributes.builder(); if (configuration.isEmbedAssets()) { attributesBuilder.linkCss(false); diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ChangeAttributeValuePreprocessor.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ChangeAttributeValuePreprocessor.java index 012a1f63..fbb3e391 100644 --- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ChangeAttributeValuePreprocessor.java +++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ChangeAttributeValuePreprocessor.java @@ -1,26 +1,27 @@ package org.asciidoctor.maven.test.processors; -import java.util.Map; - import org.asciidoctor.ast.Document; import org.asciidoctor.extension.Preprocessor; import org.asciidoctor.extension.PreprocessorReader; +import org.asciidoctor.extension.Reader; + +import java.util.Map; public class ChangeAttributeValuePreprocessor extends Preprocessor { public static final String AUTHOR_NAME = "ThisIsMe"; - + public ChangeAttributeValuePreprocessor(Map config) { super(config); - System.out.println(this.getClass().getSimpleName() + "(" + System.out.println(this.getClass().getSimpleName() + "(" + this.getClass().getSuperclass().getSimpleName() + ") initialized"); } @Override - public void process(Document document, PreprocessorReader reader) { - System.out.println("Processing "+ this.getClass().getSimpleName()); + public Reader process(Document document, PreprocessorReader reader) { + System.out.println("Processing " + this.getClass().getSimpleName()); System.out.println("Processing: blocks found: " + document.getBlocks().size()); document.getAttributes().put("author", AUTHOR_NAME); + return reader; } - } diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/FailingPreprocessor.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/FailingPreprocessor.java index 3545a28d..dbe70b79 100644 --- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/FailingPreprocessor.java +++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/FailingPreprocessor.java @@ -3,6 +3,7 @@ import org.asciidoctor.ast.Document; import org.asciidoctor.extension.Preprocessor; import org.asciidoctor.extension.PreprocessorReader; +import org.asciidoctor.extension.Reader; import java.util.Map; @@ -15,10 +16,9 @@ public FailingPreprocessor(Map config) { } @Override - public void process(Document document, PreprocessorReader reader) { - System.out.println("Processing "+ this.getClass().getSimpleName()); + public Reader process(Document document, PreprocessorReader reader) { + System.out.println("Processing " + this.getClass().getSimpleName()); System.out.println("Processing: blocks found: " + document.getBlocks().size()); throw new RuntimeException("That's all folks"); } - } diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ManpageInlineMacroProcessor.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ManpageInlineMacroProcessor.java index 8c132b93..f80198d4 100644 --- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ManpageInlineMacroProcessor.java +++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/ManpageInlineMacroProcessor.java @@ -1,6 +1,8 @@ package org.asciidoctor.maven.test.processors; import org.asciidoctor.ast.ContentNode; +import org.asciidoctor.ast.PhraseNode; +import org.asciidoctor.ast.StructuralNode; import org.asciidoctor.extension.InlineMacroProcessor; import java.util.HashMap; @@ -13,12 +15,10 @@ public ManpageInlineMacroProcessor(String macroName) { } @Override - public String process(ContentNode parent, String target, Map attributes) { - - Map options = new HashMap(); + public PhraseNode process(StructuralNode parent, String target, Map attributes) { + Map options = new HashMap<>(); options.put("type", ":link"); options.put("target", target + ".html"); - return createPhraseNode(parent, "anchor", target, attributes, options).convert(); + return createPhraseNode(parent, "anchor", target, attributes, options); } - } diff --git a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/UriIncludeProcessor.java b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/UriIncludeProcessor.java index b64aa15e..fd588f82 100644 --- a/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/UriIncludeProcessor.java +++ b/asciidoctor-maven-plugin/src/test/java/org/asciidoctor/maven/test/processors/UriIncludeProcessor.java @@ -16,8 +16,8 @@ public class UriIncludeProcessor extends IncludeProcessor { public UriIncludeProcessor(Map config) { super(config); - System.out.println(this.getClass().getSimpleName() + "(" - + this.getClass().getSuperclass().getSimpleName() + ") initialized"); + System.out.println(this.getClass().getSimpleName() + "(" + + this.getClass().getSuperclass().getSimpleName() + ") initialized"); } @Override @@ -29,10 +29,10 @@ public boolean handles(String target) { public void process(Document document, PreprocessorReader reader, String target, Map attributes) { - System.out.println("Processing "+ this.getClass().getSimpleName()); + System.out.println("Processing " + this.getClass().getSimpleName()); StringBuilder content = readContent(target); - reader.push_include(content.toString(), target, target, 1, attributes); + reader.pushInclude(content.toString(), target, target, 1, attributes); } @@ -62,5 +62,4 @@ private StringBuilder readContent(String target) { } return content; } - - } +} diff --git a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java index 791680f3..8df4c921 100644 --- a/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java +++ b/asciidoctor-parser-doxia-module/src/main/java/org/asciidoctor/maven/site/ast/AsciidoctorAstDoxiaParser.java @@ -5,10 +5,7 @@ import org.apache.maven.doxia.parser.Parser; import org.apache.maven.doxia.sink.Sink; import org.apache.maven.project.MavenProject; -import org.asciidoctor.Asciidoctor; -import org.asciidoctor.AttributesBuilder; -import org.asciidoctor.OptionsBuilder; -import org.asciidoctor.SafeMode; +import org.asciidoctor.*; import org.asciidoctor.ast.Document; import org.asciidoctor.maven.log.LogHandler; import org.asciidoctor.maven.log.LogRecordFormatter; @@ -133,14 +130,14 @@ protected File resolveSiteDirectory(MavenProject project, Xpp3Dom siteConfig) { } protected OptionsBuilder defaultOptions(File siteDirectory) { - return OptionsBuilder.options() + return Options.builder() .backend("xhtml") .safe(SafeMode.UNSAFE) .baseDir(new File(siteDirectory, ROLE_HINT)); } protected AttributesBuilder defaultAttributes() { - return AttributesBuilder.attributes() + return Attributes.builder() .attribute("idprefix", "@") .attribute("showtitle", "@"); } diff --git a/pom.xml b/pom.xml index ff22ca30..34d38a8c 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ UTF-8 11 JavaSE-1.8 - 2.5.10 + 3.0.0-alpha.1 9.4.2.0 3.9.1 0.8.8