Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

CJSCommonPlatform/generator-maven-plugin

Repository files navigation

Generator Maven Plugin

Deprecated

This project has moved to be a sub-project of Framework Libraries and is located here

Pull requests against this project have been disabled. Please contact one of the project owners for emergency bug fixes on this version


Build Status Coverage Status

This project contains a plugin for using RAML or other documents like Json Schema within Maven projects for generation of code.

Usage

For example, to generate code using a generator class ExampleGenerator using RAML from an external Maven dependency:

<build>
    <plugins>
        <plugin>
            <groupId>uk.gov.justice.maven.generator</groupId>
            <artifactId>generator-plugin</artifactId>
            <version>1.7.0</version>
            <executions>
                <execution>
                    <configuration>
                        <generatorName>
                            uk.gov.justice.raml.maven.test.ExampleGenerator
                        </generatorName>
                        <parserName>uk.gov.justice.maven.generator.io.files.parser.RamlFileParser</parserName>
                        <basePackageName>uk.gov.justice.api</basePackageName>
                        <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
                        <sourceDirectory>CLASSPATH</sourceDirectory>
                        <includes>
                            <include>**/*external-*.raml</include>
                        </includes>
                        <excludes>
                            <exclude>**/*external-ignore.raml</exclude>
                        </excludes>
                    </configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                    <phase>generate-sources</phase>
                </execution>
            </executions>
            <dependencies>
                <dependency>
                    <groupId>uk.gov.justice.maven.generator</groupId>
                    <artifactId>raml-for-testing-io</artifactId>
                    <version>1.7.0</version>
                    <classifier>raml</classifier>
                </dependency>
                <dependency>
                    <groupId>uk.gov.justice.maven.generator</groupId>
                    <artifactId>raml-parser</artifactId>
                    <version>1.7.0</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>