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.plan3:heroku-platform-api:version-0.9'
}
dependencies {
implementation("com.github.plan3:heroku-platform-api:version-0.9")
}
<dependency>
<groupId>com.github.plan3</groupId>
<artifactId>heroku-platform-api</artifactId>
<version>version-0.9</version>
</dependency>
libraryDependencies += "com.github.plan3" % "heroku-platform-api" % "version-0.9"
:dependencies [[com.github.plan3/heroku-platform-api "version-0.9"]]
Java wrapper of Heroku Platform API.
https://devcenter.heroku.com/articles/platform-api-reference
None(2013-12-06)
//Get the url of Heroku authentication page.
String oauthUrl = PlatformApi.getOAuthUrl("<YOUR_CLIENT_ID>", Scope.Global);
//... Authenticate and get code.
PlatformApi api = PlatformApi.fromOAuth("<YOUR_CLIENT_SECRET>", code);
//Get application list
List<App> appList = api.getAppList();
App app = appList.get(0);
//heroku ps:scale web=5
Formation api.updateFormation(app.getName(), "web", 5, 1);
//heroku ps:restart
api.restart(app.getName());
MIT