Skip to content

Installation

Davide Bassi edited this page Jun 19, 2023 · 2 revisions

The library is published on jitpack.io.

The custom domain com.open-meteo used as group id is an alias to com.github.open-meteo: both work.

Please note that $version is used as the version placeholder

Gradle

  1. Add the JitPack repository to your root build.gradle file:
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
  1. Add the dependency:
dependencies {
	...
	implementation 'com.open-meteo:open-meteo-api-kotlin:$version'
}
  1. If you get the error: Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle' update the dependencyResolutionManagement your root settings.gradle file like this:
dependencyResolutionManagement {
    // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) // this threw the error
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // you may also set it to PREFER_PROJECT to avoid the warning
    repositories {
        google()
        mavenCentral()
    }
}

Android

  1. Add the JitPack repository to your settings.gradle file:
dependencyResolutionManagement {
	...
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
  1. Add the dependency to the app build.gradle:
dependencies {
	...
	implementation 'com.open-meteo:open-meteo-api-kotlin:$version'
}
  1. If you get the error: Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle' update the dependencyResolutionManagement your root settings.gradle file like this:
dependencyResolutionManagement {
    // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) // this threw the error
    repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // you may also set it to PREFER_PROJECT to avoid the warning
    repositories {
        google()
        mavenCentral()
    }
}

Maven

  1. Add the JitPack repository to your build file:
<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>
  1. Add the dependency:
<dependency>
	<groupId>com.open-meteo</groupId>
	<artifactId>open-meteo-api-kotlin</artifactId>
	<version>$version</version>
</dependency>
Clone this wiki locally