Maven Setup

Maven is a free software that developers must have installed on their Appian RPA development machine. This page discusses how to set up Maven to develop and deploy robotic processes.

Download Maven

We recommend downloading the ZIP file containing the binaries. The only thing to do is unzip it in the desired folder on your machine.

Next, Appian recommends adding the bin folder to the PATH system variable, so that the Maven command can be executed from any directory on the computer.

2235075.png

As a final check, type the command mvn -version in the terminal to print out your installed version of Maven.

Configure Maven

Once Maven is downloaded and you check that it works as expected, you must configure the file settings.xml to work with Appian RPA. In each <url> element inside <repositories>, you must replace:

  • The #subdomain# tag by the subdomain which is part of the console identification.
  • The #nexus_relative_url# by the relative URL of the Nexus repository.\ For a cloud installation using Nexus 3, an example would be the following URL: https://mycompany.io/nexus/repository/appianrpa

Besides, you must change the content of <username>USERNAME</username> and <password>PASSWORD</password> by the corresponding to the credentials of our Maven repository (don't get confused with the console credentials).

The value of the element <id>SERVER_ID</id> must be the same both in <server> and in every repository inside <repositories>.

settings.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="UTF-8"?>
 
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
 
    http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
 
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
   
   
  <servers>
     
    <!-- Server authentication information. This is used to access the repositories listed below -->
    <server>
      <id>SERVER_ID</id> <!-- Name/ID used to refer this server credentials -->
      <username>USERNAME</username> <!-- Your user name -->
      <password>PASSWORD</password> <!-- Your password -->
    </server>
       
  </servers>
   
  <profiles>
     
    <!-- Jidoka profile -->
      <profile>
      <!--
       | This ID will be used as reference in order to make use of the following repositories. You will
       | use it when creating your first robot with the mvm command line tool using the "-P" flag.
      -->
      <id>jidoka-repo</id>
      <repositories>
        <repository>
          <id>SERVER_ID</id> <!-- This must match with one of the servers IDs defined before -->
          <!--
           | This URL refers to the nexus server containing all the dependencies required to create the
           | base robot. Your credentials given before will be used to access this server.
           | Please, keep in mind that the literal #client_name# must be replaced with your Nexus
           | instance. It could also be possible to have to replace the full URL.
          -->
          <url>https://#subdomain#.jidoka.io/#nexus_relative_url#/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
 
      <pluginRepositories>
        <pluginRepository>
          <id>SERVER_ID</id> <!-- This must match with one of the servers IDs defined before -->
          <!--
           | Same as above, your credentials will be used once again to access this server.
          -->
          <url>https://#subdomain#.jidoka.io/#nexus_relative_url#/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
     
  </profiles>
 
</settings>

This file must be copied into the ${user.home}/.m2 folder, in our case C:\Users\jidoka\.m2.

Create the Maven project

Appian recommends using the example Maven archetype provided. It is a basic archetype, which already includes the setup to access the libraries and dependencies of the modules (pom.xml) and a basic robotic process.

This is the robotic process you are using in our examples. It is quite simple: the only thing it does is open Windows Notepad, write some text, and close Notepad. The important thing is that it will allow us to learn about the most basic modules so later you will be able to develop more complex robots.

More on Appian RPA modules.

The first step will be to generate the project from this Maven archetype. Choose a folder in which your projects will be saved and open a terminal session (Unix) or command prompt (Windows).

Do not use PowerShell for Windows environments, since some compatibility issues with Maven have been detected, among other things.

You should also consider that to use the repository with Maven, the command for generating the project from the archetype needs the profile modifier with its id jidoka-repo. If you don't use it, you will probably get some errors in the resolution of the dependencies, since they cannot be downloaded from any repository but Appian RPA's.

1
-Pjidoka-repo

This is the only place where you need to specify the profile in the command. Thereafter, when you work on our project, from platform's version 3.5.1, you don't have to care about the required configuration for dependencies resolution, since the default profile defined in the POM, jidoka-repo, will have the repositories properly setup.

See Maven repository configuration

At this point, the next step is to run the following Maven command. You should replace the group, the artifact id, the version and the URL to our repository, with the values of the robot that will be developed.

1
mvn archetype:generate -B -DarchetypeGroupId=com.novayre.jidoka.robot -DarchetypeArtifactId=robot-archetype -DarchetypeVersion=x.y.z -DgroupId=com.novayre.jidoka.tutorial -DartifactId=robot-developmentguide-first-robot -Dversion=0.0.1 -Drepository=<mydomain>/nexus/content/repositories/<myrepository>/ -Pjidoka-repo

If successful, Maven will download the archetype from the Appian RPA repository to the local environment and will create the project.

Although as mentioned before, you are assuming enough knowledge of Maven and some expertise in running its commands, below you will analyze the execution above:

  • archetype:generate: creates a Maven project from an existing template.
  • -B: runs Maven in batch mode without interacting with the user.
  • -DarchetypeGroupId=com.novayre.jidoka.robot: parameter -D is used to define a property, in this case archetypeGroupId, which is the identifier of the group to which the archetype belongs.
  • -DarchetypeArtifactId=robot-archetype: archetypeArtifactId is the unique archetype's name, in this case robot-archetype.
  • -DarchetypeVersion=X.Y.Z: is the third property, used to find the archetype version you want to use, for example "3.7.0."

These properties are provided by your company's Appian RPA administrator:

  • -DgroupId: this property represents the package you want to create. It follows the inverted domain-name naming convention, and typically the company's domain name is used, for example: com.mycompany. In the example you are using com.novayre.jidoka.tutorial.
  • -DartifactId: it will be our project's unique name inside the group, and will be used to create, for example, the JAR file.
  • -DversionId: our project's version.
  • -Drepository: complete URL to the Maven repository set up to download the dependencies.

Assuming the repository manager is Nexus 2, the URL should look like this:

  • <mydomain>/nexus/content/repositories/<myrepository>/

In case of being Nexus 3, the URL should look like this:

  • <mydomain>/nexus/repository/<myrepository>/

Where you should replace <mydomain> and <myrepository> with the proper domain and repository, respectively.

This command will generate a Maven project called robot-developmentguide-first-robot from the archetype robot-archetype in the folder from which you have launched the command. The folder structure of the resulting project is the standard Maven structure:

951593.png

In the pom.xml file of the generated project, the value of the tag id for each created repository contains the value jidoka. This value must be the same as the id of the server configured in our settings.xml file. What really matters is not the value itself (in this case jidoka), but both of them being equal.

An example of a right configuration for both files would be:

settings.xml:

1
2
3
4
5
<server>
    <id>jidoka</id>
    <username>username</username>
    <password>thepassword</password>
</server>

pom.xml:

1
2
3
4
5
6
7
<repositories>
    <repository>
        <id>jidoka</id>
        <url>URL_TO_JIDOKA_NEXUS</url>
        <releases>
    </repository>
</repositories>

The last step in our configuration checking is to package the project and to make sure that the operation ends with no errors. To do so, you should go to the folder in which the archetype was downloaded or the folder of our Maven project for our first robotic process (robot-developmentguide-first-robot in this guide's example). In this case, Maven will also download the necessary dependencies from the repository.

1
mvn clean package -Pjidoka-repo

Don't forget that the profile modifier, -P, must be used to make Maven download the appropriate dependencies from the Maven server.

Next steps

After you create the Maven project, you're ready to import it to your IDE. Check the Development Environment Configuration topic for details on additional Maven configurations for repositories.

Open in Github

On This Page

FEEDBACK