如何配置jooq-sbt-plugin [英] How to configure jooq-sbt-plugin

查看:79
本文介绍了如何配置jooq-sbt-plugin的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对SBT比较陌生.我想在我的SBT配置中包括jooq-sbt-plugin( GitHub ) .我正在使用Build.scala处理多个项目,我想在其中包含jooq-sbt-plugin配置,但我不知道该放在哪里.

I'm relatively new to SBT. I'd like to include the jooq-sbt-plugin (GitHub) in my SBT config. I'm using Build.scala to handle multiple projects and I'd like to include the jooq-sbt-plugin config there but I couldn't figure out where to put it.

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.

Also, I've added the following to the plugins.sbt but the task jooq:codegen is not found when I try to run it.

// JOOQ plugin for SBT
resolvers += "sean8223 Releases" at "https://github.com/sean8223/repository/raw/master/releases"

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

我想用项目one运行jOOQ插件.我应该如何将此配置添加到Build.scala?非常感谢您的帮助.预先感谢!

What I'd like is to run the jOOQ plugin with the project one. How should I add this config to my Build.scala? Help is greatly appreciated. Thanks in advance!

推荐答案

我不知道此插件,但这应该可以工作:

I don't know about this plugin, but this should work:

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(...)
    )
  )

  ....
}

这篇关于如何配置jooq-sbt-plugin的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆