Skip to content

Commit

Permalink
Checkpoint: use latest available Doxia 2.0.0-M8
Browse files Browse the repository at this point in the history
* Unify Doxia versions in parent pom
* Use same Doxia version for doxia-core and doxia-site-renderer
* Use javax.inject.Named instead of custom Plexus
* Bump maven-site-plugin to 4.0.0-M13
  • Loading branch information
abelsromero committed Jan 20, 2024
1 parent c505848 commit 3933726
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion asciidoctor-converter-doxia-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
<version>${doxia-site-renderer.version}</version>
<version>${doxia.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

import org.apache.maven.doxia.parser.AbstractTextParser;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.parser.Parser;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.project.MavenProject;
import org.asciidoctor.*;
import org.asciidoctor.maven.log.LogHandler;
import org.asciidoctor.maven.log.LogRecordFormatter;
import org.asciidoctor.maven.log.LogRecordsProcessors;
import org.asciidoctor.maven.log.MemoryLogHandler;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import java.io.File;
import java.io.IOException;
Expand All @@ -31,7 +30,7 @@
* @author jdlee
* @author mojavelinux
*/
@Component(role = Parser.class, hint = AsciidoctorConverterDoxiaParser.ROLE_HINT)
@Named(AsciidoctorConverterDoxiaParser.ROLE_HINT)
public class AsciidoctorConverterDoxiaParser extends AbstractTextParser {

private final Logger logger = LoggerFactory.getLogger(AsciidoctorConverterDoxiaParser.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.asciidoctor.maven.site;

import org.apache.maven.doxia.parser.module.AbstractParserModule;
import org.apache.maven.doxia.parser.module.ParserModule;
import org.codehaus.plexus.component.annotations.Component;

import javax.inject.Named;

/**
* This class is the entry point for integration with the Maven Site Plugin
Expand All @@ -12,7 +12,7 @@
*
* @author jdlee
*/
@Component(role = ParserModule.class, hint = AsciidoctorConverterDoxiaParser.ROLE_HINT)
@Named(AsciidoctorConverterDoxiaParser.ROLE_HINT)
public class AsciidoctorConverterDoxiaParserModule extends AbstractParserModule {

/**
Expand Down
2 changes: 1 addition & 1 deletion asciidoctor-parser-doxia-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
<version>${doxia-site-renderer.version}</version>
<version>${doxia.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.apache.maven.doxia.parser.AbstractTextParser;
import org.apache.maven.doxia.parser.ParseException;
import org.apache.maven.doxia.parser.Parser;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.project.MavenProject;
import org.asciidoctor.*;
Expand All @@ -14,14 +13,15 @@
import org.asciidoctor.maven.site.SiteConversionConfiguration;
import org.asciidoctor.maven.site.SiteConversionConfigurationParser;
import org.asciidoctor.maven.site.SiteLogHandlerDeserializer;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;

import java.io.File;
import java.io.IOException;
import java.io.Reader;
Expand All @@ -35,7 +35,7 @@
*
* @author abelsromero
*/
@Component(role = Parser.class, hint = AsciidoctorAstDoxiaParser.ROLE_HINT)
@Named(AsciidoctorAstDoxiaParser.ROLE_HINT)
public class AsciidoctorAstDoxiaParser extends AbstractTextParser {

private final Logger logger = LoggerFactory.getLogger(AsciidoctorAstDoxiaParser.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.asciidoctor.maven.site.ast;

import org.apache.maven.doxia.parser.module.AbstractParserModule;
import org.apache.maven.doxia.parser.module.ParserModule;
import org.codehaus.plexus.component.annotations.Component;

import javax.inject.Named;

/**
* This class is the entry point for integration with the Maven Site Plugin
Expand All @@ -12,7 +12,7 @@
*
* @author abelsromero
*/
@Component(role = ParserModule.class, hint = AsciidoctorAstDoxiaParser.ROLE_HINT)
@Named(AsciidoctorAstDoxiaParser.ROLE_HINT)
public class AsciidoctorAstDoxiaParserModule extends AbstractParserModule {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import lombok.SneakyThrows;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.doxia.siterenderer.RenderingContext;
import org.apache.maven.doxia.siterenderer.DocumentRenderingContext;
import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
import org.asciidoctor.maven.site.ast.NodeProcessor;
import org.mockito.Mockito;
Expand All @@ -20,6 +20,6 @@ public static <T extends NodeProcessor> Pair<T, Sink> create(Class<T> clazz) {
}

public static Sink createSink() {
return new SiteRendererSink(Mockito.mock(RenderingContext.class));
return new SiteRendererSink(Mockito.mock(DocumentRenderingContext.class));
}
}
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.java.version>11</project.java.version>
<maven.version>3.9.6</maven.version>
<doxia.version>2.0.0-M7</doxia.version>
<doxia-site-renderer.version>2.0.0-M6</doxia-site-renderer.version>
<!-- ALL doxia components need to share version, even if some are newer.
https://issues.apache.org/jira/browse/DOXIA-725?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=17806458#comment-17806458
-->
<doxia.version>2.0.0-M8</doxia.version>
<plexus-component-metadata.version>2.2.0</plexus-component-metadata.version>
<asciidoctorj.version>2.5.11</asciidoctorj.version>
<jruby.version>9.4.5.0</jruby.version>
Expand Down

0 comments on commit 3933726

Please sign in to comment.