com.heroku.sdk.deploy.WarApp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of heroku-deploy Show documentation
Show all versions of heroku-deploy Show documentation
Library for deploying Java applications to Heroku
package com.heroku.sdk.deploy;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class WarApp extends App {
protected File warFile;
protected File webappRunnerJar;
public WarApp(String name) throws IOException {
super(name);
}
public WarApp(String name, List buildpacks) throws IOException {
super(name, buildpacks);
}
public WarApp(String client, String name, File warFile, File webappRunnerJar, File rootDir, File targetDir, List buildpacks) {
super(client, name, rootDir, targetDir, buildpacks);
this.warFile = warFile;
this.webappRunnerJar = webappRunnerJar;
}
@Override
public void deploy(List includedFiles, Map configVars, String jdkVersion, Map userDefinedProcessTypes, String buildFilename) throws Exception {
includedFiles.add(webappRunnerJar);
includedFiles.add(warFile);
super.deploy(includedFiles, configVars, jdkVersion, new HashMap(), buildFilename);
}
@Override
protected Map defaultProcTypes() {
Map processTypes = new HashMap();
processTypes.put("web", "java $JAVA_OPTS -jar " + relativize(webappRunnerJar) + " $WEBAPP_RUNNER_OPTS --port $PORT " + relativize(warFile));
return processTypes;
}
}