Closed patrik7 closed 7 years ago
Can you give details of how you included it in your project
@benmccann I should have put it in 6 months back, I do not have the details now.
If you give me the build.sbt that works I would appreciate it.
It shouldn't be trying to use Scala 2.11. SBT plugins only use Scala 2.10 and this module gets pulled in via sbt-js-engine. As long as you setup things according to the play docs I wouldn't expect the error you got. Sorry for the slow response. Please let us know if you have more trouble in the future.
I am not sure I understand "It shouldn't be trying to use Scala 2.11", maybe that's the problem.
We are running Play 2.4.1 with scala 2.11. I assume that all libs must use the same scala version.
`import PlayKeys._
import play.twirl.sbt.Import. import com.typesafe.sbt.web.SbtWeb.autoImport. import com.typesafe.sbt.stylus.Import.StylusKeys
javacOptions += "-Xlint:deprecation"
//javacOptions += "-Xlint:unchecked"
scalacOptions ++= Seq("-Xmax-classfile-name", "140")
lazy val root = (project in file(".")).enablePlugins(PlayJava).enablePlugins(SbtWeb)
// Set engine for SbtWeb to node JsEngineKeys.engineType := JsEngineKeys.EngineType.Node
RjsKeys.paths += ("jsRoutes" -> ("/jsroutes" -> "empty:"))
StylusKeys.compress in Assets := true
//workaround for 2.4.2 play bug - https://github.com/playframework/playframework/issues/4590 (hopefully can be deleted in the future) PlayKeys.externalizeResources := false
// Asset building pipeline pipelineStages := Seq(rjs,gzip)
scalaVersion := "2.11.1"
val gitHash = scala.sys.process.Process("git rev-parse HEAD").!!.trim val gitBranch = scala.sys.process.Process("git rev-parse --abbrev-ref HEAD").!!.trim val gitUncommitedChanges = scala.sys.process.Process("git status --porcelain").!! val gitIsClean: Boolean = gitUncommitedChanges.isEmpty
name := "Prizeo-" + gitBranch + (if (gitIsClean) "" else "-dirty")
version := "2.0-" + gitHash + "-" + System.currentTimeMillis / 1000
//needed for specs2 resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
buildInfoSettings
//specs2 is used by test framework libraryDependencies += specs2 % Test
libraryDependencies ++= Seq( javaCore, javaJdbc, javaJpa.exclude("org.hibernate.javax.persistence", "hibernate-jpa-2.0-api"), cache, javaWs, filters, "commons-logging" % "commons-logging" % "1.1.1", "javax.el" % "el-api" % "2.2", "org.glassfish.web" % "el-impl" % "2.2", "org.hibernate" % "hibernate-entitymanager" % "4.3.5.Final", "javax.mail" % "mail" % "1.4", "javax.activation" % "activation" % "1.1.1", "org.apache.commons" % "commons-pool2" % "2.0", "org.apache.commons" % "commons-email" % "1.3.2", "org.apache.commons" % "commons-csv" % "1.1", "org.bouncycastle" % "bcprov-jdk16" % "1.46", "com.google.guava" % "guava" % "18.0", "com.google.api-client" % "google-api-client" % "1.20.0", "com.google.http-client" % "google-http-client-jackson2" % "1.20.0", "com.google.apis" % "google-api-services-analytics" % "v3-rev114-1.20.0", "com.google.oauth-client" % "google-oauth-client-jetty" % "1.20.0", "com.google.api-client" % "google-api-client-java6" % "1.20.0", //"com.google.gdata" % "core" % "1.47.1", "commons-httpclient" % "commons-httpclient" % "3.1", "commons-beanutils" % "commons-beanutils" % "1.9.1", "com.newrelic.agent.java" % "newrelic-api" % "3.5.0", "mysql" % "mysql-connector-java" % "5.1.29", "com.amazonaws" % "aws-java-sdk" % "1.9.16", "com.github.segmentio" % "analytics" % "0.4.2", "com.stripe" % "stripe-java" % "1.37.0", "org.twitter4j" % "twitter4j-core" % "4.0.1", "net.sf.opencsv" % "opencsv" % "2.3", "org.kohsuke" % "geoip" % "1.2.8", "org.seleniumhq.selenium" % "selenium-java" % "2.40.0" % "test", "redis.clients" % "jedis" % "2.4.2", "nl.bitwalker" % "UserAgentUtils" % "1.2.4", //"com.github.detro.ghostdriver" % "phantomjsdriver" % "1.1.0" % "test", "com.codeborne" % "phantomjsdriver" % "1.2.1" % "test", //temporary using patched phantomJS until compatibility with Selenium is in the main one, see: https://github.com/detro/ghostdriver/pull/399 "com.maxmind.geoip2" % "geoip2" % "0.7.1", "com.relayrides" % "pushy" % "0.9", "io.netty" % "netty-tcnative-boringssl-static" % "1.1.33.Fork24", "org.webjars" % "modernizr" % "2.7.1", "org.webjars" % "requirejs" % "2.1.14-1", "net.liftweb" %% "lift-json" % "2.6-M4", "net.databinder.dispatch" %% "dispatch-core" % "0.11.2", "net.sourceforge.htmlcleaner" % "htmlcleaner" % "2.9" % "test", "com.lowagie" % "itext" % "2.1.7", "org.codehaus.groovy" % "groovy" % "2.4.0", "com.paypal.sdk" % "rest-api-sdk" % "1.4.1", "com.bugsnag" % "bugsnag" % "1.2.8", "org.jsoup" % "jsoup" % "1.7.3", "org.imgscalr" % "imgscalr-lib" % "4.2", "org.bgee.log4jdbc-log4j2" % "log4jdbc-log4j2-jdbc4" % "1.12", "com.sandinh" % "scala-soap_2.11" % "1.5.0", "net.glxn" % "qrgen" % "1.4" )
sourceGenerators in Compile <+= buildInfo
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
buildInfoPackage := "buildInfoModule"
routesImport += "binders.Binders._"
sbt.Keys.fork in Test := false
TwirlKeys.templateImports in Compile += "enums._"
TwirlKeys.templateImports in Compile += "com.prizeo.tumblr._"
TwirlKeys.templateImports in Compile += "com.prizeo.forms._"
TwirlKeys.templateImports in Compile += "com.prizeo.utils._"
TwirlKeys.templateImports in Compile += "com.prizeo.containers._"
fork in Test := false fork in run := false
parallelExecution in Test := false
jacoco.settings
incOptions := incOptions.value.withNameHashing(true)`
Does this build file give you an error? I didn't try running it as it wasn't clear to me if you were saying that it would reproduce the error
scalaVersion := "2.11.1"
means that your application will be build for Scala 2.11. However, the build system will still use Scala 2.10. This library is generally used by the build system, so I would expect it to try to use the 2.10 version.
Hi @benmccann
I did not realzie 2.11 (my app) can be combined with 2.10 for libs. Thanks for your help.
Adding:
"com.typesafe" % "npm_2.10" % "1.1.0",
Works fine.
I was adding:
"com.typesafe" % "npm_2.11" % "1.1.0",
Before
Let's close this issue.
Is there a 2.11 version available in maven, or somewhere?
I am trying to run with Play 2.4.
[info] Resolving com.typesafe#npm_2.11;1.1.1 ... [warn] module not found: com.typesafe#npm_2.11;1.1.1 [warn] ==== local: tried [warn] /home/pbeck/.ivy2/local/com.typesafe/npm_2.11/1.1.1/ivys/ivy.xml [warn] ==== public: tried [warn] https://repo1.maven.org/maven2/com/typesafe/npm_2.11/1.1.1/npm_2.11-1.1.1.pom [warn] ==== scalaz-bintray: tried [warn] https://dl.bintray.com/scalaz/releases/com/typesafe/npm_2.11/1.1.1/npm_2.11-1.1.1.pom
Is this project dead, should I be using something else to get NPM to work with Play?