@Mojo(name="cds",
defaultPhase=GENERATE_SOURCES,
aggregator=true)
public class CdsMojo
extends AbstractCdsMojo
mvn cds:cds or mvn com.sap.cds:cds-maven-plugin:cds on the command line to execute all
configured CDS commands of the project in current directory.| Modifier and Type | Field and Description |
|---|---|
protected static String |
PARAM_NODE_DIR |
protected static String |
PARAM_NPM_EXECUTABLE |
protected static String |
PARAM_NPX_EXECUTABLE |
protected static String |
PROP_NODE_DIR |
protected static String |
PROP_NODE_EXECUTABLE |
protected static String |
PROP_NPM_EXECUTABLE |
protected static String |
PROP_NPX_EXECUTABLE |
protected org.eclipse.aether.RepositorySystemSession |
repositorySystemSession
Defines settings and components that control the repository system.
|
buildContext, CDS_SERVICES_GROUPID, mojoExecution, PLUGIN_KEY, project, session, settings| Constructor and Description |
|---|
CdsMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute() |
protected void |
execute(File workDir,
File execFile,
OutputStream outputStream,
Map<String,String> additionalEnv,
int[] exitValues,
String... args)
Executes a program as child process.
|
protected void |
executeCds(File workDir,
String args,
OutputStream output,
Map<String,String> additionalEnv)
Executes a cds command with given arguments in given working directory.
|
protected String |
executeCdsVersion()
Executes command
cds version and returns console output. |
protected File |
findCdsWorkingDir()
Finds the cds working directory by going upwards and looking for a .cdsrc.json file.
|
protected File |
getWorkingDirectory() |
void |
setNpxExec(File npxExec)
Gets called to inject parameter "npxExec".
|
ensureCliExecuted, findGoalExecution, findSrvProject, getReactorBaseDirectory, isCliExecuted, logDebug, logDebug, logError, logError, logError, logInfo, logWarn, logWarn, logWarn, scanDirectory, setProperty, strongprotected static final String PROP_NODE_DIR
protected static final String PROP_NODE_EXECUTABLE
protected static final String PROP_NPM_EXECUTABLE
protected static final String PROP_NPX_EXECUTABLE
protected static final String PARAM_NODE_DIR
protected static final String PARAM_NPX_EXECUTABLE
protected static final String PARAM_NPM_EXECUTABLE
@Parameter(defaultValue="${repositorySystemSession}",
required=true,
readonly=true)
protected org.eclipse.aether.RepositorySystemSession repositorySystemSession
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void setNpxExec(File npxExec)
npxExec - a File pointing to npx executableprotected void executeCds(File workDir, String args, OutputStream output, Map<String,String> additionalEnv) throws IOException
workDir - the working directory to useargs - the cds command line argumentsoutput - an optional OutputStreamorg.apache.commons.exec.ExecuteException - if CDS execution failed with an errorIOException - if an I/O error occurredprotected File getWorkingDirectory()
protected String executeCdsVersion() throws org.apache.maven.plugin.MojoExecutionException
cds version and returns console output.cds version commandorg.apache.maven.plugin.MojoExecutionException - if execution failsprotected void execute(File workDir, File execFile, OutputStream outputStream, Map<String,String> additionalEnv, int[] exitValues, String... args) throws IOException
workDir - the working directory of child processexecFile - the executable to useoutputStream - an optional standard output streamadditionalEnv - additional environment variables, can be nullexitValues - an optional list with exit values of the process to be considered successful, can be
nullargs - an optional command line arguments passed to the processIOException - if an I/O exception occurredorg.apache.commons.exec.ExecuteException - if process execution failedprotected File findCdsWorkingDir()
null if not found.Copyright © 2023. All rights reserved.