Sample Usage

This example shows a typical usage of the CDS Maven plugin in a pom.xml:

<properties>
    <cds.services.version>2.7.0</cds.services.version>
    <cds.install-cdsdk.version>^7</cds.install-cdsdk.version>
</properties>
...
<plugin>
    <groupId>com.sap.cds</groupId>
    <artifactId>cds-maven-plugin</artifactId>
    <version>${cds.services.version}</version>

    <executions>
        <execution>
            <id>cds.clean</id>
            <goals>
                <goal>clean</goal>
            </goals>
        </execution>

        <execution>
            <id>cds.install-node</id>
            <goals>
                <goal>install-node</goal>
            </goals>
        </execution>

        <execution>
            <id>cds.install-cdsdk</id>
            <goals>
                <goal>install-cdsdk</goal>
            </goals>
        </execution>

        <execution>
            <id>cds.resolve</id>
            <goals>
                <goal>resolve</goal>
            </goals>
        </execution>

        <execution>
            <id>cds.build</id>
            <goals>
                <goal>cds</goal>
            </goals>
            <configuration>
                <commands>
                    <command>build --for java</command>
                    <command>deploy --to sqlite --dry > ${project.basedir}/src/main/resources/schema.sql</command>
                </commands>
            </configuration>
        </execution>

        <execution>
            <id>cds.generate</id>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <basePackage>cds.gen</basePackage>
            </configuration>
        </execution>
    </executions>
</plugin>
...