简体   繁体   English

在sbt-native-packager中覆盖原型模板?

[英]Overriding archetype templates in sbt-native-packager?

The start-rpm-template does not work with SLES 11 SP3. start-rpm-template不适用于SLES 11 SP3。

Reason: Init.d/functions are not available 原因:Init.d /功能不可用

# Source function library.

. /etc/rc.d/init.d/functions

On SLES the functions are here: 在SLES上,功能如下:

/lib/lsb/init-functions

How can a project provide its own Archetype templates? 项目如何提供自己的原型模板?

From src/main/scala/com/typesafe/sbt/packager/linux/Keys : src / main / scala / com / typesafe / sbt / packager / linux / Keys

val linuxMakeStartScript = TaskKey[Option[File]]("makeStartScript", "Creates or discovers the start script used by this project")
val linuxStartScriptTemplate = TaskKey[URL]("linuxStartScriptTemplate", "The location of the template start script file we use for debian (upstart or init.d")
val linuxEtcDefaultTemplate = TaskKey[URL]("linuxEtcDefaultTemplate", "The location of the /etc/default/<pkg> template script.")
val linuxJavaAppStartScriptBuilder = SettingKey[JavaAppStartScriptBuilder]("linuxJavaAppStartScriptBuilder", "Responsible for loading the start scripts. Only used with archetype.java_server")
val linuxScriptReplacements = SettingKey[Seq[(String, String)]]("linuxScriptReplacements",
  """|Replacements of template parameters used in linux scripts.
       |  Default supported templates:
       |  execScript - name of the script in /usr/bin
       |  author - author of this project
       |  descr - short description
       |  chdir - execution path of the script
       |  retries - on fail, how often should a restart be tried
       |  retryTimeout - pause between retries
       |  appName - name of application
       |  appClasspath - application classpath
       |  appMainClass - main class to start
       |  daemonUser - daemon user
    """.stripMargin)

I would use linuxMakeStartScript or linuxStartScriptTemplate or linuxScriptReplacements . 我将使用linuxMakeStartScriptlinuxStartScriptTemplatelinuxScriptReplacements

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM