# Step 1 - Set up the environment
source: https://developer.mastercard.com/account-catalog-services/tutorial/build-end-to-end-app/step1/index.md

## Step 1 - Set up the environment {#step-1---set-up-the-environment}

### 1. Pre-requisites {#1-pre-requisites}

To complete this tutorial, you will need:

* [JDK 1.8.0](https://www.java.com/en/) or later
* [Maven 3.6](https://maven.apache.org/) or later
* [IntelliJ IDEA](https://www.jetbrains.com/idea/) (or any other IDE of your choice)
* Mastercard Developers account with access to the Account Catalog Services APIs

### 2. Create a Maven project {#2-create-a-maven-project}

For this tutorial, IntelliJ IDEA is used as the IDE.
In IntelliJ IDEA, create a new Maven project that automatically sets your directory structure.
Provide an ArtifactId and a project name as per your choice.

![New Project](https://static.developer.mastercard.com/content/account-catalog-services/uploads/images/new-peoject.png)

### 3. Add resources {#3-add-resources}

Add the Account Catalog Services specification to your Maven project folder. For API description, refer to the [API Reference](https://developer.mastercard.com/account-catalog-services/documentation/api-reference/index.md).

Add the generated Sandbox signing key (`.p12` file), payload decryption key (`.p12` file), and payload encryption cert (`.pem` file) to your Maven project resources folder. Those files are generated by creating a Sandbox (MTF) project in the Mastercard Developers.

Keeping a separate resource folder for these files is suggested. Your Maven project directory structure should appear as follows:

![Add resources](https://static.developer.mastercard.com/content/account-catalog-services/uploads/images/add-resources.PNG)
Note: This tutorial uses the specification for Account Catalog Services API, but you can easily adapt it to use any API specification file.

### 4. Update pom.xml file {#4-update-pomxml-file}

In your IDE, add the [OpenAPI Generator maven plugin](https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin) to your project pom.xml file. Use the Plugin config as shown here:
Note: [OpenAPI Generator](https://openapi-generator.tech/) generates API client libraries using OpenAPI Specification. It provides multiple generators and library templates to support multiple languages and frameworks. We will use the Java generator for this project.

```XML
<build>
        <plugins>
            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>7.9.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/acs-api-swagger.yml</inputSpec>
                            <generatorName>java</generatorName>
                            <library>okhttp-gson</library>
                            <generateApiTests>false</generateApiTests>
                            <generateModelTests>false</generateModelTests>

                            <apiPackage>com.mastercard.acs.generated.apis</apiPackage>
                            <modelPackage>com.mastercard.acs.generated.models</modelPackage>
                            <invokerPackage>com.mastercard.acs.generated.invokers</invokerPackage>

                            <configOptions>
                                <sourceFolder>src/gen/main/java</sourceFolder>
                                <dateLibrary>java11</dateLibrary>
                                <useOptional>false</useOptional>
                                <supportNullable>false</supportNullable>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
```

Add the following dependencies to your pom.xml file to add dependencies for the API client library generation and the Mastercard OAuth1 Signer library.
Note: Mastercard offers Oauth1 Signer Libraries, which offer code helpers targeting the HTTP clients used by the different OpenAPI Generator Library templates. The libraries are hosted on [GitHub](https://github.com/Mastercard?utf8=%E2%9C%93&q=client-encryption&type=&language=).

Mastercard offers Client Encryption Libraries, which offer code helpers for payload encryption. The libraries are hosted on [GitHub](https://github.com/Mastercard?utf8=%E2%9C%93&q=client-encryption&type=&language=).

```XML
<dependencies>
        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>openapi-generator-cli</artifactId>
            <version>7.9.0</version>
        </dependency>
        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>jackson-databind-nullable</artifactId>
            <version>0.2.0</version>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>2.2.26</version>
        </dependency>
        <dependency>
            <groupId>io.swagger.parser.v3</groupId>
            <artifactId>swagger-parser</artifactId>
            <version>2.1.24</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>4.12.0</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>logging-interceptor</artifactId>
            <version>4.11.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.11.0</version>
        </dependency>
        <dependency>
            <groupId>io.gsonfire</groupId>
            <artifactId>gson-fire</artifactId>
            <version>1.9.0</version>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.1.1</version>
        </dependency>

        <!--
        Mastercard open source library for generating a Mastercard API compliant Oauth signature --
        https://github.com/Mastercard/oauth1-signer-java
        -->
        <dependency>
            <groupId>com.mastercard.developer</groupId>
            <artifactId>oauth1-signer</artifactId>
            <version>1.5.3</version>
        </dependency>
        <!--
        Mastercard open source library for Mastercard API compliant payload encryption/decryption --
        https://github.com/Mastercard/client-encryption-java
        -->
        <dependency>
            <groupId>com.mastercard.developer</groupId>
            <artifactId>client-encryption</artifactId>
            <version>1.8.4</version>
        </dependency>

    </dependencies>
```

For more information, refer to the [Generating and Configuring a Mastercard API Client](https://developer.mastercard.com/platform/documentation/security-and-authentication/generating-and-configuring-a-mastercard-api-client/#overview) page.
