Package com.sap.cds.maven.plugin.build
Class CdsResolveMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.sap.cds.maven.plugin.AbstractCdsMojo
com.sap.cds.maven.plugin.build.CdsResolveMojo
- All Implemented Interfaces:
CdsMojoLogger,org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="resolve",
defaultPhase=GENERATE_SOURCES,
aggregator=true,
requiresDependencyCollection=COMPILE_PLUS_RUNTIME,
requiresDependencyResolution=COMPILE_PLUS_RUNTIME)
public class CdsResolveMojo
extends AbstractCdsMojo
Extracts models from dependency JARs and places them in
Models in JARs are expected to be placed in the
Here is an example JAR layout:
target/cds/ for reuse by the CDS Compiler.
Models in JARs are expected to be placed in the
cds resources folder. All contents in this folder are copied to target/cds/.
It is recommended to specify a unique folder structure for your models, for example by reusing group ID and artifact ID of the JAR.
Here is an example JAR layout:
com/example/.../Some.class
cds/
com.example.cds/
my-reuse-models/
index.cds
Foo.cds
data/
com.example.cds-Foo.csv
i18n/
i18n.properties
You can then refer to these reuse models in your CDS files:
using { com.example.cds.Foo as Foo } from 'com.example.cds/my-reuse-models';
If your dependency is listed in the srv/pom.xml the reuse models are only available in CDS files placed in the srv folder.
This ensures that multiple independent application modules can define their reuse artifacts independently.
If you place a dependency in the root pom.xml the reuse models are available in all modules, including the db folder.- Since:
- 2.2.0
-
Field Summary
Fields inherited from class com.sap.cds.maven.plugin.AbstractCdsMojo
buildContext, CDS_SERVICES_GROUPID, mojoExecution, PLUGIN_KEY, project, session, settingsFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.sap.cds.maven.plugin.AbstractCdsMojo
ensureCliExecuted, findGoalExecution, findSrvProject, getReactorBaseDirectory, isCliExecuted, logDebug, logDebug, logError, logError, logError, logInfo, logWarn, logWarn, logWarn, scanDirectory, setProperty, strongMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
CdsResolveMojo
public CdsResolveMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-