Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 1.66 KB

README.md

File metadata and controls

57 lines (45 loc) · 1.66 KB

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>