A Java client for directly pushing artifacts to Direct-to-Heroku
Java Scala
Pull request Compare This branch is 1 commit ahead, 5 commits behind heroku:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
src
.gitignore
README.md
build.sbt
pom.xml

README.md

A Java client for directly pushing artifacts Heroku via Direct-to-Heroku.

Setup

Include as a dependency:

<dependency>
    <groupId>com.herokuapp.directto</groupId>
    <artifactId>direct-to-heroku-client</artifactId>
    <version>0.4-BETA</version>
</dependency>

Usage

Example of pushing a war file:

// Initialize the client
DirectToHerokuClient client = new DirectToHerokuClient("your api key");

// Prepare the payload
Map<String, File> files = new HashMap<String, File>(1);
files.put("war", new File(warFilePath));

// Deploy!
client.deploy("war", appName, files);

Running Tests

When running tests be sure to set system properties for test fixtures:

  • heroku.apiKey
  • heroku.appName

For example:

mvn test -Dheroku.apiKey=1234 -Dheroku.appName=app-used-for-fixture

Heroku API JAR Cohabitation

If you are using this JAR along with the Heroku API JAR in the same project, you will need to explictly declare Jackson version 1.8.3 in dependencyManagement section of your project's POM:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.8.3</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.8.3</version>
        </dependency>
    </dependencies>
</dependencyManagement>