package archetypes
- Alphabetic
- Public
- All
Type Members
-
trait
JavaAppKeys extends AnyRef
Available settings/tasks for the com.typesafe.sbt.packager.archetypes.JavaAppPackaging and all depending archetypes.
-
trait
JavaServerAppKeys extends AnyRef
Available settings/tasks for the com.typesafe.sbt.packager.archetypes.JavaServerAppPackaging
-
trait
MaintainerScriptHelper extends AnyRef
Provides utility methods to configure package maintainerScripts.
Maintainer Script Helper
Provides utility methods to configure package maintainerScripts.
Value Members
-
object
JavaAppPackaging extends AutoPlugin
This class contains the default settings for creating and deploying an archetypical Java application.
Java Application
This class contains the default settings for creating and deploying an archetypical Java application. A Java application archetype is defined as a project that has a main method and is run by placing all of its JAR files on the classpath and calling that main method.
Configuration
This plugin adds new settings to configure your packaged application. The keys are defined in com.typesafe.sbt.packager.archetypes.JavaAppKeys
Enable this plugin in your
build.sbtwithenablePlugins(JavaAppPackaging)
Example: -
object
JavaServerAppPackaging extends AutoPlugin
Provides configuration for running an application on a server.
Java Server App Packaging
Provides configuration for running an application on a server.
-
object
JavaServerBashScript
Loads scripts from the resource path that are associated with
Loads scripts from the resource path that are associated with
- an archetype
- a sbt.Configuration
val scriptName: String = "postrm" val archetype: String = "java_server" val config: Configuration = SbtNativePackager.Debian val replacements: Seq[(String,String)] = linuxScriptReplacements.value val template: Option[URL] = None // user defined override val scriptContent = JavaServerBashScript(scriptName, archetype, config, replacements, template) getOrElse { sys.error(s"Couldn't load [scriptName] for config [{config.name}] in archetype [archetype]") } IO.write(scriptFile, scriptContent)
- See also
Example: - object JavaServerLoaderScript
- object MaintainerScriptHelper extends MaintainerScriptHelper
-
object
TemplateWriter
This object provides methods to generate scripts from templates.
This object provides methods to generate scripts from templates. This involves
- procesing - replacing a placeholders with actual values
- TODO: validating - check the script if there are no remaining placeholders
a bash script can be generated like this
val template = getClass getResource "template-your-bashscript" val replacements = Seq("name" -> "your-app", "custom" -> "1") TemplateWriter.generateScript(template, replacements)
, a bat script can be generated like this
val template = getClass getResource "template-your-batscript" val replacements = Seq("name" -> "your-app", "custom" -> "1") TemplateWriter.generateScript(template, replacements, "\r\n", TemplateWriter.batFriendlyKeySurround)
TODO move out of archetypes package
Examples: