You are viewing the documentation for Blueriq 13. Documentation for other versions is available in our documentation directory.
This document explains how to configure the maven plugin to generate metamodel classes from your Studio model.
Getting started
Create a Maven project with the following POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.mycustomer</groupId> <artifactId>myproject-metamodel</artifactId> <version>1.0-SNAPSHOT</version> <name>myproject-metamodel</name> <properties> <com.blueriq.version>10.0-SNAPSHOT</com.blueriq.version> </properties> <dependencies> <dependency> <groupId>com.blueriq</groupId> <artifactId>blueriq-sdk</artifactId> <version>${com.blueriq.version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.1</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>com.blueriq</groupId> <artifactId>blueriq-metamodelgenerator-maven-plugin</artifactId> <version>${com.blueriq.version}</version> <executions> <execution> <phase>generate-sources</phase> <goals> <goal>generate-metamodel</goal> </goals> </execution> </executions> <configuration> <connections> <studio> <repository>MyRepository</repository> <branch>Trunk</branch> <project>MyProject</project> <destdir>src/main/java</destdir> <packageName>org.mycustomer.myproject.metamodel</packageName> <url>http://SERVER:PORT/Studio/Server/Services/ManagementService</url> <authentication>BASIC</authentication> <domain /> <userName></userName> <passWord></passWord> <exportProject>true</exportProject> <generatePOJOs>true</generatePOJOs> <generateRequiredMethods>true</generateRequiredMethods> <generateInstanceLocator>true</generateInstanceLocator> </studio> <offline> <applicationFile>${project.basedir}/MyProject.project.zip</applicationFile> <destdir>src/main/java</destdir> <packageName>org.mycustomer.myproject.metamodel</packageName> <generatePOJOs>true</generatePOJOs> <generateRequiredMethods>true</generateRequiredMethods> <generateInstanceLocator>true</generateInstanceLocator> </offline> </connections> </configuration> </plugin> </plugins> </build> </project>
Configuration of the POM
You have to define the location of your Studio model(s) from which you will generate metamodel classes. The models can be retrieved directly from Studio or from an export. To define this, within the <connections>
section you can add one or more <studio>
(connection to Studio) or <offline>
(export) connections.
Studio connection
Parameter | Description | Default value |
---|---|---|
repository | Name of the Blueriq repository | |
branch | Name of the Blueriq branch | |
project | Name of the Blueriq project | |
destdir | Destination directory where all the java classes are stored | src/main/java |
packageName | Name of the base java package | |
url | URL of the Blueriq Studio management service | |
authentication | Authentication method. Possible values are BASIC, NTLM and NTLM_CUSTOM | BASIC |
domain | Blueriq domain (can be left blank) | |
userName | Blueriq username | |
passWord | Blueriq password | |
exportProject | Set to true if you want to generate the Blueriq project export | false |
exportProjectDir | Foldername to save the export | target |
generatePOJOs | Set to true if you want to generate the POJO class of a Blueriq Entity | false |
generateRequiredMethods | Set to true if you want to generate the getRequired<attribute> methods | false |
generateInstanceLocator | Set to true if you want to use the InstanceLocator class | false |
bold = required
Offline connection
This connection will pick up the given file name and presumes there is an export in it. It will then use the export to create the metamodel.
Parameter | Description | Default value |
---|---|---|
applicationFile | Path of the export file | ${project.basedir}/MyProject.project.zip |
destdir | Destination directory where all the java classes are stored | src/main/java |
packageName | Name of the base java package | |
generatePOJOs | Set to true if you want to generate the POJO class of a Blueriq Entity | false |
generateRequiredMethods | Set to true if you want to generate the getRequired&tl;attribute> methods | false |
generateInstanceLocator | Set to true if you want to use the InstanceLocator class | false |
bold = required
4 Comments
Antal van Kalleveen
is it possible to NOT generate the metamodel classes but only the export ?
Unknown User (v.bingley)
You can generate exports using the blueriq-projectexport-maven-plugin, I was unable to find any documentation about this plugin however. The only page I could find that mentions it is this one:
Installatie handleiding Jenkins model pipeline
You can open the linked pom.xml for an example configuration.
Edit:
It looks like this is an internal link, you might not be able to access it.
The metamodel generator plugin cannot be configured to only generate exports. It might be worth it to create a ticket about the blueriq-projectexport-maven-plugin if you're interested in using it as I don't know why it isn't documented.
Antal van Kalleveen
thx, we are looking into this with another blueriq expert.
Antal van Kalleveen
and does the plugin add the destdir value to the maven sources ?