-
Notifications
You must be signed in to change notification settings - Fork 70
cobigen maven_configuration
For maven integration of CobiGen you can include the following build plugin into your build:
<build>
<plugins>
<plugin>
<groupId>com.capgemini</groupId>
<artifactId>cobigen-maven-plugin</artifactId>
<version>VERSION-YOU-LIKE</version>
<executions>
<execution>
<id>cobigen-generate</id>
<phase>site</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Available goals
-
generate
: Generates contents configured by the standard non-compiled configuration folder. Thus generation can be controlled/configured due to an location URI of the configuration and tempalte or increment ids to be generated for a set of inputs.
Available phases are all phases, which already provide compiled sources such that CobiGen can perform reflection on it. Thus possible phases are for example package, site.
For generation using the CobiGen maven plug-in, the CobiGen configuration can be provided in two different styles:
-
By a
configurationFolder
, which should be available on the file system whenever you are running the generation. The value ofconfigurationFolder
should correspond to the maven file path syntax.Provide CobiGen configuration by configuration folder (file)<build> <plugins> <plugin> ... <configuration> <configurationFolder>cobigen-templates</configurationFolder> </configuration> ... </plugin> </plugins> </build>
-
By maven dependency, whereas the maven dependency should stick on the same conventions as the configuration folder. This explicitly means that it should contain non-compiled resources as well as the
context.xml
on top-level.Provide CobiGen configuration by maven dependency (jar)<build> <plugins> <plugin> ... <dependencies> <dependency> <groupId>com.capgemini</groupId> <artifactId>cobigen-templates-XYZ</artifactId> <version>VERSION-YOU-LIKE</version> </dependency> </dependencies> ... </plugin> </plugins> </build>
We currently provide a generic deployed version of the templates on the oasp-nexus for Register Factory (
<artifactId>cobigen-templates-RF</artifactId>
) and for the OASP itself (<artifactId>cobigen-templates-OASP</artifactId>
).
Using the following configuration you will be able to customize your generation as follows:
-
<destinationRoot>
specifies the root directory the relativedestinationPath
of CobiGen templates configuration should depend on. Default ${basedir} -
<inputPackage>
declares a package name to be used as input for batch generation. This refers directly to the CobiGen Java Plug-in container matchers of type package configuration. -
<inputFile>
declares a file to be used as input. The CobiGen maven plug-in will try to parse this file to get an appropriate input to be interpreted by any CobiGen plug-in. -
<increment>
specifies an increment ID to be generated. -
<template>
specifies a template ID to be generated. -
<forceOverride>
specifies an overriding behavior, which enables non-mergable resources to be completely rewritten by generated contents. For mergable resources this flag indicates, that conflicting fragments during merge will be replaced by generated content. Default: false
<build>
<plugins>
<plugin>
...
<configuration>
<destinationRoot>${basedir}</destinationRoot>
<inputPackages>
<inputPackage>package.to.be.used.as.input</inputPackage>
</inputPackages>
<inputFiles>
<inputFile>path/to/file/to/be/used/as/input</inputFile>
</inputFiles>
<increments>
<increment>IncrementID</increment>
</increments>
<templates>
<template>TemplateID</template>
</templates>
<forceOverride>false</forceOverride>
</configuration>
...
</plugin>
</plugins>
</build>
Disclaimer
If you discover any documentation bugs or would like to request new content, please raise them as an issue or create a pull request. Contributions to this wiki are done through the main repo under the folder documentation.
License
This documentation is licensed under the Creative Commons License (Attribution-NoDerivatives 4.0 International
)