2016-03-11 4 views
1

build.sbt код: Я скопировать код из http://scalaxb.org/sbt-scalaxbPlayframework 2.4 - Как включить scalaxb

name := """DealerNext""" 

version := "1.0-SNAPSHOT" 

import ScalaxbKeys._ 

lazy val commonSettings = Seq(
    organization := "com.dn", 
    scalaVersion := "2.11.5" 
) 

lazy val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.0.2" 
lazy val scalaParser = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.1" 
lazy val dispatchV = "0.11.2" // change this to appropriate dispatch version 
lazy val dispatch = "net.databinder.dispatch" %% "dispatch-core" % dispatchV 

lazy val root = (project in file(".")). 
    enablePlugins(PlayScala). 
    settings(commonSettings: _*). 
    settings(
    name   := "nada", 
    libraryDependencies ++= Seq(dispatch), 
    libraryDependencies ++= { 
     if (scalaVersion.value startsWith "2.11") Seq(scalaXml, scalaParser) 
     else Seq() 
    }). 
    settings(scalaxbSettings: _*). 
    settings(
    sourceGenerators in Compile += (scalaxb in Compile).taskValue, 
    dispatchVersion in (Compile, scalaxb) := dispatchV, 
    async in (Compile, scalaxb)   := true 
    packageName in (Compile, scalaxb)  := "generated" 
    // packageNames in (Compile, scalaxb) := Map(uri("http://schemas.microsoft.com/2003/10/Serialization/") -> "microsoft.serialization"), 
    // logLevel in (Compile, scalaxb) := Level.Debug 
) 

scalaVersion := "2.11.6" 
scalacOptions ++= Seq("-Xmax-classfile-name", "100") 
libraryDependencies ++= Seq(
    jdbc, 
    cache, 
    ws, 
    specs2 % Test, 
    "io.swagger" %% "swagger-play2" % "1.5.0", 
    "com.typesafe.play" %% "anorm" % "2.4.0", 
    filters, 
    "net.kaliber" %% "play-s3" % "7.0.2" 
) 

resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases" 
resolvers += "OSS Repo" at "https://oss.sonatype.org/content/repositories/snapshots" 
resolvers += "Kaliber Internal Repository" at "https://jars.kaliber.io/artifactory/libs-release-local" 
resolvers += Resolver.sonatypeRepo("public") 

//"com.cloudphysics" % "jerkson_2.10" % "0.6.3" 

// Play provides two styles of routers, one expects its actions to be injected, the 
// other, legacy style, accesses its actions statically. 
routesGenerator := InjectedRoutesGenerator 

PackageName в (компилировать, scalaxb): = "генерируется" эта линия бросает следующее сообщение об ошибке

error: reference to packageName is ambiguous; 
it is imported twice in the same scope by 
import ScalaxbKeys._ 
and import _root_.com.typesafe.sbt.SbtNativePackager.autoImport._ 
    packageName in (Compile, scalaxb)  := "generated" 
    ^

Если я прокомментирую эту строку, файлы wsdl не будут скомпилированы в файлы scala.

ответ

1

Изменить

import ScalaxbKeys._

в import ScalaxbKeys.{packageName => scalaxbPackageName, _}

И

packageName in (Compile, scalaxb) := "generated"

в scalaxbPackageName in (Compile, scalaxb) := "generated"

 Смежные вопросы

  • Нет связанных вопросов^_^