public class Repackager extends Object
Constructor and Description |
---|
Repackager(File source) |
Modifier and Type | Method and Description |
---|---|
protected String |
findMainMethod(JarFile source) |
void |
repackage(File destination,
Libraries libraries)
Repackage to the given destination so that it can be launched using '
java -jar'
|
void |
repackage(File destination,
Libraries libraries,
LaunchScript launchScript)
Repackage to the given destination so that it can be launched using '
java -jar'
|
void |
repackage(Libraries libraries)
Repackage the source file so that it can be run using 'java -jar'
|
void |
setBackupSource(boolean backupSource)
Sets if source files should be backed up when they would be overwritten.
|
void |
setLayout(Layout layout)
Sets the layout to use for the jar.
|
void |
setMainClass(String mainClass)
Sets the main class that should be run.
|
public Repackager(File source)
public void setMainClass(String mainClass)
mainClass
- the main class namepublic void setBackupSource(boolean backupSource)
backupSource
- if source files should be backed uppublic void setLayout(Layout layout)
Layouts.forFile(File)
.layout
- the layoutpublic void repackage(Libraries libraries) throws IOException
libraries
- the libraries required to run the archiveIOException
public void repackage(File destination, Libraries libraries) throws IOException
destination
- the destination file (may be the same as the source)libraries
- the libraries required to run the archiveIOException
public void repackage(File destination, Libraries libraries, LaunchScript launchScript) throws IOException
destination
- the destination file (may be the same as the source)libraries
- the libraries required to run the archivelaunchScript
- an optional launch script prepended to the front of the jarIOException
protected String findMainMethod(JarFile source) throws IOException
IOException
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.