Class BuildMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.sap.cds.maven.plugin.AbstractCdsMojo
com.sap.cds.maven.plugin.build.BuildMojo
All Implemented Interfaces:
CdsMojoLogger, org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
WatchMojo

@Mojo(name="build", defaultPhase=NONE, aggregator=true) public class BuildMojo extends AbstractCdsMojo
Perform a CDS build with Java class generation executing the following goals of the cds-maven-plugin in this order:
  1. cds:install-node
  2. cds:install-cdsdk
  3. cds:cds
  4. cds:generate
The list of goals and their order is fixed. Any Java property provided on the command line with the -D option is forwarded to the invoked goals.
Call mvn cds:build or mvn com.sap.cds:cds-maven-plugin:build to perform the CDS build. This goal is very useful for local development to test changes to the CDS model.

Note: This goal can only be executed from the command line.

Since:
1.17.0
  • Constructor Details

    • BuildMojo

      public BuildMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • executeBuild

      protected void executeBuild() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • executeGoal

      protected void executeGoal(org.apache.maven.model.Plugin plugin, String goal) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • createRequest

      protected org.apache.maven.shared.invoker.InvocationRequest createRequest(List<String> goals, String... optionalProperties)
    • executeMojo

      protected void executeMojo(org.apache.maven.model.Plugin plugin, String goal, org.apache.maven.model.PluginExecution pluginExec) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • executeMaven

      protected Process executeMaven(org.apache.maven.shared.invoker.InvocationRequest request) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getMojoDescriptor

      protected org.apache.maven.plugin.descriptor.MojoDescriptor getMojoDescriptor(org.apache.maven.model.Plugin plugin, String goal) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException