0

我做了以下事情:

  1. 我已将 module-code/ 的内容复制到我的应用根目录中的 modules/securesocial/ 文件夹中。
  2. 我已将 Build.scala 更新为以下内容:

    import sbt._
    import Keys._
    import PlayProject._
    
    object ApplicationBuild extends Build {
    
    val appName         = "XXXXXX"
    val appVersion      = "1.0-SNAPSHOT"
    
    val appDependencies = Seq(
      // Add your project dependencies here,
    )
    
    val ssDependencies = Seq(
      // Add your project dependencies here,
      "com.typesafe" %% "play-plugins-util" % "2.0.1",
      "org.mindrot" % "jbcrypt" % "0.3m"
    )
    
    val secureSocial = PlayProject(
        "securesocial", appVersion, ssDependencies, mainLang = SCALA, path = file("modules/securesocial")
    ).settings(
      resolvers ++= Seq(
        "jBCrypt Repository" at "http://repo1.maven.org/maven2/org/",
        "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
      )
    )
    
    // Only compile the bootstrap bootstrap.less file and any other *.less file in the stylesheets directory
    def customLessEntryPoints(base: File): PathFinder = (
        (base / "app" / "assets" / "stylesheets" / "bootstrap" * "bootstrap.less") +++
        (base / "app" / "assets" / "stylesheets" / "bootstrap" * "responsive.less") +++
        (base / "app" / "assets" / "stylesheets" / "bootstrap" * "tooltip.less") +++
        (base / "app" / "assets" / "stylesheets" * "*.less")
    )
    
    val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
      // Add your own project settings here
      lessEntryPoints <<= baseDirectory(customLessEntryPoints)
    ).dependsOn(secureSocial).aggregate(secureSocial)
    
  3. 我已添加include "securesocial.conf"到 application.conf。

我不知道为什么它仍然给我一个错误:(。我得到的错误是:

未找到:值securesocial

4

1 回答 1

3

该模块现在可作为可下载的依赖项使用。如果您将 Build.scala 文件更改为类似于下面的示例,它应该可以工作:

object ApplicationBuild extends Build {
val appName         = "myapp"
val appVersion      = "1.0-SNAPSHOT"

val appDependencies = Seq(
    "securesocial" % "securesocial_2.9.1" % "2.0.6"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
  resolvers += Resolver.url("SecureSocial Repository", url("http://securesocial.ws/repository/releases/"))(Resolver.ivyStylePatterns)
)
}

项目用户指南上有关于如何安装它的详细说明。

于 2012-11-17T14:10:23.230 回答