# DeviceAtlas Enterprise API Installation # This section deals with installing the DeviceAtlas Enterprise API. ### Dependencies ### This library does not depend on any third party libraries. ### Library ### The DeviceAtlas Enterprise API consists of two libraries and each library has a separate jar file. #### DeviceAtlas Enterprise API (deviceatlas-enterprise-java-x.x.jar) #### This library contains the DeviceAtlas Device and Carrier APIs. Device detection is achieved by passing a set of request headers or a user-agent along with optional Client-side properties. Carrier detection is achieved by passing a set of request headers or an IP address. #### DeviceAtlas Enterprise API Web (deviceatlas-enterprise-java-web-x.x.jar) #### This is an extension to the above library where Device and Carrier detection is achieved by passing a `HttpServletRequest` object. This library retrieves the relevant headers from the `HttpServletRequest` object. Unless the `HttpServletRequest` object is not available or when processing an off-line user-agent list or header set, it is strongly recommended to use this library over the above library. ### Configuration ### The DeviceAtlas Enterprise API can be added as a dependency to a project using either Maven or Gradle. #### Gradle #### The following configuration should be added to the build.gradle file in the project: ``` ... repositories { maven { url "https://java-api.deviceatlas.com/" credentials { username "LICENCE_KEY" password "LICENCE_KEY" } } } dependencies { implementation (group: "afilias.deviceatlas", name: "deviceatlas-enterprise-java", version: "2.4.2") // OR implementation (group: "afilias.deviceatlas", name: "deviceatlas-enterprise-java-web", version: "2.4.2") } ``` For both username and password, the licence key should be used. #### Maven #### In order to setup Maven configuration, two steps are necessary: - configure authentication credentials - add the DeviceAtlas dependency to the pom.xml file ##### Configure the credentials #### The credentials can be configured in two different ways. ###### 1. Add a configuration local to the project ###### Create an .mvn folder in the root of the project containing two files - maven.config - settings.xml The .mvn/maven.config file should contain: ``` --settings ./.mvn/settings.xml ``` The .mvn/settings.xml file should contain: ```xml <?xml version="1.0" encoding="UTF-8"?> <settings> <servers> <server> <id>deviceatlas</id> <username>LICENCE_KEY</username> <password>LICENCE_KEY</password> </server> </servers> </settings> ``` For both username and password, the licence key should be used. ###### 2. Add to the user or global configuration ###### Alternatively, the settings.xml file could be placed in one of the following locations, with the same content as above: - ${maven.home}/conf/settings.xml - ${user.home}/.m2/settings.xml ##### Configure the dependency #### Add the DeviceAtlas dependency to the pom.xml file in the project as follows: ```xml <project ... > ... <repositories> <repository> <id>deviceatlas</id> <url>https://java-api.deviceatlas.com</url> </repository> </repositories> <dependencies> <dependency> <groupId>afilias.deviceatlas</groupId> <artifactId>deviceatlas-enterprise-java</artifactId> <version>2.4.2</version> </dependency> <!-- Or --> <dependency> <groupId>afilias.deviceatlas</groupId> <artifactId>deviceatlas-enterprise-java-web</artifactId> <version>2.4.2</version> </dependency> </dependencies> </project> ``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. _ _ https://deviceatlas.com _ <!-- HTML+JS for document formatting when opened in browser --> <div class="btn-group" id="main-menu" style="float:right"><a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Menu<span class="caret"></span></a><ul class="dropdown-menu"><li><a href="README.html">Main</a></li><li class="disabled"><a href="README.Installation.html">Enterprise API Installation</a></li><li><a href="README.DataFile.html">Data File Configuration</a></li><li><a href="README.DeviceApi.html">Device Detection</a></li><li><a href="README.DeviceApi-Config.html">Device Identification API Config</a></li><li><a href="README.CarrierApi.html">Carrier Identification API</a></li><li class="divider"></li><li><a href="./DeviceAtlasApiDocs/index.html">DeviceAtlas API Docs</a></li><li><a href="README.Upgrade.html">API Upgrade</a></li></ul></div>