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

detail

false

If true, display all settable properties for each goal.

goal

-

The name of the goal for which to show help. If unspecified, all goals are displayed.

indentSize

2

The number of spaces per indentation level, should be positive.

lineLength

80

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.

deployAppTemplate Sample
<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>http://www.mapapps.de/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

templateName

-

Name of the template. If not configured, the filename is used.

templateTitle

-

Title of the template. If not specified the name is used.

templateDescription

-

Description of the template.

templateFile

${project.build.directory}/${project.artifactId}-${project.version}.zip

The zip file pointing to the template zip/jar.

It is interpreted as output file if <templateResources> is configured, otherwise it is considered as input file for deployment.

templateResources

-

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.

appName

-

Name of the template app. If not configured, the template name is used.

appTitle

-

Title of the template app. If not specified the name is used.

appDescription

-

Description of the template app.

appEditorState

DRAFT

Editor state of the app.

appSharedInGroups

-

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.

createApp

false

Allow the use of this mojo for app creation based on this template.

serverResourcesEndpoint

http://localhost:8080/mapapps/resources

URL pointing to the resources rest service of the map.apps server.

username

-

Username for authentication at the map.apps server.

password

-

Password for authentication at the map.apps server.

token

-

Access token for authentication at the map.apps server. If configured, username and password are ignored.

skipDeploy

false

Skip template deployment task.

deployAsApp

false

Do not deploy as app template but as an app. This enables createApp.

triggerPreOptimization

false

If deployAsApp is enabled and the deployment is successful, preoptimization of the deployed app is triggered.

updateAppInfoIfExists

false

If deployAsApp is enabled and the app exists, the app metadata (title, description) is updated.

sslTrustAnyServer

true

Defines if the plugin trusts any SSL servers without checking a trust store.

useChunkedRequestEncoding

true

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.

deployApps Sample
<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>http://www.mapapps.de/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

sourceDirectory

${project.build.directory}/${project.artifactId}/js/apps

The source folder of apps. This folders sub directories are scanned for app.json files.

outputDirectory

${project.build.directory}/apps

The output directory. All app zip files are created in this directory.

skipPattern

-

A regular expression to skip folders during source app scanning.

includePattern

-

A regular expression which defines which folders are included during source app scanning. For example ./apps(/Demo)? or `./apps(/(Demo

Other))?`.

appEditorState

DRAFT

Editor state of the app.

appSharedInGroups

-

Configures the group names in which the app should be shared. This is a comma separated list of names.

createApp

false

Allow the use of this mojo for app creation based on this template.

serverResourcesEndpoint

http://localhost:8080/mapapps/resources

URL pointing to the resources rest service of the map.apps server.

username

-

Username for authentication at the map.apps server.

password

-

Password for authentication at the map.apps server.

token

-

Access token for authentication at the map.apps server. If configured username and password are ignored.

skipDeploy

false

Skip template deployment task.

deployAsApp

false

Do not deploy as app template but as an app. This enables createApp.

triggerPreOptimization

false

If deployAsApp is enabled and the deployment is successful, preoptimization of the deployed app is triggered.

updateAppInfoIfExists

false

If deployAsApp is enabled and the app exists, the app metadata (title, description) is updated.

sslTrustAnyServer

true

Defines if the plugin trusts any SSL servers without checking a trust store.

useChunkedRequestEncoding

true

All roles defined in appSharedInGroups-property must be assigned to the configured user. It is not allowed to specify roles that are not possessed by the user. For example, admin/admin can restrict apps to "maAdmin".