如何将xtend2库添加到play2?

时间:2012-04-23 03:21:02

标签: sbt playframework-2.0 xtend

我有一些关于xtend2的信息如下,但我不知道如何将它们添加到play2项目中。

<repositories>
  <repository>
    <id>maven.eclipse.org</id>
    <url>http://maven.eclipse.org/nexus/content/groups/public/</url>
  </repository>
  <repository>
    <id>xtend</id>
    <url>http://build.eclipse.org/common/xtend/maven/</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>org.eclipse.xtend2</groupId>
    <artifactId>org.eclipse.xtend2.lib</artifactId>
    <version>2.2.0</version>
  </dependency>
  <dependency>
    <groupId>org.eclipse.xtext</groupId>
    <artifactId>org.eclipse.xtext.xtend2.lib</artifactId>
    <version>2.2.0.v201112061305</version>
  </dependency>
  <dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>com.google.inject</artifactId>
    <version>2.0.0.v201105231817</version>
  </dependency>
</dependencies>

我试过了:

import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

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

  val eclipse = "eclipse" at "http://maven.eclipse.org/nexus/content/groups/public/"
  val xtend = "xtend" at "http://build.eclipse.org/common/xtend/maven/"

  val appDependencies = Seq(
    // Add your project dependencies here,
    "commons-io" % "commons-io" % "2.1",
    "org.scalatest" %% "scalatest" % "1.7.RC2" % "test",
    "postgresql" % "postgresql" % "9.1-901-1.jdbc4",
    "org.jsoup" % "jsoup" % "1.6.1",
    "org.pegdown" % "pegdown" % "1.1.0",
    "org.eclipse.xtend2" % "org.eclipse.xtend2.lib" % "2.2.0")

  val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( // Add your own project settings here      
    // in order to use scalatest
    testOptions in Test := Nil)

}

但这不起作用:

[warn]  module not found: org.eclipse.xtend2#org.eclipse.xtend2.lib;2.2.0
[warn] ==== local: tried
[warn]   E:\java\Play20\framework\.\..\repository/local/org.eclipse.xtend2/org.e
clipse.xtend2.lib/2.2.0/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/eclipse/xtend2/org.eclip
se.xtend2.lib/2.2.0/org.eclipse.xtend2.lib-2.2.0.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/org/eclipse/xtend2/org.ecli
pse.xtend2.lib/2.2.0/org.eclipse.xtend2.lib-2.2.0.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/eclipse/xtend2/org.eclipse.xtend2.lib
/2.2.0/org.eclipse.xtend2.lib-2.2.0.pom
[warn] ==== Scala-Tools Maven2 Repository: tried
[warn]   http://scala-tools.org/repo-releases/org/eclipse/xtend2/org.eclipse.xte
nd2.lib/2.2.0/org.eclipse.xtend2.lib-2.2.0.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.eclipse.xtend2#org.eclipse.xtend2.lib;2.2.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/E:/WORKSPACE_PLAY/test/}test/*:update: sbt.Res
olveException: unresolved dependency: org.eclipse.xtend2#org.eclipse.xtend2.lib;
2.2.0: not found

1 个答案:

答案 0 :(得分:2)

import sbt._
import Keys._
import PlayProject._

object ApplicationBuild extends Build {

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

  val appDependencies = Seq(
    // Add your project dependencies here,
    "commons-io" % "commons-io" % "2.1",
    "org.scalatest" %% "scalatest" % "1.7.RC2" % "test",
    "postgresql" % "postgresql" % "9.1-901-1.jdbc4",
    "org.jsoup" % "jsoup" % "1.6.1",
    "org.pegdown" % "pegdown" % "1.1.0",
    "org.eclipse.xtend2" % "org.eclipse.xtend2.lib" % "2.2.1")

  val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings( // Add your own project settings here
    resolvers += "xtend" at "http://build.eclipse.org/common/xtend/maven/",
    // in order to use scalatest
    testOptions in Test := Nil)

}