Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8266363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:08:00+00:00 2026-06-08T05:08:00+00:00

I’m working on a sbt Task and I would like to have access to

  • 0

I’m working on a sbt Task and I would like to have access to some of the application classes and dependencies.
(Specifically, I’d like to generate the Database DDL using scalaquery)

Is there any way to add those dependencies to the task or maybe I need to create a plugin for this?

object ApplicationBuild extends Build {

  val appName = "test"
  val appVersion = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    "org.scalaquery" % "scalaquery_2.9.0-1" % "0.9.5")

  val ddl = TaskKey[Unit]("ddl", "Generates the ddl in the evolutions folder")

  val ddlTask = ddl <<= (baseDirectory, fullClasspath in Runtime) map { (bs, cp) =>
    val f = bs / "conf/evolutions/default" 

    // Figures out the last sql number used
    def nextFileNumber = { ... }

    //writes to file
    def printToFile(f: java.io.File)(op: java.io.PrintWriter => Unit) { ...}

    def createDdl = {
      import org.scalaquery.session._
      import org.scalaquery.ql._
      import org.scalaquery.ql.TypeMapper._

      import org.scalaquery.ql.extended.H2Driver.Implicit._
      import org.scalaquery.ql.extended.{ ExtendedTable => Table }
      import models._
      printToFile(new java.io.File(nextFileNumber, f))(p => {
          models.Table.ddl.createStatements.foreach(p.println)
      });
    }
    createDdl
    None
  }

  val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
    ddlTask)

}

The error I get is

[test] $ reload
[info] Loading global plugins from /home/asal/.sbt/plugins
[info] Loading project definition from /home/asal/myapps/test/project
[error] /home/asal/myapps/test/project/Build.scala:36: object scalaquery is not a member of package org
[error]       import org.scalaquery.session._
[error]                  ^
[error] one error found

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:08:03+00:00Added an answer on June 8, 2026 at 5:08 am

    You have to add ScalaQuery and everything else your build depends on as a build dependency. That means that basically, you have to add it “as an sbt plugin”.

    This is described in some detail in the Using Plugins section of the sbt wiki. It all boils down to a very simple thing, though – just add a line defining your dependency under project/plugins.sbt like this:

    libraryDependencies += "org.scalaquery" % "scalaquery_2.9.0-1" % "0.9.5"
    

    Now, the problem with using application classes in the build is that you can’t really add build products as build dependencies. – So, you would probably have to create a separate project that builds your DDL module, and add that as dependency to the build of this project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I have a reasonable size flat file database of text documents mostly saved in
I have a view passing on information from a database: def serve_article(request, id): served_article
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have two tables with like below codes: Table: Accounts id | username |
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.