Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.olerom:formula-one-ergast:0.1.1'
}
dependencies {
implementation("com.github.olerom:formula-one-ergast:0.1.1")
}
<dependency>
<groupId>com.github.olerom</groupId>
<artifactId>formula-one-ergast</artifactId>
<version>0.1.1</version>
</dependency>
libraryDependencies += "com.github.olerom" % "formula-one-ergast" % "0.1.1"
:dependencies [[com.github.olerom/formula-one-ergast "0.1.1"]]
Java implementation to get a historical record of motor racing data from Ergast Developer API.
Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
Add the dependency:
dependencies {
compile 'com.github.olerom.formula-one-ergast:ergast:0.1.1'
}
Add the JitPack repository to your build file:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add the dependency:
<dependency>
<groupId>com.github.olerom.formula-one-ergast</groupId>
<artifactId>ergast</artifactId>
<version>0.1.1</version>
</dependency>
You have to initialize Ergast object:
Ergast ergast = new Ergast(2016, 100, 2);
Ergast ergast = new Ergast();
If you use default constructor, season will be set as NO_SEASON, limit as DEFAULT_LIMIT and offset as DEFAULT_OFFSET.
You can get the following objects that satisfy Ergast queries:
For example, to get information about pit stops at final race of 2016 season with 100 limit:
Ergast ergast = new Ergast(2016, 100, Ergast.DEFAULT_OFFSET);
ergast.getRacePitStops(21).forEach(System.out::println);
It would be cool, if you review the code or create a pull request.