How-to setup your license credentials

We distribute the Charts.kt artifacts through a maven repository that is only available with valid credentials.

When you obtain a license, we send you an email containing your credentials. You have to use them to access the Charts.kt maven repository.

This is how you have to define your repositories in your gradle build:

using the Kotlin Gradle DSL

maven { url = uri("https://maven.pkg.jetbrains.space/data2viz/p/charts-1-r/maven") authentication { create<BasicAuthentication>("basic") } credentials { username = "XXXXX-XXXXX-XXXXX" // your client id password = "XXXXX-XXXXX-XXXXX" // your client secret } }

using the Groovy Gradle DSL

repositories { maven { url "https://maven.pkg.jetbrains.space/data2viz/p/charts-1-r/maven" credentials { username "XXXXX-XXXXX-XXXXX" // your client id password "XXXXX-XXXXX-XXXXX" // your client secret } } }

Setup the license keys globally

It is much safer to set your license keys outside of your project code and put them in a global Gradle properties file.

Look for your gradle.properties file located at:

  • C:\Users\<you>\.gradle\gradle.properties on Windows
  • /Users/<you>/.gradle/gradle.properties on Mac / Linux

Here, you can add your license as 2 properties. Note that you don't need to use quotation marks, just enter your key as you get them:

chartsClientSecret = XXXXX-XXXXX-XXXXX

Then, in your project, add a reference to these two properties and use them as your credentials.

Here is a complete build.gradle.kts file for a Kotlin JS project. You can click on the "+" icon to see the full file:

plugins { kotlin("js") version "1.4.31" } group = "io.data2viz" version = "1.0-SNAPSHOT" val d2vVersion: String by project val chartsVersion: String by project val chartsClientId: String by project val chartsClientSecret: String by project repositories { maven { url = uri("https://maven.pkg.jetbrains.space/data2viz/p/charts-1-r/maven") authentication { create<BasicAuthentication>("basic") } credentials { username = chartsClientId password = chartsClientSecret } } mavenCentral() } dependencies { implementation ("io.data2viz.d2v:core-js:$d2vVersion") implementation ("io.data2viz.charts:core:$chartsVersion") } kotlin { js(LEGACY) { browser { binaries.executable() webpackTask { cssSupport.enabled = true } runTask { cssSupport.enabled = true } testTask { useKarma { useChromeHeadless() webpackConfig.cssSupport.enabled = true } } } } }