아래와 같이 maven에서 특정 plugin의 id를 실행하려면 아래와 같이 명령어를 실행하면 된다.
방법) mvn [plugin]:[goal]@[execution_id]
mvn asciidoctor:process-asciidoc@generate-docs
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>${asciidoctorj.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-asciidoctor</artifactId>
<version>${spring-restdocs.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>html5</backend>
<doctype>book</doctype>
<attributes>
<api-version>${project.version}</api-version>
<snippets>${project.build.directory}/generated-snippets</snippets>
<docinfodir>${project.basedir}/src/main/asciidoc</docinfodir>
<docroot>${project.basedir}/src/main/asciidoc/doc</docroot>
</attributes>
</configuration>
</execution>
</executions>
</plugin>
반응형