This project creates a maven archetype that can be used to simplify the setup of a Maven document project to produce PDFs based on asciidoc sources. It uses a sample document that, besides showing several useful asciidoc(tor) features, documents how the demo build pipeline works and where to start to customize it.
Note
|
As this relates to Maven tooling, it is assumed that you have a working Maven configuration. You can verify that by using |
To build the archetype and have it available in your local archetype library follow these steps:
-
Clone this repository and move to the created directory
-
type the command
mvn install
-
And voilà: the archetype is now available in your local archetype catalog.
Once the archetype is available either in your local catalog or in a repository, you create the demo project with:
mvn archetype:generate -Dfilter=asciidoctor-maven-archetype
This will start the interactive user interface where you can choose the archetype version you want to use. It will prompt you for the groupId, artifactId and propose default values for the artifact version and package (that you accept with <enter>).
Your sample project is generated in a subdirectory named after the artifactId under the current directory.
See the archetype:generate
documentation for all the options that can be used to generate a project from a Maven archetypes.
$ mvn archetype:generate -Dfilter=asciidoctor-maven-archetype (1) [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.2:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: local -> org.asciidoctor:asciidoctor-maven-archetype (Asciidoctor Maven Archetype - V1.0-SNAPSHOT) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 (2) Define value for property 'groupId': : org.asciidoctor (3) Define value for property 'artifactId': : demo (4) Define value for property 'version': 1.0-SNAPSHOT: : (5) Define value for property 'package': org.asciidoctor: : (6) Confirm properties configuration: groupId: org.asciidoctor artifactId: demo version: 1.0-SNAPSHOT package: org.asciidoctor Y: : y (7) [INFO] ---------------------------------------------------------------------------- [INFO] Using following parameters for creating project from Archetype: asciidoctor-maven-archetype:1.0-SNAPSHOT [INFO] ---------------------------------------------------------------------------- [INFO] Parameter: groupId, Value: org.asciidoctor [INFO] Parameter: artifactId, Value: demo [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: org.asciidoctor [INFO] Parameter: packageInPathFormat, Value: org/asciidoctor [INFO] Parameter: package, Value: org.asciidoctor [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: groupId, Value: org.asciidoctor [INFO] Parameter: artifactId, Value: demo [INFO] project created from Archetype in dir: /Users/jmm/work/demo [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2:45.650s [INFO] Finished at: Mon Feb 03 13:55:10 CET 2014 [INFO] Final Memory: 13M/156M [INFO] ------------------------------------------------------------------------
-
The command to start the generation.
-
Only one archetype was found (V1.0-SNAPSHOT). Enter the number of the archetype ("1" in this case).
-
Enter the 'groupId' of your project.
-
Enter the 'artifactId' or name of your project.
-
Accept the proposed default 'version' by pressing enter.
-
Accept the proposed default 'package' name by pressing enter.
-
Confirm the parameters with 'y' to start the generation of the project.