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 deployement 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>
                <!-- synchronization settings -->
                <sync>true</sync>
                <syncMode>MERGE</syncMode>
                <!-- 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=OAUTH -->
                <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.

sync

false

Defines if the app is synchronized with the app template (use together with createApp).

syncMode

MERGE

Defines the app template synchronization mode (MERGE or REPLACE).

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>
                <skipPattern>.*foldername</skipPattern>
                <!-- 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=OAUTH -->
                <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 some folders during source app scanning.

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.

sync

false

Defines if the app is synchronized with the app template (use together with createApp).

syncMode

MERGE

Defines the app template synchronization mode (MERGE or REPLACE).

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.

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".