mapapps-maven-plugin
The mapapps-maven-plugin provides tools to manage app template deployment. This section describes the configuration properties.
Goals
help
Display help for the mapapps-maven-plugin:
> mvn de.conterra.mapapps:mapapps-maven-plugin:<version>:help -Ddetail=true
Set <version>
to your current map.apps version, for example 3.1.0
Parameter | Default | Description |
---|---|---|
|
|
If true, display all settable properties for each goal. |
|
- |
The name of the goal for which to show help. If unspecified, all goals are displayed. |
|
|
The number of spaces per indentation level, should be positive. |
|
|
The maximum length of a display line, should be positive. |
deployAppTemplate
Can be used to automate the following tasks:
-
create <app template>.zip
-
deploy <app template> as app template to map.apps server
-
create <app> based on the deployed app-template
-
deploy <app template> as app to map.apps server
Binds by default to the package lifecycle.
<plugin>
<groupId>de.conterra.mapapps</groupId>
<artifactId>mapapps-maven-plugin</artifactId>
<executions>
<execution>
<id>deploy-template</id>
<goals>
<goal>deployAppTemplate</goal>
</goals>
<configuration>
<!-- common template metadata -->
<templateName>myapptemplate</templateName>
<templateTitle>MyAppTemplate</templateTitle>
<templateDescription>MyAppTemplate is an app-template to ...</templateDescription>
<!-- template file specification -->
<templateFile>${basedir}/target/myapptemplate.zip</templateFile>
<!-- which resources should be put in template -->
<templateResources>
<!-- multiple templateResource definitions are possible -->
<templateResource>
<directory>${basedir}/src/main/js/apps/myapptemplate</directory>
<includes>
<include>**/*</include>
</includes>
</templateResource>
</templateResources>
<!-- enable deployment to server -->
<skipDeploy>false</skipDeploy>
<!-- a template should be deployed not a pure app -->
<deployAsApp>false</deployAsApp>
<!-- create an app based on the uploaded template -->
<createApp>true</createApp>
<!-- app metadata -->
<appEditorState>PUBLISHED</appEditorState>
<appName>mycoolapp</appName>
<appTitle>My Cool App</appTitle>
<appDescription>a test application</appDescription>
<!-- allowed groups/roles -->
<appSharedInGroups>maAdmin</appSharedInGroups>
<!-- the map.apps server endpoint definition -->
<serverResourcesEndpoint>https://www.example.com/mapapps/resources</serverResourcesEndpoint>
<!-- username and password -->
<username>admin</username>
<password>admin</password>
<!-- or a token e.g. if security.mode=IDENTITY -->
<token>ab3434hab3434j00b3j34</token>
</configuration>
</execution>
</executions>
</plugin>
Parameter | Default | Description |
---|---|---|
|
- |
Name of the template. If not configured, the filename is used. |
|
- |
Title of the template. If not specified the name is used. |
|
- |
Description of the template. |
|
|
The zip file pointing to the template zip/jar. It is interpreted as output file if |
|
- |
Include/excludes of a template. If this is configured, the templateFile is interpreted as output file and the template is first created by this mojo. |
|
- |
Name of the template app. If not configured, the template name is used. |
|
- |
Title of the template app. If not specified the name is used. |
|
- |
Description of the template app. |
|
|
Editor state of the app. |
|
- |
Configures the group names in which the app should be shared. This is a comma separated list of names. You can only specify roles that are assigned to the signed in user. |
|
|
Allow the use of this mojo for app creation based on this template. |
|
|
URL pointing to the resources rest service of the map.apps server. |
|
- |
Username for authentication at the map.apps server. |
|
- |
Password for authentication at the map.apps server. |
|
- |
Access token for authentication at the map.apps server. If configured, username and password are ignored. |
|
|
Skip template deployment task. |
|
|
Do not deploy as app template but as an app.
This enables |
|
|
If |
|
|
If |
|
|
Defines if the plugin trusts any SSL servers without checking a trust store. |
|
|
Defines that content upload is using Chunked Request Encoding. If false uploads are buffered in memory to calculate the content length. |
deployApps
Can be used to automate the same tasks as 'deployAppTemplate' goal, but works on an apps folder as input.
Binds by default to the package lifecycle.
<plugin>
<groupId>de.conterra.mapapps</groupId>
<artifactId>mapapps-maven-plugin</artifactId>
<executions>
<execution>
<id>deploy-apps</id>
<goals>
<goal>deployApps</goal>
</goals>
<configuration>
<!-- input output folders -->
<sourceDirectory>${project.build.directory}/apps</sourceDirectory>
<outputDirectory>${project.build.directory}/apps</outputDirectory>
<!-- Regular expression to exclude apps from deployment -->
<!-- Example: Skip the app 'Demo': '.*/Demo' -->
<!-- Example: Skip multiple apps: '.*/(Demo|other)' -->
<!-- '/' can be safely used as a path separator -->
<skipPattern>.*/foldername</skipPattern>
<!-- Regular expression to include apps for deployment -->
<!-- Example: Include app 'Demo' only: '.*/apps(/Demo)?' -->
<!-- Example: Include multiple apps: '.*/apps(/(Demo|other))?' -->
<!-- '/' can be safely used as a path separator -->
<!-- Note: A pattern like '.*/Demo' will not work. It needs to allow the root path of apps '/apps' -->
<includePattern>.*</includePattern>
<!-- enable deployment to server -->
<skipDeploy>false</skipDeploy>
<!-- a template should be deployed, not a pure app -->
<deployAsApp>false</deployAsApp>
<!-- create an app based on the uploaded template -->
<createApp>true</createApp>
<!-- app metadata -->
<appEditorState>PUBLISHED</appEditorState>
<!-- allowed groups/roles -->
<appSharedInGroups>maAdmin</appSharedInGroups>
<!-- the map.apps server endpoint definition -->
<serverResourcesEndpoint>https://www.example.com/mapapps/resources</serverResourcesEndpoint>
<!-- username and password -->
<username>admin</username>
<password>admin</password>
<!-- or a token e.g. if security.mode=IDENTITY -->
<token>ab3434hab3434j00b3j34</token>
</configuration>
</execution>
</executions>
</plugin>
Parameter | Default | Description |
---|---|---|
|
|
The source folder of apps.
This folders sub directories are scanned for |
|
|
The output directory. All app zip files are created in this directory. |
|
- |
A regular expression to skip folders during source app scanning. |
|
- |
A regular expression which defines which folders are included during source app scanning. For example |
|
|
Editor state of the app. |
|
- |
Configures the group names in which the app should be shared.
This is a comma separated list of group names. |
|
|
Allow the use of this mojo for app creation based on this template. |
|
|
URL pointing to the resources rest service of the map.apps server. |
|
- |
Username for authentication at the map.apps server. |
|
- |
Password for authentication at the map.apps server. |
|
- |
Access token for authentication at the map.apps server. If configured username and password are ignored. |
|
|
Skip template deployment task. |
|
|
Do not deploy as app template but as an app.
This enables |
|
|
If |
|
|
If |
|
|
Defines if the plugin trusts any SSL servers without checking a trust store. |
|
|
Defines that content upload is using Chunked Request Encoding. If false uploads are buffered in memory to calculate the content length. |
standaloneApp
This goal creates a standalone application that contains all required JavaScript resources. The resulting folder can be deployed to a web server and served independently, without the need for a map.apps backend.
The goal determines the required bundles from the project’s classpath (.jar
files) or by searching a specified folder for production ready bundles.
A bundle is considered production ready if it is compressed and includes a dependencies.json
file.
This goal does not provide warnings if required bundles are missing. Ensure that all necessary bundles are available in the configured directories. |
The goal binds by default to the package lifecycle.
<plugin>
<groupId>de.conterra.mapapps</groupId>
<artifactId>mapapps-maven-plugin</artifactId>
<executions>
<execution>
<id>create-standalone-apps</id>
<goals>
<goal>standaloneApp</goal>
</goals>
<configuration>
<!-- Export target folder. All apps are exported into this folder. -->
<outputDirectory>${project.build.directory}/export</outputDirectory>
<!-- folder where the apps for export are located -->
<sourceDirectory>${project.build.directory}/webapp/js/apps</sourceDirectory>
<!-- (optional) regex which apps should be exported. By default all in the sourceDirectory. -->
<includePattern>.*</includePattern>
<!-- (optional) regex which apps should not be exported. By default empty. -->
<skipPattern></skipPattern>
<!-- (optional) folder to a local bundles directory, which is used as source of bundles. The bundles need to be compressed and have a dependencies.json. -->
<localBundlesDirectory>${project.build.directory}/webapp/js/bundles</localBundlesDirectory>
<!-- (optional) folder with custom index.html or config.js file of the exported app. -->
<standaloneTemplateOverride>${project.build.directory}/standalone-template</standaloneTemplateOverride>
<!-- (optional) read the application.properties as source for property replacement of the exported files -->
<applicationProperties>${project.build.directory}/test-classes/application.properties</applicationProperties>
<!-- (optional) define further replacement properties, this will overwrite settings from the application.properties -->
<replacementProperties>
<myproperty>xyz</myproperty>
</replacementProperties>
<!-- (optional) custom javascript modules included in the apps layer file
e.g. myBundle/someModule,myBundle/anotherModule
-->
<exportCustomModules>map-preload-2D</exportCustomModules>
<!-- (optional) custom files included in the export
e.g. myBundle/*.gif,myBundle/*.svg
-->
<exportCustomFiles></exportCustomFiles>
<!-- If true .js, .json and .css files are pre-compressed,
which means that .gz and .br variants of the files are added to the export.
Enable it only if your target server supports pre-compressed files.
The files are only compressed if the size of the file is bigger than the compressMinSize.
The compressMinSize is in bytes.
-->
<compressFiles>false</compressFiles>
<compressMinSize>512000</compressMinSize>
</configuration>
</execution>
</executions>
</plugin>
All of the following properties are optional.
Parameter | Default | Description |
---|---|---|
|
|
The output directory. All app export directories are created in this directory. |
|
|
The source folder of apps.
This folders sub directories are scanned for |
|
- |
A regular expression to skip folders during source app scanning. |
|
- |
A regular expression which defines which folders are included during source app scanning. For example |
|
|
Folder to a local bundles directory, which is used as source of bundles. The bundles need to be compressed and have a dependencies.json. |
|
|
A folder with custom index.html or config.js files integrated into the exported app. |
|
|
A |
|
- |
Define further replacement properties.
This will overwrite settings from the |
|
- |
Custom javascript modules included in the apps layer file.
For example |
|
- |
Custom files included in the export.
For example |
|
|
If true, .js, .json and .css files are pre-compressed. This means that .gz and .br variants of the files are added to the export. |
|
|
The minimum size of a file in bytes to be compressed. The files are only compressed if the size of the file is bigger than the compressMinSize. |