# Add Project Dependencies
source: https://developer.mastercard.com/mastercard-threat-intelligence/tutorial/api-sandbox-guide/step-4/index.md

In this step, you create the `pom.xml` file. It declares your dependencies and the build plugins.

*** ** * ** ***

### Key Dependencies {#key-dependencies}

The project uses a small set of libraries:

* The Mastercard OAuth 2.0 client, which handles authentication. For more information, read the [oauth2-client-java](https://github.com/Mastercard/oauth2-client-java) documentation.
* OkHttp and Gson, which the generated API client uses for HTTP and JSON.

*** ** * ** ***

### Key Plugins {#key-plugins}

The build uses two plugins:

* The OpenAPI Generator plugin, which creates the API client from the specification.
* The Exec plugin, which runs the application from the command line.

*** ** * ** ***

### Create the pom.xml {#create-the-pomxml}

Add the following `pom.xml` to your project root:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example.mti</groupId>
    <artifactId>mti-api-demo</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>Mastercard Threat Intelligence API Demo</name>
    <description>A simple demo that consumes the Mastercard Threat Intelligence API.</description>

    <properties>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Library versions -->
        <oauth2-client.version>1.0.3</oauth2-client.version>
        <okhttp.version>4.12.0</okhttp.version>
        <gson.version>2.11.0</gson.version>
        <gson-fire.version>1.9.0</gson-fire.version>
        <jakarta-annotation.version>2.1.1</jakarta-annotation.version>
        <slf4j.version>2.0.13</slf4j.version>

        <!-- Plugin versions -->
        <compiler-plugin.version>3.13.0</compiler-plugin.version>
        <openapi-generator.version>7.11.0</openapi-generator.version>
        <exec-plugin.version>3.5.0</exec-plugin.version>
    </properties>

    <dependencies>
        <!-- Mastercard OAuth 2.0 client: handles authentication for Mastercard APIs -->
        <dependency>
            <groupId>com.mastercard.developer</groupId>
            <artifactId>oauth2-client-java</artifactId>
            <version>${oauth2-client.version}</version>
        </dependency>

        <!-- HTTP client and JSON library used by the generated API client -->
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>${okhttp.version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>logging-interceptor</artifactId>
            <version>${okhttp.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>io.gsonfire</groupId>
            <artifactId>gson-fire</artifactId>
            <version>${gson-fire.version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>${jakarta-annotation.version}</version>
        </dependency>

        <!-- Optional: shows OAuth 2.0 library logs on the console -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Compiles the project with the configured Java release -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
            </plugin>

            <!-- Generates the API client from the OpenAPI spec during the build -->
            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>${openapi-generator.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/mastercard-threat-intelligence-api.yaml</inputSpec>
                            <generatorName>java</generatorName>
                            <library>okhttp-gson</library>
                            <apiPackage>com.example.mti.client.api</apiPackage>
                            <modelPackage>com.example.mti.client.model</modelPackage>
                            <invokerPackage>com.example.mti.client.invoker</invokerPackage>
                            <generateApiTests>false</generateApiTests>
                            <generateModelTests>false</generateModelTests>
                            <generateApiDocumentation>false</generateApiDocumentation>
                            <generateModelDocumentation>false</generateModelDocumentation>
                            <configOptions>
                                <dateLibrary>java8</dateLibrary>
                                <useJakartaEe>true</useJakartaEe>
                                <openApiNullable>false</openApiNullable>
                                <containerDefaultToNull>true</containerDefaultToNull>
                                <hideGenerationTimestamp>true</hideGenerationTimestamp>
                                <sourceFolder>src/main/java</sourceFolder>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Runs the application with: mvn exec:java -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-plugin.version}</version>
                <configuration>
                    <mainClass>com.example.mti.MtiDemoApplication</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
```

The next step explains how the OpenAPI Generator plugin turns the specification into a Java client.

*** ** * ** ***

