# Configuration

All available SDKs in the various versions and programming languages are managed via Artifactory and are available there. A separate account is required for this, which will be provided upon request.

# C# Configuration

WARNING

this manual is from artifactory and therefore may contain errors.

When using Artifactory as a NuGet repository you can either work with the NuGet CLI directly or with Visual Studio.

# NuGet CLI Configuration

Note: If this repository is configured as a NuGet API v3 repository (you may need to contact your Artifactory administrator),you should skip to the NuGet CLI Configuration (API v3) section.

To configure the NuGet CLI to work with Artifactory, you need to add this repository to the list of sources. To add this repository, use the following command:

nuget sources Add -Name Artifactory -Source https://anybill.jfrog.io/artifactory/api/nuget/anybill.POS.Client.CSharp -username <USERNAME> -password <PASSWORD>

Then, to authenticate against Artifactory with the NuGet API key, run the following command:

nuget setapikey <USERNAME>:<PASSWORD> -Source Artifactory

# NuGet CLI Configuration (API v3)

If this repository is configured as a NuGet API v3 repository (you may need to contact your Artifactory administrator), manually add the following line to the NuGet.config file: The NuGet.config file can be found at %appdata%\NuGet\NuGet.Config (Windows) or ~/.config/NuGet/NuGet.Config (Mac/Linux)

<add key="ArtifactoryNuGetV3" value="https://anybill.jfrog.io/artifactory/api/nuget/v3/anybill.POS.Client.CSharp" protocolVersion="3" />

Then, to authenticate against Artifactory with the NuGet API key, run the following command:

nuget setapikey <USERNAME>:<PASSWORD> -Source ArtifactoryNuGetV3

# Visual Studio Configuration

To configure the NuGet Visual Studio Extension to use Artifactory, you need to add this repository as another Package Source under NuGet Package Manager. Go to the "Package Manager Settings" in your Visual Studio (Tools > NuGet Package Manager > Package Manager Settings > Package Sources) and add another Package Source. Name: Add a name for the package source (e.g. Artifactory NuGet repository) Paste the snippet below in the URL field

https://anybill.jfrog.io/artifactory/api/nuget/anybill.POS.Client.CSharp (Optional) If this repository is configured as a NuGet API v3 repository (you may need to contact your Artifactory administrator), manually add the following line to the NuGet.config file: The NuGet.config file can be found at %appdata%\NuGet\NuGet.Config (Windows) or ~/.config/NuGet/NuGet.Config (Mac/Linux)

<add key="ArtifactoryNuGetV3" value="https://anybill.jfrog.io/artifactory/api/nuget/v3/anybill.POS.Client.CSharp" protocolVersion="3" />

# Java Configuration

Integrating our Java SDK into a project requires the 2 steps:

  1. Add the anybill artifactory to your Maven repositories
  2. Add our Java library as dependency to your project

# 1. Artifactory configuration

In your build.gradle.kts add a new Maven repository. The anybill artifactory can only be used when credentials are provided.

repositories {
        val artifactoryUsername: String? by project
        val artifactoryPassword: String? by project

        mavenCentral()
        maven("https://anybill.jfrog.io/artifactory/anybill.POS.Client.Java/") {
            credentials {
                username = artifactoryUsername ?: ""
                password = artifactoryPassword ?: ""
            }
        }
    }

With gradle you typically want to configure credentials in the local project configuration. This can be done by creating a file ~/.gradle/gradle.properties in your home directory. This file should contain the following properties:

artifactoryUsername=your-username
artifactoryPassword=you-password

Username and password are provided by anybill.

# 2. Add dependency

Add the dependency for de.anybill.pos:sdk to your project build.gradle.kts dependencies. For logging SLF4J API is used. It should be sufficient to have a SLF4J implementation like Logback or Log4j2 in your classpath.

dependencies {
    implementation("de.anybill.pos:sdk:0.9.1")

    // Logging
    implementation("ch.qos.logback:logback-classic:1.2.10")
}

# Download Javadoc

Your IDE e.g. Intellij Idea might need to be configured to download Javadocs. This can be done by adding the idea plugin and configure the plugin to download Javadoc. Add the following to your build.gradle.kts project file:

plugins {
    application
    idea
}

idea {
    module {
        isDownloadJavadoc = true
        isDownloadSources = true // Default should already be true 
    }
}