【maven插件】asciidoctor-maven-plugin:编译Asciidoc
前言
- maven 3.5.0
- asciidoctor-maven-plugin 2.0.0-RC.1
- jdk 1.8
- eclipse 2019-09 R (4.13.0)
Asciidoc是个啥?
看着个介绍吧:https://my.oschina.net/gudaoxuri/blog/524132
怎么编辑Asciidoc
使用AsciidocFX编辑Asciidoc。https://github.com/asciidocfx/AsciidocFX
语法参考
https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/
怎么将Asciidoc转换成html、pdf或者…?
- 官方说,大多数Linux发行版都带有转换工具。如果你在用linux,那参考相关的手册即可。
- 用windows的话,图形化的工具可以参考。AsciidocFX就不错。
- windows下想用命令行转换的话,可以使用asciidoctor(https://asciidoctor.org)。asciidoctor是ruby开发的,安装ruby后,可以起飞。
- 如果熟练maven的话,用maven也可以在windows下进行转换。asciidoctor提供了maven的插件asciidoctor-maven-plugin。
asciidoctor-maven-plugin的使用
asciidoctor官方git地址:https://github.com/asciidoctor/asciidoctor-maven-plugin
asciidoctor示例:https://github.com/asciidoctor/asciidoctor-maven-examples
有啥不明白的,参考一下示例吧。
给个测试过的示例:
当目录结构是下面这样的时候
pom.xml是这样的
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>ethereum_book</groupId><artifactId>ethereum_book</artifactId><version>0.0.1-SNAPSHOT</version><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><asciidoctor.maven.plugin.version>2.0.0-RC.1</asciidoctor.maven.plugin.version><asciidoctorj.version>2.1.0</asciidoctorj.version><jruby.version>9.2.8.0</jruby.version></properties><build><defaultGoal>process-resources</defaultGoal><plugins><plugin><groupId>org.asciidoctor</groupId><artifactId>asciidoctor-maven-plugin</artifactId><version>${asciidoctor.maven.plugin.version}</version> <dependencies><!-- Comment this section to use the default jruby artifact provided by the plugin --><dependency><groupId>org.jruby</groupId><artifactId>jruby-complete</artifactId><version>${jruby.version}</version></dependency><!-- Comment this section to use the default AsciidoctorJ artifact provided by the plugin --><dependency><groupId>org.asciidoctor</groupId><artifactId>asciidoctorj</artifactId><version>${asciidoctorj.version}</version></dependency></dependencies><configuration><sourceDirectory>src/docs/asciidoc</sourceDirectory><!-- Attributes common to all output formats --><attributes><endpoint-url>http://example.org</endpoint-url><sourcedir>${project.build.sourceDirectory}</sourcedir><project-version>${project.version}</project-version></attributes></configuration><executions><execution><id>asciidoc-to-html</id><phase>generate-resources</phase><goals><goal>process-asciidoc</goal></goals><configuration><backend>html5</backend><sourceHighlighter>coderay</sourceHighlighter><attributes><imagesdir>./</imagesdir><toc>left</toc><icons>font</icons><sectanchors>true</sectanchors><!-- set the idprefix to blank --><idprefix/><idseparator>-</idseparator><docinfo1>true</docinfo1></attributes></configuration></execution></executions></plugin></plugins></build></project>
注:这个pom.xml在eclipse中会有下面这样的报错。不理报错就好了。
Plugin execution not covered by lifecycle configuration:
org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:
process-asciidoc (execution: asciidoc-to-html, phase: generate-resources)
参考资料
Asciidoc官网
http://asciidoc.org/
【maven插件】asciidoctor-maven-plugin:编译Asciidoc相关推荐
- maven插件打包exec_Exec Maven插件–从Maven Build运行Java程序
maven插件打包exec Maven exec plugin allows us to execute system and Java programs from the maven command ...
- maven插件_Apache Maven WAR Plugin_用overlays合并多个war
转: http://kyfxbl.iteye.com/blog/1678121 在一个大项目中拆分maven工程时,很有可能会把js.css.jsp等文件放在不同的工程里(根据业务模块划分).因为如果 ...
- sonarqube通过sonarqube maven插件分析maven工程使用的mvn命令示例
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package -T 1C -Dmaven.test.skip=true -Dmaven. ...
- dojo还有人用吗_我的Dojo中有一个Mojo(如何编写Maven插件)
dojo还有人用吗 我一直忙于在工作中使用Maven的腋窝. 对于很多开发人员,我会听到:"那又怎样." 区别在于,我通常在无法直接访问Internet的环境中工作. 因此,当我说 ...
- 我的Dojo中有一个Mojo(如何编写Maven插件)
我一直忙于在工作中使用Maven的腋窝. 对于很多开发人员,我会听到:"那又怎样." 不同之处在于,我通常在无法直接访问Internet的环境中工作. 因此,当我说我经常使用Mav ...
- 自定义maven插件
文章目录 maven插件介绍 自定义插件 使用 运行 maven插件介绍 maven插件有很多的作用,maven插件简介 说个用的比较多的,就是jetty插件,通过配置jetty可以通过插件一键运行代 ...
- maven插件-及插件的使用
官方文档请参考:https://maven.apache.org/plugins/ Maven插件分类 maven中有两种插件:build和reporting: build:在构建期间运行,配置在bu ...
- proguard+springboot+maven插件 代码混淆
一 背景 Java web项目部署到服务器上以后,尤其针对是在客户的服务器上部署,很容易被"友商"捞到相关的包,通过反编译的手段,我们的代码几乎等同于裸奔在不可管控的服务器上,产品 ...
- 构建maven项目插件_如何构建一个Maven插件
构建maven项目插件 使用Okta的身份管理平台轻松部署您的应用程序 使用Okta的API在几分钟之内即可对任何应用程序中的用户进行身份验证,管理和保护. 今天尝试Okta. 由于其插件生态系统的普 ...
最新文章
- 实战|基于图割算法的木材表面缺陷图像分析
- MapReduce编程实战之“初识”
- IDEA出现错误:找不到或无法加载主类 io.renren.RenrenApplication
- 【Tiny4412】烧写最小文件系统到SD卡
- Python 爬虫知识点 - 淘宝商品检索结果抓包分析(续一)
- preparedstatement打印sql语句_Mybatis是这样防止sql注入的
- 台达伺服电机选型手册_机械加工工艺师手册_打包下载
- AnimalTFDB 3.0 | 动物转录因子注释和预测的综合资源库
- 9.jsonp的实现原理
- mac使用allure_制作测试报告,allure,生成
- Spark —— RDD、DataFrame 与 Dataset
- 陈希孺《概率论与数理统计》读书笔记
- 遗传算法 matlab实现 多维变量 二进制编码
- mysql 取汉字笔划数_PHP获取汉字笔画数功能【测试可用】
- 7、STC12C5A60S2核心芯片说明文档
- 智课雅思词汇---八、ject是什么意思
- python倒数切片_python切片
- Microsoft Visual C++ Runtime Library Runtime Error的一个解决方法
- SAP—IDoc操作步骤
- java虚拟机JVM内存不够,OutOfMemorry Error