首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何配置jooq sbt-插件

如何配置jooq sbt-插件
EN

Stack Overflow用户
提问于 2013-08-20 07:37:49
回答 1查看 944关注 0票数 5

我对SBT比较陌生。我想在我的SBT配置中包括jooq (GitHub)。我使用Build.scala来处理多个项目,我想在那里包含配置,但是我不知道把它放在哪里。

代码语言:javascript
复制
import sbt._
import Keys._

object SampleBuild extends Build {

    lazy val all = Project(id = "all", base = file("."), settings = defaultSettings) aggregate(
      one, two
    )

    lazy val one = Project(
        id = "one",
        base = file("one"),
        settings = defaultSettings ++ Seq(
            libraryDependencies ++= Dependencies.one
        )
    )

    lazy val two = Project(
        id = "two",
        base = file("two"),
        settings = defaultSettings ++ Seq(
            libraryDependencies ++= Dependencies.two
        )
    ) dependsOn (one)

    override lazy val settings = super.settings ++ buildSettings

    lazy val buildSettings = Seq(
        organization := "org.sample",
        version      := "0.1-SNAPSHOT",
        scalaVersion := "2.10.2"
    )

    lazy val defaultSettings = Defaults.defaultSettings ++ Seq(
        scalacOptions in Compile ++= scalacParams,
        externalResolvers in Compile := Resolvers.commonResolvers,
        shellPrompt  := ShellPrompt.buildShellPrompt,
        resolvers ++= Resolvers.commonResolvers
    )
}

object Resolvers { /* ... */ }

object Dependencies { /* ... */ }

object ShellPrompt { /* ... */ }

此外,我在plugins.sbt中添加了以下内容,但在尝试运行任务jooq:codegen时找不到它。

代码语言:javascript
复制
// JOOQ plugin for SBT
resolvers += "sean8223 Releases" at "https://github.com/sean8223/repository/raw/master/releases"

addSbtPlugin("sean8223" %% "jooq-sbt-plugin" % "1.0")

我想要的是使用项目jOOQ运行one插件。如何将此配置添加到我的Build.scala中?我们非常感谢你的帮助。提前感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-22 14:59:00

我不知道这个插件,但这个应该能用:

代码语言:javascript
复制
import sbt._
import Keys._
import JOOQPlugin._

object SampleBuild extends Build {
  lazy val one = Project(
    id = "one",
    base = file("one"),
    settings = defaultSettings ++ jooqSettings ++ Seq(
      libraryDependencies ++= Dependencies.one,
      jooqOptions := Seq(...)
    )
  )

  ....
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18329458

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档